From 8d1758ceea2e00d3ba33a30f64e79677da7a517d Mon Sep 17 00:00:00 2001 From: Anshal Shukla <53994948+anshalshukla@users.noreply.github.com> Date: Thu, 30 Nov 2023 04:19:52 +0300 Subject: [PATCH] Add support for amoy testnet (#8674) Co-authored-by: Mark Holt Co-authored-by: alex.sharov --- README.md | 4 +- common/paths/paths.go | 2 + core/allocs/amoy.json | 17 ++++++++ core/forkid/forkid_test.go | 9 ++++ core/genesis_write.go | 17 ++++++++ core/system_contract_lookup.go | 2 +- erigon-lib/chain/networkname/network_name.go | 2 + erigon-lib/chain/snapcfg/util.go | 4 ++ eth/ethconfig/config.go | 1 + params/bootnodes.go | 4 ++ params/chainspecs/amoy.json | 44 ++++++++++++++++++++ params/config.go | 9 ++++ params/config_test.go | 5 +++ turbo/node/node.go | 2 + turbo/stages/genesis_test.go | 30 +++++++++++++ 15 files changed, 149 insertions(+), 3 deletions(-) create mode 100644 core/allocs/amoy.json create mode 100644 params/chainspecs/amoy.json diff --git a/README.md b/README.md index 6a8ff1a00..98c016d93 100644 --- a/README.md +++ b/README.md @@ -102,8 +102,8 @@ download speed by flag `--torrent.download.rate=20mb`. 🔬 See [Downloade Use `--datadir` to choose where to store data. -Use `--chain=gnosis` for [Gnosis Chain](https://www.gnosis.io/), `--chain=bor-mainnet` for Polygon Mainnet, -and `--chain=mumbai` for Polygon Mumbai. +Use `--chain=gnosis` for [Gnosis Chain](https://www.gnosis.io/), `--chain=bor-mainnet` for Polygon Mainnet, +`--chain=mumbai` for Polygon Mumbai and `--chain=amoy` for Polygon Amoy. For Gnosis Chain you need a [Consensus Layer](#beacon-chain-consensus-layer) client alongside Erigon (https://docs.gnosischain.com/node/guide/beacon). diff --git a/common/paths/paths.go b/common/paths/paths.go index 51c097635..5b2bd1f69 100644 --- a/common/paths/paths.go +++ b/common/paths/paths.go @@ -88,6 +88,8 @@ func DataDirForNetwork(datadir string, network string) string { return networkDataDirCheckingLegacy(datadir, "goerli") case networkname.MumbaiChainName: return networkDataDirCheckingLegacy(datadir, "mumbai") + case networkname.AmoyChainName: + return networkDataDirCheckingLegacy(datadir, "amoy") case networkname.BorMainnetChainName: return networkDataDirCheckingLegacy(datadir, "bor-mainnet") case networkname.BorDevnetChainName: diff --git a/core/allocs/amoy.json b/core/allocs/amoy.json new file mode 100644 index 000000000..df3d74e45 --- /dev/null +++ b/core/allocs/amoy.json @@ -0,0 +1,17 @@ +{ + "0000000000000000000000000000000000001000": { + "balance": "0x0", + "code": "0x608060405234801561001057600080fd5b50600436106101f05760003560e01c806360c8614d1161010f578063af26aa96116100a2578063d5b844eb11610071578063d5b844eb14610666578063dcf2793a14610684578063e3b7c924146106b6578063f59cf565146106d4576101f0565b8063af26aa96146105c7578063b71d7a69146105e7578063b7ab4db514610617578063c1b3c91914610636576101f0565b806370ba5707116100de57806370ba57071461052b57806398ab2b621461055b5780639d11b80714610579578063ae756451146105a9576101f0565b806360c8614d1461049c57806365b3a1e2146104bc57806366332354146104db578063687a9bd6146104f9576101f0565b80633434735f1161018757806344d6528f1161015657806344d6528f146103ee5780634dbc959f1461041e57806355614fcc1461043c578063582a8d081461046c576101f0565b80633434735f1461035257806335ddfeea1461037057806343ee8213146103a057806344c15cb1146103be576101f0565b806323f2a73f116101c357806323f2a73f146102a45780632bc06564146102d45780632de3a180146102f25780632eddf35214610322576101f0565b8063047a6c5b146101f55780630c35b1cb146102275780631270b5741461025857806323c2a2b414610288575b600080fd5b61020f600480360361020a9190810190612944565b610706565b60405161021e93929190613283565b60405180910390f35b610241600480360361023c9190810190612944565b61075d565b60405161024f9291906130a4565b60405180910390f35b610272600480360361026d919081019061296d565b610939565b60405161027f91906130db565b60405180910390f35b6102a2600480360361029d9190810190612a4c565b610a91565b005b6102be60048036036102b9919081019061296d565b61112a565b6040516102cb91906130db565b60405180910390f35b6102dc611281565b6040516102e99190613231565b60405180910390f35b61030c600480360361030791908101906128a1565b611286565b60405161031991906130f6565b60405180910390f35b61033c60048036036103379190810190612944565b611307565b6040516103499190613231565b60405180910390f35b61035a611437565b6040516103679190613089565b60405180910390f35b61038a600480360361038591908101906128dd565b61144f565b60405161039791906130db565b60405180910390f35b6103a861151a565b6040516103b591906130f6565b60405180910390f35b6103d860048036036103d391908101906129a9565b611531565b6040516103e59190613231565b60405180910390f35b6104086004803603610403919081019061296d565b611619565b6040516104159190613216565b60405180910390f35b610426611781565b6040516104339190613231565b60405180910390f35b61045660048036036104519190810190612826565b611791565b60405161046391906130db565b60405180910390f35b6104866004803603610481919081019061284f565b6117ab565b60405161049391906130f6565b60405180910390f35b6104a4611829565b6040516104b393929190613283565b60405180910390f35b6104c461189d565b6040516104d29291906130a4565b60405180910390f35b6104e361198e565b6040516104f09190613231565b60405180910390f35b610513600480360361050e9190810190612a10565b611993565b6040516105229392919061324c565b60405180910390f35b61054560048036036105409190810190612826565b6119f7565b60405161055291906130db565b60405180910390f35b610563611a11565b60405161057091906130f6565b60405180910390f35b610593600480360361058e9190810190612944565b611a28565b6040516105a09190613231565b60405180910390f35b6105b1611b59565b6040516105be91906130f6565b60405180910390f35b6105cf611b70565b6040516105de93929190613283565b60405180910390f35b61060160048036036105fc9190810190612944565b611bd1565b60405161060e9190613231565b60405180910390f35b61061f611cd1565b60405161062d9291906130a4565b60405180910390f35b610650600480360361064b9190810190612944565b611ce5565b60405161065d9190613231565b60405180910390f35b61066e611d06565b60405161067b91906132ba565b60405180910390f35b61069e60048036036106999190810190612a10565b611d0b565b6040516106ad9392919061324c565b60405180910390f35b6106be611d6f565b6040516106cb9190613231565b60405180910390f35b6106ee60048036036106e99190810190612944565b611d81565b6040516106fd93929190613283565b60405180910390f35b60008060006002600085815260200190815260200160002060000154600260008681526020019081526020016000206001015460026000878152602001908152602001600020600201549250925092509193909250565b60608060ff83116107795761077061189d565b91509150610934565b600061078484611bd1565b9050606060016000838152602001908152602001600020805490506040519080825280602002602001820160405280156107cd5781602001602082028038833980820191505090505b509050606060016000848152602001908152602001600020805490506040519080825280602002602001820160405280156108175781602001602082028038833980820191505090505b50905060008090505b60016000858152602001908152602001600020805490508110156109295760016000858152602001908152602001600020818154811061085c57fe5b906000526020600020906003020160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683828151811061089a57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001600085815260200190815260200160002081815481106108f257fe5b90600052602060002090600302016001015482828151811061091057fe5b6020026020010181815250508080600101915050610820565b508181945094505050505b915091565b6000606060016000858152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015610a0c578382906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152505081526020019060010190610970565b50505050905060008090505b8151811015610a84578373ffffffffffffffffffffffffffffffffffffffff16828281518110610a4457fe5b60200260200101516040015173ffffffffffffffffffffffffffffffffffffffff161415610a7757600192505050610a8b565b8080600101915050610a18565b5060009150505b92915050565b73fffffffffffffffffffffffffffffffffffffffe73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0a906131f6565b60405180910390fd5b6000610b1d611781565b90506000811415610b3157610b30611dab565b5b610b456001826120cc90919063ffffffff16565b8814610b86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7d90613176565b60405180910390fd5b868611610bc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bbf906131d6565b60405180910390fd5b6000601060018989030181610bd957fe5b0614610c1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c11906131b6565b60405180910390fd5b8660026000838152602001908152602001600020600101541115610c73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6a90613156565b60405180910390fd5b6000600260008a81526020019081526020016000206000015414610ccc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc390613196565b60405180910390fd5b604051806060016040528089815260200188815260200187815250600260008a8152602001908152602001600020600082015181600001556020820151816001015560408201518160020155905050600388908060018154018082558091505090600182039060005260206000200160009091929091909150555060008060008a815260200190815260200160002081610d669190612620565b506000600160008a815260200190815260200160002081610d879190612620565b506060610ddf610dda87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506120eb565b612119565b905060008090505b8151811015610f51576060610e0e838381518110610e0157fe5b6020026020010151612119565b90506000808c81526020019081526020016000208054809190600101610e349190612620565b506040518060600160405280610e5d83600081518110610e5057fe5b60200260200101516121f6565b8152602001610e7f83600181518110610e7257fe5b60200260200101516121f6565b8152602001610ea183600281518110610e9457fe5b6020026020010151612267565b73ffffffffffffffffffffffffffffffffffffffff168152506000808d81526020019081526020016000208381548110610ed757fe5b9060005260206000209060030201600082015181600001556020820151816001015560408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050508080600101915050610de7565b506060610fa9610fa486868080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506120eb565b612119565b905060008090505b815181101561111d576060610fd8838381518110610fcb57fe5b6020026020010151612119565b9050600160008d81526020019081526020016000208054809190600101610fff9190612620565b5060405180606001604052806110288360008151811061101b57fe5b60200260200101516121f6565b815260200161104a8360018151811061103d57fe5b60200260200101516121f6565b815260200161106c8360028151811061105f57fe5b6020026020010151612267565b73ffffffffffffffffffffffffffffffffffffffff16815250600160008e815260200190815260200160002083815481106110a357fe5b9060005260206000209060030201600082015181600001556020820151816001015560408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050508080600101915050610fb1565b5050505050505050505050565b60006060600080858152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156111fc578382906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152505081526020019060010190611160565b50505050905060008090505b8151811015611274578373ffffffffffffffffffffffffffffffffffffffff1682828151811061123457fe5b60200260200101516040015173ffffffffffffffffffffffffffffffffffffffff1614156112675760019250505061127b565b8080600101915050611208565b5060009150505b92915050565b601081565b60006002600160f81b84846040516020016112a393929190612ff6565b6040516020818303038152906040526040516112bf9190613033565b602060405180830381855afa1580156112dc573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052506112ff9190810190612878565b905092915050565b60006060600080848152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156113d9578382906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815250508152602001906001019061133d565b505050509050600080905060008090505b825181101561142c5761141d83828151811061140257fe5b602002602001015160200151836120cc90919063ffffffff16565b915080806001019150506113ea565b508092505050919050565b73fffffffffffffffffffffffffffffffffffffffe81565b600080600080859050600060218087518161146657fe5b04029050600081111561147f5761147c876117ab565b91505b6000602190505b818111611509576000600182038801519050818801519550806000602081106114ab57fe5b1a60f81b9450600060f81b857effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614156114f0576114e98685611286565b93506114fd565b6114fa8487611286565b93505b50602181019050611486565b508782149450505050509392505050565b60405161152690613074565b604051809103902081565b60008060009050600080905060008090505b84518167ffffffffffffffff16101561160c57606061156e868367ffffffffffffffff16604161228a565b90506000611585828961231690919063ffffffff16565b905061158f612652565b6115998a83611619565b90506115a58a8361112a565b80156115dc57508473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16115b156115fe578194506115fb8160200151876120cc90919063ffffffff16565b95505b505050604181019050611543565b5081925050509392505050565b611621612652565b6060600080858152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156116f1578382906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152505081526020019060010190611655565b50505050905060008090505b8151811015611779578373ffffffffffffffffffffffffffffffffffffffff1682828151811061172957fe5b60200260200101516040015173ffffffffffffffffffffffffffffffffffffffff16141561176c5781818151811061175d57fe5b60200260200101519250611779565b80806001019150506116fd565b505092915050565b600061178c43611bd1565b905090565b60006117a461179e611781565b8361112a565b9050919050565b60006002600060f81b836040516020016117c6929190612fca565b6040516020818303038152906040526040516117e29190613033565b602060405180830381855afa1580156117ff573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052506118229190810190612878565b9050919050565b60008060008061184a600161183c611781565b6120cc90919063ffffffff16565b905060026000828152602001908152602001600020600001546002600083815260200190815260200160002060010154600260008481526020019081526020016000206002015493509350935050909192565b606080606060016040519080825280602002602001820160405280156118d25781602001602082028038833980820191505090505b509050736ab3d36c46ecfb9b9c0bd51cb1c3da5a2c81cea6816000815181106118f757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050606060016040519080825280602002602001820160405280156119635781602001602082028038833980820191505090505b5090506127108160008151811061197657fe5b60200260200101818152505081819350935050509091565b60ff81565b600160205281600052604060002081815481106119ac57fe5b9060005260206000209060030201600091509150508060000154908060010154908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905083565b6000611a0a611a04611781565b83610939565b9050919050565b604051611a1d9061304a565b604051809103902081565b6000606060016000848152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015611afb578382906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152505081526020019060010190611a5f565b505050509050600080905060008090505b8251811015611b4e57611b3f838281518110611b2457fe5b602002602001015160200151836120cc90919063ffffffff16565b91508080600101915050611b0c565b508092505050919050565b604051611b659061305f565b604051809103902081565b600080600080611b7e611781565b905060026000828152602001908152602001600020600001546002600083815260200190815260200160002060010154600260008481526020019081526020016000206002015493509350935050909192565b60008060038054905090505b6000811115611c9157611bee612689565b6002600060036001850381548110611c0257fe5b906000526020600020015481526020019081526020016000206040518060600160405290816000820154815260200160018201548152602001600282015481525050905083816020015111158015611c5f57506000816040015114155b8015611c6f575080604001518411155b15611c8257806000015192505050611ccc565b50808060019003915050611bdd565b5060006003805490501115611cc757600360016003805490500381548110611cb557fe5b90600052602060002001549050611ccc565b600090505b919050565b606080611cdd4361075d565b915091509091565b60038181548110611cf257fe5b906000526020600020016000915090505481565b600281565b60006020528160005260406000208181548110611d2457fe5b9060005260206000209060030201600091509150508060000154908060010154908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905083565b600060104381611d7b57fe5b04905090565b60026020528060005260406000206000915090508060000154908060010154908060020154905083565b606080611db661189d565b8092508193505050600080905060405180606001604052808281526020016000815260200160ff815250600260008381526020019081526020016000206000820151816000015560208201518160010155604082015181600201559050506003819080600181540180825580915050906001820390600052602060002001600090919290919091505550600080600083815260200190815260200160002081611e5f9190612620565b5060006001600083815260200190815260200160002081611e809190612620565b5060008090505b8351811015611fa2576000808381526020019081526020016000208054809190600101611eb49190612620565b506040518060600160405280828152602001848381518110611ed257fe5b60200260200101518152602001858381518110611eeb57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff168152506000808481526020019081526020016000208281548110611f2957fe5b9060005260206000209060030201600082015181600001556020820151816001015560408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050508080600101915050611e87565b5060008090505b83518110156120c657600160008381526020019081526020016000208054809190600101611fd79190612620565b506040518060600160405280828152602001848381518110611ff557fe5b6020026020010151815260200185838151811061200e57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1681525060016000848152602001908152602001600020828154811061204d57fe5b9060005260206000209060030201600082015181600001556020820151816001015560408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050508080600101915050611fa9565b50505050565b6000808284019050838110156120e157600080fd5b8091505092915050565b6120f36126aa565b600060208301905060405180604001604052808451815260200182815250915050919050565b606061212482612420565b61212d57600080fd5b60006121388361246e565b905060608160405190808252806020026020018201604052801561217657816020015b6121636126c4565b81526020019060019003908161215b5790505b509050600061218885602001516124df565b8560200151019050600080600090505b848110156121e9576121a983612568565b91506040518060400160405280838152602001848152508482815181106121cc57fe5b602002602001018190525081830192508080600101915050612198565b5082945050505050919050565b600080826000015111801561221057506021826000015111155b61221957600080fd5b600061222883602001516124df565b9050600081846000015103905060008083866020015101905080519150602083101561225b57826020036101000a820491505b81945050505050919050565b6000601582600001511461227a57600080fd5b612283826121f6565b9050919050565b60608183018451101561229c57600080fd5b60608215600081146122b95760405191506020820160405261230a565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156122f757805183526020830192506020810190506122da565b50868552601f19601f8301166040525050505b50809150509392505050565b6000806000806041855114612331576000935050505061241a565b602085015192506040850151915060ff6041860151169050601b8160ff16101561235c57601b810190505b601b8160ff16141580156123745750601c8160ff1614155b15612385576000935050505061241a565b6000600187838686604051600081526020016040526040516123aa9493929190613111565b6020604051602081039080840390855afa1580156123cc573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561241257600080fd5b809450505050505b92915050565b600080826000015114156124375760009050612469565b60008083602001519050805160001a915060c060ff168260ff16101561246257600092505050612469565b6001925050505b919050565b6000808260000151141561248557600090506124da565b6000809050600061249984602001516124df565b84602001510190506000846000015185602001510190505b808210156124d3576124c282612568565b8201915082806001019350506124b1565b8293505050505b919050565b600080825160001a9050608060ff168110156124ff576000915050612563565b60b860ff16811080612524575060c060ff168110158015612523575060f860ff1681105b5b15612533576001915050612563565b60c060ff168110156125535760018060b80360ff16820301915050612563565b60018060f80360ff168203019150505b919050565b6000806000835160001a9050608060ff168110156125895760019150612616565b60b860ff168110156125a6576001608060ff168203019150612615565b60c060ff168110156125d65760b78103600185019450806020036101000a85510460018201810193505050612614565b60f860ff168110156125f357600160c060ff168203019150612613565b60f78103600185019450806020036101000a855104600182018101935050505b5b5b5b8192505050919050565b81548183558181111561264d5760030281600302836000526020600020918201910161264c91906126de565b5b505050565b60405180606001604052806000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b60405180606001604052806000815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b604051806040016040528060008152602001600081525090565b61273191905b8082111561272d5760008082016000905560018201600090556002820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055506003016126e4565b5090565b90565b600081359050612743816134b3565b92915050565b600081359050612758816134ca565b92915050565b60008151905061276d816134ca565b92915050565b60008083601f84011261278557600080fd5b8235905067ffffffffffffffff81111561279e57600080fd5b6020830191508360018202830111156127b657600080fd5b9250929050565b600082601f8301126127ce57600080fd5b81356127e16127dc82613302565b6132d5565b915080825260208301602083018583830111156127fd57600080fd5b61280883828461345d565b50505092915050565b600081359050612820816134e1565b92915050565b60006020828403121561283857600080fd5b600061284684828501612734565b91505092915050565b60006020828403121561286157600080fd5b600061286f84828501612749565b91505092915050565b60006020828403121561288a57600080fd5b60006128988482850161275e565b91505092915050565b600080604083850312156128b457600080fd5b60006128c285828601612749565b92505060206128d385828601612749565b9150509250929050565b6000806000606084860312156128f257600080fd5b600061290086828701612749565b935050602061291186828701612749565b925050604084013567ffffffffffffffff81111561292e57600080fd5b61293a868287016127bd565b9150509250925092565b60006020828403121561295657600080fd5b600061296484828501612811565b91505092915050565b6000806040838503121561298057600080fd5b600061298e85828601612811565b925050602061299f85828601612734565b9150509250929050565b6000806000606084860312156129be57600080fd5b60006129cc86828701612811565b93505060206129dd86828701612749565b925050604084013567ffffffffffffffff8111156129fa57600080fd5b612a06868287016127bd565b9150509250925092565b60008060408385031215612a2357600080fd5b6000612a3185828601612811565b9250506020612a4285828601612811565b9150509250929050565b600080600080600080600060a0888a031215612a6757600080fd5b6000612a758a828b01612811565b9750506020612a868a828b01612811565b9650506040612a978a828b01612811565b955050606088013567ffffffffffffffff811115612ab457600080fd5b612ac08a828b01612773565b9450945050608088013567ffffffffffffffff811115612adf57600080fd5b612aeb8a828b01612773565b925092505092959891949750929550565b6000612b088383612b2c565b60208301905092915050565b6000612b208383612f9d565b60208301905092915050565b612b35816133d2565b82525050565b612b44816133d2565b82525050565b6000612b558261334e565b612b5f8185613389565b9350612b6a8361332e565b8060005b83811015612b9b578151612b828882612afc565b9750612b8d8361336f565b925050600181019050612b6e565b5085935050505092915050565b6000612bb382613359565b612bbd818561339a565b9350612bc88361333e565b8060005b83811015612bf9578151612be08882612b14565b9750612beb8361337c565b925050600181019050612bcc565b5085935050505092915050565b612c0f816133e4565b82525050565b612c26612c21826133f0565b61349f565b82525050565b612c358161341c565b82525050565b612c4c612c478261341c565b6134a9565b82525050565b6000612c5d82613364565b612c6781856133ab565b9350612c7781856020860161346c565b80840191505092915050565b6000612c906004836133c7565b91507f766f7465000000000000000000000000000000000000000000000000000000006000830152600482019050919050565b6000612cd0602d836133b6565b91507f537461727420626c6f636b206d7573742062652067726561746572207468616e60008301527f2063757272656e74207370616e000000000000000000000000000000000000006020830152604082019050919050565b6000612d36600f836133b6565b91507f496e76616c6964207370616e20696400000000000000000000000000000000006000830152602082019050919050565b6000612d766013836133b6565b91507f5370616e20616c726561647920657869737473000000000000000000000000006000830152602082019050919050565b6000612db66045836133b6565b91507f446966666572656e6365206265747765656e20737461727420616e6420656e6460008301527f20626c6f636b206d75737420626520696e206d756c7469706c6573206f66207360208301527f7072696e740000000000000000000000000000000000000000000000000000006040830152606082019050919050565b6000612e426005836133c7565b91507f38303030320000000000000000000000000000000000000000000000000000006000830152600582019050919050565b6000612e82600e836133c7565b91507f6865696d64616c6c2d38303030320000000000000000000000000000000000006000830152600e82019050919050565b6000612ec2602a836133b6565b91507f456e6420626c6f636b206d7573742062652067726561746572207468616e207360008301527f7461727420626c6f636b000000000000000000000000000000000000000000006020830152604082019050919050565b6000612f286012836133b6565b91507f4e6f742053797374656d204164646573732100000000000000000000000000006000830152602082019050919050565b606082016000820151612f716000850182612f9d565b506020820151612f846020850182612f9d565b506040820151612f976040850182612b2c565b50505050565b612fa681613446565b82525050565b612fb581613446565b82525050565b612fc481613450565b82525050565b6000612fd68285612c15565b600182019150612fe68284612c3b565b6020820191508190509392505050565b60006130028286612c15565b6001820191506130128285612c3b565b6020820191506130228284612c3b565b602082019150819050949350505050565b600061303f8284612c52565b915081905092915050565b600061305582612c83565b9150819050919050565b600061306a82612e35565b9150819050919050565b600061307f82612e75565b9150819050919050565b600060208201905061309e6000830184612b3b565b92915050565b600060408201905081810360008301526130be8185612b4a565b905081810360208301526130d28184612ba8565b90509392505050565b60006020820190506130f06000830184612c06565b92915050565b600060208201905061310b6000830184612c2c565b92915050565b60006080820190506131266000830187612c2c565b6131336020830186612fbb565b6131406040830185612c2c565b61314d6060830184612c2c565b95945050505050565b6000602082019050818103600083015261316f81612cc3565b9050919050565b6000602082019050818103600083015261318f81612d29565b9050919050565b600060208201905081810360008301526131af81612d69565b9050919050565b600060208201905081810360008301526131cf81612da9565b9050919050565b600060208201905081810360008301526131ef81612eb5565b9050919050565b6000602082019050818103600083015261320f81612f1b565b9050919050565b600060608201905061322b6000830184612f5b565b92915050565b60006020820190506132466000830184612fac565b92915050565b60006060820190506132616000830186612fac565b61326e6020830185612fac565b61327b6040830184612b3b565b949350505050565b60006060820190506132986000830186612fac565b6132a56020830185612fac565b6132b26040830184612fac565b949350505050565b60006020820190506132cf6000830184612fbb565b92915050565b6000604051905081810181811067ffffffffffffffff821117156132f857600080fd5b8060405250919050565b600067ffffffffffffffff82111561331957600080fd5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006133dd82613426565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b8381101561348a57808201518184015260208101905061346f565b83811115613499576000848401525b50505050565b6000819050919050565b6000819050919050565b6134bc816133d2565b81146134c757600080fd5b50565b6134d38161341c565b81146134de57600080fd5b50565b6134ea81613446565b81146134f557600080fd5b5056fea365627a7a7231582054ae86d53ba5464a9d9098ba148754fdba81f088cac08ff2e7c7bf6a46aae8a96c6578706572696d656e74616cf564736f6c63430005110040" + }, + "0000000000000000000000000000000000001001": { + "balance": "0x0", + "code": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806319494a17146100465780633434735f146100e15780635407ca671461012b575b600080fd5b6100c76004803603604081101561005c57600080fd5b81019080803590602001909291908035906020019064010000000081111561008357600080fd5b82018360208201111561009557600080fd5b803590602001918460018302840111640100000000831117156100b757600080fd5b9091929391929390505050610149565b604051808215151515815260200191505060405180910390f35b6100e96104b6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101336104ce565b6040518082815260200191505060405180910390f35b600073fffffffffffffffffffffffffffffffffffffffe73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610200576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4e6f742053797374656d2041646465737321000000000000000000000000000081525060200191505060405180910390fd5b606061025761025285858080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506104d4565b610502565b905060006102788260008151811061026b57fe5b60200260200101516105df565b905080600160005401146102f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f537461746549647320617265206e6f742073657175656e7469616c000000000081525060200191505060405180910390fd5b600080815480929190600101919050555060006103248360018151811061031757fe5b6020026020010151610650565b905060606103458460028151811061033857fe5b6020026020010151610673565b9050610350826106ff565b156104ab576000624c4b409050606084836040516024018083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156103aa57808201518184015260208101905061038f565b50505050905090810190601f1680156103d75780820380516001836020036101000a031916815260200191505b5093505050506040516020818303038152906040527f26c53bea000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905060008082516020840160008887f19650847f5a22725590b0a51c923940223f7458512164b1113359a735e86e7f27f44791ee88604051808215151515815260200191505060405180910390a250505b505050509392505050565b73fffffffffffffffffffffffffffffffffffffffe81565b60005481565b6104dc61097f565b600060208301905060405180604001604052808451815260200182815250915050919050565b606061050d82610718565b61051657600080fd5b600061052183610766565b905060608160405190808252806020026020018201604052801561055f57816020015b61054c610999565b8152602001906001900390816105445790505b509050600061057185602001516107d7565b8560200151019050600080600090505b848110156105d25761059283610860565b91506040518060400160405280838152602001848152508482815181106105b557fe5b602002602001018190525081830192508080600101915050610581565b5082945050505050919050565b60008082600001511180156105f957506021826000015111155b61060257600080fd5b600061061183602001516107d7565b9050600081846000015103905060008083866020015101905080519150602083101561064457826020036101000a820491505b81945050505050919050565b6000601582600001511461066357600080fd5b61066c826105df565b9050919050565b6060600082600001511161068657600080fd5b600061069583602001516107d7565b905060008184600001510390506060816040519080825280601f01601f1916602001820160405280156106d75781602001600182028038833980820191505090505b50905060008160200190506106f3848760200151018285610918565b81945050505050919050565b600080823b905060008163ffffffff1611915050919050565b6000808260000151141561072f5760009050610761565b60008083602001519050805160001a915060c060ff168260ff16101561075a57600092505050610761565b6001925050505b919050565b6000808260000151141561077d57600090506107d2565b6000809050600061079184602001516107d7565b84602001510190506000846000015185602001510190505b808210156107cb576107ba82610860565b8201915082806001019350506107a9565b8293505050505b919050565b600080825160001a9050608060ff168110156107f757600091505061085b565b60b860ff1681108061081c575060c060ff16811015801561081b575060f860ff1681105b5b1561082b57600191505061085b565b60c060ff1681101561084b5760018060b80360ff1682030191505061085b565b60018060f80360ff168203019150505b919050565b6000806000835160001a9050608060ff16811015610881576001915061090e565b60b860ff1681101561089e576001608060ff16820301915061090d565b60c060ff168110156108ce5760b78103600185019450806020036101000a8551046001820181019350505061090c565b60f860ff168110156108eb57600160c060ff16820301915061090b565b60f78103600185019450806020036101000a855104600182018101935050505b5b5b5b8192505050919050565b60008114156109265761097a565b5b602060ff1681106109565782518252602060ff1683019250602060ff1682019150602060ff1681039050610927565b6000600182602060ff16036101000a03905080198451168184511681811785525050505b505050565b604051806040016040528060008152602001600081525090565b60405180604001604052806000815260200160008152509056fea265627a7a72315820bf998627ab3f0decc9d4ae85871979b6f1fec222bbafeb2e0045daf58b93f4b864736f6c63430005110032" + }, + "0000000000000000000000000000000000001010": { + "balance": "0x204fce28085b549b31600000", + "code": "0x6080604052600436106101b75760003560e01c80638da5cb5b116100ec578063b789543c1161008a578063e614d0d611610064578063e614d0d614610ac1578063ed9ef52414610aec578063f2fde38b14610b3d578063fc0c546a14610b8e576101b7565b8063b789543c146109e8578063cc79f97b14610a6b578063e306f77914610a96576101b7565b806395d89b41116100c657806395d89b4114610874578063a9059cbb14610904578063abceeba21461096a578063acd06cb314610995576101b7565b80638da5cb5b1461075e5780638f32d59b146107b55780639025e64c146107e4576101b7565b806347e7ef241161015957806370a082311161013357806370a08231146105a5578063715018a61461060a578063771282f61461062157806377d32e941461064c576101b7565b806347e7ef2414610482578063485cc955146104dd57806360f96a8f1461054e576101b7565b806319d27d9c1161019557806319d27d9c146102c85780632e1a7d4d146103cc578063313ce567146103fa57806342fc47fb1461042b576101b7565b806306fdde03146101bc5780631499c5921461024c57806318160ddd1461029d575b600080fd5b3480156101c857600080fd5b506101d1610be5565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102115780820151818401526020810190506101f6565b50505050905090810190601f16801561023e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025857600080fd5b5061029b6004803603602081101561026f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c22565b005b3480156102a957600080fd5b506102b2610c90565b6040518082815260200191505060405180910390f35b3480156102d457600080fd5b5061038a600480360360a08110156102eb57600080fd5b810190808035906020019064010000000081111561030857600080fd5b82018360208201111561031a57600080fd5b8035906020019184600183028401116401000000008311171561033c57600080fd5b9091929391929390803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ca6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103f8600480360360208110156103e257600080fd5b8101908080359060200190929190505050610e7b565b005b34801561040657600080fd5b5061040f610fcd565b604051808260ff1660ff16815260200191505060405180910390f35b34801561043757600080fd5b50610440610fd6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561048e57600080fd5b506104db600480360360408110156104a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ffc565b005b3480156104e957600080fd5b5061054c6004803603604081101561050057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b8565b005b34801561055a57600080fd5b50610563611287565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105b157600080fd5b506105f4600480360360208110156105c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112ad565b6040518082815260200191505060405180910390f35b34801561061657600080fd5b5061061f6112ce565b005b34801561062d57600080fd5b5061063661139e565b6040518082815260200191505060405180910390f35b34801561065857600080fd5b5061071c6004803603604081101561066f57600080fd5b81019080803590602001909291908035906020019064010000000081111561069657600080fd5b8201836020820111156106a857600080fd5b803590602001918460018302840111640100000000831117156106ca57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506113a4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561076a57600080fd5b50610773611529565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107c157600080fd5b506107ca611552565b604051808215151515815260200191505060405180910390f35b3480156107f057600080fd5b506107f96115a9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561083957808201518184015260208101905061081e565b50505050905090810190601f1680156108665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561088057600080fd5b506108896115e2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108c95780820151818401526020810190506108ae565b50505050905090810190601f1680156108f65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6109506004803603604081101561091a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061161f565b604051808215151515815260200191505060405180910390f35b34801561097657600080fd5b5061097f611645565b6040518082815260200191505060405180910390f35b3480156109a157600080fd5b506109ce600480360360208110156109b857600080fd5b81019080803590602001909291905050506116d2565b604051808215151515815260200191505060405180910390f35b3480156109f457600080fd5b50610a5560048036036080811015610a0b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001909291905050506116f2565b6040518082815260200191505060405180910390f35b348015610a7757600080fd5b50610a80611712565b6040518082815260200191505060405180910390f35b348015610aa257600080fd5b50610aab611719565b6040518082815260200191505060405180910390f35b348015610acd57600080fd5b50610ad661171f565b6040518082815260200191505060405180910390f35b348015610af857600080fd5b50610b3b60048036036020811015610b0f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117ac565b005b348015610b4957600080fd5b50610b8c60048036036020811015610b6057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611903565b005b348015610b9a57600080fd5b50610ba3611920565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60606040518060400160405280600b81526020017f4d6174696320546f6b656e000000000000000000000000000000000000000000815250905090565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f44697361626c656420666561747572650000000000000000000000000000000081525060200191505060405180910390fd5b6000601260ff16600a0a6402540be40002905090565b6000808511610cb457600080fd5b6000831480610cc35750824311155b610d35576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5369676e6174757265206973206578706972656400000000000000000000000081525060200191505060405180910390fd5b6000610d4c610d4633888888611946565b30611a1c565b9050600015156005600083815260200190815260200160002060009054906101000a900460ff16151514610de8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f536967206465616374697661746564000000000000000000000000000000000081525060200191505060405180910390fd5b60016005600083815260200190815260200160002060006101000a81548160ff021916908315150217905550610e628189898080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506113a4565b9150610e6f828488611bab565b50509695505050505050565b60003390506000610e8b826112ad565b9050610ea283600654611f6890919063ffffffff16565b600681905550600083118015610eb757508234145b610f29576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f496e73756666696369656e7420616d6f756e740000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167febff2602b3f468259e1e99f613fed6691f3a6526effe6ef3e768ba7ae7a36c4f8584610fa5876112ad565b60405180848152602001838152602001828152602001935050505060405180910390a3505050565b60006012905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611004611552565b61100d57600080fd5b60008111801561104a5750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b61109f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061226c6023913960400191505060405180910390fd5b60006110aa836112ad565b905060008390508073ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501580156110f7573d6000803e3d6000fd5b5061110d83600654611f8890919063ffffffff16565b6006819055508373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f4e2ca0515ed1aef1395f66b5303bb5d6f1bf9d61a353fa53f73f8ac9973fa9f6858561118f896112ad565b60405180848152602001838152602001828152602001935050505060405180910390a350505050565b600760009054906101000a900460ff161561121e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806122496023913960400191505060405180910390fd5b6001600760006101000a81548160ff02191690831515021790555080600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061128382611fa7565b5050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b6112d6611552565b6112df57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60065481565b60008060008060418551146113bf5760009350505050611523565b602085015192506040850151915060ff6041860151169050601b8160ff1610156113ea57601b810190505b601b8160ff16141580156114025750601c8160ff1614155b156114135760009350505050611523565b60018682858560405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611470573d6000803e3d6000fd5b505050602060405103519350600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561151f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4572726f7220696e2065637265636f766572000000000000000000000000000081525060200191505060405180910390fd5b5050505b92915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b6040518060400160405280600381526020017f013882000000000000000000000000000000000000000000000000000000000081525081565b60606040518060400160405280600581526020017f4d41544943000000000000000000000000000000000000000000000000000000815250905090565b6000813414611631576000905061163f565b61163c338484611bab565b90505b92915050565b6040518060800160405280605b8152602001612313605b91396040516020018082805190602001908083835b602083106116945780518252602082019150602081019050602083039250611671565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040528051906020012081565b60056020528060005260406000206000915054906101000a900460ff1681565b600061170861170386868686611946565b61209f565b9050949350505050565b6201388281565b60015481565b60405180608001604052806052815260200161228f605291396040516020018082805190602001908083835b6020831061176e578051825260208201915060208101905060208303925061174b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040528051906020012081565b6117b4611552565b6117bd57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611843576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001806122e16032913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1f9f3556dd336016cdf20adaead7d5c73665dba664b60e8c17e9a4eb91ce1d3960405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61190b611552565b61191457600080fd5b61191d81611fa7565b50565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806040518060800160405280605b8152602001612313605b91396040516020018082805190602001908083835b602083106119985780518252602082019150602081019050602083039250611975565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405280519060200120905060405181815273ffffffffffffffffffffffffffffffffffffffff8716602082015285604082015284606082015283608082015260a0812092505081915050949350505050565b60008060405180608001604052806052815260200161228f605291396040516020018082805190602001908083835b60208310611a6e5780518252602082019150602081019050602083039250611a4b565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051602081830303815290604052805190602001206040518060400160405280600d81526020017f4d61746963204e6574776f726b00000000000000000000000000000000000000815250805190602001206040518060400160405280600181526020017f3100000000000000000000000000000000000000000000000000000000000000815250805190602001206201388286604051602001808681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200195505050505050604051602081830303815290604052805190602001209050611ba284826120b4565b91505092915050565b6000803073ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611c2b57600080fd5b505afa158015611c3f573d6000803e3d6000fd5b505050506040513d6020811015611c5557600080fd5b8101908080519060200190929190505050905060003073ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611ce757600080fd5b505afa158015611cfb573d6000803e3d6000fd5b505050506040513d6020811015611d1157600080fd5b81019080805190602001909291905050509050611d2f8686866120f5565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fe6497e3ee548a3372136af2fcb0696db31fc6cf20260707645068bd3fe97f3c48786863073ffffffffffffffffffffffffffffffffffffffff166370a082318e6040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611e3757600080fd5b505afa158015611e4b573d6000803e3d6000fd5b505050506040513d6020811015611e6157600080fd5b81019080805190602001909291905050503073ffffffffffffffffffffffffffffffffffffffff166370a082318e6040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611eef57600080fd5b505afa158015611f03573d6000803e3d6000fd5b505050506040513d6020811015611f1957600080fd5b8101908080519060200190929190505050604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a46001925050509392505050565b600082821115611f7757600080fd5b600082840390508091505092915050565b600080828401905083811015611f9d57600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611fe157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006120ad826001546120b4565b9050919050565b60006040517f190100000000000000000000000000000000000000000000000000000000000081528260028201528360228201526042812091505092915050565b3073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612197576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f63616e27742073656e6420746f204d524332300000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156121dd573d6000803e3d6000fd5b508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505056fe54686520636f6e747261637420697320616c726561647920696e697469616c697a6564496e73756666696369656e7420616d6f756e74206f7220696e76616c69642075736572454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e7472616374294368696c6420746f6b656e3a206e6577206368696c64206164647265737320697320746865207a65726f2061646472657373546f6b656e5472616e736665724f726465722861646472657373207370656e6465722c75696e7432353620746f6b656e49644f72416d6f756e742c6279746573333220646174612c75696e743235362065787069726174696f6e29a265627a7a72315820eb7babc3f24d0f6948fed0801b988371ba0eb26b26d496fea92b7b57a72148e164736f6c63430005110032" + }, + "6aB3d36C46ecFb9B9c0bD51CB1c3da5A2C81cea6": { + "balance": "0x3635c9adc5dea00000" + } +} \ No newline at end of file diff --git a/core/forkid/forkid_test.go b/core/forkid/forkid_test.go index 3cf3c8897..310beaa73 100644 --- a/core/forkid/forkid_test.go +++ b/core/forkid/forkid_test.go @@ -154,6 +154,15 @@ func TestCreation(t *testing.T) { {41874000, 0, ID{Hash: checksumToBytes(0x0c015a91), Next: 0}}, // First Agra block }, }, + // Amoy test cases + { + params.AmoyChainConfig, + params.AmoyGenesisHash, + []testcase{ + {0, 0, ID{Hash: checksumToBytes(0xbe06a477), Next: 73100}}, + {73100, 0, ID{Hash: checksumToBytes(0x135d2cd5), Next: 0}}, // First London, Jaipur, Delhi, Indore, Agra + }, + }, // Bor mainnet test cases { params.BorMainnetChainConfig, diff --git a/core/genesis_write.go b/core/genesis_write.go index 2c27b6de3..7c7f9750f 100644 --- a/core/genesis_write.go +++ b/core/genesis_write.go @@ -380,6 +380,7 @@ func GoerliGenesisBlock() *types.Genesis { } } +// MumbaiGenesisBlock returns the Amoy network genesis block. func MumbaiGenesisBlock() *types.Genesis { return &types.Genesis{ Config: params.MumbaiChainConfig, @@ -393,6 +394,20 @@ func MumbaiGenesisBlock() *types.Genesis { } } +// AmoyGenesisBlock returns the Amoy network genesis block. +func AmoyGenesisBlock() *types.Genesis { + return &types.Genesis{ + Config: params.AmoyChainConfig, + Nonce: 0, + Timestamp: 1700225065, + GasLimit: 10000000, + Difficulty: big.NewInt(1), + Mixhash: libcommon.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"), + Coinbase: libcommon.HexToAddress("0x0000000000000000000000000000000000000000"), + Alloc: readPrealloc("allocs/amoy.json"), + } +} + // BorMainnetGenesisBlock returns the Bor Mainnet network genesis block. func BorMainnetGenesisBlock() *types.Genesis { return &types.Genesis{ @@ -650,6 +665,8 @@ func GenesisBlockByChainName(chain string) *types.Genesis { return GoerliGenesisBlock() case networkname.MumbaiChainName: return MumbaiGenesisBlock() + case networkname.AmoyChainName: + return AmoyGenesisBlock() case networkname.BorMainnetChainName: return BorMainnetGenesisBlock() case networkname.BorDevnetChainName: diff --git a/core/system_contract_lookup.go b/core/system_contract_lookup.go index 01067fb26..2905904a2 100644 --- a/core/system_contract_lookup.go +++ b/core/system_contract_lookup.go @@ -15,7 +15,7 @@ import ( func init() { // Initialise SystemContractCodeLookup - for _, chainName := range []string{networkname.BorMainnetChainName, networkname.MumbaiChainName, networkname.BorDevnetChainName} { + for _, chainName := range []string{networkname.BorMainnetChainName, networkname.MumbaiChainName, networkname.AmoyChainName, networkname.BorDevnetChainName} { byChain := map[libcommon.Address][]libcommon.CodeRecord{} systemcontracts.SystemContractCodeLookup[chainName] = byChain // Apply genesis with the block number 0 diff --git a/erigon-lib/chain/networkname/network_name.go b/erigon-lib/chain/networkname/network_name.go index 258174763..877b37389 100644 --- a/erigon-lib/chain/networkname/network_name.go +++ b/erigon-lib/chain/networkname/network_name.go @@ -7,6 +7,7 @@ const ( GoerliChainName = "goerli" DevChainName = "dev" MumbaiChainName = "mumbai" + AmoyChainName = "amoy" BorMainnetChainName = "bor-mainnet" BorDevnetChainName = "bor-devnet" GnosisChainName = "gnosis" @@ -20,6 +21,7 @@ var All = []string{ SepoliaChainName, GoerliChainName, MumbaiChainName, + AmoyChainName, BorMainnetChainName, BorDevnetChainName, GnosisChainName, diff --git a/erigon-lib/chain/snapcfg/util.go b/erigon-lib/chain/snapcfg/util.go index 548c9b94a..9a33a8373 100644 --- a/erigon-lib/chain/snapcfg/util.go +++ b/erigon-lib/chain/snapcfg/util.go @@ -19,6 +19,7 @@ var ( Sepolia = fromToml(snapshothashes.Sepolia) Goerli = fromToml(snapshothashes.Goerli) Mumbai = fromToml(snapshothashes.Mumbai) + Amoy = fromToml(snapshothashes.Amoy) BorMainnet = fromToml(snapshothashes.BorMainnet) Gnosis = fromToml(snapshothashes.Gnosis) Chiado = fromToml(snapshothashes.Chiado) @@ -53,6 +54,7 @@ var ( SepoliaChainSnapshotCfg = newCfg(Sepolia) GoerliChainSnapshotCfg = newCfg(Goerli) MumbaiChainSnapshotCfg = newCfg(Mumbai) + AmoyChainSnapshotCfg = newCfg(Amoy) BorMainnetChainSnapshotCfg = newCfg(BorMainnet) GnosisChainSnapshotCfg = newCfg(Gnosis) ChiadoChainSnapshotCfg = newCfg(Chiado) @@ -100,6 +102,7 @@ var KnownCfgs = map[string]*Cfg{ networkname.SepoliaChainName: SepoliaChainSnapshotCfg, networkname.GoerliChainName: GoerliChainSnapshotCfg, networkname.MumbaiChainName: MumbaiChainSnapshotCfg, + networkname.AmoyChainName: AmoyChainSnapshotCfg, networkname.BorMainnetChainName: BorMainnetChainSnapshotCfg, networkname.GnosisChainName: GnosisChainSnapshotCfg, networkname.ChiadoChainName: ChiadoChainSnapshotCfg, @@ -138,6 +141,7 @@ var KnownWebseeds = map[string][]string{ networkname.SepoliaChainName: webseedsParse(webseed.Sepolia), networkname.GoerliChainName: webseedsParse(webseed.Goerli), networkname.MumbaiChainName: webseedsParse(webseed.Mumbai), + networkname.AmoyChainName: webseedsParse(webseed.Amoy), networkname.BorMainnetChainName: webseedsParse(webseed.BorMainnet), networkname.GnosisChainName: webseedsParse(webseed.Gnosis), networkname.ChiadoChainName: webseedsParse(webseed.Chiado), diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 9c18aeb9b..770634301 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -281,6 +281,7 @@ var ChainsWithSnapshots = map[string]struct{}{ networkname.SepoliaChainName: {}, networkname.GoerliChainName: {}, networkname.MumbaiChainName: {}, + networkname.AmoyChainName: {}, networkname.BorMainnetChainName: {}, networkname.GnosisChainName: {}, networkname.ChiadoChainName: {}, diff --git a/params/bootnodes.go b/params/bootnodes.go index b53f547c2..36c5d8504 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -109,6 +109,8 @@ var V5Bootnodes = []string{ "enr:-Ku4QEWzdnVtXc2Q0ZVigfCGggOVB2Vc1ZCPEc6j21NIFLODSJbvNaef1g4PxhPwl_3kax86YPheFUSLXPRs98vvYsoBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhDZBrP2Jc2VjcDI1NmsxoQM6jr8Rb1ktLEsVcKAPa08wCsKUmvoQ8khiOl_SLozf9IN1ZHCCIyg", } +var AmoyBootnodes = []string{} // Todo: Add BorAmoy bootnodes + var BorMainnetBootnodes = []string{ "enode://b8f1cc9c5d4403703fbf377116469667d2b1823c0daf16b7250aa576bacf399e42c3930ccfcb02c5df6879565a2b8931335565f0e8d3f8e72385ecf4a4bf160a@3.36.224.80:30303", "enode://8729e0c825f3d9cad382555f3e46dcff21af323e89025a0e6312df541f4a9e73abfa562d64906f5e59c51fe6f0501b3e61b07979606c56329c020ed739910759@54.194.245.5:30303", @@ -172,6 +174,8 @@ func BootnodeURLsOfChain(chain string) []string { return GoerliBootnodes case networkname.MumbaiChainName: return MumbaiBootnodes + case networkname.AmoyChainName: + return AmoyBootnodes case networkname.BorMainnetChainName: return BorMainnetBootnodes case networkname.GnosisChainName: diff --git a/params/chainspecs/amoy.json b/params/chainspecs/amoy.json new file mode 100644 index 000000000..64c5f51b2 --- /dev/null +++ b/params/chainspecs/amoy.json @@ -0,0 +1,44 @@ +{ + "ChainName": "amoy", + "chainId": 80002, + "consensus": "bor", + "homesteadBlock": 0, + "eip150Block": 0, + "eip155Block": 0, + "byzantiumBlock": 0, + "constantinopleBlock": 0, + "petersburgBlock": 0, + "istanbulBlock": 0, + "muirGlacierBlock": 0, + "berlinBlock": 0, + "londonBlock": 73100, + "burntContract": { + "0": "0x000000000000000000000000000000000000dead", + "73100": "0xeCDD77cE6f146cCf5dab707941d318Bd50eeD2C9" + }, + "bor": { + "period": { + "0": 2 + }, + "producerDelay": { + "0": 4 + }, + "sprint": { + "0": 16 + }, + "backupMultiplier": { + "0": 2 + }, + "stateSyncConfirmationDelay": { + "0": 128 + }, + "validatorContract": "0x0000000000000000000000000000000000001000", + "stateReceiverContract": "0x0000000000000000000000000000000000001001", + "overrideStateSyncRecords": null, + "jaipurBlock": 73100, + "delhiBlock": 73100, + "indoreBlock": 73100, + "agraBlock": 73100 + } + } + \ No newline at end of file diff --git a/params/config.go b/params/config.go index c9ea236f5..5f6c41600 100644 --- a/params/config.go +++ b/params/config.go @@ -55,6 +55,7 @@ var ( SepoliaGenesisHash = libcommon.HexToHash("0x25a5cc106eea7138acab33231d7160d69cb777ee0c2c553fcddf5138993e6dd9") GoerliGenesisHash = libcommon.HexToHash("0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a") MumbaiGenesisHash = libcommon.HexToHash("0x7b66506a9ebdbf30d32b43c5f15a3b1216269a1ec3a75aa3182b86176a2b1ca7") + AmoyGenesisHash = libcommon.HexToHash("0x7202b2b53c5a0836e773e319d18922cc756dd67432f9a1f65352b61f4406c697") BorMainnetGenesisHash = libcommon.HexToHash("0xa9c28ce2141b56c474f1dc504bee9b01eb1bd7d1a507580d5519d4437a97de1b") BorDevnetGenesisHash = libcommon.HexToHash("0x5a06b25b0c6530708ea0b98a3409290e39dce6be7f558493aeb6e4b99a172a87") GnosisGenesisHash = libcommon.HexToHash("0x4f1dd23188aab3a76b463e4af801b52b1248ef073c648cbdc4c9333d3da79756") @@ -123,6 +124,8 @@ var ( MumbaiChainConfig = readChainSpec("chainspecs/mumbai.json") + AmoyChainConfig = readChainSpec("chainspecs/amoy.json") + BorMainnetChainConfig = readChainSpec("chainspecs/bor-mainnet.json") BorDevnetChainConfig = readChainSpec("chainspecs/bor-devnet.json") @@ -205,6 +208,8 @@ func ChainConfigByChainName(chain string) *chain.Config { return GoerliChainConfig case networkname.MumbaiChainName: return MumbaiChainConfig + case networkname.AmoyChainName: + return AmoyChainConfig case networkname.BorMainnetChainName: return BorMainnetChainConfig case networkname.BorDevnetChainName: @@ -230,6 +235,8 @@ func GenesisHashByChainName(chain string) *libcommon.Hash { return &GoerliGenesisHash case networkname.MumbaiChainName: return &MumbaiGenesisHash + case networkname.AmoyChainName: + return &AmoyGenesisHash case networkname.BorMainnetChainName: return &BorMainnetGenesisHash case networkname.BorDevnetChainName: @@ -255,6 +262,8 @@ func ChainConfigByGenesisHash(genesisHash libcommon.Hash) *chain.Config { return GoerliChainConfig case genesisHash == MumbaiGenesisHash: return MumbaiChainConfig + case genesisHash == AmoyGenesisHash: + return AmoyChainConfig case genesisHash == BorMainnetGenesisHash: return BorMainnetChainConfig case genesisHash == BorDevnetGenesisHash: diff --git a/params/config_test.go b/params/config_test.go index 7617ead1a..c5463a12f 100644 --- a/params/config_test.go +++ b/params/config_test.go @@ -132,4 +132,9 @@ func TestGetBurntContract(t *testing.T) { addr = MumbaiChainConfig.GetBurntContract(41874000 + 1) require.NotNil(t, addr) assert.Equal(t, common.HexToAddress("0x617b94CCCC2511808A3C9478ebb96f455CF167aA"), *addr) + + // Amoy + addr = AmoyChainConfig.GetBurntContract(0) + require.NotNil(t, addr) + assert.Equal(t, common.HexToAddress("0x000000000000000000000000000000000000dead"), *addr) } diff --git a/turbo/node/node.go b/turbo/node/node.go index 5caf4d045..6bb3e38c5 100644 --- a/turbo/node/node.go +++ b/turbo/node/node.go @@ -78,6 +78,8 @@ func NewNodConfigUrfave(ctx *cli.Context, logger log.Logger) *nodecfg.Config { logger.Info("Starting Erigon in ephemeral dev mode...") case networkname.MumbaiChainName: logger.Info("Starting Erigon on Mumbai testnet...") + case networkname.AmoyChainName: + logger.Info("Starting Erigon on Amoy testnet...") case networkname.BorMainnetChainName: logger.Info("Starting Erigon on Bor Mainnet...") case networkname.BorDevnetChainName: diff --git a/turbo/stages/genesis_test.go b/turbo/stages/genesis_test.go index 650ba4473..67e685eb3 100644 --- a/turbo/stages/genesis_test.go +++ b/turbo/stages/genesis_test.go @@ -103,6 +103,36 @@ func TestSetupGenesis(t *testing.T) { wantHash: params.SepoliaGenesisHash, wantConfig: params.SepoliaChainConfig, }, + { + name: "custom block in DB, genesis == bor-mainnet", + fn: func(db kv.RwDB) (*chain.Config, *types.Block, error) { + core.MustCommitGenesis(&customg, db, tmpdir) + return core.CommitGenesisBlock(db, core.BorMainnetGenesisBlock(), tmpdir, logger) + }, + wantErr: &types.GenesisMismatchError{Stored: customghash, New: params.BorMainnetGenesisHash}, + wantHash: params.BorMainnetGenesisHash, + wantConfig: params.BorMainnetChainConfig, + }, + { + name: "custom block in DB, genesis == mumbai", + fn: func(db kv.RwDB) (*chain.Config, *types.Block, error) { + core.MustCommitGenesis(&customg, db, tmpdir) + return core.CommitGenesisBlock(db, core.MumbaiGenesisBlock(), tmpdir, logger) + }, + wantErr: &types.GenesisMismatchError{Stored: customghash, New: params.MumbaiGenesisHash}, + wantHash: params.MumbaiGenesisHash, + wantConfig: params.MumbaiChainConfig, + }, + { + name: "custom block in DB, genesis == amoy", + fn: func(db kv.RwDB) (*chain.Config, *types.Block, error) { + core.MustCommitGenesis(&customg, db, tmpdir) + return core.CommitGenesisBlock(db, core.AmoyGenesisBlock(), tmpdir, logger) + }, + wantErr: &types.GenesisMismatchError{Stored: customghash, New: params.AmoyGenesisHash}, + wantHash: params.AmoyGenesisHash, + wantConfig: params.AmoyChainConfig, + }, { name: "compatible config in DB", fn: func(db kv.RwDB) (*chain.Config, *types.Block, error) {