diff --git a/.gitignore b/.gitignore index 2fe83577d0..96df5a21fd 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,12 @@ node_modules vendor/ coverage.out + +# for the docs folder +.code +docs/site/ +docs/venv/ +docs/env/ +*.out +node_modules/ +*.iml diff --git a/docs/Dockerfile b/docs/Dockerfile new file mode 100755 index 0000000000..bb63d18a2a --- /dev/null +++ b/docs/Dockerfile @@ -0,0 +1,17 @@ +FROM python:3.9-alpine + +# Install system dependencies +RUN apk update && \ + apk add --no-cache rsync git nodejs npm && \ + rm -rf /var/cache/apk/* + +# Copy and install Python dependencies +COPY requirements.txt requirements.txt +RUN pip install -r requirements.txt --no-cache-dir + +# Switch to a non-root user (if 'nonroot' is already created) +USER nonroot + +# Build doc by default +ENTRYPOINT ["mkdocs"] +CMD ["serve", "--dev-addr", "0.0.0.0:8000"] diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000000..f7a2b3ff88 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,48 @@ +# Polygon Edge docs + +Welcome to the Polygon Edge documentation, built with [the Material theme for MkDocs](https://squidfunk.github.io/mkdocs-material/). + +## Build and serve the site + +### Clone the repo + +```sh +https://github.com/0xPolygon/polygon-edge.git +cd polygon-edge/wiki-docs +``` + +### Run with Python + +1. Download and install Python 3.11: https://www.python.org/downloads/ + +2. Install the `virtualenv` package: + +```sh +pip install virtualenv +``` + +3. Build and serve the html + +```sh +./run.sh +``` + +The site runs at: http://127.0.0.1:8000/ + +### Run with Docker + +:warning: Remove line 10 from the `Dockerfile` to run locally. + +1. Spin up the image: + +```sh +docker build -t polygon-edge-docs . +``` + +2. Run the container: + +``` +docker compose up +``` + +The site runs at: http://127.0.0.1:8000/ \ No newline at end of file diff --git a/docs/docker-compose.yml b/docs/docker-compose.yml new file mode 100755 index 0000000000..8b5b48ec22 --- /dev/null +++ b/docs/docker-compose.yml @@ -0,0 +1,13 @@ +version: "3.6" + +services: + developer-docs: + image: "polygon-edge-docs" + ports: + - "0.0.0.0:8000:8000" + container_name: "serve-edge-docs" + working_dir: /workspace/ + volumes: + - type: bind + source: . + target: /workspace diff --git a/docs/docs/api/json-rpc-bridge.md b/docs/docs/api/json-rpc-bridge.md new file mode 100644 index 0000000000..f58f0e6a3c --- /dev/null +++ b/docs/docs/api/json-rpc-bridge.md @@ -0,0 +1,31 @@ +## bridge_generateExitProof + +Returns the proof for a given exit event. Used by users that want to exit the L2 chain and withdraw tokens to L1. + +### Parameters + +**exitID** - ID of the exit event submitted by L2StateSender contract when the user wants to exit the L2 contract. + +### Returns + + +- **Object** - A proof object containing: + - **Array of hashes** - representing the proof of membership of a given exit event on some checkpoint. + - **Map** - containing a leaf index of given exit event in the Merkle tree, Exit event and block number in which checkpoint that contains a given exit event was submitted to the rootchain. + +--- + +## bridge_getStateSyncProof + +Returns the proof for a given state sync event. Used by users (Relayer) when they want to execute a state change on the childchain (for example, depositing funds from L1 to L2). + +### Parameters + +**stateSyncID** - ID of the state sync event submitted by StateSender contract. + +### Returns + + +- **Object** - A proof object containing: + - **Array of hashes** - representing the proof of membership of a given state sync event on some commitment. + - **Map** - containing the state sync event data. diff --git a/docs/docs/api/json-rpc-debug.md b/docs/docs/api/json-rpc-debug.md new file mode 100644 index 0000000000..117550f5dd --- /dev/null +++ b/docs/docs/api/json-rpc-debug.md @@ -0,0 +1,137 @@ +To enable the debug route namespace, you need to modify the configuration and add the "debug" parameter as shown below: + +``` +[jsonrpc.http] + enabled = true + port = 8545 + host = "0.0.0.0" + api = ["eth", "net", "web3", "txpool", "bor", "debug"] +``` + +## debug_traceBlockByNumber + +Executes all transactions in the block specified by number with a tracer and returns the tracing result. + +### Parameters + +* QUANTITY|TAG - integer of a block number, or the string "latest" +* Object - The tracer options: + + + enableMemory: Boolean - (optional, default: false) The flag indicating enabling memory capture. + + disableStack: Boolean - (optional, default: false) The flag indicating disabling stack capture. + + disableStorage: Boolean - (optional, default: false) The flag indicating disabling storage capture. + + enableReturnData: Boolean - (optional, default: false) The flag indicating enabling return data capture. + + timeOut: String - (optional, default: "5s") The timeout for cancellation of execution. + + tracer: String - (default: "structTracer") Defines the debug tracer used for given call. Supported values: structTracer, callTracer. + + +### Returns + + Array - Array of trace objects with the following fields: + + * failed: Boolean - the tx is successful or not + * gas: QUANTITY - the total consumed gas in the tx + * returnValue: DATA - the return value of the executed contract call + * structLogs: Array - the trace result of each step with the following fields: + + + pc: QUANTITY - the current index in bytecode + + op: String - the name of current executing operation + + gas: QUANTITY - the available gas ßin the execution + + gasCost: QUANTITY - the gas cost of the operation + + depth: QUANTITY - the number of levels of calling functions + + error: String - the error of the execution + + stack: Array - array of values in the current stack + + memory: Array - array of values in the current memory + + storage: Object - mapping of the current storage + + refund: QUANTITY - the total of current refund value + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_traceBlockByNumber","params":["latest"],"id":1}' +```` + +## debug_traceBlockByHash + +Executes all transactions in the block specified by block hash with a tracer and returns the tracing result. + +### Parameters + +* DATA , 32 Bytes - Hash of a block. +* Object - The tracer options. See debug_traceBlockByNumber for more details. + +### Returns + + Array - Array of trace objects. See debug_traceBlockByNumber for more details. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_traceBlockByHash","params":["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae"],"id":1}' +```` + +## debug_traceBlock + +Executes all transactions in the block given from the first argument with a tracer and returns the tracing result. + +### Parameters + +* DATA - RLP Encoded block bytes +* Object - The tracer options. See debug_traceBlockByNumber for more details. + +### Returns + + Array - Array of trace objects. See debug_traceBlockByNumber for more details. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_traceBlock","params":["0xf9...."],"id":1}' +```` + +## debug_traceTransaction + +Executes the transaction specified by transaction hash with a tracer and returns the tracing result. + +### Parameters + +* DATA , 32 Bytes - Hash of a transaction. +* Object - The tracer options. See debug_traceBlockByNumber for more details. + +### Returns + + Object - Trace object. See debug_traceBlockByNumber for more details. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_traceTransaction","params":["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae"],"id":1}' +```` + +## debug_traceCall + +Executes a new message call with a tracer and returns the tracing result. + +### Parameters + +* Object - The transaction call object + + + from: DATA, 20 Bytes - (optional) The address the transaction is sent from. + + to: DATA, 20 Bytes - The address the transaction is directed to. + + gas: QUANTITY - (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions. + + gasPrice: QUANTITY - (optional) Integer of the gasPrice used for each paid gas + + value: QUANTITY - (optional) Integer of the value sent with this transaction + + data: DATA - (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation + +* QUANTITY|TAG - integer block number, or the string "latest" +* Object - The tracer options. See debug_traceBlockByNumber for more details. + +### Returns + + Object - Trace object. See debug_traceBlockByNumber for more details. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_traceCall","params":[{"to": "0x1234", "data": "0x1234"}, "latest", {}],"id":1}' +```` diff --git a/docs/docs/api/json-rpc-eth.md b/docs/docs/api/json-rpc-eth.md new file mode 100644 index 0000000000..aa5e5f039f --- /dev/null +++ b/docs/docs/api/json-rpc-eth.md @@ -0,0 +1,580 @@ +## eth_chainId + +Returns the currently configured chain id, a value used in replay-protected transaction signing as introduced by EIP-155. + +### Parameters + +* None + +### Returns + + +* QUANTITY - big integer of the current chain id. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' +```` + +## eth_syncing + +Returns information about the sync status of the node + +### Parameters + +* None + +### Returns + + +* Boolean (FALSE) - if the node isn't syncing (which means it has fully synced) + +* Object - an object with sync status data if the node is syncing + * startingBlock: QUANTITY - The block at which the import started (will only be reset, after the sync reached his head) + * currentBlock: QUANTITY - The current block, same as eth_blockNumber + * highestBlock: QUANTITY - The estimated highest block + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' +```` + +## eth_getBlockByNumber + +Returns block information by number. + +### Parameters + +* QUANTITY|TAG - integer of a block number, or the string "latest" +* Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions. + +### Returns + +Object - A block object, or null when no block was found: + +* number: QUANTITY - the block number. +* hash: DATA, 32 Bytes - hash of the block. +* parentHash: DATA, 32 Bytes - hash of the parent block. +* nonce: DATA, 8 Bytes - hash of the generated proof-of-work. +* sha3Uncles: DATA, 32 Bytes - SHA3 of the uncles data in the block. +* logsBloom: DATA, 256 Bytes - the bloom filter for the logs of the block. +* transactionsRoot: DATA, 32 Bytes - the root of the transaction trie of the block. +* stateRoot: DATA, 32 Bytes - the root of the final state trie of the block. +* receiptsRoot: DATA, 32 Bytes - the root of the receipts trie of the block. +* miner: DATA, 20 Bytes - the address of the beneficiary to whom the mining rewards were given. +* difficulty: QUANTITY - integer of the difficulty for this block. +* totalDifficulty: QUANTITY - integer of the total difficulty of the chain until this block. +* extraData: DATA - the “extra data” field of this block. +* size: QUANTITY - integer the size of this block in bytes. +* gasLimit: QUANTITY - the maximum gas allowed in this block. +* gasUsed: QUANTITY - the total used gas by all transactions in this block. +* timestamp: QUANTITY - the unix timestamp for when the block was collated. +* transactions: Array - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter. +* uncles: Array - Array of uncle hashes. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest", true],"id":1}' +```` + +## eth_getBlockByHash + +Returns block information by hash. + +### Parameters + +* DATA , 32 Bytes - Hash of a block. +* Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions. + +### Returns + + Object - A block object, or null when no block was found: + +* number: QUANTITY - the block number. +* hash: DATA, 32 Bytes - hash of the block. +* parentHash: DATA, 32 Bytes - hash of the parent block. +* nonce: DATA, 8 Bytes - hash of the generated proof-of-work. +* sha3Uncles: DATA, 32 Bytes - SHA3 of the uncles data in the block. +* logsBloom: DATA, 256 Bytes - the bloom filter for the logs of the block. +* transactionsRoot: DATA, 32 Bytes - the root of the transaction trie of the block. +* stateRoot: DATA, 32 Bytes - the root of the final state trie of the block. +* receiptsRoot: DATA, 32 Bytes - the root of the receipts trie of the block. +* miner: DATA, 20 Bytes - the address of the beneficiary to whom the mining rewards were given. +* difficulty: QUANTITY - integer of the difficulty for this block. +* totalDifficulty: QUANTITY - integer of the total difficulty of the chain until this block. +* extraData: DATA - the “extra data” field of this block. +* size: QUANTITY - integer the size of this block in bytes. +* gasLimit: QUANTITY - the maximum gas allowed in this block. +* gasUsed: QUANTITY - the total used gas by all transactions in this block. +* timestamp: QUANTITY - the unix timestamp for when the block was collated. +* transactions: Array - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter. +* uncles: Array - Array of uncle hashes. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae",false],"id":1}' +```` + +## eth_blockNumber + +Returns the number of the most recent block. + +### Parameters + +None + +### Returns + + +* QUANTITY - integer of the current block number the client is on. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' +```` + +## eth_gasPrice + +Returns the current price of gas in wei. +If minimum gas price is enforced by setting the `--price-limit` flag, +this endpoint will return the value defined by this flag as minimum gas price. + +--- + +### Parameters + +None + +### Returns + + +* QUANTITY - integer of the current gas price in wei. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":1}' +```` + +## eth_getBalance + +Returns the balance of the account of the given address. + +### Parameters + +* DATA, 20 Bytes - address to check for balance. +* QUANTITY|TAG - integer block number, or the string "latest" + +### Returns + + +* QUANTITY - integer of the current balance in wei. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"],"id":1}' +```` + +## eth_sendRawTransaction + +Creates new message call transaction or a contract creation for signed transactions. + +### Parameters + +* DATA - The signed transaction data. + +### Returns + + +* DATA, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"],"id":1}' +```` + +## eth_getTransactionByHash + +Returns the information about a transaction requested by transaction hash. + +### Parameters + +* DATA, 32 Bytes - hash of a transaction + +### Returns + + Object - A transaction object, or null when no transaction was found: + +* blockHash: DATA, 32 Bytes - hash of the block where this transaction was in. +* blockNumber: QUANTITY - block number where this transaction was in. +* from: DATA, 20 Bytes - address of the sender. +* gas: QUANTITY - gas provided by the sender. +* gasPrice: QUANTITY - gas price provided by the sender in Wei. +* hash: DATA, 32 Bytes - hash of the transaction. +* input: DATA - the data send along with the transaction. +* nonce: QUANTITY - the number of transactions made by the sender prior to this one. +* to: DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. +* transactionIndex: QUANTITY - integer of the transactions index position in the block. +* value: QUANTITY - value transferred in Wei. +* v: QUANTITY - ECDSA recovery id +* r: DATA, 32 Bytes - ECDSA signature r +* s: DATA, 32 Bytes - ECDSA signature s + +### Example +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"],"id":1}' +```` + +## eth_getTransactionReceipt + +Returns the receipt of a transaction by transaction hash. + +Note That the receipt is not available for pending transactions. + +### Parameters + +* DATA, 32 Bytes - hash of a transaction + +### Returns + + Object - A transaction receipt object, or null when no receipt was found: + +* transactionHash : DATA, 32 Bytes - hash of the transaction. +* transactionIndex: QUANTITY - integer of the transactions index position in the block. +* blockHash: DATA, 32 Bytes - hash of the block where this transaction was in. +* blockNumber: QUANTITY - block number where this transaction was in. +* from: DATA, 20 Bytes - address of the sender. +* to: DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. +* cumulativeGasUsed : QUANTITY - The total amount of gas used when this transaction was executed in the block. +* gasUsed : QUANTITY - The amount of gas used by this specific transaction alone. +* contractAddress : DATA, 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null. +* logs: Array - Array of log objects, which this transaction generated. +* logsBloom: DATA, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs. + +It also returns either : + +* root : DATA 32 bytes - post-transaction stateroot (pre Byzantium) +* status: QUANTITY - either 1 (success) or 0 (failure) + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"],"id":1}' +```` + +## eth_getTransactionCount + +Returns the number of transactions sent from an address. + +### Parameters + +* DATA, 20 Bytes - address. +* QUANTITY|TAG - integer block number, or the string "latest" + +### Returns + + +* QUANTITY - integer of the number of transactions send from this address. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0x407d73d8a49eeb85d32cf465507dd71d507100c1","latest"],"id":1}' +```` + +## eth_getBlockTransactionCountByNumber + +Returns the number of transactions in a block matching the given block number. + +### Parameters + +* QUANTITY|TAG - integer of a block number, or the string "latest" + +### Returns + + +* QUANTITY - integer of the number of transactions in this block. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByNumber","params":["latest"],"id":1}' +```` + +## eth_getLogs + +Returns an array of all logs matching a given filter object. + +### Parameters + Object - The filter options: + +* fromBlock: QUANTITY|TAG - (optional, default: "latest") Integer block number, or "latest" for the last mined block +* toBlock: QUANTITY|TAG - (optional, default: "latest") Integer block number, or "latest" for the last mined block +* address: DATA|Array, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate. +* topics: Array of DATA - (optional) Array of 32 Bytes DATA topics. Topics are order-dependent. Each topic can also be an array of DATA with “or” options. +* blockhash: DATA, 32 Bytes - (optional, future) With the addition of EIP-234, blockHash will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to fromBlock = toBlock = the block number with hash blockHash. If blockHash is present in the filter criteria, then neither fromBlock nor toBlock is allowed. + +### Returns + + +* QUANTITY - integer of the number of transactions send from this address. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b"]}],"id":1}' +```` + +## eth_getCode + +Returns code at a given address. + +### Parameters + +* DATA, 20 Bytes - address +* QUANTITY|TAG - integer block number, or the string "latest" + +### Returns + + +* DATA - the code from the given address. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getCode","params":["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"],"id":1}' +```` + +## eth_call + +Executes a new message call immediately without creating a transaction on the blockchain. + +### Parameters + Object - The transaction call object + +* from: DATA, 20 Bytes - (optional) The address the transaction is sent from. +* to: DATA, 20 Bytes - The address the transaction is directed to. +* gas: QUANTITY - (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions. +* gasPrice: QUANTITY - (optional) Integer of the gasPrice used for each paid gas +* value: QUANTITY - (optional) Integer of the value sent with this transaction +* data: DATA - (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation +* QUANTITY|TAG - integer block number, or the string "latest", see the default block paramete + +### Returns + + +* DATA - the return value of executed contract. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_call","params":[{see above}],"id":1}' +```` + +## eth_getStorageAt + +Returns the value from a storage position at a given address. + +### Parameters + +* DATA, 20 Bytes - address of the storage. +* QUANTITY - integer of the position in the storage. +* QUANTITY|TAG - integer block number, or the string "latest" + +### Returns + + +* DATA - the value at this storage position. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getStorageAt","params":["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"],"id":1}' +```` + +## eth_estimateGas + +Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance. + +### Parameters + +Expect that all properties are optional. + + Object - The transaction call object + +* from: DATA, 20 Bytes - The address the transaction is sent from. +* to: DATA, 20 Bytes - The address the transaction is directed to. +* gas: QUANTITY - Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions. +* gasPrice: QUANTITY - Integer of the gasPrice used for each paid gas +* value: QUANTITY - Integer of the value sent with this transaction +* data: DATA - Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation +* QUANTITY|TAG - integer block number, or the string "latest", see the default block paramete + +### Returns + + +* QUANTITY - the amount of gas used. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_estimateGas","params":[{see above}],"id":1}' +```` + +## eth_newFilter + +Creates a filter object, based on filter options. +To get all matching logs for specific filter, call eth_getFilterLogs. +To check if the state has changed, call eth_getFilterChanges. + +### Parameters + Object - The filter options: + +* fromBlock: QUANTITY|TAG - (optional, default: "latest") Integer block number, or "latest" for the last mined block +* toBlock: QUANTITY|TAG - (optional, default: "latest") Integer block number, or "latest" for the last mined block +* address: DATA|Array, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate. +* topics: Array of DATA - (optional) Array of 32 Bytes DATA topics. Topics are order-dependent. Each topic can also be an array of DATA with “or” options. + +### Returns + + +* QUANTITY - A filter id. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_newFilter","params":[{"topics":["0x12341234"]}],"id":1}' +```` + +## eth_newBlockFilter + +Creates a filter in the node, to notify when a new block arrives. +To check if the state has changed, call eth_getFilterChanges. + +### Parameters + +None + +### Returns + + +1. QUANTITY - A filter id. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_newBlockFilter","params":[],"id":1}' +```` + + + +## eth_getFilterLogs + +Returns an array of all logs matching filter with given id. + +:::caution eth_getLogs vs. eth_getFilterLogs +These 2 methods will return the same results for same filter options: +1. eth_getLogs with params [options] +2. eth_newFilter with params [options], getting a [filterId] back, then calling eth_getFilterLogs with [filterId] +::: + +### Parameters + +* QUANTITY - the filter id. + +### Returns + + Array - Array of log objects, or an empty array + +* For filters created with eth_newFilter logs are objects with the following params: + * removed: TAG - true when the log was removed, due to a chain reorganization. false if its a valid log. + * logIndex: QUANTITY - integer of the log index position in the block. null when its pending log. + * transactionIndex: QUANTITY - integer of the transactions index position log was created from. null when its pending log. + * transactionHash: DATA, 32 Bytes - hash of the transactions this log was created from. null when its pending log. + * blockHash: DATA, 32 Bytes - hash of the block where this log was in. null when its pending log. + * blockNumber: QUANTITY - the block number where this log was in. null when its pending log. + * address: DATA, 20 Bytes - address from which this log originated. + * data: DATA - contains one or more 32 Bytes non-indexed arguments of the log. + * topics: Array of DATA - Array of 0 to 4 32 Bytes DATA of indexed log arguments. (In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getFilterLogs","params":["0x16"],"id":1}' +```` + +## eth_getFilterChanges + +Polling method for a filter, which returns an array of logs that occurred since the last poll. + +### Parameters + +* QUANTITY - the filter id. + +### Returns + + Array - Array of log objects, or an empty array if nothing has changed since last poll. + +* For filters created with eth_newBlockFilter the return are block hashes (DATA, 32 Bytes), e.g. ["0x3454645634534..."]. +* For filters created with eth_newFilter logs are objects with the following params: + * removed: TAG - true when the log was removed, due to a chain reorganization. false if its a valid log. + * logIndex: QUANTITY - integer of the log index position in the block. null when its pending log. + * transactionIndex: QUANTITY - integer of the transactions index position log was created from. null when its pending log. + * transactionHash: DATA, 32 Bytes - hash of the transactions this log was created from. null when its pending log. + * blockHash: DATA, 32 Bytes - hash of the block where this log was in. null when its pending log. + * blockNumber: QUANTITY - the block number where this log was in. null when its pending log. + * address: DATA, 20 Bytes - address from which this log originated. + * data: DATA - contains one or more 32 Bytes non-indexed arguments of the log. + * topics: Array of DATA - Array of 0 to 4 32 Bytes DATA of indexed log arguments. (In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getFilterChanges","params":["0x16"],"id":1}' +```` + +## eth_uninstallFilter + +Uninstalls a filter with a given id. Should always be called when a watch is no longer needed. +Additionally, filters timeout when they aren’t requested with eth_getFilterChanges for some time. + +### Parameters + +* QUANTITY - The filter id. + +### Returns + + +* Boolean - true if the filter was successfully uninstalled, otherwise false. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_uninstallFilter","params":["0xb"],"id":1}' +```` + +## eth_unsubscribe + +Subscriptions are cancelled with a regular RPC call with eth_unsubscribe as a method and the subscription id as the first parameter. It returns a bool indicating if the subscription was cancelled successfully. + +### Parameters + +* SUBSCRIPTION ID + +### Returns + + +* UNSUBSCRIBED FLAG - true if the subscription was cancelled successful. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_unsubscribe","params":["0x9cef478923ff08bf67fde6c64013158d"],"id":1}' +```` diff --git a/docs/docs/api/json-rpc-net.md b/docs/docs/api/json-rpc-net.md new file mode 100644 index 0000000000..002d23e7f5 --- /dev/null +++ b/docs/docs/api/json-rpc-net.md @@ -0,0 +1,56 @@ +## net_version + +Returns the current network id. + +### Parameters + +None + +### Returns + + +* String - The current network id. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"net_version","params":[],"id":83}' +```` + +## net_listening + +Returns true if a client is actively listening for network connections. + +### Parameters + +None + +### Returns + + +* Boolean - true when listening, otherwise false. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"net_listening","params":[],"id":83}' +```` + +## net_peerCount + +Returns number of peers currently connected to the client. + +### Parameters + +None + +### Returns + + +* QUANTITY - integer of the number of connected peers. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}' +```` diff --git a/docs/docs/api/json-rpc-txpool.md b/docs/docs/api/json-rpc-txpool.md new file mode 100644 index 0000000000..9f5a5de940 --- /dev/null +++ b/docs/docs/api/json-rpc-txpool.md @@ -0,0 +1,40 @@ +## txpool_content + +Returns a list with the exact details of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. + +### Parameters + +None + +### Example +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"txpool_content","params":[],"id":1}' +```` + +## txpool_inspect + +Returns a list with a textual summary of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. This is a method specifically tailored to developers to quickly see the transactions in the pool and find any potential issues. + +### Parameters + +None + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"txpool_inspect","params":[],"id":1}' +```` + +## txpool_status + +Returns the number of transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. + +### Parameters + +None + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"txpool_status","params":[],"id":1}' +```` diff --git a/docs/docs/api/json-rpc-web3.md b/docs/docs/api/json-rpc-web3.md new file mode 100644 index 0000000000..0dabe7072e --- /dev/null +++ b/docs/docs/api/json-rpc-web3.md @@ -0,0 +1,37 @@ +## web3_clientVersion + +Returns the current client version. + +### Parameters + +None + +### Returns + + +* String - The current client version + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' +```` + +## web3_sha3 + +Returns Keccak-256 (not the standardized SHA3-256) of the given data. + +### Parameters + +* DATA - the data to convert into a SHA3 hash + +### Returns + + +* DATA - The SHA3 result of the given string. + +### Example + +````bash +curl https://rpc-endpoint.io:8545 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"web3_sha3","params":["0x68656c6c6f20776f726c64"],"id":1}' +```` diff --git a/docs/docs/design/blockchain.md b/docs/docs/design/blockchain.md new file mode 100644 index 0000000000..e16d706ad3 --- /dev/null +++ b/docs/docs/design/blockchain.md @@ -0,0 +1,18 @@ +Edge-powered chains are built on a common blockchain design that effectively manages and maintains the blockchain data structure, consisting of a sequential chain of blocks containing transactions and other metadata; a state database. + +The core blockchain implementation offers various functionalities, such as: + +- Adding new blocks to the chain. +- Retrieving blocks using their hash or number. +- Handling chain reorganizations (i.e., switching to a different chain with greater difficulty). +- Verifying block headers and gas limits. +- Caching block headers and receipts to improve retrieval speed. +- Updating the chain's average gas price. + +To provide these functionalities, the implementation employs several sub-components, including: + +- A consensus component responsible for validating new blocks and incorporating them into the chain. +- A database component that persistently stores blockchain data. +- An event component that notifies other components of chain reorganizations and new block additions. +- A transaction signer component that verifies transaction signatures and identifies the sender address. +- A gas price calculator component that computes the chain's average gas price. diff --git a/docs/docs/design/bridge/assets/erc/erc1155.md b/docs/docs/design/bridge/assets/erc/erc1155.md new file mode 100644 index 0000000000..6f21a0bcd6 --- /dev/null +++ b/docs/docs/design/bridge/assets/erc/erc1155.md @@ -0,0 +1,19 @@ +ERC-1155 is a token standard that enables the creation of both fungible and non-fungible tokens on a blockchain network. In the context of Edge, ERC-1155 tokens can be used to represent multiple instances of a single fungible or non-fungible asset on an Edge-powered chain. + +## ChildERC1155 + +Developers can use the [`ChildERC1155`](../../../../interfaces/erc1155/childerc1155.md) token standard to create ERC-1155 tokens on an Edge-powered chain. To create a new ChildERC1155 token, developers can use the `ChildERC1155` contract as a template and deploy it on the Edge-powered chain. The contract requires a name and symbol to determine the unique identity of the token. + +Once created, `ChildERC1155` tokens can be minted and burned on the Edge-powered chain through the corresponding ERC1155Predicate contract. This ensures that the supply of tokens on the rootchain and the Edge-powered chain remains in sync. The `ERC1155Predicate` contract also allows for the transfer of tokens between the two. + +## Predicates + +The [`RootERC1155Predicate`](../../../../interfaces/erc1155/rooterc1155-predicate.md) contract serves as the root token contract, while the [`ChildERC1155Predicate`](../../../../interfaces/erc1155/childerc1155-predicate.md) contract serves as the child token contract. When a user wants to deposit an ERC-1155 token on the rootchain into the Edge-powered chain, they call the deposit function on the `RootERC1155Predicate` contract with the appropriate parameters, including the token ID, sender, and receiver addresses. + +Once the child contract instance is created, the `RootERC1155Predicate` contract maps the root token to the child token using a mapping, allowing users to deposit and withdraw tokens between the root and Edge-powered chain. The ChildERC1155Predicate contract includes functions for minting and burning child tokens, which are triggered when the deposit and withdrawal functions are called. + +To withdraw a child token back to the rootchain, a user calls the appropriate function on the ChildERC1155Predicate contract with the necessary parameters, including the token ID, the amount to withdraw, and the receiver address. The `ChildERC1155Predicate` contract then burns the child token and emits a withdrawal event. The `RootERC1155Predicate` contract listens for these events and relays them to the rootchain using the `L2StateSender` contract. + +## Deposits and Withdrawals + +Depositing and withdrawing ERC-1155 tokens between the rootchain and Edge-powered chain can be done using the `deposit` and `withdraw` functions in the `RootERC1155Predicate` and `ChildERC1155Predicate` contracts, respectively. The `ChildERC1155Predicate` contract includes functions for minting and burning child tokens, which are triggered when the deposit and withdrawal functions are called. To withdraw a child token back to the rootchain, a user calls the appropriate function on the `ChildERC1155Predicate` contract with the necessary parameters, including the token ID, the amount to withdraw, and the receiver address. The `ChildERC1155Predicate` contract then burns the child token and emits a withdrawal event. diff --git a/docs/docs/design/bridge/assets/erc/erc20.md b/docs/docs/design/bridge/assets/erc/erc20.md new file mode 100644 index 0000000000..25a8d421ed --- /dev/null +++ b/docs/docs/design/bridge/assets/erc/erc20.md @@ -0,0 +1,40 @@ +Edge provides developers with two standards for creating ERC-20 fungible tokens on their networks: `NativeERC20` and `ChildERC20`. These standards are based on the widely-used ERC-20 standard and offer similar functionality, including the ability to transfer tokens between addresses, approve others to spend tokens on your behalf, and check your balance. However, there are significant differences in their deployment and management. + +## ChildERC20 + +The [`ChildERC20`](../../../../interfaces/erc20/childerc20.md) token standard is used for tokens mapping and enables developers to create tokens on both the Edge-powered chain and the associated rootchain. To create a new `ChildERC20` token, developers can use the `ChildERC20` contract as a template and deploy it on their Edge-powered chain. The contract requires a name, symbol, and number of decimals to determine the minimum unit of the token. + +`ChildERC20` tokens are minted and burned on the Edge-powered chain through the corresponding [`ERC20Predicate`](../../../../interfaces/erc20/childerc20-predicate.md) contract. This ensures that the supply of tokens on the rootchain and the Edge-powered chain remains in sync. The `ERC20Predicate` contract also allows for the transfer of tokens between the two networks using the native bridge. + +## NativeERC20 + +The [`NativeERC20`](../../../../interfaces/erc20/native-erc20.md) token standard represents native tokens on Edge and offers fast and inexpensive transactions. It is deployed only on the Edge-powered chain and relies on the native transfer precompile to make transfers. The `NativeERC20` tokens can be minted and burned by the associated predicate contract. + +In addition, developers can use the `NativeERC20Mintable` contract to create and manage `NativeMintable` tokens, which are fungible tokens that represent assets on the Edge-powered chain. These tokens can be managed through the native bridge contract and transferred between an Edge-powered chain and rootchain networks. + +## Deposits and Withdrawals + +The deposit and withdrawal functionality plays a critical role in bridging ERC-20 tokens between a rootchain and an Edge-powered chain. + +When a user wants to deposit ERC-20 tokens into an Edge-powered chain, they call the `deposit` function. This function maps the root token to a child token and then mints the equivalent amount of child tokens to the user's address on the Edge-powered chain. By doing this, the ERC-20 tokens are effectively transferred from the rootchain to the Edge-powered chain. The user can then use these tokens on the Edge-powered chain or transfer them to other addresses on the network. + +On the other hand, when a user wants to withdraw ERC-20 tokens from an Edge-powered chain to the rootchain, they call the `withdraw` function. This function burns the equivalent amount of child tokens on the Edge-powered chain and then triggers a function on the rootchain that transfers the equivalent amount of root tokens to the user's address on the rootchain. By doing this, the ERC-20 tokens are effectively transferred from the Edge-powered chain back to the rootchain. + +Both the `deposit` and `withdraw` functions emit events that log the amount and token involved in the transaction. This provides transparency and allows users to track the movement of their tokens between the two networks. + +### EIP1559Burn + +The dynamic gas fee mechanism implements a base fee per gas to improve transaction fee predictability and efficiency. The base fee adjusts dynamically based on gas target deviations and is burned within the protocol. + +- **Burn Contract**: The burn contract parameter specifies the contract address where fees will be sent and utilized. To enable the London hard fork and set the burn contract address, use the `--burn-contract` flag in the genesis command with the following format: `:
`. + +- **Genesis Base Fee**: The genesis base fee parameter sets the initial base fee (in GWEI) for the genesis block. Include this value in the genesis.json file during the genesis command. By default, the genesis base fee is set to 1 GWEI. + +- **Genesis Base FeeEM**: The genesis base fee elasticity multiplier determines the base fee for blocks following the genesis block. It is initially set to 2. If the London hard fork is disabled (i.e., when the burn contract is not set), the base fee remains the same as the genesis base fee. + +- **Burn Contract Parameter Revision**: The burn contract address can be adjusted during a node reboot, which is achieved by modifying the `burnContract` parameter in the genesis.json file. It's crucial to comprehend, however, that merely identifying the burn contract address does not implicitly activate the EIP-1559 feature. If the EIP-1559 was not initialized during genesis, a series of procedures are required to activate it subsequently: + +- The burn contract should be properly deployed onto the Edge-powered chain. +- The genesis file must detail the burn contracts map, incorporating both the block number and the burn contract address. +- The base fee and base fee elasticity multiplier are required to be manually defined in the genesis file. +- Finally, the EIP1559 fork must be activated. diff --git a/docs/docs/design/bridge/assets/erc/erc721.md b/docs/docs/design/bridge/assets/erc/erc721.md new file mode 100644 index 0000000000..7c64a1728d --- /dev/null +++ b/docs/docs/design/bridge/assets/erc/erc721.md @@ -0,0 +1,18 @@ + +ERC-721 is a token standard that allows for the creation of unique, non-fungible tokens on a blockchain network. In the context of Edge, ERC-721 tokens can be used to represent unique assets. + +## ChildERC721 + +Developers can use the [`ChildERC721`](../../../../interfaces/erc721/childerc721.md) token standard to create ERC-721 tokens on the Edge-powered chain. To create a new ChildERC721 token, developers can use the ChildERC721 predicate contract as a template and deploy it on the Edge-powered chain. The contract requires a name and symbol to determine the unique identity of the token. + +Once created, `ChildERC721` tokens can be minted and burned on the Edge-powered chain through the corresponding `ERC721Predicate` contract. This ensures that the supply of tokens on the rootchain and the Edge-powered chain remains in sync. The `ERC721Predicate` contract also allows for the transfer of tokens between the two networks using the native bridge. + +## Predicates + +The [`RootERC721Predicate`](../../../../interfaces/erc721/rooterc721-predicate.md) contract serves as the rootchain token predicate contract, while the [`ChildERC721Predicate`](../../../../interfaces/erc721/childerc721-predicate.md) contract serves as the Edge-powered chain token predicate contract. When a user wants to deposit an ERC-721 token on the rootchain into the Edge-powered chain, they call the `deposit` function on the `RootERC721Predicate` contract with the appropriate parameters, including the token ID, sender, and receiver addresses. + +When a user deposits a token for the first time, the token mapping between the root and Edge-powered chain is created automatically. This mapping allows users to deposit and withdraw tokens between the root and Edge-powered chain. + +## Deposits and Withdrawals + +The `ChildERC721Predicate` contract includes functions for minting and burning child tokens, which are triggered when the deposit and withdrawal functions are called. To withdraw a child token back to the rootchain, a user calls the appropriate function on the `ChildERC721Predicate` contract with the necessary parameters, including the token ID and receiver address. The `ChildERC721Predicate` contract then burns the child token and emits a withdrawal event. The `RootERC721Predicate` contract listens for these events and relays them to the rootchain using the `L2StateSender` contract. diff --git a/docs/docs/design/bridge/checkpoint.md b/docs/docs/design/bridge/checkpoint.md new file mode 100644 index 0000000000..e74e9afb52 --- /dev/null +++ b/docs/docs/design/bridge/checkpoint.md @@ -0,0 +1,35 @@ + +## Introduction + +Checkpointing is the process of recording and committing a snapshot of the state of a system at a specific point in time. In the context of blockchain, checkpoints are used to increase security by allowing faster verification of the state of the blockchain without needing to process all transactions from the genesis block. Checkpoints can be used to speed up sync times for new nodes and help prevent certain types of attacks, such as 51% attacks. + +## Checkpoints in Edge + +!!! info "Key point" + + - The checkpoints are made **by the validators on the Edge-powered chain** and are committed to the rootchain. + - A checkpoint serves as a snapshot of the Edge state. This snapshot is stored as a Merkle root and **represents the state of the Edge-powered chain** at that point in time it was created. + - The checkpoint process is important for **ensuring the security of the network** as it enables the rootchain to detect and prevent any potential fraud or malicious activity on the child. + + +### CheckpointManager + +A `CheckpointManager` contract responsible for managing checkpoints in the network. + +The checkpoints represent a snapshot of the Edge state, which is periodically checkpointed to the rootchain by the validators. The checkpoints are used as a reference point for the rootchain to verify the integrity and accuracy of the data on the Edge-powered chain. + +The contract has several functions to facilitate the management of checkpoints, such as submitting a new checkpoint with metadata, verifying signatures, and getting the event root by block number or epoch. The contract also has a mapping to store the checkpoints and the current validator set, and an array to keep track of the checkpoint block numbers. + +The contract uses a Merkle tree to efficiently prove the membership of an event in the Edge state. The tree is constructed using the hashed exit events sent by the L2StateSender, which the Edge client saves to its local storage after their transactions are executed. The membership proofs can be verified using the Merkle proofs provided by the users. + +The contract also implements a BLS signature scheme to verify the signatures submitted by the validators. The validators' signatures are aggregated, and the contract checks whether the required voting power threshold is met to accept the checkpoint. + +!!! info "Details of the checkpoint" + + To elaborate, the root of the Merkle tree is a hash value that represents a specific subset of the Edge state at a specific point in time. This state includes only the exit events sent by the L2StateSender contract. When a user wants to exit the L2 chain (transfer their tokens from L2 to L1), their exit transaction is included in this Merkle tree. + + When a checkpoint is made, the root of the Merkle tree is included as part of the checkpoint, along with other metadata. This checkpoint is then sent to the rootchain where it is verified and stored by the validators. + + Later, when a user wants to verify a particular exit event on the Edge-powered chain, they can provide a Merkle proof, which is a cryptographic proof that demonstrates the inclusion of a particular exit event in the Merkle tree. The Merkle proof can be verified by the rootchain using the root of the Merkle tree, which was included in the checkpoint. + + In short, the root of the Merkle tree is a compact representation of the exit events on the Edge-powered chain at a specific point in time, which is included in checkpoints and used for verification purposes. diff --git a/docs/docs/design/bridge/overview.md b/docs/docs/design/bridge/overview.md new file mode 100644 index 0000000000..46c227496f --- /dev/null +++ b/docs/docs/design/bridge/overview.md @@ -0,0 +1,41 @@ +## Overview + +Edge provides a built-in bridging mechanism that enables cross-chain communication. The bridging mechanism is a technical infrastructure that facilitates the transfer of arbitrary messages between any EVM-compatible PoS blockchain (rootchain), and an Edge-powered chain. + +It relies on mapping between the token contracts on the rootchain and the target chain, which is crucial for tracking assets and ensuring the correct amount of tokens are minted and burned during the transfer process. + +!!! caution "Bridge as an Attack Vector" + The cross-chain bridge can be an attack vector if not properly managed. Ensure you fully understand its functionality, potential vulnerabilities, and security measures before use. Expertise in this area is crucial for maintaining system security. + + +During the transfer process, assets are locked in a contract on the rootchain, and an equivalent amount of tokens are minted on the target chain. When assets are withdrawn from the target chain, the corresponding tokens are burned, and the assets are unlocked on the rootchain. Smart contracts on both the rootchain and the target chain are used to facilitate these processes, ensuring that the asset transfer is secure and transparent. + +!!! note "Enabled by Default" + + The cross-chain bridge in Edge is an integral part of the consensus client and is enabled by default. It cannot be disabled, as it is required for the functioning of the network. Being native to Edge, the bridge is built into the protocol and does not require any external third-party solutions or plug-ins. + + If you choose to use another cross-chain bridging mechanism, you will need to customize it yourself, and there are no guarantees of compatibility with associated contracts and infrastructure. + + +
+ bridge +
+

The following diagram provides a visual representation of how messages can be passed between different EVM blockchain layers, allowing for seamless message transfers and coordination between various components of a Super network.

+

How does message passing work?

+

StateSync: real-time synchronization

+

Message passing between a rootchain and an Edge-powered chain is achieved through continuous state synchronization, known as StateSync. This process involves transferring state data between system calls.

+

Check out the StateSync document to learn more.

+

Checkpoints: Ensuring liveliness and reference points

+

When passing messages from an Edge-chain to a rootchain, the validator set commits checkpoints, which are snapshots of the Edge state containing only the root of the Exit events, excluding all transactions. Checkpoints serve as reference points for clients, and validators periodically checkpoint all transactions occurring on the Edge-powered chain to the rootchain. Checkpoints also ensure liveliness and are submitted to the associated rootchain asset contract.

+

Check out the Checkpoint document to learn more.

+

Bridge States: tracking event progress

+

The bridge can exist in one of three states:

+
    +
  • Pending: Events are waiting to be bundled and sent over.
  • +
  • Committed: Event data has been relayed to the associated chain.
  • +
  • Executed: The event has been committed, and the state executed, resulting in a state change.
  • +
+

Assets: supporting a range of standards

+

The bridge is compatible with various token standards, including ERC-20, ERC-721, and ERC-1155, enabling a wide range of assets to be transferred between chains.

+
+
diff --git a/docs/bridge/sequences.md b/docs/docs/design/bridge/sequences.md similarity index 100% rename from docs/bridge/sequences.md rename to docs/docs/design/bridge/sequences.md diff --git a/docs/docs/design/bridge/statesync.md b/docs/docs/design/bridge/statesync.md new file mode 100644 index 0000000000..decaa3266d --- /dev/null +++ b/docs/docs/design/bridge/statesync.md @@ -0,0 +1,37 @@ +## Introduction + +State synchronization (StateSync) is a mechanism used to update the state of a contract on the Edge-powered chain based on events occurring on the rootchain. It is a critical component of blockchain technology as it enables secure and efficient communication between the two chains. State synchronization allows for a more efficient and secure way to update the chain state on the Edge-powered chain without needing to process all transactions from the genesis block. + +## StateSync in Edge + +!!! info "Key points" + + - `StateSync` enables the efficient and secure transfer of data between an Edge-powered chain and rootchain. + - `StateSync` is initiated on the Edge-powered chain through the `StateSender` contract and executed on the rootchain through the `StateReceiver` contract. + - The `StateSync` process is used to update the state of a contract on the rootchain based on events occurring on the Edge-powered chain. + +### StateSender + +The `StateSender` contract is deployed on the rootchain and is triggered by either the associated rootchain predicate or `SupernetManager` rootchain contract. Its main responsibility is to generate sync state events based on the provided data and receiver address. Anyone can call the `syncState` function to emit a sync state event. The data is sent along with the event and represents the state change that needs to be executed on the Edge-powered chain. + +### StateReceiver + +The `StateReceiver` contract is deployed on the Edge and is responsible for executing and relaying the state data sent from the rootchain. It receives the state change data from the rootchain contract bundled up in the form of a commitment, sent with the Merkle Tree root hash. This tree is created by bundling a number of `StateSync` events received by the `StateSender`. Commitments are submitted to the `StateReceiver` by a block proposer, and it is a system (state) transaction. They are used to verify the execution of state data from the rootchain to the Edge-powered chain, such as transferring funds from rootchain to Edge. Commitments are similar to checkpoints but are used in the process of transferring data from rootchain to Edge, while checkpoints are used in the process of transferring data from Edge to rootchain. + +## L2StateSender and ExitHelper + +To enable communication from the Edge-powered chain to the rootchain, the `L2StateSender` contract resides on an Edge-powered chain and is responsible for emitting `L2StateSyncs` (also referred to as exit events). These events are indexed by the rootchain validators and submitted as a checkpoint on the rootchain, allowing for lazy execution. Unlike the `StateSender`, there is no transaction execution on the rootchain for the `L2StateSender`. + +On the rootchain, the `ExitHelper` contract is responsible for verifying the execution of the exit events and enabling users to withdraw their funds from the Edge-powered chain to the rootchain. It is analogous to the StateReceiver on the Edge-powered chain, and both contracts work together to enable two-way communication between the rootchain and the Edge-powered chain. + +!!! info "Synchronization and commitments" + + The `StateSync` process involves two main steps: synchronization and commitments. + + In the synchronization step, the `StateSender` contract on the rootchain generates sync state events based on receiver and data. The `syncState` function allows anyone to call this method to emit an event. The data is sent along with the event and represents the state change that needs to be executed on the Edge. + + In the commitments step, the `StateReceiver` contract on the Edge-powered chain receives the state change data along with a Merkle proof from the `StateSender` contract and verifies the proof to ensure the data's integrity. If the proof is valid, the state change is executed on the Edge-powered chain. + + To ensure the validity of the state change, the `StateSender` contract generates a unique id for each sync state event. This id is used by the `StateReceiver` contract to prevent replay attacks, which could result in the execution of duplicate state changes. + + The `StateReceiver` contract also implements a BLS signature scheme to verify the signatures submitted by the validators. The validators' signatures are aggregated, and the contract checks whether the required voting power threshold is met to accept the state change. diff --git a/docs/docs/design/consensus/polybft/ibft.md b/docs/docs/design/consensus/polybft/ibft.md new file mode 100644 index 0000000000..f2976f4149 --- /dev/null +++ b/docs/docs/design/consensus/polybft/ibft.md @@ -0,0 +1,54 @@ +## Consensus Engine + +The PolyBFT consensus mechanism uses the IBFT 2.0 consensus engine to agree on adding new blocks to the blockchain. The validator pool in IBFT 2.0 is responsible for validating candidate blocks proposed by a randomly selected block proposer who is part of the validator pool. The proposer is responsible for constructing a block at the block interval. The proposer mechanism is based on [Tendermint](https://tendermint.com/), where a proposer is chosen based on a deterministic selection algorithm. The frequency of selection is proportional to the voting power of the validator. + +Each block in IBFT 2.0 requires at least one round of voting by the validator to arrive at consensus, which is recorded as a collection of signatures on the block content. In general, a supermajority of validators must confirm that a block is valid for the block to be added to the blockchain. Only when there is no consensus on a given block, multiple rounds of voting are needed. The ideal path would be when the validator pool reaches consensus on a candidate block in the first round of voting, and the block is added to the blockchain without the need for additional rounds of voting. This is the most efficient and optimal outcome, as it allows the network to continue processing transactions and adding new blocks to the chain in a timely manner. + +A validator's voting power is proportional to the amount of stake they have locked up on the network. This means that validators with more stake will have more voting power and, therefore, more influence over the decision-making process on the network. This also provides an economic incentive for validators to behave honestly and act in the network's best interest. + +!!! info "Sealing a block" + + ### State transitions + + PolyBFT's consensus mechanism follows a series of state transitions that ensure network-wide consensus on the blockchain's state. The consensus process starts with a validator proposing a new block to be added to the blockchain, which includes a list of transactions to update the blockchain's state. + + Next, validators in the active set vote on whether to accept the proposed block. Each validator's voting weight determines their influence in voting, and a supermajority of validators must agree to accept the block for consensus to be reached. The protocol tracks the current block's position, also known as its **sequence**. + + The process to finalize a block in PolyBFT is referred to as **sealing**. When a validator proposes a new block, other validators vote on whether to accept it, and this process can be repeated multiple times. Each repetition is called a **round**, and during each round, a set number of validators must agree to seal the proposed block for it to be added to the blockchain. If the required number of votes isn't reached during a particular round, the voting process will continue into the next round, and the protocol "increases the round". Another validator will then attempt to seal the sequence in the new round. + + If the proposed block is accepted, it's added to the blockchain, and the state of the blockchain is updated to reflect the changes introduced by the transactions in the block. This process continues with the next proposer proposing a new block, and the process repeats. + +### Validator Set + +PolyBFT limits network participation to around 100 validators, and a variable amount of stake is used as a fixed stake criterion to limit the system's security and can make the system economically vulnerable. The validator set in the PolyBFT does not update on each block but is fixed during n block periods known as an epoch. + +The `n` block period to define one epoch is determined by `genesis` configuration, and until then, validators will remain the same. At the end of the epoch, a special state transaction to validatorSetManagementContract is emitted, notifying the system about the validators' uptime during the epoch. It is up to the smart contract to reward validators by their uptime and update the validator set for the next epoch. There is a function getValidatorSet which returns the current validator set at any time. + +!!! note + Proposer selection algorithm - Section is being updated + +The proposer selection algorithm is Tendermint-based. + +### Staking + +Staking is managed by staking contracts on the Edge-powered chain. The staking module on Polygon validates staked tokens and is independent of Ethereum's security. In principle, the network is secured by the rootchain and Ethereum. Transaction checkpoints still occur on Ethereum, but Ethereum does not validate staking on Polygon. + +At the end of each epoch, a reward calculation occurs to reward validators who actively participated in that epoch. + +!!! info + Staking details and rewards - Section is being updated + + +## Benefits + +### Consensus benefits + +- **Immediate block finality**: Only one block is proposed at a given chain height; thus, the single chain removes forking, uncle blocks, and the risk that a transaction may be "undone" once on the chain later. +- **Reduced time between blocks**: The effort needed to construct and validate blocks is decreased significantly, which increases the chain's throughput. +- **High data integrity and fault tolerance**: IBFT 2.0 uses a pool of validators to ensure the integrity of each proposed block. A supermajority (~66%) of these validators must sign the block before insertion into the chain, making block forgery very difficult. Also, the proposer of the block rotates over time, ensuring a faulty node cannot exert long-term influence over the chain. +- **Operationally flexible**: The validators can be modified quickly, ensuring the group contains only fully trusted nodes. + +### Network benefits + +- **Liveness**: It has been proven that IBFT 2.0 does not guarantee BFT persistence nor liveness when operating on a synchronous network. If a validator receives enough confirmation about a block, it can lock the proposed block (assuming it has not locked any prior). If a change were to occur because of a fault in the network, it could trigger the activation of the round change protocol, where the protocol would expect to commit the locked block at that specific height. +- **Persistence**: If, for instance, there is a faulty network condition present where two different node subsets lock to two different blocks, the system enters into an infinite cycle of state transitions that cannot converge states and finalize the block. diff --git a/docs/docs/design/consensus/polybft/overview.md b/docs/docs/design/consensus/polybft/overview.md new file mode 100644 index 0000000000..0d6164aece --- /dev/null +++ b/docs/docs/design/consensus/polybft/overview.md @@ -0,0 +1,22 @@ +## Overview + +PolyBFT is a sophisticated and robust consensus mechanism employed by Polygon Edge. +The consensus mechanism comprises two key components, a **consensus engine** and **consensus protocol**. +PolyBFT utilizes the IBFT consensus engine and a Proof-of-Stake architecture to seal blocks, provide specific network capabilities, and govern the network. +The core smart contracts work in tandem with the consensus engine to define all the network's Proof-of-Stake rules. + +![bridge](../../..//img/edge/polybft.excalidraw.png) + +The consensus engine of PolyBFT is based on the Istanbul Byzantine Fault Tolerance [(IBFT 2.0) protocol](https://github.com/0xPolygon/go-ibft), which is responsible for sealing blocks on the blockchain. +The IBFT 2.0 protocol ensures that network integrity is maintained even in the presence of malicious or dishonest nodes. + +To achieve fault tolerance, IBFT allows for `f` faulty nodes in a `3f + 1` network, as long as two-thirds of the nodes are honest. This algorithm is also known as a "super-majority rules" algorithm. +Each PolyBFT node maintains a local copy of the blockchain, represented as a list of blocks similar to the blockchain. The height of a block is defined as the number of parent links that separate the block from the genesis block, with the genesis block having a height of 0. Sequential instances of a block finalization protocol are run, with the objective of each instance being to determine which block is to be added at height h of the blockchain. + +PolyBFT's consensus protocol is implemented through a set of core smart contracts. These contracts serve multiple purposes, including enabling staking functionality and defining an incentivization scheme for validators on the network, managing the validator set, and facilitating cross-chain communication through a native bridge. + +![bridge](../../../img/edge/contracts.excalidraw.png) + +## Bridge + +The bridge transfers assets and data between an Edge-powered chain and an external EVM-compatible blockchain (rootchain), making it a critical component of the network's interoperability. Two predicate contracts, one on the childchain and one on the rootchain, implement the core bridge functionality and use the associated core contracts to deposit, withdraw, and verify cross-chain bridge transactions. The diagram above illustrates how the core contracts fit into the overall smart contract system design. diff --git a/docs/docs/design/consensus/polybft/protocol.md b/docs/docs/design/consensus/polybft/protocol.md new file mode 100644 index 0000000000..21cd1049d6 --- /dev/null +++ b/docs/docs/design/consensus/polybft/protocol.md @@ -0,0 +1,123 @@ +## State Transitions + +In PolyBFT, the consensus protocol follows a set of state transitions that enable the network to reach consensus on the state of the blockchain. The process begins when a validator proposes adding a new block to the blockchain. This block contains a list of transactions that the validator would like to include in the next update to the blockchain's state. + +Other validators in the active set will vote on whether to accept the proposed block. Each validator has a voting weight that influences voting. A super-majority of validators must agree to accept the block to reach consensus. Once a sufficient number of validators have agreed to accept the proposed block, it is added to the blockchain, and the state of the blockchain is updated to reflect the changes introduced by the transactions in the block. The protocol refers to the current block's position (the block height) as its *sequence*. + +The process to finalize a block in PolyBFT is known as *sealing*. When a validator proposes a new block, other validators on the network will vote on whether to accept the block. This process is may be repeated several times; each repetition is known as a *round*. During each round, certain validators must agree to seal the proposed block for it to be added to the blockchain. Another validator will attempt to seal the sequence in the new round. If the required number of votes is not reached during a particular round, the voting process will continue into the next round, and thus, the protocol "increases the round". + +Once the proposed block is accepted, it will be added to the blockchain, and the state of the blockchain will be updated to reflect the changes introduced by the transactions in the block. This process continues with the next proposer proposing a new block, and the process repeats. + +## Validator Set + +PolyBFT limits network participation to around 100 validators, and a variable amount of stake is used as a fixed stake criterion to limit the system's security and can make the system economically vulnerable. The validator set in the PolyBFT does not update on each block but is fixed during n block periods known as an epoch. + +The `n` block period to define one epoch is determined by governance, and until then, validators will remain the same. At the end of the epoch, a special state transaction to validatorSetManagementContract is emitted, notifying the system about the validators' uptime during the epoch. It is up to the smart contract to reward validators by their uptime and update the validator set for the next epoch. There is a function getValidatorSet which returns the current validator set at any time. + +## Staking + +Staking is governed by staking contracts directly on Polygon. To be clear, the staking module validates on Polygon and does not rely on Ethereum's security, but in principle, two chains are securing the network, PoS client and Ethereum. Transaction checkpoints still occur on Ethereum, but Ethereum does not validate staking on Polygon. + +At the end of each epoch, a reward calculation occurs to reward the active validators. + +## Native Bridge Integration + +PolyBFT supports an in-built bridging mechanism that enables arbitrary message passing between an Edge-powered chain and another Proof-of-Stake blockchain (rootchain) with the help of the consensus algorithm. Transfers can occur without mapping, allowing users to move assets between the two chains seamlessly. + +## Slashing + +Like in other Proof-of-Stake systems, validators are subject to slashing for malicious activity or poor performance. The slashing mechanics are still being determined, but PolyBFT will undoubtedly include a mechanism to penalize bad actors. Slashing a validator typically involves a penalty, such as losing some or all of their stake on the network. Examples of malicious activities are double-signing and equivocation. + +## State transitions + +The consensus protocol follows a set of state transitions. While things are still being finalized, the +process will typically follow the steps below. + +1. A validator proposes adding a new block to the blockchain. This block contains a list of transactions + that the validator would like to include in the next update to the blockchain's state. + +A + certain number of validators must agree to accept the block to reach consensus. 2. Other validators in the active set will vote on whether to accept the proposed block. The voting weight of + each validator influences voting. The protocol refers to block height as a *sequence*. + + All nodes in the network exchange information for a given sequence. The process to finalize a block in PolyBFT is known as *sealing*. The sealing of blocks is instant + and final. + + When a validator proposes a new block, other validators on the network will vote on whether to + accept the block. This process is typically repeated several times; each repetition is known as a + *round*. During each round, certain validators must agree to seal the proposed block + for it to be added to the blockchain. If the required number of votes is not reached during a + particular round, the voting process will continue into the next round, and thus, the protocol + "increases the round". Another validator will attempt to seal the sequence in the new round. + > The best case for a proposed block is that it is sealed at round 0. Blocks that are repeatedly + > sealed at a high-order round usually indicates a network problem. + +3. If the proposed block is accepted, it will be added to the blockchain, and the state of the blockchain + will be updated to reflect the changes introduced by the transactions in the block. + > If a malicious actor attempted to fork the network, they would need to obtain control of 2/3 of + > the network, which PolyBFT prevents. + +4. Once the state of the blockchain has been updated, the next proposer will propose a new block, and + the process repeats. + +IBFT limits network participation to around 100 validators. A variable amount of stake is used as a fixed +stake criterion to limit the system's security and can make the system economically vulnerable. The +validator set in the PolyBFT does not update on each block but is fixed during `n` block periods known as +an `epoch`. + +> The `n` block period to define one epoch is to be determined by governance. Until then, validators will +> remain the same. At the end of the epoch, a special `state transaction` to `validatorSetManagementContract` +> is emitted, notifying the system about validators' uptime during the `epoch`. It is up to the smart contract +> to reward validators by their uptime and **update the validator set** for the next `epoch`. There is a +> function `getValidatorSet`, which returns the current validator set at any time. + +Staking is governed by staking contracts directly on Polygon. To be clear, the staking module validates on +Polygon does not rely on Ethereum's security, but in principle, two chains are securing the network, PoS +client and Ethereum. Transaction checkpoints still occur on Ethereum, but Ethereum does not validate staking +on Polygon. + +!!! note + Note that in Tendermint, an epoch is set to 1. However, PolyBFT includes the logic to set a custom epoch time, with the intent of each epoch being one day in blocks, or around 14000 blocks. + +A reward calculation occurs at the end of the epoch to reward the active validators in that epoch. + +!!! caution "Slashing" + + Like in other Proof-of-Stake systems, validators are subject to slashing for malicious activity or + poor performance. Slashing a validator typically involves a penalty, such + as losing some or all of their stake on the network. The slashing mechanics are still being determined, but PolyBFT will undoubtedly + include a mechanism to penalize bad actors. + + Examples of malicious activities are double-signing and equivocation: + + - Double-signing refers to the act of signing two conflicting transactions. When a validator double-signs, + it creates a situation where the network is unable to reach consensus on the state of the blockchain, + which can lead to problems such as an attempt to fork or network instability. + + - Equivocation refers to the act of a validator attempting to create two conflicting versions of the + blockchain, which can also lead to problems such as a fork or network instability. + +## Block timestamp drift validation + +In the PolyBFT consensus mechanism, an important security feature is the validation of block timestamps. This +feature prevents malicious actors from creating blocks with timestamps far in the future, which could disrupt the +blockchain's operation. + +The block time drift validation works by checking if the block's timestamp is within a predefined time slot. If the +timestamp is outside this window, the block is considered a future block and is rejected. This time slot is defined by +a parameter called `blockTimeDrift`, which is nominated in seconds, and can be set during the genesis of the blockchain. +The default value for `blockTimeDrift` is 1 second. + +This feature ensures that all blocks in the blockchain have valid timestamps, preventing potential attacks and maintaining +the integrity of the blockchain. + +## Native bridge integration + +With the help of PolyBFT, Edge supports an +[in-built bridging mechanism (a two-way bridge)](../../bridge/overview.md), +which enables arbitrary message passing between an Edge-powered chain and another Proof-of-Stake +blockchain (`rootchain`). Transfers can occur without mapping. + +![bridge](../../../img/edge/contracts-bridge.excalidraw.png) + +Learn more [here](../../bridge/overview.md)). diff --git a/docs/docs/design/grpc.md b/docs/docs/design/grpc.md new file mode 100644 index 0000000000..74deade0b5 --- /dev/null +++ b/docs/docs/design/grpc.md @@ -0,0 +1,20 @@ +## What is gRPC used for? + +gRPC is a popular RPC (remote procedure call) framework that enables efficient communication between distributed systems. It is commonly used in microservices architectures and is especially useful for building high-performance, scalable applications that require low-latency communication between services. With its support for multiple programming languages and its built-in support for data serialization, gRPC provides a powerful and flexible tool for building distributed systems. + +## gRPC in Edge + +libp2p provides the underlying networking layer for establishing connections between peers. By creating a gRPC server instance on each peer in the network and allowing gRPC client connections to be established, a network API can be created that enables clients to interact with the network. + +When a client makes a remote procedure call to the server, the gRPC protocol abstracts the details of network communication, serialization, and deserialization. The gRPC client sends a request message to the gRPC server, which deserializes the request message, executes the appropriate method, and serializes the response message. The gRPC server then sends the response message back to the client, which deserializes the response message and returns the result to the caller. + +!!! info "Breakdown of the gRPC API" + + The `GrpcStream` struct lies at the core of the gRPC implementation, providing developers with a flexible and powerful tool for building decentralized applications on the network. By abstracting away the intricacies of network communication, it offers a simple and high-level API for constructing distributed systems. + + To create a new `GrpcStream` object and initialize a gRPC server instance, developers can call the `NewGrpcStream()` function. The `Client()` method allows developers to wrap a network stream in a gRPC client connection, and the `Serve()` method starts the gRPC server in a separate goroutine. + + For registering a gRPC service and its implementation with the server, developers can use the `RegisterService()` method. The `GrpcServer()` method returns the underlying gRPC server instance, making it simple to configure and manage. + + For greater flexibility and control over the network communication process, developers can use the `Accept()` method to wait for and accept incoming connections. The `WrapClient()` function can also wrap a network stream in a gRPC client connection. + diff --git a/docs/docs/design/jsonrpc.md b/docs/docs/design/jsonrpc.md new file mode 100644 index 0000000000..40744efec3 --- /dev/null +++ b/docs/docs/design/jsonrpc.md @@ -0,0 +1,19 @@ +## What is JSON-RPC used for? + +JSON-RPC is a remote procedure call (RPC) protocol encoded in JSON. It enables the communication between distributed systems, often found in microservices architectures. JSON-RPC is a lightweight, language-agnostic protocol that allows developers to build scalable applications with low-latency communication between services. With its simplicity and support for multiple programming languages, JSON-RPC offers an accessible and flexible tool for building distributed systems. + +## JSON-RPC in Edge + +JSON-RPC is implemented in Edge as an API consensus. + +When a client makes a remote procedure call to the server, the JSON-RPC protocol abstracts the details of network communication, serialization, and deserialization. The JSON-RPC client sends a request message to the JSON-RPC server, which deserializes the request message, executes the appropriate method, and serializes the response message. The JSON-RPC server then sends the response message back to the client, which deserializes the response message and returns the result to the caller. + +!!! info "Breakdown of the JSON-RPC API" + + The JSON-RPC implementation in Edge consists of several key components, including the `JSONRPC` struct and the `JSONRPCStore` interface. + + The `JSONRPC` struct handles the core functionality of the JSON-RPC server. It includes methods for setting up the HTTP server, handling WebSocket connections, and managing incoming requests. The `NewJSONRPC()` function is used to create a new instance of the JSONRPC server with a specified logger and configuration. + + The JSONRPCStore interface defines all the methods required by the JSON-RPC endpoints. These methods are implemented by various store types, such as `ethStore`, `networkStore`, `txPoolStore`, `filterManagerStore`, `bridgeStore`, and `debugStore`. These store types interact with different aspects of the system, allowing the JSON-RPC server to provide a comprehensive API for clients. + + For handling WebSocket connections, a `handleWs` function is used to upgrade HTTP connections to WebSocket connections. A `wsWrapper` struct wraps WebSocket connections and provides methods for managing WebSocket communication. diff --git a/docs/docs/design/libp2p.md b/docs/docs/design/libp2p.md new file mode 100644 index 0000000000..6e04548dc8 --- /dev/null +++ b/docs/docs/design/libp2p.md @@ -0,0 +1,26 @@ +## Overview + +PolyBFT uses a decentralized networking layer based on the libp2p protocol. The protocol provides peer-to-peer networking primitives such as peer discovery, connection management, and secure messaging. The network relies on a secure Identity Service to manage peer connectivity and handshaking, ensuring only valid peers can join the network. + +## Identity + +The Identity Service validates incoming connections and manages peer handshaking. It maintains a list of pending peer connections and uses a networkingServer interface to communicate with the underlying networking layer. + +## Peer discovery + +PolyBFT uses libp2p's distributed hash table (DHT) based on the Kademlia algorithm for peer discovery. The DHT stores information about other peers in the network, such as their addresses and availability. When a new node joins the network, it uses the DHT to find other peers that are currently online. The process of using the DHT to discover peers and then sending out connection requests is repeated periodically to maintain a sufficient number of connections in the network. + +## Peer routing + +Bootnodes act as rendezvous servers that help new nodes discover and connect to the network. The polygon-edge command allows you to specify one or more bootnodes while creating the genesis file. Bootnodes are defined using libp2p multiaddrs, which contain information about the protocol, network address, and node port number. + +```bash +--bootnode /ip4/127.0.0.1/tcp/30301/p2p/16Uiu2HAmJxxH1tScDX2rLGSU9exnuvZKNM9SoK3v315azp68DLPW \ +--bootnode /ip4/127.0.0.1/tcp/30302/p2p/16Uiu2HAmS9Nq4QAaEiogE4ieJFUYsoH28magT7wSvJPpfUGBj3Hq \ +``` + +## Gossipsub + +Gossipsub is a decentralized, peer-to-peer messaging protocol used in Polygon Edge to broadcast messages efficiently across the network. It's used in various network components, including the TxPool, where it's used to broadcast new transactions and relay transaction data between nodes. Gossipsub allows for efficient and reliable message propagation while minimizing the bandwidth requirements of the network. + +To learn more about libp2p networking, check out the [official libp2p documentation](https://docs.libp2p.io/). diff --git a/docs/docs/design/mempool.md b/docs/docs/design/mempool.md new file mode 100644 index 0000000000..4f5df8b6e8 --- /dev/null +++ b/docs/docs/design/mempool.md @@ -0,0 +1,17 @@ +## What is a Mempool? + +A mempool, short for "memory pool," is a temporary storage area in a blockchain node for pending transactions before they are added to a block and confirmed on the network. When users submit transactions, they are initially held in the mempool, where miners or validators can select them to include in the next block. Transactions in the mempool are generally ordered based on factors such as transaction fees and age, which helps prioritize transactions for faster confirmation. + +## Mempool in Edge + +In Edge, the mempool is crucial in managing and prioritizing pending transactions. When a transaction is submitted to the network, it is first stored in the mempool, which remains until it is confirmed in a block. The mempool helps ensure that transactions are executed fairly and efficiently, as validators can choose which transactions to include in a block based on factors such as fees and age. + +The mempool in Edge is designed to optimize transaction processing and improve network performance. Some of the key features of the mempool in Edge include: + +- **Transaction prioritization**: The mempool prioritizes transactions based on fees and age. Transactions with higher fees are generally processed faster, providing greater incentives for validators to include them in a block. + +- **Mempool management**: Mechanisms for handling congestion, transaction eviction, and memory usage are implemented to help maintain a healthy mempool, ensuring that the network remains stable and responsive. + +- **Transaction validation**: Before a transaction is added to the mempool, validators validate it to ensure that it is valid and adheres to the network's consensus rules. + +- **Mempool synchronization**: Nodes share information about their mempools to maintain a consistent view of the pending transactions in the network. diff --git a/docs/docs/design/overview.md b/docs/docs/design/overview.md new file mode 100644 index 0000000000..0c5dc2df4d --- /dev/null +++ b/docs/docs/design/overview.md @@ -0,0 +1,21 @@ +The diagram below illustrates the major components of Edge. + +
+ Edge architecture overview +
+ +## Components + +The following table breaks down each of these components. + +| Component | Description | Link | +| --- | --- | --- | +| libp2p | Provides the networking layer for Edge and is designed for peer-to-peer network architectures. | [libp2p Overview](libp2p.md) | +| Bridge | An in-built bridging mechanism enabled by PolyBFT that allows message passing between an Edge-powered chain and another Proof-of-Stake blockchain without mapping. | [Native Bridge overview](bridge/overview.md) | +| Mempool | Enables multiple validators to aggregate their signatures to create a single, aggregated signature representing all validators in the pool. | [mempool Overview](mempool.md) | +| Consensus | PolyBFT serves as the consensus mechanism of Polygon Edge and consists of a consensus engine, IBFT 2.0, and a consensus protocol that includes the bridge, staking, and other utilities. | [PolyBFT Overview](consensus/polybft/overview.md) | +| Blockchain | Coordinates everything in the system, curates state transitions, and is responsible for state changes when a new block is added to the chain. | [Blockchain Overview](blockchain.md) | +| Runtime (EVM) | Uses the EVM as the runtime environment for executing smart contracts. | [Runtime Overview](runtime/overview.md) | +| TxPool | Represents the transaction pool, closely linked with other modules in the system. | [TxPool Overview](txpool.md) | +| JSON-RPC | Facilitates interaction between dApp developers and the blockchain, allowing developers to issue JSON-RPC requests to an Edge node and receive responses. | [JSON-RPC Overview](jsonrpc.md) | +| gRPC | Essential for operator interactions, allowing node operators to interact with the client easily and providing a seamless user experience. | [gRPC Overview](grpc.md) | diff --git a/docs/docs/design/runtime/allowlist.md b/docs/docs/design/runtime/allowlist.md new file mode 100644 index 0000000000..9a7593cdda --- /dev/null +++ b/docs/docs/design/runtime/allowlist.md @@ -0,0 +1,51 @@ +## Overview + +Edge offers access control lists (ACLs) to manage and control access to specific network resources, contracts, or functionalities. Network operators can limit access to certain addresses using ACLs, ensuring a controlled and secure environment for their applications. + +## Roles + +There are currently two primary roles within the ACL system: + +- **Admin**: An address with full control over the list, capable of adding, modifying, or removing entries. +- **Enabled**: An address that has been granted access to the specific resource or functionality covered by the list. + +## Initializing and Managing Admins in ACLs + +To effectively manage ACLs, at least one address with the Admin role should be assigned when initializing each list in your blockchain application. Admins have the authority to modify the roles of other addresses, granting or revoking access to resources or functionalities as needed. + +When setting up ACLs, you should: + +- Select trusted addresses to serve as admins. +- Assign the `Admin` role to these addresses using the appropriate flag for each list type. +- Admin addresses will manage the respective ACLs, including adding or removing new addresses. Ensure that the admin addresses are secure and that only authorized users have access to them to maintain the integrity and security of your application. + +## Designating Multiple Admins + +You can designate multiple admin addresses for redundancy and better access control management. Having more than one admin can help: + +- Prevent single points of failure. +- Distribute the responsibility of managing the ACLs among multiple trusted entities. + +However, assigning multiple admins also increases the potential attack surface. It is essential to strike the right balance between security and flexibility when managing admin addresses or use your best judgment based on the needs and purpose of the network. + +## ACL Types + +Edge supports several types of ACLs: + +- **Contract Deployer Allow/Block Lists**: Controls which can deploy contracts on the network. +- **Transactions Allow/Block Lists**: Controls which addresses can send transactions on the network. +- **Bridge Allow/Block Lists**: Controls that can interact with the bridge functionality. + +Each list type serves a different purpose and can be configured separately to provide fine-grained control over various aspects of the network. Network operators can use a combination of these lists to maintain a secure and controlled environment for their applications. + +### Bridge ACLs + +Bridge ACLs are an additional layer of security for cross-chain transactions, allowing only specific authorized contracts to interact with a particular bridge. By using an alternative ACL-enabled contract, network operators can have greater control over cross-chain interactions, ensuring that only trusted parties can perform certain actions. + +However, it's essential to note that using an alternative ACL-enabled contract comes with a trade-off in terms of gas consumption. Since these contracts introduce additional checks and restrictions on transactions, they require more computational resources, leading to higher gas fees. Network operators must carefully weigh the benefits of increased security against the potential increased costs for users. + +## Current Limitations + +- **Limited role definitions**: The current implementation only supports two primary roles (Admin and Enabled). You must modify the implementation if your application requires more granular access control or additional roles. +- **Granularity**: The current implementation applies the ACLs at the network level. More granular control may require custom implementation, such as using ACLs for specific contracts or functionalities. +- **Static call limitation**: Write operations are not allowed in static calls, which might be a constraint in specific scenarios where you would want to perform a write operation within a static call. diff --git a/docs/docs/design/runtime/overview.md b/docs/docs/design/runtime/overview.md new file mode 100644 index 0000000000..c3e4cac153 --- /dev/null +++ b/docs/docs/design/runtime/overview.md @@ -0,0 +1,10 @@ + +The EVM is the core interface for executing and interacting with smart contracts on a Edge-powered chain. It operates consistently with the Ethereum EVM and supports the same set of OPCODEs. + +!!! info "Overview of the EVM" + + Smart contracts represent self-executing agreements, with their terms explicitly encoded into the contract's code. Deployed on the Ethereum network, these contracts are processed by the EVM, which provides a secure, decentralized environment for execution. The EVM guarantees that all network nodes adhere to the same rules and yield identical outcomes when running smart contracts. + + Featuring a stack-based architecture, the EVM processes low-level instructions known as opcodes. Each opcode serves a specific function, such as performing arithmetic operations, managing storage access, or facilitating interactions with other contracts. To limit resource consumption during contract execution and prevent issues like infinite loops, the EVM employs gas as a metric for computational work. + + Developers typically create smart contracts using high-level programming languages, such as Solidity, which are subsequently compiled into EVM bytecode. The EVM executes this bytecode, ensuring the contract's logic is implemented as intended. diff --git a/docs/docs/design/txpool.md b/docs/docs/design/txpool.md new file mode 100644 index 0000000000..9788b63b86 --- /dev/null +++ b/docs/docs/design/txpool.md @@ -0,0 +1,21 @@ +## What is the TxPool used for? + +The TxPool module manages the incoming transactions for processing. It maintains a list of unprocessed transactions and ensures they conform to specific constraints before entering the pool. + +## TxPool in Edge + +The TxPool has several methods to handle incoming transactions. + +!!! info "Details on how the TxPool works" + + The `addTx()` method is the main entry point for all new transactions. It validates the incoming transaction and adds it to the pool. If the call is successful, an account is created for this address (only once), and an `enqueueRequest` is signaled. + + The `handleEnqueueRequest()` method attempts to enqueue the transaction in the given request to the associated account. If the account is eligible for promotion, a `promoteRequest` is signaled afterward. The `handlePromoteRequest()` method moves promotable transactions of some accounts from enqueued to promoted. It can only be invoked by `handleEnqueueRequest()` or `resetAccount()`. + + The TxPool also has a `validateTx()` method that checks specific constraints before entering the pool. These constraints include checking the transaction size to overcome DOS Attacks, ensuring the transaction has a strictly positive value, and checking if the transaction is appropriately signed. + + The `resetAccounts()` method also updates existing accounts with the new nonce and prunes stale transactions. This ensures that the pool only contains relevant and valid transactions. The `updateAccountSkipsCounts()` method updates the accounts' skips, which is the number of consecutive blocks that do not have the account's transactions. + + The TxPool implementation in Polygon Edge uses several data structures to manage transactions efficiently. The `accounts` data structure stores all the accounts and transactions in the pool. The `index` data structure maintains a list of all transactions in the pool, and the `gauge` data structure keeps track of the number of slots used in the pool. + + Finally, the TxPool implementation in Polygon Edge handles transactions gossiped by the network through the `addGossipTx()` method. It verifies that the gossiped transaction message is not empty, decodes the transaction, and adds it to the pool using the `addTx()` method. diff --git a/docs/docs/design/txrelayer.md b/docs/docs/design/txrelayer.md new file mode 100644 index 0000000000..203b3637b0 --- /dev/null +++ b/docs/docs/design/txrelayer.md @@ -0,0 +1,19 @@ +## What is a TxRelayer used for? + +A TxRelayer is a component that facilitates the creation and sending of transactions. It provides a simple interface for executing a message call without creating a dedicated transaction and sending signed transactions to a blockchain. + +## TxRelayer in Edge + +In Polygon Edge, the TxRelayer module contains a client communicating with an Ethereum node and a wallet for signing transactions. + +!!! info "Details on using the TxRelayer" + + The first step for those looking to use the TxRelayer is to create a new instance by calling the `NewTxRelayer()` function. This function takes several optional arguments that can be used to configure the TxRelayer, such as `clientConfig` and `receiptTimeout`. By default, the client is set to connect to an Ethereum node running on `localhost:8545`, and the `receiptTimeout` is set to 50 milliseconds. + + Once the TxRelayer is created, you can call the `Call()`, `SendTransaction()`, or `SendTransactionLocal()` methods to execute message calls or send signed transactions to the blockchain. + + The `Call()` method allows you to execute a message call without creating a transaction on the blockchain. It takes in the from and to addresses and the input data for the call. The result of the call is returned as a byte array. + + The `SendTransaction()` method signs the provided transaction with the provided key and sends it to the blockchain. It first fetches the nonce for the sender's address, sets the gas price and limit (if they are not already set), signs the transaction with the `EIP155Signer`, and then sends the raw transaction data to the Ethereum node. + + The `SendTransactionLocal()` method sends a non-signed transaction to the blockchain only for testing purposes. It sets the gas price and limit and uses the first account returned by the Ethereum node's `Accounts()` method as the sender. diff --git a/docs/docs/disclaimer.md b/docs/docs/disclaimer.md new file mode 100644 index 0000000000..ce06ffebeb --- /dev/null +++ b/docs/docs/disclaimer.md @@ -0,0 +1,7 @@ +## Polygon Wiki Third-Party Content Disclaimer + +The Polygon Wiki contains third-party content, including websites, products, and services, that are provided for informational purposes only. + +Polygon Labs does not endorse, warrant, or make any representations regarding the accuracy, quality, reliability, or legality of any third-party websites, products, or services. If you decide to access any third-party content linked from the Polygon Wiki, you do so entirely at your own risk and subject to the terms and conditions of use for such websites. Polygon Labs reserves the right to withdraw such references and links without notice. + +The Polygon Wiki serves as an industry public good and is made available under the MIT open source license. In addition, please view the official Polygon Labs Terms of Use, available [here](https://polygon.technology/terms-of-use). \ No newline at end of file diff --git a/docs/docs/img/edge/bridge-deposit-childchain.excalidraw.png b/docs/docs/img/edge/bridge-deposit-childchain.excalidraw.png new file mode 100644 index 0000000000..ff584ff059 Binary files /dev/null and b/docs/docs/img/edge/bridge-deposit-childchain.excalidraw.png differ diff --git a/docs/docs/img/edge/bridge-deposit-rootchain.excalidraw.png b/docs/docs/img/edge/bridge-deposit-rootchain.excalidraw.png new file mode 100644 index 0000000000..82e1d178dc Binary files /dev/null and b/docs/docs/img/edge/bridge-deposit-rootchain.excalidraw.png differ diff --git a/docs/docs/img/edge/bridge-withdraw-childchain.excalidraw.png b/docs/docs/img/edge/bridge-withdraw-childchain.excalidraw.png new file mode 100644 index 0000000000..363b514f33 Binary files /dev/null and b/docs/docs/img/edge/bridge-withdraw-childchain.excalidraw.png differ diff --git a/docs/docs/img/edge/bridge-withdraw-rootchain.excalidraw.png b/docs/docs/img/edge/bridge-withdraw-rootchain.excalidraw.png new file mode 100644 index 0000000000..c0b32200e8 Binary files /dev/null and b/docs/docs/img/edge/bridge-withdraw-rootchain.excalidraw.png differ diff --git a/docs/docs/img/edge/consensus.excalidraw.png b/docs/docs/img/edge/consensus.excalidraw.png new file mode 100644 index 0000000000..4efdb75678 Binary files /dev/null and b/docs/docs/img/edge/consensus.excalidraw.png differ diff --git a/docs/docs/img/edge/contracts-bridge.excalidraw.png b/docs/docs/img/edge/contracts-bridge.excalidraw.png new file mode 100644 index 0000000000..b9e5d0c1ef Binary files /dev/null and b/docs/docs/img/edge/contracts-bridge.excalidraw.png differ diff --git a/docs/docs/img/edge/contracts.excalidraw.png b/docs/docs/img/edge/contracts.excalidraw.png new file mode 100644 index 0000000000..5ea50488fb Binary files /dev/null and b/docs/docs/img/edge/contracts.excalidraw.png differ diff --git a/docs/docs/img/edge/l1-l2-l3.excalidraw.png b/docs/docs/img/edge/l1-l2-l3.excalidraw.png new file mode 100644 index 0000000000..bb5014899d Binary files /dev/null and b/docs/docs/img/edge/l1-l2-l3.excalidraw.png differ diff --git a/docs/docs/img/edge/polybft-node.excalidraw.png b/docs/docs/img/edge/polybft-node.excalidraw.png new file mode 100644 index 0000000000..26f7fd1a18 Binary files /dev/null and b/docs/docs/img/edge/polybft-node.excalidraw.png differ diff --git a/docs/docs/img/edge/polybft.excalidraw.png b/docs/docs/img/edge/polybft.excalidraw.png new file mode 100644 index 0000000000..4baf86d3b3 Binary files /dev/null and b/docs/docs/img/edge/polybft.excalidraw.png differ diff --git a/docs/docs/img/edge/supernet.svg b/docs/docs/img/edge/supernet.svg new file mode 100644 index 0000000000..7959bed4b3 --- /dev/null +++ b/docs/docs/img/edge/supernet.svg @@ -0,0 +1,3 @@ + + + diff --git a/docs/docs/img/edge/supernets-checkpoint-exit.excalidraw.png b/docs/docs/img/edge/supernets-checkpoint-exit.excalidraw.png new file mode 100644 index 0000000000..e91441d503 Binary files /dev/null and b/docs/docs/img/edge/supernets-checkpoint-exit.excalidraw.png differ diff --git a/docs/docs/img/edge/supernets-checkpoint.excalidraw.png b/docs/docs/img/edge/supernets-checkpoint.excalidraw.png new file mode 100644 index 0000000000..8d096dd860 Binary files /dev/null and b/docs/docs/img/edge/supernets-checkpoint.excalidraw.png differ diff --git a/docs/docs/img/edge/supernets-consensus.excalidraw.png b/docs/docs/img/edge/supernets-consensus.excalidraw.png new file mode 100644 index 0000000000..4bcabfd3ff Binary files /dev/null and b/docs/docs/img/edge/supernets-consensus.excalidraw.png differ diff --git a/docs/docs/img/edge/supernets-interconnected.excalidraw.png b/docs/docs/img/edge/supernets-interconnected.excalidraw.png new file mode 100644 index 0000000000..ed1735c619 Binary files /dev/null and b/docs/docs/img/edge/supernets-interconnected.excalidraw.png differ diff --git a/docs/docs/img/edge/supernets-logo.png b/docs/docs/img/edge/supernets-logo.png new file mode 100644 index 0000000000..76575aa89d Binary files /dev/null and b/docs/docs/img/edge/supernets-logo.png differ diff --git a/docs/docs/img/edge/supernets-overview.excalidraw.png b/docs/docs/img/edge/supernets-overview.excalidraw.png new file mode 100644 index 0000000000..1fcb26c91a Binary files /dev/null and b/docs/docs/img/edge/supernets-overview.excalidraw.png differ diff --git a/docs/docs/img/edge/supernets-setup-non.excalidraw.png b/docs/docs/img/edge/supernets-setup-non.excalidraw.png new file mode 100644 index 0000000000..e04a8d662c Binary files /dev/null and b/docs/docs/img/edge/supernets-setup-non.excalidraw.png differ diff --git a/docs/docs/img/edge/supernets-setup.excalidraw.png b/docs/docs/img/edge/supernets-setup.excalidraw.png new file mode 100644 index 0000000000..cecb573710 Binary files /dev/null and b/docs/docs/img/edge/supernets-setup.excalidraw.png differ diff --git a/docs/docs/img/edge/supernets-together-lp.excalidraw.png b/docs/docs/img/edge/supernets-together-lp.excalidraw.png new file mode 100644 index 0000000000..ebda3b1dd1 Binary files /dev/null and b/docs/docs/img/edge/supernets-together-lp.excalidraw.png differ diff --git a/docs/docs/img/edge/supernets-together.excalidraw.png b/docs/docs/img/edge/supernets-together.excalidraw.png new file mode 100644 index 0000000000..8d9fea6672 Binary files /dev/null and b/docs/docs/img/edge/supernets-together.excalidraw.png differ diff --git a/docs/docs/img/edge/val-select.excalidraw.png b/docs/docs/img/edge/val-select.excalidraw.png new file mode 100644 index 0000000000..33a720a608 Binary files /dev/null and b/docs/docs/img/edge/val-select.excalidraw.png differ diff --git a/docs/docs/index.md b/docs/docs/index.md new file mode 100644 index 0000000000..ed30cf5ce7 --- /dev/null +++ b/docs/docs/index.md @@ -0,0 +1,38 @@ +## Background + +Polygon Edge was established with the aim of delivering a robust Software Development Kit (SDK) for blockchains, grounded in Polygon's foundational vision for Ethereum. This vision sought to transform Ethereum into a multi-chain system by introducing a structured framework for its diversified expansion. + +Despite its role in empowering critical infrastructure, the original SDK lacked essential support and pre-built services necessary for overcoming challenges in blockchain infrastructure deployment, management, and bootstrapping. It was at this juncture that the Supernets vision was conceived to elevate Edge by developing a product suite centered around the [Edge client](https://github.com/0xPolygon/polygon-edge), while incorporating enterprise-grade features such as cross-chain interoperability, access control, and extensive customizability. + +Now, the innovations from ZK and PoS-based mechanisms are integrated into a comprehensive chain development kit, known as the Polygon CDK. + +In summary: + +- **Polygon Edge**: Originated as an SDK designed for initiating sidechains, it facilitated the development of Ethereum-compatible blockchain networks and functioned as a Layer 3 development kit. **The original Edge progressed until the 0.6.x versions, stopping at [v0.6.3](https://github.com/0xPolygon/polygon-edge/releases/tag/v0.6.3). Please read [this archive disclaimer](https://github.com/0xPolygon/wiki/tree/main/archive/edge) on the legacy Edge documentation.** + +- **Polygon Supernets**: Representing the evolved form of Edge, it resolves the complexities associated with infrastructure development and bootstrapping for app-chains. It aimed to provide enhanced interoperability, customization options, and also operates as a Layer 3 development kit. **Supernets was introduced in [v0.7.0](https://github.com/0xPolygon/polygon-edge/releases/tag/v0.7.0-alpha1); the latest version is [v1.1.0](https://github.com/0xPolygon/polygon-edge/releases/tag/v1.1.0).** + +- **Polygon CDK**: The most refined and sophisticated version, focusing on Layer 2 solutions, exemplifies modularity and customization. It leverages the innovative ZK protocol primitives from Polygon 2.0, allowing developers to craft chains specifically aligned with their unique requirements. The CDK currently priortizes the validium offering, which is based on Polygon zkEVM. + +## Introduction + +Edge provides infrastructure for application-specific chains that operate with PolyBFT consensus. It leverages a native bridge to connect with an associated rootchain, enabling Edge-powered chains to inherit its security and capabilities. Additionally, Edge extend the block space available on the rootchain, providing scalability and interoperability for decentralized applications. With on-chain governance mechanisms, Edge empower communities to make decisions and upgrade the network in a transparent and compliant manner. + +The following table offers a comprehensive overview on what Edge-powered chains are through different perspectives. + +| Edge-powered chains are | Description | +|-----------|-------------| +| Application-specific blockchain networks designed for specific use cases. | Appchains are customizable blockchain networks that developers can tailor to meet specific enterprise or application use cases. With appchains, developers can create high-performance blockchain networks that are fast and low-cost. | +| Modular and complex-minimized blockchain development. | Edge offer a modular framework that simplifies blockchain development, providing developers with the tools necessary to create customizable blockchain networks that are scalable, secure, and interoperable. Developers can use the Edge stack to create high-performance blockchain networks with advanced capabilities without worrying about complex integrations or intermediaries. | +| Customizable blockchain networks for reliable business logic. | A customizable virtual machine provides full Ethereum Virtual Machine (EVM) support out of the box, enabling developers to tailor the virtual machine to their specific needs and requirements. This feature includes customizing gas limits, adding new opcodes, and integrating with other technologies. | +| Interoperable and multi-chain driven | A native bridging solution enables the seamless transfer of assets from various EVM-compatible blockchains back to the Polygon ecosystem. This bridging solution allows developers to customize bridge plugins to meet specific requirements, facilitating interoperability between blockchains and different layers. | + +
+ bridge +
+ +The diagram above demonstrates how Edge-powered chains are interconnected with the Polygon PoS network, which benefits from the security properties of Ethereum. By leveraging blockchain technology, Edge provide a strong foundation for building decentralized and blockchain-based solutions that can withstand adversarial conditions, resist censorship, and scale to meet the increasing demand for processing power, data storage, and transaction throughput. + +Edge employs a multi-faceted approach that leverages a combination of complementary scaling solutions to achieve maximum scalability. These solutions include layer-2 scaling techniques, parallelization, and, eventually, ZK technology. + +By integrating these methods, Edge can efficiently accommodate the increasing demand for processing power, data storage, and transaction throughput as the number of users and applications on the network grows. diff --git a/docs/docs/interfaces/cryptography/bls.md b/docs/docs/interfaces/cryptography/bls.md new file mode 100644 index 0000000000..4f931d0a83 --- /dev/null +++ b/docs/docs/interfaces/cryptography/bls.md @@ -0,0 +1,111 @@ +The `IBLS` interface provides a set of functions for working with BLS (Boneh-Lynn-Shacham) signatures in a smart contract. This user guide will explain how to interact with the functions provided by the IBLS interface. + +## Functions + +### verifySingle() + +This function verifies a single signature. + +#### Parameters + +- `signature` (uint256[2]): A 64-byte G1 group element (small signature). +- `pubkey` (uint256[4]): A 128-byte G2 group element (big pubkey). +- `message` (uint256[2]): The message signed to produce the signature. + +#### Usage + +To verify a single signature, call the verifySingle() function with the required parameters: + +```solidity +(bool sigVerification, bool callSuccess) = IBLS.instance.verifySingle(signature, pubkey, message); +``` + +### verifyMultiple() + +This function verifies multiple non-aggregated signatures where each message is unique. + +#### Parameters + +- `signature` (uint256[2]): A 64-byte G1 group element (small signature). +- `pubkeys` (uint256[4][]): An array of 128-byte G2 group elements (big pubkeys). +- `messages` (uint256[2][]): An array of messages signed to produce the signature. + +#### Usage + +To verify multiple non-aggregated signatures, call the verifyMultiple() function with the required parameters: + +```solidity +(bool checkResult, bool callSuccess) = IBLS.instance.verifyMultiple(signature, pubkeys, messages); +``` + +### verifyMultipleSameMsg() + +This function verifies an aggregated signature where the same message is signed. + +#### Parameters + +- `signature` (uint256[2]): A 64-byte G1 group element (small signature). +- `pubkeys` (uint256[4][]): An array of 128-byte G2 group elements (big pubkeys). +- `message` (uint256[2]): The message signed by all to produce the signature. + +#### Usage + +To verify an aggregated signature with the same message, call the verifyMultipleSameMsg() function with the required parameters: + +```solidity +(bool checkResult, bool callSuccess) = IBLS.instance.verifyMultipleSameMsg(signature, pubkeys, message); +``` + +### mapToPoint() + +This function maps a field element to the curve. + +#### Parameters + +`_x`(uint256): A valid field element. + +#### Usage + +To map a field element to the curve, call the mapToPoint() function with the required parameter: + +```solidity +uint256[2] memory point = IBLS.instance.mapToPoint(_x); +``` + +### isValidSignature() + +This function checks if a signature is formatted correctly and valid. It will revert if improperly formatted and return false if invalid. + +#### Parameters + +`signature` (uint256[2]): The BLS signature. + +#### Usage + +To check if a signature is valid, call the isValidSignature() function with the required parameter: + +```solidity +bool isValid = IBLS.instance.isValidSignature(signature); +``` + +### isOnCurveG1() + +This function checks if a point in the finite field Fq (x, y) is on the G1 curve. + +#### Parameters + +`point` (uint256[2]): An array with x and y values of the point. + +#### Usage + +To check if a point is on the G1 curve, call the isOnCurveG1() function with the required parameter: + +```solidity +bool isOnCurve = IBLS.instance.isOnCurveG1(point); +``` + +### isOnCurveG2() + +This function checks if a point in the finite field Fq (x, y) is on the G2 curve. + +#### Parameters diff --git a/docs/docs/interfaces/cryptography/bn256g2.md b/docs/docs/interfaces/cryptography/bn256g2.md new file mode 100644 index 0000000000..0386c2cf54 --- /dev/null +++ b/docs/docs/interfaces/cryptography/bn256g2.md @@ -0,0 +1,35 @@ +The `IBN256G2` interface provides functionality for performing addition operations on points in the G2 subgroup of the BN256 elliptic curve. This user guide will explain how to interact with the function provided by the `IBN256G2` interface. + +## Functions + +### ecTwistAdd() + +This function performs the addition operation on two points in the G2 subgroup of the BN256 elliptic curve. + +#### Parameters + +- `pt1xx` (uint256): The xx-coordinate of the first point. +- `pt1xy` (uint256): The xy-coordinate of the first point. +- `pt1yx` (uint256): The yx-coordinate of the first point. +- `pt1yy` (uint256): The yy-coordinate of the first point. +- `pt2xx` (uint256): The xx-coordinate of the second point. +- `pt2xy` (uint256): The xy-coordinate of the second point. +- `pt2yx` (uint256): The yx-coordinate of the second point. +- `pt2yy` (uint256): The yy-coordinate of the second point. + +#### Usage + +To perform the addition operation on two points in the G2 subgroup of the BN256 elliptic curve, call the `ecTwistAdd()` function with the required parameters: + +```solidity +IBN256G2 bn256g2Instance = IBN256G2(bn256g2Address); + +(uint256 pt3xx, uint256 pt3xy, uint256 pt3yx, uint256 pt3yy) = bn256g2Instance.ecTwistAdd( + pt1xx, pt1xy, pt1yx, pt1yy, + pt2xx, pt2xy, pt2yx, pt2yy +); +``` + +Replace `bn256g2Address` with the address of an existing `IBN256G2` implementation. Replace `pt1xx`, `pt1xy`, `pt1yx`, `pt1yy`, `pt2xx`, `pt2xy`, `pt2yx`, and `pt2yy` with the coordinates of the points you want to add. The resulting point, `pt3`, will have the coordinates (`pt3xx`, `pt3xy`, `pt3yx`, `pt3yy`). + +The `ecTwistAdd()` function allows you to perform elliptic curve operations on the BN256 curve in the G2 subgroup, which can be useful for cryptographic applications such as zero-knowledge proofs, signature schemes, and more. diff --git a/docs/docs/interfaces/eip1559.md b/docs/docs/interfaces/eip1559.md new file mode 100644 index 0000000000..de909dcb2f --- /dev/null +++ b/docs/docs/interfaces/eip1559.md @@ -0,0 +1,47 @@ +The `EIP1559Burn` contract burns the native token on the rootchain as an ERC-20 token. This operation is crucial for maintaining the value of the token across different chains. + +## Functions + +## initialize() + +```solidity +function initialize(IChildERC20Predicate newChildERC20Predicate, address newBurnDestination) +``` + +This is the initialization function for the `EIP1559Burn` contract. It sets the `childERC20Predicate` and `burnDestination` state variables. This function can only be called once due to the initializer modifier. + +### Parameters: + +- `newChildERC20Predicate`: Address of the ERC20 predicate on the childchain +- `newBurnDestination`: Address on the root chain to burn the tokens and send to + +## withdraw() + +```solidity +function withdraw() external { + require(address(childERC20Predicate) != address(0), "EIP1559Burn: UNINITIALIZED"); + ... +} +``` + +This function burns the native tokens on the childchain and sends them to the burn destination on the rootchain. It requires the `childERC20Predicate` to be initialized, and takes the entire current native token balance and burns it. + +## Events + +### NativeTokenBurnt() + +This event is emitted when native tokens are burnt. It includes the address of the burner and the amount of tokens that were burnt. + +## Usage + +The `EIP1559Burn` contract is a part of the asset bridging process between the rootchain and the childchain. It interacts with the `IChildERC20Predicate` contract, which is responsible for handling the token transfer process. + +In the asset bridging process, users deposit ERC20 tokens from the rootchain to the childchain, transact on the childchain, and then withdraw their assets back to the rootchain when they're done. The `withdraw()` function of the EIP1559Burn contract is called when users are ready to burn their tokens on the child chain and move them back to the rootchain. + +Here is a high-level sequence of the bridging process: + +- **Deposit**: Users deposit ERC20 tokens from the root chain to the childchain. The tokens are approved for transfer by the rootchain's ERC20 contract, and then deposited in the root chain's ERC20 predicate contract. The state of the deposit is synced to the childchain, and the tokens are minted on the child chain​1​ + +- **Withdraw**: When users want to move their assets back to the root chain, they initiate a withdrawal. The childchain's ERC20 predicate contract calls the `withdrawTo()` function, which burns the tokens on the childchain and syncs the state of the withdrawal back to the rootchain​​. + +- **Exit**: The withdrawal is finalized on the root chain. The root chain's ERC20 predicate contract transfers the tokens back to the user. diff --git a/docs/docs/interfaces/erc1155/childerc1155-predicate.md b/docs/docs/interfaces/erc1155/childerc1155-predicate.md new file mode 100644 index 0000000000..7a5ea27a49 --- /dev/null +++ b/docs/docs/interfaces/erc1155/childerc1155-predicate.md @@ -0,0 +1,77 @@ +The `IChildERC1155Predicate` interface is designed to work with the ERC1155-compliant token on the L2 side of the childchain. It handles the minting, burning, and state management for child tokens. This user guide will explain how to interact with the functions provided by the `IChildERC1155Predicate` interface. + +## Functions + +### initialize() + +This function initializes the predicate with the required parameters. + +#### Parameters + +- `newL2StateSender` (address): The L2 state sender address. +- `newStateReceiver` (address): The state receiver address. +- `newRootERC721Predicate` (address): The root ERC721 predicate address. +- `newChildTokenTemplate` (address): The child token template address. + +#### Usage + +To initialize the `IChildERC1155Predicate` instance, call the `initialize()` function with the required parameters: + +```solidity +IChildERC1155Predicate.instance.initialize(newL2StateSender, newStateReceiver, newRootERC721Predicate, newChildTokenTemplate); +``` + +### onStateReceive() + +This function receives the state data from the main chain. + +#### Parameters + +- `id` (uint256): An identifier for the state data. +- `sender` (address): The sender address. +- `data` (bytes): The state data. + +#### Usage + +To handle state data received from the main chain, the predicate should call the `onStateReceive()` function with the required parameters: + +```solidity +IChildERC1155Predicate.instance.onStateReceive(id, sender, data); +``` + +### withdraw() + +This function allows the user to withdraw their child tokens to the main chain. + +#### Parameters + +- `childToken` (IChildERC1155): The child token contract. +- `tokenId` (uint256): The token identifier. +- `amount` (uint256): The amount of tokens to withdraw. + +#### Usage + +To withdraw child tokens to the main chain, call the `withdraw()` function with the required parameters: + +```solidity +IChildERC1155Predicate.instance.withdraw(childToken, tokenId, amount); +``` + +### withdrawTo() + +This function allows the user to withdraw their child tokens to a specific address on the main chain. + +#### Parameters + +- `childToken` (IChildERC1155): The child token contract. +- `receiver` (address): The address to receive the tokens on the main chain. +- `tokenId` (uint256): The token identifier. +- `amount` (uint256): The amount of tokens to withdraw. + +#### Usage + +To withdraw child tokens to a specific address on the main chain, call the `withdrawTo()` function with the required parameters: + +```solidity +IChildERC1155Predicate.instance.withdrawTo(childToken, receiver, tokenId, amount); +``` diff --git a/docs/docs/interfaces/erc1155/childerc1155.md b/docs/docs/interfaces/erc1155/childerc1155.md new file mode 100644 index 0000000000..87eb979a84 --- /dev/null +++ b/docs/docs/interfaces/erc1155/childerc1155.md @@ -0,0 +1,117 @@ +The `IChildERC1155` interface represents an ERC1155-compliant token on the L2 side of the childchain. It allows the minting and burning of tokens under the control of a predicate address. This user guide will explain how to interact with the functions provided by the `IChildERC1155` interface. + +## Functions + +### initialize() + +This function sets the values for the rootToken, name, and uri. The value for rootToken is immutable and can only be set once during initialization. + +#### Parameters + +- `rootToken_` (address): The address of the token on the rootchain. +- `name_` (string): The token's name. +- `uri_` (string): The token's metadata URI. + +#### Usage + +To initialize the IChildERC1155 instance, call the initialize() function with the required parameters: + +```solidity +IChildERC1155.instance.initialize(rootToken, name, uri); +``` + +### predicate() + +This function returns the predicate address controlling the child token. + +#### Usage + +To get the predicate address, call the predicate() function: + +```solidity +const predicateAddress = IChildERC1155.instance.predicate(); +``` + +### rootToken() + +This function returns the address of the token on the rootchain. + +#### Usage + +To get the address of the token on the rootchain, call the rootToken() function: + +```solidity +const rootTokenAddress = IChildERC1155.instance.rootToken(); +``` + +### mint() + +This function mints an NFT token to a particular address. The predicate address can only call it. + +#### Parameters + +- `account` (address): The user's account to mint the tokens. +- `id` (uint256): The index of NFT to mint to the account. +- `amount` (uint256): The amount of NFT to mint. + +#### Usage + +To mint an NFT token to an address, the predicate should call the mint() function with the required parameters: + +```solidity +bool success = IChildERC1155.instance.mint(account, id, amount); +``` + +### mintBatch() + +This function mints multiple NFTs to one address. + +#### Parameters + +- `accounts` (address[]): An array of addresses to mint each NFT to. +- `tokenIds` (uint256[]): An array of indexes of the NFTs to be minted. +- `amounts` (uint256[]): An array of the amount of each NFT to be minted. + +#### Usage + +To mint multiple NFTs to one address, call the mintBatch() function with the required parameters: + +```solidity +bool success = IChildERC1155.instance.mintBatch(accounts, tokenIds, amounts); +``` + +### burn() + +This function burns an NFT token from a particular address. The predicate address can only call it. + +#### Parameters + +- `from` (address): The user's account to burn the tokens from. +- `id` (uint256): The index of NFT to burn from the account. +- `amount` (uint256): The amount of NFT to burn. + +#### Usage + +To burn an NFT token from an address, the predicate should call the burn() function with the required parameters: + +```solidity +bool success = IChildERC1155.instance.burn(from, id, amount); +``` + +### burnBatch() + +This function burns multiple NFTs from one address. + +#### Parameters + +- `from` (address): The address to burn NFTs from. +- `tokenIds` (uint256[]): An array of indexes of the NFTs to be burned. +- `amounts` (uint256[]): An array of the amount of each N + +#### Usage + +To burn multiple NFTs from one address, call the burnBatch() function with the required parameters: + +```solidity +bool success = IChildERC1155.instance.burnBatch(from, tokenIds, amounts); +``` diff --git a/docs/docs/interfaces/erc1155/rooterc1155-predicate.md b/docs/docs/interfaces/erc1155/rooterc1155-predicate.md new file mode 100644 index 0000000000..31ed4666ac --- /dev/null +++ b/docs/docs/interfaces/erc1155/rooterc1155-predicate.md @@ -0,0 +1,81 @@ +The `IRootERC1155Predicate` interface is designed to work with ERC-1155 tokens on a rootchain. It provides functionality for depositing, withdrawing, and mapping ERC-1155 tokens between root and childchains. This user guide will explain how to interact with the functions provided by the `IRootERC1155Predicate` interface. + +## Functions + +### deposit() + +This function deposits tokens from the depositor to themselves on the childchain. + +#### Parameters + +- `rootToken` (IERC1155MetadataURI): The root token being deposited. +- `tokenId` (uint256): The index of the NFT to deposit. +- `amount` (uint256): The amount to deposit. + +#### Usage + +To deposit tokens from the depositor to themselves on the childchain, call the `deposit()` function with the required parameters: + +```solidity +IRootERC1155Predicate.instance.deposit(rootToken, tokenId, amount); +``` + +### depositTo() + +This function deposits tokens from the depositor to another address on the childchain. + +#### Parameters + +- `rootToken` (IERC1155MetadataURI): The root token being deposited. +- `receiver` (address): The address of the receiver on the childchain. +- `tokenId` (uint256): The index of the NFT to deposit. +- `amount` (uint256): The amount to deposit. + +#### Usage + +To deposit tokens from the depositor to another address on the childchain, call the `depositTo()` function with the required parameters: + +```solidity +IRootERC1155Predicate.instance.depositTo(rootToken, receiver, tokenId, amount); +``` + +### depositBatch() + +This function deposits tokens from the depositor to other addresses on the childchain. + +#### Parameters + +- `rootToken` (IERC1155MetadataURI): The root token being deposited. +- `receivers` (address[]): The addresses of the receivers on the childchain. +- `tokenIds` (uint256[]): The indices of the NFTs to deposit. +- `amounts` (uint256[]): The amounts to deposit. + +#### Usage + +To deposit tokens from the depositor to other addresses on the childchain, call the `depositBatch()` function with the required parameters: + +```solidity +IRootERC1155Predicate.instance.depositBatch(rootToken, receivers, tokenIds, amounts); +``` + +### mapToken() + +This function is used for token mapping. + +#### Parameters + +`rootToken` (IERC1155MetadataURI): The address of the root token to map. + +#### Returns + +`childToken` (address): The address of the mapped child token. + +#### Usage + +To map a token, call the mapToken() function with the required parameter: + +```solidity +address childToken = IRootERC1155Predicate.instance.mapToken(rootToken); +``` + +This function is called internally on deposit if the token is not mapped already. diff --git a/docs/docs/interfaces/erc20/childerc20-predicate.md b/docs/docs/interfaces/erc20/childerc20-predicate.md new file mode 100644 index 0000000000..783af83572 --- /dev/null +++ b/docs/docs/interfaces/erc20/childerc20-predicate.md @@ -0,0 +1,55 @@ +The `IChildERC20Predicate` interface is part of the cross-chain bridge system, which manages the child tokens on the L2 side. This guide will explain the methods provided by the IChildERC20Predicate interface and how to use them. + +## Overview + +The `IChildERC20Predicate` interface is responsible for managing child tokens on L2. It provides: + +- Methods for deploying new child tokens. +- Processing state updates received from L1. +- Withdrawing tokens back to L1. + +## Initialize + +Before using the IChildERC20Predicate contract, it must be initialized with the required parameters: + +```solidity +function initialize( + address newL2StateSender, + address newStateReceiver, + address newRootERC20Predicate, + address newChildTokenTemplate, + address newNativeTokenRootAddress +) public virtual onlySystemCall initializer { +``` + +The parameters for initialization include the addresses of the L2 state sender, the state receiver, the root ERC20 predicate, and the child token template. The initialization also requires the native token's root address, name, symbol, and decimals. + +## Process state updates + +The onStateReceive method receives state updates from the L1 side and processes the data accordingly: + +```solidity +function onStateReceive(uint256 /* id */, address sender, bytes calldata data) external; +``` + +When a state update is received, the method processes the data based on the sender's address and provided data. The system typically calls this method automatically when state updates are received from L1. + +## Withdraw tokens + +To withdraw tokens from L2 back to L1, call the withdraw method: + +```solidity +function withdraw(IChildERC20 childToken, uint256 amount) external; +``` + +This method takes the child token contract address and the amount to be withdrawn. The tokens will be withdrawn to the message sender's address on L1. + +## Withdraw tokens to a specific address + +If you want to withdraw tokens from L2 to L1 for a specific address, use the `withdrawTo` method: + +```solidity +function withdrawTo(IChildERC20 childToken, address receiver, uint256 amount) external; +``` + +This method takes the child token contract address, the receiver's address, and the amount to be withdrawn. The tokens will be withdrawn to the specified receiver's address on L1. diff --git a/docs/docs/interfaces/erc20/childerc20.md b/docs/docs/interfaces/erc20/childerc20.md new file mode 100644 index 0000000000..92a5a97b5c --- /dev/null +++ b/docs/docs/interfaces/erc20/childerc20.md @@ -0,0 +1,65 @@ +The `IChildERC20` interface extends the `IERC20MetadataUpgradeable` interface to provide additional token functionality on a childchain or layer 2 solution. This guide explains how to interact with the interface and its methods. + +## Overview + +The `IChildERC20` interface includes methods for: + +- Initializing the token +- Retrieving the predicate and root token addresses +- Minting and burning tokens + +## Initializing the Token + +To initialize a child token, call the initialize function with the following parameters: + +- `rootToken_`: The address of the root token on the main chain. +- `name_`: The name of the token. +- `symbol_`: The symbol of the token. +- `decimals_`: The number of decimals used to define the smallest unit of the token. + +Example + +```solidity +childToken.initialize(rootTokenAddress, "My Token", "MTK", 18); +``` + +## Retrieving the Predicate and Root Token Addresses + +To get the predicate and root token addresses, call the `predicate` and `rootToken` functions respectively. + +Example: + +```solidity +address predicateAddress = childToken.predicate(); +address rootTokenAddress = childToken.rootToken(); +``` + +## Minting and Burning Tokens + +The `mint` and `burn` functions can only be called by the predicate address, which typically represents a bridge contract responsible for managing the token's supply between the main chain and the childchain. + +### Minting Tokens + +To mint tokens, call the mint function with the following parameters: + +- `account`: The user's address to mint the tokens. +- `amount`: The amount of tokens to mint to the account. + +```solidity +bool success = childToken.mint(userAddress, 100 * 10**18); +``` + +## Burning Tokens + +To burn tokens, call the burn function with the following parameters: + +- `account`: The user's address to burn the tokens. +- `amount`: The amount of tokens to burn from the account. + +Example: + +```solidity +bool success = childToken.burn(userAddress, 50 * 10**18); +``` + +> Note: The predicate address should only call the mint and burn functions. If you're a developer integrating with a child token, you typically won't need to interact with these functions directly. Instead, you'll interact with the bridge or the main chain's root token contract to move tokens between chains. diff --git a/docs/docs/interfaces/erc20/native-erc20.md b/docs/docs/interfaces/erc20/native-erc20.md new file mode 100644 index 0000000000..fbe70eb2d0 --- /dev/null +++ b/docs/docs/interfaces/erc20/native-erc20.md @@ -0,0 +1,84 @@ +The `INativeERC20` interface represents a native ERC20 token on the L2 side of the childchain. It allows the minting and burning of tokens under the control of a predicate address. This user guide will explain how to interact with the functions provided by the `INativeERC20` interface. + +## Functions + +### initialize() + +This function sets the values for the predicate, rootToken, name, symbol, and decimals. + +#### Parameters + +- `predicate_` (address): The address of the predicate controlling the child token. +- `rootToken_` (address): The address of the root token on the mainchain. +- `name_` (string): The token's name. +- `symbol_` (string): The token's symbol. +- `decimals_` (uint8): The number of decimals for the token. +- `tokenSupply_` (uint256): Initial total supply of token. + +#### Usage + +To initialize the INativeERC20 instance, call the `initialize()` function with the required parameters: + +```solidity +INativeERC20.instance.initialize(predicate, rootToken, name, symbol, decimals); +``` + +### predicate() + +This function returns the predicate address controlling the child token. + +#### Usage + +To get the predicate address, call the `predicate()` function: + +```solidity +const predicateAddress = INativeERC20.instance.predicate(); +``` + +### rootToken() + +This function returns the root token address. + +#### Usage + +To get the root token address, call the `rootToken()` function: + +```solidity +const rootTokenAddress = INativeERC20.instance.rootToken(); +``` + +### mint() + +This function mints an amount of tokens to a particular address. The predicate address can only call it. + +#### Parameters + +- `account` (address): The user's account to mint the tokens. +- `amount` (uint256): The token amount to mint to the account. + +#### Usage + +To mint tokens to an address, the predicate should call the `mint()` function with the required parameters: + +```solidity +INativeERC20.instance.mint(account, amount); +``` + +### burn() + +This function burns an amount of tokens from a particular address. The predicate address can only call it. + +#### Parameters + +- `account` (address): The user's account to burn the tokens from. +- `amount` (uint256): The amount of tokens to burn from the account. + +#### Usage + +To burn tokens from an address, the predicate should call the `burn()` function with the required parameters: + +```solidity +INativeERC20.instance.burn(account, amount); +``` + +These functions enable interaction with native ERC20 tokens on the L2 side of the childchain. Developers can use these functions to mint, burn, and retrieve information about native ERC20 tokens. diff --git a/docs/docs/interfaces/erc20/rooterc20-predicate.md b/docs/docs/interfaces/erc20/rooterc20-predicate.md new file mode 100644 index 0000000000..5de009c72d --- /dev/null +++ b/docs/docs/interfaces/erc20/rooterc20-predicate.md @@ -0,0 +1,50 @@ +The `IRootERC20Predicate` interface is designed to work with ERC20 tokens on a rootchain. It provides functionality for depositing and mapping ERC20 tokens between root and childchains. This user guide will explain how to interact with the functions provided by the `IRootERC20Predicate` interface. + +## Functions + +### deposit() + +This function deposits tokens from the depositor to themselves on the childchain. + +#### Parameters + +- `rootToken` (IERC20Metadata): The root token being deposited. +- `amount` (uint256): The amount to deposit. + +#### Usage + +To deposit tokens from the depositor to themselves on the childchain, call the `deposit()` function with the required parameters: + +```solidity +IRootERC20Predicate.instance.deposit(rootToken, amount); +``` + +### depositTo() + +This function deposits tokens from the depositor to another address on the childchain. + +#### Parameters + +- `rootToken` (IERC20Metadata): The root token being deposited. +- `receiver` (address): The address of the receiver on the childchain. +- `amount` (uint256): The amount to deposit. + +#### Usage + +To deposit tokens from the depositor to another address on the childchain, call the `depositTo()` function with the required parameters: + +```solidity +IRootERC20Predicate.instance.depositTo(rootToken, receiver, amount); +``` + +### mapToken() + +This function is used for token mapping. + +#### Parameters + +rootToken (IERC20Metadata): The address of the root token to map. + +#### Usage + +The mapToken() function is called internally on deposit if the token is not mapped already. diff --git a/docs/docs/interfaces/erc721/childerc721-predicate.md b/docs/docs/interfaces/erc721/childerc721-predicate.md new file mode 100644 index 0000000000..bb90a32335 --- /dev/null +++ b/docs/docs/interfaces/erc721/childerc721-predicate.md @@ -0,0 +1,89 @@ +The `IChildERC721Predicate` interface is designed to work in conjunction with the `IChildERC721` interface to enable the withdrawal of ERC721-compliant NFT tokens from a childchain back to the rootchain. This user guide will explain how to interact with the functions provided by the `IChildERC721Predicate` interface. + +## Functions + +### initialize() + +This function initializes the predicate contract with required parameters. + +#### Parameters + +- `newL2StateSender` (address): The address of the L2 state sender. +- `newStateReceiver` (address): The address of the state receiver. +- `newRootERC721Predicate` (address): The address of the root ERC721 predicate. +- `newChildTokenTemplate` (address): The address of the child token template. + +#### Usage + +To initialize the `IChildERC721Predicate` instance, call the `initialize()` function with the required parameters: + +```solidity +IChildERC721Predicate.instance.initialize(newL2StateSender, newStateReceiver, newRootERC721Predicate, newChildTokenTemplate); +``` + +### onStateReceive() + +This function is called when the predicate receives a state update from the L2 state sender. + +#### Parameters + +- `id` (uint256): An identifier, not used in this implementation. +- `sender` (address): The address of the sender. +- `data` (bytes): The calldata to be processed. + +#### Usage + +The `onStateReceive()` function is not intended to be called directly by developers. It is automatically called when the predicate receives a state update from the L2 state sender. + +### withdraw() + +This function withdraws an NFT token to the original owner. + +#### Parameters + +- `childToken` (IChildERC721): The child token contract instance. +- `tokenId` (uint256): The token identifier. + +#### Usage + +To withdraw an NFT token to the original owner, call the `withdraw()` function with the required parameters: + +```solidity +IChildERC721Predicate.instance.withdraw(childToken, tokenId); +``` + +### withdrawTo() + +This function withdraws an NFT token to a specified address. + +#### Parameters + +- `childToken` (IChildERC721): The child token contract instance. +- `receiver` (address): The address of the recipient. +- `tokenId` (uint256): The token identifier. + +#### Usage + +To withdraw an NFT token to a specified address, call the `withdrawTo()` function with the required parameters: + +```solidity +IChildERC721Predicate.instance.withdrawTo(childToken, receiver, tokenId); +``` + +### withdrawBatch() + +This function withdraws multiple NFT tokens to specified addresses in one transaction. + +#### Parameters + +- `childToken` (IChildERC721): The child token contract instance. +- `receivers` (address[]): An array of recipient addresses. +- `tokenIds` (uint256[]): An array of token identifiers. + +#### Usage + +To withdraw multiple NFT tokens to specified addresses in one transaction, call the `withdrawBatch()` function with the required parameters: + +```solidity +IChildERC721Predicate.instance.withdrawBatch(childToken, receivers, tokenIds); +``` diff --git a/docs/docs/interfaces/erc721/childerc721.md b/docs/docs/interfaces/erc721/childerc721.md new file mode 100644 index 0000000000..ec756b74c4 --- /dev/null +++ b/docs/docs/interfaces/erc721/childerc721.md @@ -0,0 +1,113 @@ +The `IChildERC721` interface is designed to work with ERC721-compliant NFT tokens on a childchain. It provides functionality for minting, burning, and managing NFTs. This user guide will explain how to interact with the functions provided by the `IChildERC721` interface. + +## Functions + +### initialize() + +This function initializes the child token contract with the root token address, name, and symbol. + +#### Parameters + +- `rootToken_` (address): The root token address. +- `name_` (string): The name of the token. +- `symbol_` (string): The symbol of the token. + +#### Usage + +To initialize the IChildERC721 instance, call the `initialize()` function with the required parameters: + +```solidity +IChildERC721.instance.initialize(rootToken_, name_, symbol_); +``` + +### predicate() + +This function returns the predicate address controlling the child token. + +#### Usage + +To get the predicate address, call the predicate() function: + +```solidity +address predicateAddress = IChildERC721.instance.predicate(); +``` + +### rootToken() + +This function returns the address of the token on the rootchain. + +#### Usage + +To get the root token address, call the `rootToken()` function: + +```solidity +address rootTokenAddress = IChildERC721.instance.rootToken(); +``` + +### mint() + +This function mints an NFT token to a specific address. + +#### Parameters + +- `account` (address): The recipient address. +- `tokenId` (uint256): The token identifier. + +#### Usage + +To mint an NFT token to a specific address, call the `mint()` function with the required parameters: + +```solidity +bool success = IChildERC721.instance.mint(account, tokenId); +``` + +### mintBatch() + +This function mints multiple NFT tokens in one transaction. + +#### Parameters + +- `accounts` (address[]): An array of recipient addresses. +- `tokenIds` (uint256[]): An array of token identifiers. + +#### Usage + +To mint multiple NFT tokens in one transaction, call the `mintBatch()` function with the required parameters: + +```solidity +bool success = IChildERC721.instance.mintBatch(accounts, tokenIds); +``` + +### burn() + +This function burns an NFT token from a specific address. + +#### Parameters + +- `account` (address): The address to burn the NFT from. +- `tokenId` (uint256): The token identifier. + +#### Usage + +To burn an NFT token from a specific address, call the `burn()` function with the required parameters: + +```solidity +bool success = IChildERC721.instance.burn(account, tokenId); +``` + +### burnBatch() + +This function burns multiple NFT tokens from a specific address in one transaction. + +#### Parameters + +- `account` (address): The address to burn the NFTs from. +- `tokenIds` (uint256[]): An array of token identifiers. + +#### Usage + +To burn multiple NFT tokens from a specific address in one transaction, call the `burnBatch()` function with the required parameters: + +```solidity +bool success = IChildERC721.instance.burnBatch(account, tokenIds); +``` diff --git a/docs/docs/interfaces/erc721/rooterc721-predicate.md b/docs/docs/interfaces/erc721/rooterc721-predicate.md new file mode 100644 index 0000000000..266764286a --- /dev/null +++ b/docs/docs/interfaces/erc721/rooterc721-predicate.md @@ -0,0 +1,68 @@ +The `IRootERC721Predicate` interface is designed to work with ERC721-compliant NFT tokens on a rootchain. It provides functionality for depositing and mapping ERC721 tokens between root and childchains. This user guide will explain how to interact with the functions provided by the `IRootERC721Predicate` interface. + +## Functions + +### deposit() + +This function deposits tokens from the depositor to themselves on the childchain. + +#### Parameters + +- `rootToken` (IERC721Metadata): The root token being deposited. +- `tokenId` (uint256): The index of the NFT to deposit. + +#### Usage + +To deposit tokens from the depositor to themselves on the childchain, call the `deposit()` function with the required parameters: + +```solidity +IRootERC721Predicate.instance.deposit(rootToken, tokenId); +``` + +### depositTo() + +This function deposits tokens from the depositor to another address on the childchain. + +#### Parameters + +- `rootToken` (IERC721Metadata): The root token being deposited. +- `receiver` (address): The address of the receiver on the childchain. +- `tokenId` (uint256): The index of the NFT to deposit. + +#### Usage + +To deposit tokens from the depositor to another address on the childchain, call the depositTo() function with the required parameters: + +```solidity +IRootERC721Predicate.instance.depositTo(rootToken, receiver, tokenId); +``` + +### depositBatch() + +This function deposits tokens from the depositor to other addresses on the childchain. + +#### Parameters + +- `rootToken` (IERC721Metadata): The root token being deposited. +- `receivers` (address[]): An array of addresses of the receivers on the childchain. +- `tokenIds` (uint256[]): An array of indices of the NFTs to deposit. + +#### Usage + +To deposit tokens from the depositor to other addresses on the childchain, call the `depositBatch()` function with the required parameters: + +```solidity +IRootERC721Predicate.instance.depositBatch(rootToken, receivers, tokenIds); +``` + +### mapToken() + +This function is used for token mapping. + +#### Parameters + +`rootToken` (IERC721Metadata): The address of the root token to map. + +#### Usage + +The `mapToken()` function is called internally on deposit if the token is not mapped already. diff --git a/docs/docs/interfaces/network/checkpoint-manager.md b/docs/docs/interfaces/network/checkpoint-manager.md new file mode 100644 index 0000000000..0eb32abdba --- /dev/null +++ b/docs/docs/interfaces/network/checkpoint-manager.md @@ -0,0 +1,76 @@ +The `ICheckpointManager` interface is a crucial part of the checkpoint system, allowing validators to submit signed checkpoints as proof of the canonical chain. This guide will explain the methods the ICheckpointManager interface provides and how to use them. + +## Overview + +The `ICheckpointManager` interface is responsible for managing checkpoints in the system. It provides methods for submitting checkpoints, verifying event membership by block number or epoch, and retrieving checkpoint information. + +## Submit a checkpoint + +To submit a checkpoint, call the submit method: + +```solidity +function submit( + CheckpointMetadata calldata checkpointMetadata, + Checkpoint calldata checkpoint, + uint256[2] calldata signature, + Validator[] calldata newValidatorSet, + bytes calldata bitmap +) external; +``` + +The parameters for submitting a checkpoint include the following: + +- The checkpoint metadata. +- The checkpoint itself. +- The aggregated signature. +- The new validator set. +- A bitmap of the old validator set that signed the message. +- The contract will verify the provided signature against the stored validator set. + +## Get event membership by block number + +To check if an event is part of the event root for a given block number, call the getEventMembershipByBlockNumber method: + +```solidity +function getEventMembershipByBlockNumber( + uint256 blockNumber, + bytes32 leaf, + uint256 leafIndex, + bytes32[] calldata proof +) external view returns (bool); +``` + +This method takes the block number, the leaf of the event (keccak256-encoded log), the leaf index in the Merkle root tree, and the proof for leaf membership in the event root tree. It returns true if the event is part of the event root. + +## Get event membership by epoch + +To check if an event is part of the event root for a given epoch, call the getEventMembershipByEpoch method: + +```solidity +function getEventMembershipByEpoch( + uint256 epoch, + bytes32 leaf, + uint256 leafIndex, + bytes32[] calldata proof +) external view returns (bool); +``` + +This method takes the epoch ID, the leaf of the event (keccak256-encoded log), the leaf index in the Merkle root tree, and the proof for leaf membership in the event root tree. It returns true if the event is part of the event root. + +## Get checkpoint block number + +To get the checkpoint block number for a given block number, call the getCheckpointBlock method: + +```solidity +function getCheckpointBlock(uint256 blockNumber) external view returns (bool, uint256); +``` + +This method takes the block number and returns a boolean indicating if the block number was checkpointed, as well as the checkpoint block number. + +## Get event root by block + +To get the event root for a given block number, call the getEventRootByBlock method: + +```solidity +function getEventRootByBlock(uint256 blockNumber) external view returns (bytes32); +``` diff --git a/docs/docs/interfaces/network/exit-helper.md b/docs/docs/interfaces/network/exit-helper.md new file mode 100644 index 0000000000..02244ba528 --- /dev/null +++ b/docs/docs/interfaces/network/exit-helper.md @@ -0,0 +1,59 @@ +The `IExitHelper` interface is a helper contract that processes exits from stored event roots in `CheckpointManager`. It allows users to perform an exit for one or multiple events. This user guide will explain how to interact with the functions provided by the IExitHelper interface. + +## Functions + +### exit() + +This function allows you to perform an exit for one event. + +#### Parameters + +- `blockNumber` (uint256): The block number of the exit event on L2. +- `leafIndex` (uint256): The leaf index in the exit event Merkle tree. +- `unhashedLeaf` (bytes): The ABI-encoded exit event leaf. +- `proof` (bytes32[]): The proof of the event inclusion in the tree. + +#### Usage + +To exit an event, call the `exit()` function with the required parameters: + +```solidity +IExitHelper.exitHelperInstance.exit(blockNumber, leafIndex, unhashedLeaf, proof); +``` + +### batchExit() + +This function allows you to perform a batch exit for multiple events. + +#### Parameters + +- `inputs` (BatchExitInput[]): An array of BatchExitInput structs, where each struct contains the following fields: + - `blockNumber` (uint256): The block number of the exit event on L2. + - `leafIndex` (uint256): The leaf index in the exit event Merkle tree. + - `unhashedLeaf` (bytes): The ABI-encoded exit event leaf. + - `proof` (bytes32[]): The proof of the event inclusion in the tree. + +#### Usage + +To perform a batch exit for multiple events, create an array of `BatchExitInput` structs and call the `batchExit()` function: + +```solidity +let batchExitInputs = [ + { + blockNumber: blockNumber1, + leafIndex: leafIndex1, + unhashedLeaf: unhashedLeaf1, + proof: proof1 + }, + { + blockNumber: blockNumber2, + leafIndex: leafIndex2, + unhashedLeaf: unhashedLeaf2, + proof: proof2 + } +]; + +IExitHelper.exitHelperInstance.batchExit(batchExitInputs); +``` + +This will process exits for multiple events in a single transaction, which can save gas and improve efficiency. diff --git a/docs/docs/interfaces/network/state-receiver.md b/docs/docs/interfaces/network/state-receiver.md new file mode 100644 index 0000000000..1bd3d2d97c --- /dev/null +++ b/docs/docs/interfaces/network/state-receiver.md @@ -0,0 +1,30 @@ +The `IStateReceiver` interface is designed to handle state updates received from a higher-level entity, typically on the L2 side of the childchain. This user guide will explain how to interact with the functions provided by the `IStateReceiver` interface. + +## Functions + +### onStateReceive() + +This function is called when the contract receives a state update. It processes the incoming state, allowing the contract to react to changes in the higher-level state. + +#### Parameters + +- `counter` (uint256): A counter value associated with the state update. +- `sender` (address): The entity's address sending the state update. +- `data` (bytes): The calldata associated with the state update. + +#### Usage + +To handle a state update in your contract, you must implement the onStateReceive() function. The higher-level entity will call this function when a state update is sent. + +For example, you might implement onStateReceive() as follows: + +```solidity +contract MyStateReceiver is IStateReceiver { + function onStateReceive(uint256 counter, address sender, bytes calldata data) external override { + // Process the incoming state update + // ... + } +} +``` + +This function allows your contract to react to state updates, enabling communication between your contract and higher-level state providers. By implementing the `IStateReceiver` interface, you can ensure that your contract stays current with broader ecosystem changes. diff --git a/docs/docs/interfaces/network/state-sender.md b/docs/docs/interfaces/network/state-sender.md new file mode 100644 index 0000000000..b20de65a8c --- /dev/null +++ b/docs/docs/interfaces/network/state-sender.md @@ -0,0 +1,29 @@ +The `IStateSender` interface provides a way to send state updates from one contract to another, often between different layers of a network, such as L1 and L2. This user guide will help you understand how to interact with the functions provided by the `IStateSender` interface. + +## Functions + +### syncState() + +This function sends a state update to a specified contract, allowing the receiving contract to process the changes in the state. + +#### Parameters + +- `receiver` (address): The contract address will receive the state update. +- `data` (bytes): The calldata associated with the state update to be sent. + +#### Usage + +You'll need to call the syncState() function to send a state update from your contract. This function will send the state update to the specified receiver contract. + +For example, you might use the `syncState()` function as follows: + +```solidity +contract MyStateSender is IStateSender { + function sendStateUpdate(address receiver, bytes calldata data) public { + // Send the state update to the specified receiver contract + syncState(receiver, data); + } +} +``` + +This function enables your contract to communicate state updates to other contracts, facilitating cross-contract and cross-layer communication. By implementing the IStateSender interface, you can ensure your contract can send state updates to other parts of the ecosystem. diff --git a/docs/docs/interfaces/staking/custom-supernet-manager.md b/docs/docs/interfaces/staking/custom-supernet-manager.md new file mode 100644 index 0000000000..747c8c6d29 --- /dev/null +++ b/docs/docs/interfaces/staking/custom-supernet-manager.md @@ -0,0 +1,147 @@ +The `CustomSupernetManager` contract manages validator access and syncs voting power between the stake manager and the validator set on the child chain. It implements the base `SupernetManager` contract. + +## Events + +### AddedToWhitelist() + +```solidity +event AddedToWhitelist(address indexed validator); +``` + +This event is emitted when a validator is added to the whitelist of validators allowed to stake. + +### RemovedFromWhitelist() + +```solidity +event RemovedFromWhitelist(address indexed validator); +``` + +This event is emitted when a validator is removed from the whitelist of validators allowed to stake. + +### ValidatorRegistered() + +```solidity +event ValidatorRegistered(address indexed validator, uint256[4] blsKey); +``` + +This event is emitted when a validator is registered with their public key. + +### ValidatorDeactivated() + +```solidity +event ValidatorDeactivated(address validator); +``` + +This event is emitted when a validator is deactivated. + +### GenesisFinalized() + +```solidity +event GenesisFinalized(uint256 amountValidators); +``` + +This event is emitted when the initial genesis validator set is finalized. + +### StakingEnabled() + +```solidity +event StakingEnabled(); +``` + +This event is emitted when staking is enabled after the successful initialization of the child chain. + +## Functions + +### whitelistValidators() + +```solidity +function whitelistValidators(address[] calldata validators_) external; +``` + +This function allows whitelisting validators that are allowed to stake. It can only be called by the owner of the contract. + +### Parameters: + +`validators_`: An array of addresses representing the validators to be whitelisted. + +### register() + +```solidity +function register(uint256[2] calldata signature, uint256[4] calldata pubkey) external; +``` + +This function is called to register the public key of a validator. It validates the signature and registers the validator with their public key. + +#### Parameters: + +- `signature`: An array of two 256-bit integers representing the signature. +- `pubkey`: An array of four 256-bit integers representing the public key of the validator. + +### finalizeGenesis() + +```solidity +function finalizeGenesis() external; +``` + +This function is called to finalize the initial genesis validator set. It can only be called by the owner of the contract. + +### enableStaking() + +```solidity + function enableStaking() external; +``` + +This function is called to enable staking after the successful initialization of the child chain. It can only be called by the owner of the contract. + +### withdrawSlashedStake() + +```solidity +function withdrawSlashedStake(address to) external; +``` + +This function is called to withdraw slashed MATIC of slashed validators. It can only be called by the owner of the contract. + +#### Parameters: + +`to`: The address where the slashed stake will be withdrawn. + +### onL2StateReceive() + +```solidity +function onL2StateReceive(uint256 /*id*/, address sender, bytes calldata data) external; +``` + +This function is called by the exit helpers to either release the stake of a validator or slash it. It can only be called after the genesis and must be synced from the child chain. + +#### Parameters: + +- `sender`: The address of the sender calling the function. +- `data`: The data containing the information about the stake release or slash. + +### genesisSet() + +```solidity +function genesisSet() external view returns (GenesisValidator[] memory); +``` + +This function returns the initial genesis validator set with their balances. + +#### Returns: + +`GenesisValidator[]`: An array of GenesisValidator structs representing the initial genesis validator set. + +### getValidator() + +```solidity +function getValidator(address validator_) external view returns (Validator memory); +``` + +This function returns the Validator instance based on the provided validator address. + +#### Parameters: + +`validator_`: The address of the validator. + +#### Returns: + +`Validator`: The Validator struct representing the validator instance. diff --git a/docs/docs/interfaces/staking/stake-manager.md b/docs/docs/interfaces/staking/stake-manager.md new file mode 100644 index 0000000000..ff4e1e4459 --- /dev/null +++ b/docs/docs/interfaces/staking/stake-manager.md @@ -0,0 +1,218 @@ +The `StakeManager` interface manages stakes for all childchains in the Edge architecture. + +## Events + +### ChildManagerRegistered() + +```solidity +event ChildManagerRegistered(uint256 indexed id, address indexed manager); +``` + +This event is emitted when a new child chain manager is registered with the StakeManager contract. It includes the ID of the child chain and the address of the manager contract. + +### StakeAdded() + +```solidity +event StakeAdded(uint256 indexed id, address indexed validator, uint256 amount); +``` + +This event is emitted when a validator adds stake for a child chain. It includes the ID of the child chain, the address of the validator, and the amount of stake added. + +### StakeRemoved() + +```solidity +event StakeRemoved(uint256 indexed id, address indexed validator, uint256 amount); +``` + +This event is emitted when a validator's stake is removed for a child chain. It includes the ID of the child chain, the address of the validator, and the amount of stake removed. + +### StakeWithdrawn() + +```solidity +event StakeWithdrawn(address indexed validator, address indexed recipient, uint256 amount); +``` + +This event is emitted when a validator withdraws their released stake. It includes the address of the validator, the address of the recipient, and the amount of stake withdrawn. + +### ValidatorSlashed() + +```solidity +event ValidatorSlashed(uint256 indexed id, address indexed validator, uint256 amount); +``` + +This event is emitted when a validator's stake is slashed for a child chain. It includes the ID of the child chain, the address of the validator, and the amount of stake slashed. + +## Functions + +### registerChildChain() + +```solidity +function registerChildChain(address manager) external returns (uint256 id); +``` + +This function is called to register a new child chain with the StakeManager contract. It associates the child chain with its manager contract. + +#### Parameters: + +`manager`: The address of the manager contract for the child chain. + +### stakeFor() + +```solidity +function releaseStakeOf(address validator, uint256 amount) external; +``` + +This function is called by a validator to stake for a child chain. It adds the specified amount of stake for the given child chain. + +#### Parameters: + +- `id`: The ID of the child chain. +- `amount`: The amount of stake to be added. + +### releaseStakeOf() + +```solidity +function releaseStakeOf(address validator, uint256 amount) external; +``` + +This function is called by the child manager contract to release a validator's stake. It releases the specified amount of stake for the given validator. + +#### Parameters: + +- `validator`: The address of the validator. +- `amount`: The amount of stake to be released. + +### withdrawStake() + +```solidity +function withdrawStake(address to, uint256 amount) external; +``` + +This function allows a validator to withdraw their released stake. It transfers the specified amount of released stake to the specified recipient address. + +#### Parameters: + +- `to`: The address where the withdrawn stake will be sent. +- `amount`: The amount of released stake to be withdrawn. + +### slashStakeOf() + +```solidity +function slashStakeOf(address validator, uint256 amount) external; +``` + +This function is called by the child manager contract to slash a validator's stake. It slashes the specified amount of stake for the given validator, and the manager contract collects the slashed amount. + +#### Parameters: + +- `validator`: The address of the validator. +- `amount`: The amount of stake to be slashed. + +### withdrawableStake() + +```solidity +function withdrawableStake(address validator) external view returns (uint256 amount); +``` + +This function returns the amount of stake that a validator can withdraw. It represents the released stake that is available for withdrawal. + +#### Parameters: + +`validator`: The address of the validator. + +#### Returns: + +`amount`: The amount of stake that the validator can withdraw. + +### totalStake() + +```solidity +function totalStake() external view returns (uint256 amount); +``` + +This function returns the total amount of stake staked for all child chains. + +#### Returns: + +`amount`: The total amount of stake staked for all child chains. + +### totalStakeOfChild() + +```solidity +function totalStakeOfChild(uint256 id) external view returns (uint256 amount); +``` + +This function returns the total amount of stake staked for a specific child chain. + +#### Parameters: + +`id`: The ID of the child chain. + +#### Returns: + +`amount`: The total amount of stake staked for the specified child chain. + +### totalStakeOf() + +```solidity +function totalStakeOf(address validator) external view returns (uint256 amount); +``` + +This function returns the total amount of stake staked by a validator for all child chains. + +#### Parameters: + +`validator`: The address of the validator. + +#### Returns: + +`amount`: The total amount of stake staked by the specified validator. + +### stakeOf() + +```solidity +function stakeOf(address validator, uint256 id) external view returns (uint256 amount); +``` + +This function returns the amount of stake staked by a validator for a specific child chain. + +#### Parameters: + +- `validator`: The address of the validator. +- `id`: The ID of the child chain. + +#### Returns: + +`amount`: The amount of stake staked by the specified validator for the specified child chain. + +### managerOf() + +```solidity +function managerOf(uint256 id) external view returns (ISupernetManager manager); +``` + +This function returns the child chain manager contract for a specific child chain. + +#### Parameters: + +`id`: The ID of the child chain. + +#### Returns: + +`manager`: The address of the child chain manager contract. + +### idFor() + +```solidity +function idFor(address manager) external view returns (uint256 id); +``` + +This function returns the child chain ID associated with a specific child chain manager contract. + +#### Parameters: + +`manager`: The address of the child chain manager contract. + +#### Returns: + +`id`: The ID of the child chain associated with the specified manager contract. diff --git a/docs/docs/interfaces/staking/supernet-manager.md b/docs/docs/interfaces/staking/supernet-manager.md new file mode 100644 index 0000000000..04aa3bf9e6 --- /dev/null +++ b/docs/docs/interfaces/staking/supernet-manager.md @@ -0,0 +1,28 @@ +The `SupernetManager` contract is an abstract contract for managing Edge-powered chains. It serves as a base contract that should be implemented with custom desired functionality. + +## Functions + +### onInit() + +```solidity +function onInit(uint256 id) external; +``` + +This function is called when a new childchain is registered. It allows the implementing contract to perform initialization logic when a new child chain is added to the Edge-powered chain. + +#### Parameters: + +`id`: The ID of the newly registered child chain. + +### onStake() + +```solidity +function onStake(address validator, uint256 amount) external; +``` + +This function is called when a validator stakes. It allows the implementing contract to perform additional logic when a validator stakes for a child chain in the Edge-powered chain. + +### Parameters: + +- `validator`: The address of the validator who stakes. +- `amount`: The amount of stake being staked by the validator. diff --git a/docs/docs/interfaces/validators/validator-set-base.md b/docs/docs/interfaces/validators/validator-set-base.md new file mode 100644 index 0000000000..eb31531212 --- /dev/null +++ b/docs/docs/interfaces/validators/validator-set-base.md @@ -0,0 +1,68 @@ +The `IChildValidatorSetBase` interface is part of the childchain. It handles validator registration, stake storage, and reward distribution. This user guide will explain the key components and functions of the interface. + +## Structs + +### InitStruct + +InitStruct is used during the initialization of the contract. + +- `epochReward` (uint256): The reward per epoch. +- `minStake` (uint256): The minimum amount a validator must stake. +- `minDelegation` (uint256): The minimum amount for delegating MATIC tokens. +- `epochSize` (uint256): The size of an epoch. + +### ValidatorInit + +ValidatorInit is used when initializing a validator. + +- `addr` (address): The validator's address. +- `pubkey` (uint256[4]): The validator's public BLS key. +- `signature` (uint256[2]): The validator's signature. +- `stake` (uint256): The amount staked by the validator. + +### DoubleSignerSlashingInput + +DoubleSignerSlashingInput represents the information about double signers to be slashed along with signatures and bitmap. + +- `epochId` (uint256): The ID of the epoch. +- `eventRoot` (bytes32): The event root. +- `currentValidatorSetHash` (bytes32): The current validator set hash. +- `nextValidatorSetHash` (bytes32): The next validator set hash. +- `blockHash` (bytes32): The block hash. +- `bitmap` (bytes): The bitmap. +- `signature` (bytes): The signature. + +## Functions + +### commitEpoch + +Commits an epoch to the contract. Called by the Edge client. + +- `id` (uint256): The ID of the epoch to be committed. +- `epoch` (Epoch): The epoch data to be committed. +- `uptime` (Uptime): The uptime data for the epoch being committed. + +### commitEpochWithDoubleSignerSlashing + +Commits an epoch and slashes double signers. Called by the Edge client. + +- `curEpochId` (uint256): The ID of the epoch to be committed. +- `blockNumber` (uint256): The block number at which the double signer occurred. +- `pbftRound` (uint256): The round number at which the double signing occurred. +- `epoch` (Epoch): The epoch data to be committed. +- `uptime` (Uptime): The uptime data for the epoch being committed. +- `inputs` (DoubleSignerSlashingInput[]): Information about double signers to be slashed along with signatures and bitmap. + +### getCurrentValidatorSet + +Returns the addresses of active validators in the current epoch, sorted by total stake (self-stake + delegation). + +### getEpochByBlock + +Looks up an epoch by block number in O(log n) time. + +- `blockNumber` (uint256): The block number. + +### totalActiveStake + +Calculates the total stake of active validators (self-stake + delegation). diff --git a/docs/docs/operate/benchmarks.md b/docs/docs/operate/benchmarks.md new file mode 100644 index 0000000000..74075321ff --- /dev/null +++ b/docs/docs/operate/benchmarks.md @@ -0,0 +1,108 @@ +This document presents a summary of performance benchmarks for Edge production releases. + +## Summary of Test Results + +### v1.0.0-rc + +| Transaction Type | TPS Sent | TPS Mined | Gas per Second | Gas per Transaction | Instance Type(s) | +|------------------|----------|-----------|----------------|---------------------|------------------------------| +| EOA to EOA | 2,600 | 2,442 | 51,282,000 | 21,000 | x2iezn.2xlarge | +| ERC20 | 1,300 | 591 | 21,696,201 | 36,711 | x2iezn.2xlarge | +| ERC721 | 800 | 558 | 32,642,442 | 58,499 | x2iezn.2xlarge | + +### v1.0.0 + +| Transaction Type | TPS Sent | TPS Mined | Gas per Second | Gas per Transaction | Instance Type(s) | +|------------------|----------|-----------|----------------|---------------------|------------------------------| +| EOA to EOA | 2,475 | 2,459 | 51,639,000 | 21,000 | x2iezn.2xlarge | +| ERC20 | 550 | 680 | 24,963,480 | 36,711 | x2iezn.2xlarge | +| ERC721 | 550 | 649 | 37,965,851 | 58,499 | x2iezn.2xlarge | + +### v1.1.0 + +| Transaction Type | TPS Sent | TPS Mined | Gas per Second | Gas per Transaction | Instance Type(s) | +|------------------|----------|-----------|----------------|---------------------|------------------------------| +| EOA to EOA | 2,475 | 2,396 | 50,316,000 | 21,000 | x2iezn.2xlarge | +| ERC20 | 550 | 653 | 23,972,283 | 36,711 | x2iezn.2xlarge | +| ERC721 | 550 | 621 | 36,327,879 | 58,499 | x2iezn.2xlarge | + +### v1.3.0 + +| Transaction Type | TPS Sent | TPS Mined | Gas per Second | Gas per Transaction | Instance Type(s) | +|------------------|----------|-----------|----------------|---------------------|------------------------------| +| EOA to EOA | 3,000 | 2,577 | 54,117,000 | 21,000 | x2iezn.2xlarge | +| ERC20 | 820 | 813 | 23,005,250 | 28,297 | x2iezn.2xlarge | +| ERC721 | 750 | 746 | 37,393,367 | 50,125 | x2iezn.2xlarge | + +## Test Environment + +The performance tests were conducted in a controlled environment to ensure accuracy and consistency in the results. The environment setup includes the following components: + +### Network Configuration + +- Network: Polygon Edge +- Consensus Algorithm: PolyBFT + +### Instance Types + +The tests utilized various Amazon Web Services (AWS) instance types to evaluate the impact of varying compute resources on network performance: + +- **t2.xlarge** +- **t2.micro** +- **c5.2xlarge** +- **c6a.48xlarge** +- **x2iezn.2xlarge** +- **c6a.xlarge** + +
+General instance specifications + +- **t2.xlarge** + - vCPU: 4 + - Memory: 16 GiB + - Network Performance: Up to 5 Gigabit + - EBS-Optimized: Up to 2,750 Mbps +- **t2.micro** + - vCPU: 1 + - Memory: 1 GiB + - Network Performance: Low to Moderate + - EBS-Optimized: Not available +- **c5.2xlarge** + - vCPU: 8 + - Memory: 16 GiB + - Network Performance: Up to 10 Gigabit + - EBS-Optimized: Up to 3,500 Mbps +- **c6a.48xlarge** + - vCPU: 192 + - Memory: 768 GiB + - Network Performance: 50 Gigabit + - EBS-Optimized: 14,000 Mbps +- **x2iezn.2xlarge** + - vCPU: 8 + - Memory: 64 GiB + - Network Performance: Up to 25 Gigabit + - EBS-Optimized: Up to 3,500 Mbps +- **c6a.xlarge** + - vCPU: 4 + - Memory: 16 GiB + - Network Performance: Up to 10 Gigabit + - EBS-Optimized: Up to 4,750 Mbps + +
+ +### Transaction Types + +The tests were performed using three different types of transactions to assess the network's capability to handle various use cases: + +- **EOA to EOA**: Representing simple value transfers between user accounts. +- **ERC20**: Token transfers, simulating the exchange of tokens on the network. +- **ERC721**: Non-fungible token (NFT) transfers representing the exchange of unique digital assets. + +### Performance Metrics + +The following key performance metrics were considered during the tests: + +- **Transactions per second (TPS) sent**: The number of transactions submitted to the network per second. +- **Transactions per second (TPS) mined**: The number of transactions successfully processed and included in the blockchain per second. +- **Gas per transaction**: The amount of gas consumed by each transaction, representing the computational cost. +- **Gas per second**: The total amount consumed per second indicates the network's overall computational capacity. diff --git a/docs/docs/operate/deploy/access-control/allowlist-general.md b/docs/docs/operate/deploy/access-control/allowlist-general.md new file mode 100644 index 0000000000..b1396f91df --- /dev/null +++ b/docs/docs/operate/deploy/access-control/allowlist-general.md @@ -0,0 +1,216 @@ + +## Understanding ACL and Address Roles + +ACLs or Access Control Lists are a way of managing permissions in your Edge-powered chain. In this context, an ACL is essentially a list of addresses and their corresponding roles. + +:::info Keep in mind + +- **Enabling Lists**: Allowlists and blocklists are enabled or disabled exclusively during network initialization through the genesis command. Changes to the configuration cannot be made dynamically. +- **Admin Role**: To enable a list, an admin role must be set in the genesis command. The admin manages the list and can only be specified during the network's initial setup. +- **Exclusive Enablement**: It is not valid to enable both allowlists and blocklists for a given list type. If both lists are set, the allowlist takes precedence, and the blocklist is ignored. +- **System Transaction Address**: The system transaction address (0xffffFFFfFFffffffffffffffFfFFFfffFFFfFFfE) is excluded from allowlist and blocklist validation. It is always allowed to perform actions and is not subject to list checks. +- **Impact on Validators and System Transactions**: The impact of allowlists and blocklists on validators and system transactions can vary depending on network implementation. + +::: + +## ABI Specification + +### Overview + +Below is an overview of the ABI for the ACL in Edge: + +```shell +function setAdmin(address) +function setEnabled(address) +function setNone(address) +function readAddressList(address) returns (uint256) +``` + +### Functions + +**Roles can be one of three types:** + +- `NoRole`: The address has no permissions. +- `EnabledRole`: The address has some permissions. +- `AdminRole`: The address has all permissions and can change the roles of other addresses. + +**For more information about how ACLs work in Edge, check out the overview guide [here](../../../design/runtime/allowlist.md).** + +```go +NoRole Role = Role(types.StringToHash("...")) +EnabledRole Role = Role(types.StringToHash("...")) +AdminRole Role = Role(types.StringToHash("...")) +``` + +- **Function Signatures**: The module provides functions to set or query roles: + - Set an address as an admin. + - Enable an address. + - Remove any role from an address. + - Read the role of an address. + +```go +SetAdminFunc = abi.MustNewMethod("function setAdmin(address)") +SetEnabledFunc = abi.MustNewMethod("function setEnabled(address)") +SetNoneFunc = abi.MustNewMethod("function setNone(address)") +ReadAddressListFunc = abi.MustNewMethod("function readAddressList(address) returns (uint256)") +``` + +### Key Functionalities + +- **Creating an AddressList**: An instance of the AddressList is created with a reference to the state and the contract's address. + +```go +func NewAddressList(state stateRef, addr types.Address) *AddressList {...} +``` + +- **Running the Contract**: The `Run` function decodes the input to determine the function being called and executes it. + +```go +func (a *AddressList) Run(c *runtime.Contract, host runtime.Host, _ *chain.ForksInTime) *runtime.ExecutionResult {...} +``` + +- **Setting and Getting Roles**: The module provides functions to assign a role to an address and to fetch the role of a given address. + +```go +func (a *AddressList) SetRole(addr types.Address, role Role) {...} +func (a *AddressList) GetRole(addr types.Address) Role {...} +``` + +### How It Works + +1. A call to the `AddressList` triggers the `Run` function. +2. The function decodes the input to identify the function being called. +3. If querying a role, the role of the provided address is returned. +4. For modifying roles, checks are in place to ensure: + - The caller has enough gas. + - The call isn't static (read-only). + - Only admins can modify roles. + - Admins can't remove their own admin role. + +## Interacting with an ACL + +Edge ACLs are implemented as precompiles, which are built-in contracts within the Edge client. You can interact with these ACL precompiles using libraries like ether.js and web3.js. + +To interact with the ACL precompiles using an external library or client, follow these steps: + +1. Obtain the ABI (Application Binary Interface) for the specific ACL precompile you want to interact with. The ABI contains the definitions of the precompile's functions, including their parameters and return types. + +2. Create a contract instance for the ACL precompile using the ABI and the provider connected to the Edge-powered chain. + +3. Use the contract instance to call the functions defined in the precompile's ABI. These functions allow you to manage the ACL by adding or removing accounts, modifying roles, or performing other ACL-related operations. + +## Example Interaction with ethers.js + +### Prerequisites + +- Install ethers.js in your project using npm or yarn: `npm i --save ethers`. +- Ensure you have a wallet and some gas for transaction fees. +- Obtain the address and ABI of the ACL smart contract you want to interact with. + +:::note + +- These operations should be performed by an account with the `AdminRole`. +- Make sure to replace the placeholders with your actual values. +- The await keyword must be used in an async function. +- Be mindful of transaction fees (gas costs) when interacting with the network. + +::: + +### Sample Workflow + +Create a contract instance for the ACL precompile using the ABI and the provider connected to the network. +Please note that these examples are provided as guidance and assume the usage of ether.js, with Alice and Bob used as placeholders for specific agents. + +```javascript +const ethers = require('ethers'); + +// Connect to the provider (e.g., local node, Infura, Alchemy, etc.) +const provider = new ethers.providers.JsonRpcProvider('https://rpc-endpoint.io'); + +const ACLInterface = [{...}]; // Replace with the ABI of the Access List precompile + +// Contract Deployer Allow List +const contractDeployerAlowListAddress = '0xContractDeployerAllowListAddress'; +const contractDeployerAllowList = new ethers.Contract(contractDeployerAddress, ACLInterface, provider); + +// Transactions Allow List +const transactionsAllowListAddress = '0xTransactionsAllowListAddress'; +const transactionsAllowList = new ethers.Contract(transactionsAllowListAddress, ACLInterface, provider); + +// Transactions Block List +const transactionsBlockListAddress = '0xTransactionsBlockListAddress'; +const transactionsBlockList = new ethers.Contract(transactionsBlockListAddress, ACLInterface, provider); + +// Bridge Allow List +const bridgeAllowListAddress = '0xBridgeAllowListAddress'; +const bridgeAllowList = new ethers.Contract(bridgeAllowListAddress, ACLInterface, provider); + +// Bridge Block List +const bridgeBlockListAddress = '0xBridgeBlockListAddress'; +const bridgeBlockList = new ethers.Contract(bridgeBlockListAddress, ACLInterface, provider); +``` + +#### Interact with the ContractDeployer ACL + +```javascript +// Example interaction with the Contract Deployer ACL + +const addrAlice = '0xAliceAddress'; // Replace with Alice's address +const addrBob = '0xBobAddress'; // Replace with Bob's address + +// Add Alice's address to the contract deployer allowlist +const allowlistContractDeployerTx1 = contractDeployerAllowList.setEnabled(addrAlice); +allowlistContractDeployerTx1.wait(); + +// Remove Alice's address from the contract deployer allowlist +const allowlistContractDeployerTx2 = contractDeployerAllowList.setNone(addrAlice); +allowlistContractDeployerTx2.wait(); + +// Add Bob's address to the contract deployer allowlist +const allowlistContractDeployerTx3 = contractDeployerAllowList.setEnabled(addrBob); +allowlistContractDeployerTx3.wait(); + +// Remove Bob's address from the contract deployer allowlist +const allowlistContractDeployerTx4 = contractDeployerAllowList.setNone(addrBob); +allowlistContractDeployerTx4.wait(); +``` + +#### Interact with Transactions ACL + +```javascript +// Add Bob's address to the transaction allowlist +const allowlistTxTx1 = transactionsAllowList.setEnabled(addrBob); +allowlistTxTx1.wait(); + +// Remove Bob's address from the transaction allowlist +const allowlistTxTx2 = transactionsAllowList.setNone(addrBob); +allowlistTxTx2.wait(); + +// Add Alice's address to the transaction blocklist +const blocklistTxTx1 = transactionsBlockList.setEnabled(addrAlice); +blocklistTxTx1.wait(); + +// Remove Alice's address from the transaction blocklist +const blocklistTxTx2 = transactionsBlockList.setNone(addrAlice); +blocklistTxTx2.wait(); +``` + +#### Interact with the Bridge ACL + +```javascript +// Add Alice's address to the bridge allowlist +const allowlistBridgeTx1 = bridgeAllowList.setEnabled(addrAlice); +allowlistBridgeTx1.wait(); + +// Remove Alice's address from the bridge allowlist +const allowlistBridgeTx2 = bridgeAllowList.setNone(addrAlice); +allowlistBridgeTx2.wait(); + +// Add Alice's address to the bridge blocklist +const blocklistBridgeTx1 = bridgeBlockList.setEnabled(addrAlice); +blocklistBridgeTx1.wait(); + +// Remove Alice's address from the bridge blocklist +const blocklistBridgeTx2 = bridgeBlockList.setNone(addrAlice); +blocklistBridgeTx2.wait(); +``` diff --git a/docs/docs/operate/deploy/genesis-validators.md b/docs/docs/operate/deploy/genesis-validators.md new file mode 100644 index 0000000000..e88a9ed60b --- /dev/null +++ b/docs/docs/operate/deploy/genesis-validators.md @@ -0,0 +1,138 @@ +In this section, we'll look at how to configure the initial rootchain validator set through allowlisting and by staking. + +## 1. Allowlist validators on the rootchain + +The `CustomSupernetManager` contract on the rootchain is responsible for managing the PolyBFT network. + +Before validators can be registered on the `CustomSupernetManager` contract on the rootchain, they need to be allowlisted by the deployer of the `CustomSupernetManager` contract. Validators can register themselves, or a registrator can register them on their behalf. Once registered, validators can stake and start validating transactions. + +This can be done using the `polygon-edge polybft whitelist-validators` command. The deployer can specify the hex-encoded private key of the `CustomSupernetManager` contract deployer or use the `--data-dir` flag if they have initialized their secrets. + +
+Flags ↓ + +| Flag | Description | Example | +| -----------------| ------------------------------------------------------------------------------------------------| ------------------------------------------- | +| `--private-key` | Hex-encoded private key of the account that deploys the SupernetManager contract | `--private-key ` | +| `--addresses` | Comma-separated list of hex-encoded addresses of validators to be whitelisted | `--addresses 0x8a98f47a9820e3f3a6C16f44194F1d7eCCe3A110,0x8a98f47a9820e3f3a6C16f44194F1d7eCCe3A110` | +| --supernet-manager| Address of the SupernetManager contract on the rootchain | `--supernet-manager 0x3c6f8c6Fd90b2Bee1E78E2B2D1e7aB6cFf9Dc113` | +| `--data-dir` | Directory for the Polygon Edge data if the local FS is used | `--data-dir ./polygon-edge/data` | +| `--jsonrpc` | JSON-RPC interface | `--jsonrpc 0.0.0.0:8545` | +| `--config` | Path to the SecretsManager config file. If omitted, the local FS secrets manager is used | `--config /path/to/config/file.yaml` | + +
+ +In the following example command, we are using a placeholder private key for the `CustomSupernetManager` contract deployer. + +> If running the demo Geth instance, the test account private key has been hardcoded: `aa75e9a7d427efc732f8e4f1a5b7646adcc61fd5bae40f80d13c8419c9f43d6d`. + +The `--addresses` flag is a comma-separated list of the first two validators generated earlier. The `--supernet-manager` flag specifies the actual `CustomSupernetManager` contract address that was deployed. + +```bash +./polygon-edge polybft whitelist-validators \ + --private-key 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \ + --addresses 0x61324166B0202DB1E7502924326262274Fa4358F,0xFE5E166BA5EA50c04fCa00b07b59966E6C2E9570 \ + --supernet-manager 0x75aA024A2292A3FD3C17d67b54B3d00435437246 +``` + +## 2. Register validators on the rootchain + +Each validator needs to register themselves on the `CustomSupernetManager` contract. This is done using the `polygon-edge polybft register-validator` command. **Note that this command is for testing purposes only.** + +
+Flags ↓ + +| Flag | Description | Example | +| -----------------------------| ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | +| `--config` | Path to the SecretsManager config file. If omitted, the local FS secrets manager is used. | `--config /path/to/config/file.yaml` | +| `--data-dir` | The directory path where the new validator key is stored. | `--data-dir /path/to/validator1` | | +| `--jsonrpc` | The JSON-RPC interface. Default is `0.0.0.0:8545`. | `--jsonrpc 0.0.0.0:8545` | +| `--supernet-manager` | Address of the SupernetManager contract on the rootchain. | `--supernet-manager 0x75aA024A2292A3FD3C17d67b54B3d00435437246` | + +
+ +```bash +./polygon-edge polybft register-validator --data-dir ./test-chain-1 \ + --supernet-manager $(cat genesis.json | jq -r '.params.engine.polybft.bridge.customSupernetManagerAddr') +``` + +## 3. Initial staking on the rootchain + +Each validator needs to perform initial staking on the rootchain `StakeManager` contract. This is done using the `polygon-edge polybft stake` command. **Note that this command is for testing purposes only.** + +
+Flags ↓ + +|| Flag | Description | Example | +| -----------------------------| --------------------------------------------------------------------------------- | ---------------------------------------- | +| `--amount ` | The amount to stake | `--amount 5000000000000000000` | +| `--supernet-id` | The ID of the supernet provided by stake manager on supernet registration | `--chain-id 100` | +| `--config ` | The path to the SecretsManager config file | `--config /path/to/config/file.yaml` | +| `--data-dir` | The directory for the Polygon Edge data | `--data-dir ./polygon-edge/data` | +| `--jsonrpc` | The JSON-RPC interface | `--jsonrpc 0.0.0.0:8545` | +| `--stake-token ` | The address of ERC20 Token used for staking on rootchain | `--native-root-token 0x` | +| `--stake-manager` | The address of the stake manager contract | `--stake-manager 0x` | + +
+ +In the following example command, we use the validator key and the rootchain `StakeManager` contract address that was generated earlier. We also set the staking amount to `1000000000000000000` which is equivalent to 1 token. The `--stake-token` flag is used to specify the address of the native token of the rootchain. + +:::info Staking requirement: wrapping a non-ERC-20 token + +Edge allow for the customization of the gas token and mandate the use of ERC-20 tokens for staking instead of the rootchain's native token. + +When performing rootchain staking on the Polygon PoS Mainnet, [WMATIC](https://polygonscan.com/token/0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270?a=0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45) (wrapped MATIC) is the required token. This is due to the ERC-20 standard requirement for staking, which MATIC doesn't meet. + +WMATIC is deployed at `0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270`. + +This principle also applies to the Mumbai Testnet, where wrapped test MATIC must be used instead of test MATIC. + +If you currently hold MATIC tokens, you can convert them to WMATIC through various methods. One common method is to use a decentralized exchange (DEX) like Uniswap, where you can swap your MATIC tokens for WMATIC. **Always ensure you're using a reputable platform for this conversion and double-check that the contract address for WMATIC is correct.** + +
+Obtaining native root token address + +For example, if you are using the Mumbai test network, you can obtain the address of the MATIC testnet token by sending a POST request to the Mumbai network's JSON-RPC endpoint: + +```bash +curl \ + -X POST \ + -H "Content-Type: application/json" \ + --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"","data":"0x06fdde03"},"latest"],"id":1}' +``` + +
+ +::: + +```bash +./polygon-edge polybft stake \ + --data-dir ./test-chain-1 \ + --supernet-id $(cat genesis.json | jq -r '.params.engine.polybft.supernetID') \ + --amount 1000000000000000000 \ + --stake-manager $(cat genesis.json | jq -r '.params.engine.polybft.bridge.stakeManagerAddr') \ + --stake-token $(cat genesis.json | jq -r '.params.engine.polybft.bridge.stakeTokenAddr') \ +``` + +## 4. Finalize validator set on the rootchain + +After all validators from the genesis block have performed initial staking on the rootchain, the final step required before starting the chain is to finalize the genesis validator set on the `SupernetManager` contract on the rootchain. This can be done using the `polygon-edge polybft supernet` command. + +The deployer of the `SupernetManager` contract can specify their hex-encoded private key or use the `--data-dir` flag if they have initialized their secrets. If the `--enable-staking` flag is provided, validators will be able to continue staking on the rootchain. If not, genesis validators will not be able to update their stake or unstake, nor will newly registered validators after genesis be able to stake tokens on the rootchain. The enabling of staking can be done through this command or later after the Edge-powered chain starts. + +In the following example command, we use a placeholder hex-encoded private key of the `SupernetManager` contract deployer. The addresses of the `SupernetManager` and `StakeManager` contracts are the addresses that were generated earlier. We also use the `--finalize-genesis-set` and `--enable-staking` flags to enable staking and finalize the genesis state. + +```bash +./polygon-edge polybft supernet + --private-key 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \ + --genesis /path/to/genesis/file \ + --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 +``` + +## 5. Next Steps + +With all the necessary configurations in place for the Edge-powered chain, we are ready to proceed with starting the chain. + +Navigate to the [Start Your Chain](start-chain.md) deployment guide, which will provide you with instructions on how to initiate and launch the chain. diff --git a/docs/docs/operate/deploy/genesis.md b/docs/docs/operate/deploy/genesis.md new file mode 100644 index 0000000000..712267a989 --- /dev/null +++ b/docs/docs/operate/deploy/genesis.md @@ -0,0 +1,557 @@ + +In this section, we'll walk through how to configure the initial childchain state by generating a new genesis file. + +## 1. Overview + +The genesis file is a critical component in setting up a blockchain network, containing the initial validator set, genesis block, and other essential parameters that define the network's behavior. The initial validator set is responsible for bootstrapping the consensus mechanism, allowing the blockchain to function and reach consensus on new blocks. + +Edge allow for customizable parameters such as the block gas limit, epoch size, and block rewards, which enable network operators to tailor the network to specific requirements. Additionally, Edge support allowlists and blocklists for transactions and validators, providing an extra layer of control and security to the network. These lists can be used to restrict or permit specific addresses, ensuring only authorized parties can participate in the network or execute transactions. + +To create the chain configuration, we use the `polygon-edge genesis` command, which generates the genesis file. + +
+Common Flags ↓ + +| Flag | Description | Example | +|--------------------------------------------|-----------------------------------------------------------|--------------------------------------------------| +| `--block-gas-limit uint` | The maximum amount of gas used by all transactions in a block (default 5242880) | `--block-gas-limit 10000000` | +| `--block-time duration` | The predefined period which determines block creation frequency (default 2s) | `--block-time 5s` | +| `--block-time-drift uint` | Configuration for block time drift value (in seconds) (default 10) | | +| `--block-tracker-poll-interval duration` | Interval (number of seconds) at which block tracker polls for latest block at rootchain (default 1s) | | +| `--bootnode stringArray` | MultiAddr URL for p2p discovery bootstrap. This flag can be used multiple times | `--bootnode /ip4/127.0.0.1/tcp/30301/p2p/QmSomeNodeId` | +| `--burn-contract string` | The burn contract block and address (format: `:
[: destination]`) | `--burn-contract 100:0x742d35Cc6634C0532925a3b844Bc454e4438f44e` | +| `--chain-id uint` | The ID of the chain (default 100) | `--chain-id 1234` | +| `--consensus string` | The consensus protocol to be used (default "polybft") | `--consensus ibft` | +| `--dir string` | The directory for the Polygon Edge genesis data (default "./genesis.json") | `--dir ./genesis_data` | +| `--epoch-reward uint` | Reward size for block sealing (default 1) | `--epoch-reward 1000000000000000000` | +| `--epoch-size uint` | The epoch size for the chain (default 100000) | `--epoch-size 100` | +| `--ibft-validator stringArray` | Addresses to be used as IBFT validators, can be used multiple times. Needs to be present if ibft-validators-prefix-path is omitted | `--ibft-validator 0x742d35Cc6634C0532925a3b844Bc454e4438f44e` | +| `--ibft-validator-type string` | The type of validators in IBFT (default "bls") | `--ibft-validator-type ecdsa` | +| `--ibft-validators-prefix-path string` | Prefix path for validator folder directory. Needs to be present if ibft-validator is omitted | `--ibft-validator-prefix-path ./validators` | +| `--max-validator-count uint` | The maximum number of validators in the validator set for PoS (default 9007199254740990) | `--max-validator-count 100` | +| `--min-validator-count uint` | The minimum number of validators in the validator set for PoS (default 1) | `--min-validator-count 4` | +| `--name string` | The name for the chain (default "polygon-edge") | `--name "My Polygon Chain"` | +| `--native-token-config string` | Native token configuration, provided in the following format: | `--native-token-config "MyToken:MTK:18:true/false"` | +| `--pos` | The flag indicating that the client should use Proof of Stake IBFT. Defaults to Proof of Authority if flag is not provided or false | `--is-pos true` | +| `--premine stringArray` | The premined accounts and balances (format: `
[:]`). Default premined balance: 1000000000000000000000000 | `--premine 0x742d35Cc6634C0532925a3b844Bc454e4438f44e:1000000000000000000` | +| `--proxy-contracts-admin string` | Admin for proxy contracts | | +| `--reward-token-code string` | Hex encoded reward token byte code | `--reward-token-code 0x606060...` | +| `--reward-wallet string` | Configuration of reward wallet in format | `--reward-wallet 0x742d35Cc6634C0532925a3b844Bc454e4438f44e:1000000000000000000` | +| `--sprint-size uint` | The number of block included into a sprint (default 5) | `--sprint-size 10` | +| `--trieroot string` | Trie root from the corresponding triedb | `--trie-root 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef` | +| `--validators stringArray` | Validators defined by user (format: `::`) | `--validators /ip4/127.0.0.1/tcp/30301/p2p/...` | +| `--validators-path string` | Root path containing polybft validators secrets (default "./") | `--validators-path ./validators` | +| `--validators-prefix string` | Folder prefix names for polybft validators secrets (default "test-chain-") | `--validators-prefix polybft-` | + +
+ +:::caution Must enable ACLs before launching the network + +Keep in mind that allowlists must be enabled prior to launching the network. After the network is started, configuration of the allowlist will no longer be possible. The access control process will be initiated by the initial allowlisted addresses. + +::: + +
+Access Control List Flags ↓ + +Contract deployer: + +| Flag | Description | Example | +|--------------------------------------------|-----------------------------------------------------------|--------------------------------------------------| +| `--contract-deployer-allow-list-admin stringArray` | List of addresses to use as admin accounts in the contract deployer allow list | `--contract-deployer-allow-list-admin 0x742d35Cc6634C0532925a3b844Bc454e4438f44e` | +| `--contract-deployer-allow-list-enabled stringArray` | List of addresses to enable by default in the contract deployer allow list | `--contract-deployer-allow-list-enabled 0x742d35Cc6634C0532925a3b844Bc454e4438f44e` | +| `--contract-deployer-block-list-admin stringArray` | List of addresses to use as admin accounts in the contract deployer block list | `--contract-deployer-block-list-admin 0x742d35Cc6634C0532925a3b844Bc454e4438f44e` | +| `--contract-deployer-block-list-enabled stringArray` | List of addresses to enable by default in the contract deployer block list | `--contract-deployer-block-list-enabled 0x742d35Cc6634C0532925a3b844Bc454e4438f44e` | + +Transactions: + +| Flag | Description | Example | +|--------------------------------------------|-----------------------------------------------------------|--------------------------------------------------| +| `--transactions-allow-list-admin stringArray` | List of addresses to use as admin accounts in the transactions allow list | `--transactions-allow-list-admin 0x742d35Cc6634C0532925a3b844Bc454e4438f44e` | +| `--transactions-allow-list-enabled stringArray` | List of addresses to enable by default in the transactions allow list | `--transactions-allow-list-enabled 0x742d35Cc6634C0532925a3b844Bc454e4438f44e` | +| `--transactions-block-list-admin stringArray` | List of addresses to use as admin accounts in the transactions block list | `--transactions-block-list-admin 0x742d35Cc6634C0532925a3b844Bc454e4438f44e` | +| `--transactions-block-list-enabled stringArray` | List of addresses to enable by default in the transactions block list | `--transactions-block-list-enabled 0x742d35Cc6634C0532925a3b844Bc454e4438f44e` | + +Bridge: + +| Flag | Description | Example | +|--------------------------------------------|-----------------------------------------------------------|--------------------------------------------------| +| `--bridge-allow-list-admin stringArray` | List of addresses to use as admin accounts in the bridge allow list | `--bridge-allow-list-admin 0x742d35Cc6634C0532925a3b844Bc454e4438f44e` | +| `--bridge-allow-list-enabled stringArray` | List of addresses to enable by default in the bridge allow list | `--bridge-allow-list-enabled 0x742d35Cc6634C0532925a3b844Bc454e4438f44e` | +| `--bridge-block-list-admin stringArray` | List of addresses to use as admin accounts in the bridge block list | `--bridge-block-list-admin 0x742d35Cc6634C0532925a3b844Bc454e4438f44e` | +| `--bridge-block-list-enabled stringArray` | List of addresses to enable by default in the bridge block list | `--bridge-block-list-enabled 0x742d35Cc6634C0532925a3b844Bc454e4438f44e` | + +
+ +:::note Base Fee Adjustments and Network Stability + +The `--base-fee-change-denom` parameter represents the value that bounds the amount the base fee can change between blocks. This ensures that the base fee doesn't fluctuate too wildly from one block to the next, providing stability and predictability in transaction costs for users. While dynamic adjustments to the base fee can help in managing network congestion, it's essential to strike a balance to maintain user trust and consistent transaction costs. + +::: + +:::note ACL gas cost considerations + +While the use of alternative ACL-enabled contracts, such as bridge ACLs, offers finer control over cross-chain interactions, these contracts also result in increased gas consumption for transactions. As you weigh the benefits of enhanced security, keep in mind that security measures can often come with higher costs. + +::: + +## 2. Deployment Considerations + +| Consideration | Description | Details | +| --- | --- | --- | +| **Difference between `chain-id` and `supernet-id`** | - `chain-id`: Unique identifier for a childchain.
- `supernet-id`: Identifier populated during registration with `StakeManager`. | Users can assign a custom `chain-id` via the genesis command. The `supernet-id` value is derived from the `rootchain deploy` command. | +| **Create a Native Token and Premine** | Configure the native token and premine specific accounts. | - `--premine`: Specify premined accounts and balances.
- `--native-token-config`: Configure the native token's details.
- `--owner` (Note): For mintable native tokens, designates permissions. | +| **Enable EIP1559** | Enable the London hard fork with specific configurations. | As of version 1.3.0, the `--genesis-base-fee` flag is not exposed. However, you can manually tweak `baseFee` and `baseFeeEM` in the `genesis.json` and restart the node for changes to take effect. | +| **Contract Upgradability via Proxy Contracts** | Use proxy contracts for flexible and controlled upgrades. | - **Genesis Initialization**: Use `--proxy-contracts-admin` to specify upgrade permissions.
- **Rootchain Deployment**: Uses `--proxy-contracts-admin` to define contract address while being able to upgrade logic.
- **Stake Manager Deployment**: Uses `--proxy-contracts-admin` to define proxy admin for Staking Manager contract. | + +## 3. Specify Validator Set & Generate Genesis + +There are two ways to specify the initial validator set: + +- **Single-Host Validator Setup**: All validator information is present in the local storage of a single host. In this case, you can provide the directory using the `--validators-path` flag and the validator folder prefix names using the `--validators-prefix` flag. To enable reward distribution, you must define a reward wallet address and its balance using the `--reward-wallet` flag. The wallet address is used to distribute reward tokens from that address to validators that signed blocks in that epoch. +- **Multi-Host Validator Setup**: Validator information is scattered across multiple hosts. In this case, you can supply the necessary information using the `--validators` flag. + + + + + + + + + + + +In the following example command, we will set the block gas limit to `10,000,000` and the epoch size to `10` using the `--block-gas-limit` and `--epoch-size` flags, respectively. + +We will also specify the consensus mechanism as PolyBFT using the `--consensus` flag. + +To enable reward distribution, we will define a reward wallet address and its balance using the `--reward-wallet` flag (for this example, we use the first validator as the reward wallet). + +In addition, we can provide the directory where the validator information is stored using the `--validators-path` flag and the prefix for the validator folder names using the `--validators-prefix` flag. + +We also add the `--transactions-allow-list-admin` flag to specify the admin addresses for the transactions allowlist, and the `--transactions-allow-list-enabled` flag to specify the addresses that will be enabled by default in the transactions allowlist, using the first and second validator nodes. + +**You can customize the initial chain state using the flags listed above.** + +```bash +./polygon-edge genesis --block-gas-limit 10000000 --epoch-size 10 \ + --proxy-contracts-admin 0x61324166B0202DB1E7502924326262274Fa4358F \ + --validators-path ./ --validators-prefix test-chain- \ + --consensus polybft \ + --reward-wallet 0x61324166B0202DB1E7502924326262274Fa4358F:1000000 \ + --transactions-allow-list-admin 0x61324166B0202DB1E7502924326262274Fa4358F,0xFE5E166BA5EA50c04fCa00b07b59966E6C2E9570 \ + --transactions-allow-list-enabled 0x61324166B0202DB1E7502924326262274Fa4358F,0xFE5E166BA5EA50c04fCa00b07b59966E6C2E9570 \ + --premine 0x0:1000000000000000000000 +``` + +By customizing these flags, we can tailor the network to meet our specific requirements. Remember to consider the impact of these parameters carefully, as they can significantly affect the network's performance, security, and scalability. + +
+Genesis output example ↓ + +#### Output: + +```bash +[GENESIS VALIDATORS] +Address=0x61324166B0202DB1E7502924326262274Fa4358F; Balance=1000000; P2P Multi addr=/ip4/127.0.0.1/tcp/30301/p2p/16Uiu2HAmMYyzK7c649Tnn6XdqFLP7fpPB2QWdck1Ee9vj5a7Nhg8; BLS Key=06d8d9e6af67c28e85ac400b72c2e635e83234f8a380865e050a206554049a222c4792120d84977a6ca669df56ff3a1cf1cfeccddb650e7aacff4ed6c1d4e37b055858209f80117b3c0a6e7a28e456d4caf2270f430f9df2ba37221f23e9bbd313c9ef488e1849cc5c40d18284d019dde5ed86770309b9c24b70ceff6167a6ca; +Address=0xFE5E166BA5EA50c04fCa00b07b59966E6C2E9570; Balance=1000000000000000000000000; P2P Multi addr=/ip4/127.0.0.1/tcp/30302/p2p/16Uiu2HAmLXVapjR2Yx3B1taCmHnckQ1ph2xrawBjW2kvSErps9CX; BLS Key=0601da8856a6d3d3bb0f3bcbb90ea7b8c0db8271b9203e6123c6804aa3fc5f810be33287968ca1af2be11839516850a6ffef2337d99e679b7531efbbea2e3bf727a053c0cbede71da3d5f489b6ad862ccd8bb0bfb7fa379e3395d3b1142594a73020e87d63c298a3a4eba0ace65727f8659bab6389b9448b72512db72bbe937f; +Address=0x9aBb8441A12d4FD8D505C3fc50cDdc45E0df2b1e; Balance=1000000000000000000000000; P2P Multi addr=/ip4/127.0.0.1/tcp/30303/p2p/16Uiu2HAmGskf5sZ514Ab4SHTPuw8RRBQudyrU211wn3P1knRz9Ed; BLS Key=17c26d9d91dddc3c1318b20a1ddb3322ea1f4e4415c27e9011d706e7407eed672837173d1909cbff6ccdfd110af3b18bdfea878e8120fdb5bae70dc7a044a2f40aa8f118b41704896f474f80fff52d9047fa8e4a464ac86f9d05a0220975d8440e20c6307d866137053cabd4baf6ba84bfa4a22f5f9297c1bfc2380c23535210; +Address=0xCaB5AAC79Bebe326e0c80d72b5662E73f5D8ea56; Balance=1000000000000000000000000; P2P Multi addr=/ip4/127.0.0.1/tcp/30304/p2p/16Uiu2HAm42EFMhJPGcMRFHPaWWxBzoEsWRbGxJnBHMu4VFojg99U; BLS Key=1d7bb7d44a2f0ebeae2f4380f88188080de34635d78a36647f0704c7b70de7291e2e3b9a1ef699a078c6cd9bb816ea2917c2c2fc699c6248f1f7812a167caf7e15361ec16df56d194768d57c79897c681c96f4321651464f7b577d08083d8b67213a1e29dc8495d8389e6cbd85fdd738c402a1801198b57b302e0e00dfaf1247;[GENESIS SUCCESS] + +Genesis written to ./genesis.json +``` + +#### genesis.json: + +```json +{ + "name": "polygon-edge", + "genesis": { + "nonce": "0x0000000000000000", + "timestamp": "0x0", + "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000f90305f90299f90294f8a39461324166b0202db1e7502924326262274fa4358fb88006d8d9e6af67c28e85ac400b72c2e635e83234f8a380865e050a206554049a222c4792120d84977a6ca669df56ff3a1cf1cfeccddb650e7aacff4ed6c1d4e37b055858209f80117b3c0a6e7a28e456d4caf2270f430f9df2ba37221f23e9bbd313c9ef488e1849cc5c40d18284d019dde5ed86770309b9c24b70ceff6167a6ca8ad3c21bcecceda100000001f8a394fe5e166ba5ea50c04fca00b07b59966e6c2e9570b8800601da8856a6d3d3bb0f3bcbb90ea7b8c0db8271b9203e6123c6804aa3fc5f810be33287968ca1af2be11839516850a6ffef2337d99e679b7531efbbea2e3bf727a053c0cbede71da3d5f489b6ad862ccd8bb0bfb7fa379e3395d3b1142594a73020e87d63c298a3a4eba0ace65727f8659bab6389b9448b72512db72bbe937f8ad3c21bcecceda100000001f8a3949abb8441a12d4fd8d505c3fc50cddc45e0df2b1eb88017c26d9d91dddc3c1318b20a1ddb3322ea1f4e4415c27e9011d706e7407eed672837173d1909cbff6ccdfd110af3b18bdfea878e8120fdb5bae70dc7a044a2f40aa8f118b41704896f474f80fff52d9047fa8e4a464ac86f9d05a0220975d8440e20c6307d866137053cabd4baf6ba84bfa4a22f5f9297c1bfc2380c235352108ad3c21bcecceda100000001f8a394cab5aac79bebe326e0c80d72b5662e73f5d8ea56b8801d7bb7d44a2f0ebeae2f4380f88188080de34635d78a36647f0704c7b70de7291e2e3b9a1ef699a078c6cd9bb816ea2917c2c2fc699c6248f1f7812a167caf7e15361ec16df56d194768d57c79897c681c96f4321651464f7b577d08083d8b67213a1e29dc8495d8389e6cbd85fdd738c402a1801198b57b302e0e00dfaf12478ad3c21bcecceda100000001c080c0c0f8658080a00000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000", + "gasLimit": "0x989680", + "difficulty": "0x0", + "mixHash": "0xadce6e5230abe012342a44e4e9b6d05997d6f015387ae0e59be924afc7ec70c1", + "coinbase": "0x0000000000000000000000000000000000000000", + "alloc": { + "0x0000000000000000000000000000000000000101": { + "code": "0x608060405234801561001057600080fd5b50600436106101b05760003560e01c806370a08231116100ef578063ce513b6f11610092578063ce513b6f14610398578063dd62ed3e146103ab578063e0563ab1146103be578063ea0fee4f146103c7578063eacdc5ff146103cf578063eeb49945146103d8578063f3f43703146103eb578063fd242c14146103fe57600080fd5b806370a08231146102e7578063947287cf146102fa57806395d89b411461030357806397e5230d1461030b578063981b24d014610315578063a457c2d714610328578063a9059cbb1461033b578063c6b61e4c1461034e57600080fd5b8063395093511161015757806339509351146102735780633b878c22146102865780633ccfd60b1461028f5780633fd50001146102975780634ee2cd7e146102aa57806351351d53146102bd57806361cc2763146102cb57806362656003146102de57600080fd5b806306fdde03146101b5578063095ea7b3146101d35780630f50287c146101f657806318160ddd1461020b57806323b872dd1461021d578063284017f5146102305780632e17de7814610251578063313ce56714610264575b600080fd5b6101bd610411565b6040516101ca91906119ba565b60405180910390f35b6101e66101e13660046119e2565b6104a3565b60405190151581526020016101ca565b610209610204366004611a0e565b6104bd565b005b6035545b6040519081526020016101ca565b6101e661022b366004611a46565b61074f565b61023961202081565b6040516001600160a01b0390911681526020016101ca565b61020961025f366004611a87565b610773565b604051601281526020016101ca565b6101e66102813660046119e2565b61078a565b61023961101081565b6102096107ac565b61020f6102a5366004611a87565b6108bd565b61020f6102b83660046119e2565b6108de565b6102396002600160a01b0381565b6102096102d9366004611b10565b6108f1565b61020f60cc5481565b61020f6102f5366004611c29565b610b1f565b61020f61520881565b6101bd610b3a565b61020f620249f081565b61020f610323366004611a87565b610b49565b6101e66103363660046119e2565b610b54565b6101e66103493660046119e2565b610bcf565b61037d61035c366004611a87565b60ce6020526000908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016101ca565b61020f6103a6366004611c29565b610bdd565b61020f6103b9366004611c46565b610c0b565b61023961203081565b61020f600181565b61020f60cd5481565b6102096103e6366004611c7f565b610c36565b61020f6103f9366004611c29565b610d08565b61020f61040c366004611a87565b610d2f565b60606036805461042090611d08565b80601f016020809104026020016040519081016040528092919081815260200182805461044c90611d08565b80156104995780601f1061046e57610100808354040283529160200191610499565b820191906000526020600020905b81548152906001019060200180831161047c57829003601f168201915b5050505050905090565b6000336104b1818585610d79565b60019150505b92915050565b336002600160a01b03146105065760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064015b60405180910390fd5b60cd80546000918261051783611d58565b9190505590508083146105625760405162461bcd60e51b815260206004820152601360248201527215539156141150d5115117d15413d0d217d251606a1b60448201526064016104fd565b81356020830135116105ac5760405162461bcd60e51b81526020600482015260136024820152721393d7d09313d0d2d4d7d0d3d3535255151151606a1b60448201526064016104fd565b60cc546105be83356020850135611d71565b6105c9906001611d84565b6105d39190611dad565b1561062e5760405162461bcd60e51b815260206004820152602560248201527f45504f43485f4d5553545f42455f444956495349424c455f42595f45504f43486044820152645f53495a4560d81b60648201526084016104fd565b813560ce600061063f600185611d71565b815260200190815260200160002060010154600161065d9190611d84565b146106a05760405162461bcd60e51b8152602060048201526013602482015272494e56414c49445f53544152545f424c4f434b60681b60448201526064016104fd565b600081815260ce6020526040902082906106d182828135815560208201356001820155604082013560028201555050565b505060cf80546001810182556000919091526020838101357facb8d954e2cfef495862221e91bd7523613cf8808827cb33edfe4904cc51bf299092018290556040805190850135815284359186917f0ce8712c4dee4bd5a691f0bc1c39594671591e77395f8ebf6a3fb5f63fbea66a910160405180910390a4505050565b60003361075d858285610e9e565b610768858585610f12565b506001949350505050565b61077d33826110b6565b61078733826111e1565b50565b6000336104b181858561079d8383610c0b565b6107a79190611d84565b610d79565b33600090815260d06020526040812060cd5490919081906107ce90849061125a565b808555604051828152919350915033907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a260c95460cb54604080517f8ca9a95e41b5eece253c93f5b31eed1253aed6b145d8a6e14d913fdf8e7322936020820152338183015260608082018790528251808303909101815260808201928390526316f1983160e01b9092526001600160a01b03938416936316f198319361088693911691608401611dc1565b600060405180830381600087803b1580156108a057600080fd5b505af11580156108b4573d6000803e3d6000fd5b50505050505050565b60cf81815481106108cd57600080fd5b600091825260209091200154905081565b60006108ea83836112cc565b9392505050565b600054610100900460ff16158080156109115750600054600160ff909116105b8061092b5750303b15801561092b575060005460ff166001145b61098e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104fd565b6000805460ff1916600117905580156109b1576000805461ff0019166101001790555b6109fb6040518060400160405280600c81526020016b15985b1a59185d1bdc94d95d60a21b815250604051806040016040528060048152602001631594d15560e21b815250611315565b60c980546001600160a01b038089166001600160a01b03199283161790925560ca805488841690831617905560cb80549287169290911691909117905560cc83905560005b8251811015610a9557610a8d838281518110610a5e57610a5e611de5565b602002602001015160000151848381518110610a7c57610a7c611de5565b60200260200101516020015161134a565b600101610a40565b5060cf80546001818101835560009283527facb8d954e2cfef495862221e91bd7523613cf8808827cb33edfe4904cc51bf299091019190915560cd558015610b17576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6001600160a01b031660009081526033602052604090205490565b60606037805461042090611d08565b60006104b782611354565b60003381610b628286610c0b565b905083811015610bc25760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016104fd565b6107688286868403610d79565b6000336104b1818585610f12565b60cd546001600160a01b038216600090815260d0602052604081209091610c04919061125a565b5092915050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b60ca546001600160a01b031633148015610c5d575060cb546001600160a01b038481169116145b610c9a5760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a2a72222a960911b60448201526064016104fd565b7f1bcc0f4c3fad314e585165815f94ecca9b96690a26d6417d7876448a9a867a69610cc9602060008486611dfb565b610cd291611e25565b03610d0257600080610ce78360208187611dfb565b810190610cf491906119e2565b91509150610b17828261134a565b50505050565b60cd546001600160a01b038216600090815260d06020526040812090916104b7919061137f565b600081815260ce60205260408120600101548015610d7057600083815260ce6020526040902054610d609082611d71565b610d6b906001611d84565b6108ea565b60009392505050565b6001600160a01b038316610ddb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104fd565b6001600160a01b038216610e3c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104fd565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6000610eaa8484610c0b565b90506000198114610d025781811015610f055760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016104fd565b610d028484848403610d79565b6001600160a01b038316610f765760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104fd565b6001600160a01b038216610fd85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104fd565b610fe383838361141d565b6001600160a01b0383166000908152603360205260409020548181101561105b5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016104fd565b6001600160a01b038085166000818152603360205260408082208686039055928616808252908390208054860190559151600080516020611fd6833981519152906110a99086815260200190565b60405180910390a3610d02565b6001600160a01b0382166111165760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016104fd565b6111228260008361141d565b6001600160a01b038216600090815260336020526040902054818110156111965760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016104fd565b6001600160a01b0383166000818152603360209081526040808320868603905560358054879003905551858152919291600080516020611fd68339815191529101610e91565b505050565b61121381600160cd546111f49190611d84565b6001600160a01b038516600090815260d0602052604090209190611486565b816001600160a01b03167f655c1cd0236fb6dc4916f34c8ff10e3b18fcaea5b344dfc16c36fbb1bdfc5df28260405161124e91815260200190565b60405180910390a25050565b81546000905b83600101548110156112c5576000818152600285016020908152604091829020825180840190935280548352600101549082018190528410156112a357506112c5565b80516112af9084611d84565b92505080806112bd90611d58565b915050611260565b9250929050565b6001600160a01b0382166000908152606560205260408120819081906112f39085906115b1565b915091508161130a5761130585610b1f565b61130c565b805b95945050505050565b600054610100900460ff1661133c5760405162461bcd60e51b81526004016104fd90611e43565b611346828261169f565b5050565b61134682826116df565b60008060006113648460666115b1565b915091508161137557603554611377565b805b949350505050565b60018201546000908082036113985760009150506104b7565b60006113a5600183611d71565b90505b845481106114155760008181526002860160209081526040918290208251808401909352805483526001015490820181905285106113e65750611415565b80516113f29085611d84565b9350816000036114025750611415565b508061140d81611e8e565b9150506113a8565b505092915050565b6001600160a01b038316158061143a57506001600160a01b038216155b61147b5760405162461bcd60e51b81526020600482015260126024820152712a2920a729a322a92fa327a92124a22222a760711b60448201526064016104fd565b6111dc83838361179a565b8160000361149657611496611ea5565b825460018401548181036114ed576040805180820182528581526020808201868152600085815260028a0190925292812091518255915160019182015586018054916114e183611d58565b91905055505050505050565b600060028601816114ff600185611d71565b81526020019081526020016000206001015490508084101561152357611523611ea5565b83811015611572576040805180820182528681526020808201878152600086815260028b01909252928120915182559151600191820155870180549161156883611d58565b9190505550610b17565b84600287016000611584600186611d71565b815260200190815260200160002060000160008282546115a49190611d84565b9091555050505050505050565b600080600084116115fd5760405162461bcd60e51b815260206004820152601660248201527504552433230536e617073686f743a20696420697320360541b60448201526064016104fd565b60cd5484111561164f5760405162461bcd60e51b815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e7420696400000060448201526064016104fd565b600061165b84866117e2565b845490915081036116735760008092509250506112c5565b600184600101828154811061168a5761168a611de5565b906000526020600020015492509250506112c5565b600054610100900460ff166116c65760405162461bcd60e51b81526004016104fd90611e43565b60366116d28382611f01565b5060376111dc8282611f01565b6001600160a01b0382166117355760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016104fd565b6117416000838361141d565b80603560008282546117539190611d84565b90915550506001600160a01b038216600081815260336020908152604080832080548601905551848152600080516020611fd6833981519152910160405180910390a35050565b6001600160a01b0383166117b9576117b18261188f565b6111dc6118b9565b6001600160a01b0382166117d0576117b18361188f565b6117d98361188f565b6111dc8261188f565b815460009081036117f5575060006104b7565b82546000905b8082101561184257600061180f83836118c9565b6000878152602090209091508590820154111561182e5780915061183c565b611839816001611d84565b92505b506117fb565b60008211801561186e57508361186b8661185d600186611d71565b600091825260209091200190565b54145b156118875761187e600183611d71565b925050506104b7565b5090506104b7565b6001600160a01b0381166000908152606560205260409020610787906118b483610b1f565b6118e4565b6118c760666118b460355490565b565b60006118d86002848418611fc1565b6108ea90848416611d84565b60006118ef60cd5490565b9050806118fb8461192f565b10156111dc578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b8054600090810361194257506000919050565b8154829061195290600190611d71565b8154811061196257611962611de5565b90600052602060002001549050919050565b6000815180845260005b8181101561199a5760208185018101518683018201520161197e565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006108ea6020830184611974565b6001600160a01b038116811461078757600080fd5b600080604083850312156119f557600080fd5b8235611a00816119cd565b946020939093013593505050565b6000808284036080811215611a2257600080fd5b833592506060601f1982011215611a3857600080fd5b506020830190509250929050565b600080600060608486031215611a5b57600080fd5b8335611a66816119cd565b92506020840135611a76816119cd565b929592945050506040919091013590565b600060208284031215611a9957600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611ad957611ad9611aa0565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611b0857611b08611aa0565b604052919050565b600080600080600060a08688031215611b2857600080fd5b8535611b33816119cd565b9450602086810135611b44816119cd565b9450604087810135611b55816119cd565b945060608801359350608088013567ffffffffffffffff80821115611b7957600080fd5b818a0191508a601f830112611b8d57600080fd5b813581811115611b9f57611b9f611aa0565b611bad858260051b01611adf565b818152858101925060069190911b83018501908c821115611bcd57600080fd5b928501925b81841015611c165784848e031215611bea5760008081fd5b611bf2611ab6565b8435611bfd816119cd565b8152848701358782015283529284019291850191611bd2565b8096505050505050509295509295909350565b600060208284031215611c3b57600080fd5b81356108ea816119cd565b60008060408385031215611c5957600080fd5b8235611c64816119cd565b91506020830135611c74816119cd565b809150509250929050565b60008060008060608587031215611c9557600080fd5b843593506020850135611ca7816119cd565b9250604085013567ffffffffffffffff80821115611cc457600080fd5b818701915087601f830112611cd857600080fd5b813581811115611ce757600080fd5b886020828501011115611cf957600080fd5b95989497505060200194505050565b600181811c90821680611d1c57607f821691505b602082108103611d3c57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600060018201611d6a57611d6a611d42565b5060010190565b818103818111156104b7576104b7611d42565b808201808211156104b7576104b7611d42565b634e487b7160e01b600052601260045260246000fd5b600082611dbc57611dbc611d97565b500690565b6001600160a01b038316815260406020820181905260009061137790830184611974565b634e487b7160e01b600052603260045260246000fd5b60008085851115611e0b57600080fd5b83861115611e1857600080fd5b5050820193919092039150565b803560208310156104b757600019602084900360031b1b1692915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600081611e9d57611e9d611d42565b506000190190565b634e487b7160e01b600052600160045260246000fd5b601f8211156111dc57600081815260208120601f850160051c81016020861015611ee25750805b601f850160051c820191505b81811015610b1757828155600101611eee565b815167ffffffffffffffff811115611f1b57611f1b611aa0565b611f2f81611f298454611d08565b84611ebb565b602080601f831160018114611f645760008415611f4c5750858301515b600019600386901b1c1916600185901b178555610b17565b600085815260208120601f198616915b82811015611f9357888601518255948401946001909101908401611f74565b5085821015611fb15787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082611fd057611fd0611d97565b50049056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220ceae916e2fad24f9aaa4340b6994418d32d33c6ae1f266c50dd4ec5ccbdbce2764736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000000102": { + "code": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c806391ec2d2b1161006657806391ec2d2b1461013b578063a850a9091461015b578063d58e77331461016e578063e242cce914610181578063ebbdac911461019457600080fd5b8063115000fe146100a3578063247dd9fb146100cb5780633e5476ce146100de5780638669026f146101085780639141376314610128575b600080fd5b6100b66100b1366004612708565b6101a7565b60405190151581526020015b60405180910390f35b6100b66100d9366004612785565b61030e565b6100f16100ec366004612841565b6103b8565b6040805192151583529015156020830152016100c2565b61011b6101163660046128ce565b61079f565b6040516100c29190612957565b6100f1610136366004612988565b6108bb565b61014e6101493660046128ce565b610d5c565b6040516100c29190612a86565b61011b6101693660046128ce565b610ff8565b61011b61017c366004612aa0565b6111d4565b6100b661018f366004612785565b6115aa565b6100f16101a2366004612ab9565b611609565b600081516020830151600080516020612d63833981519152828309600080516020612d638339815191528283098182830101600080516020612d638339815191528283840108600080516020612d638339815191528682600080516020612d6383398151915203860109935050600080516020612d638339815191528483600080516020612d63833981519152038301099150600080516020612d638339815191527f2b149d40ceb8aaae81be18991be06ac3b5b4c5e559dbefa33267e6dc24a138e584089450600080516020612d638339815191527e9713b03af0fed4cd2cafadeed8fdf4a74fa084e52d1852e4a2bd0685c315d2830893506040870151925060608701519150600080516020612d638339815191528083600080516020612d63833981519152038508600080516020612d63833981519152848608099050600080516020612d63833981519152828460011b0994149290931491909116949350505050565b8051600090600080516020612d6383398151915211158061034157506020820151600080516020612d6383398151915211155b1561034e57506000919050565b60405163e242cce960e01b8152309063e242cce990610371908590600401612957565b602060405180830381865afa15801561038e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b29190612b1c565b92915050565b60008083806103e25760405162461bcd60e51b81526004016103d990612b3e565b60405180910390fd5b60006103ef826001612b95565b6103fa906006612ba8565b90506000816001600160401b038111156104165761041661269a565b60405190808252806020026020018201604052801561043f578160200160208202803683370190505b50905088600060200201358160008151811061045d5761045d612b06565b602090810291909101015288600160200201358160018151811061048357610483612b06565b602002602001018181525050600080516020612d43833981519152816002815181106104b1576104b1612b06565b602002602001018181525050600080516020612d23833981519152816003815181106104df576104df612b06565b602002602001018181525050600080516020612d838339815191528160048151811061050d5761050d612b06565b602002602001018181525050600080516020612da38339815191528160058151811061053b5761053b612b06565b60200260200101818152505060005b8381101561075a57863582610560836006612ba8565b61056b906006612b95565b8151811061057b5761057b612b06565b602090810291909101015286600160200201358261059a836006612ba8565b6105a5906007612b95565b815181106105b5576105b5612b06565b6020026020010181815250508888828181106105d3576105d3612b06565b9050608002016001600481106105eb576105eb612b06565b6020020135826105fc836006612ba8565b610607906008612b95565b8151811061061757610617612b06565b60200260200101818152505088888281811061063557610635612b06565b90506080020160006004811061064d5761064d612b06565b60200201358261065e836006612ba8565b610669906009612b95565b8151811061067957610679612b06565b60200260200101818152505088888281811061069757610697612b06565b9050608002016003600481106106af576106af612b06565b6020020135826106c0836006612ba8565b6106cb90600a612b95565b815181106106db576106db612b06565b6020026020010181815250508888828181106106f9576106f9612b06565b90506080020160026004811061071157610711612b06565b602002013582610722836006612ba8565b61072d90600b612b95565b8151811061073d5761073d612b06565b60209081029190910101528061075281612bbf565b91505061054a565b50610763612640565b602081602085026020850160085afa945084610789576000809550955050505050610796565b5115159450600193505050505b94509492505050565b6107a761265e565b6040516391ec2d2b60e01b815260009030906391ec2d2b906107cf9087908790600401612bd8565b600060405180830381865afa1580156107ec573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108149190810190612bf9565b9050600080600080601885016001600160c01b0381511693506030860190506001600160c01b038151169450600080516020612d6383398151915285600080516020612d63833981519152600160c01b870908604887015160608801516001600160c01b0390811697501694509250600080516020612d6383398151915290508481600160c01b860908604080518082019091529283526020830152509695505050505050565b60008084806108dc5760405162461bcd60e51b81526004016103d990612b3e565b8084146109495760405162461bcd60e51b815260206004820152603560248201527f424c533a206e756d626572206f66207075626c6963206b65797320616e64206d604482015274195cdcd859d95cc81b5d5cdd08189948195c5d585b605a1b60648201526084016103d9565b6000610956826001612b95565b610961906006612ba8565b90506000816001600160401b0381111561097d5761097d61269a565b6040519080825280602002602001820160405280156109a6578160200160208202803683370190505b5090508960006020020135816000815181106109c4576109c4612b06565b60209081029190910101528960016020020135816001815181106109ea576109ea612b06565b602002602001018181525050600080516020612d4383398151915281600281518110610a1857610a18612b06565b602002602001018181525050600080516020612d2383398151915281600381518110610a4657610a46612b06565b602002602001018181525050600080516020612d8383398151915281600481518110610a7457610a74612b06565b602002602001018181525050600080516020612da383398151915281600581518110610aa257610aa2612b06565b60200260200101818152505060005b83811015610d1657878782818110610acb57610acb612b06565b905060400201600060028110610ae357610ae3612b06565b602002013582610af4836006612ba8565b610aff906006612b95565b81518110610b0f57610b0f612b06565b602002602001018181525050878782818110610b2d57610b2d612b06565b905060400201600160028110610b4557610b45612b06565b602002013582610b56836006612ba8565b610b61906007612b95565b81518110610b7157610b71612b06565b602002602001018181525050898982818110610b8f57610b8f612b06565b905060800201600160048110610ba757610ba7612b06565b602002013582610bb8836006612ba8565b610bc3906008612b95565b81518110610bd357610bd3612b06565b602002602001018181525050898982818110610bf157610bf1612b06565b905060800201600060048110610c0957610c09612b06565b602002013582610c1a836006612ba8565b610c25906009612b95565b81518110610c3557610c35612b06565b602002602001018181525050898982818110610c5357610c53612b06565b905060800201600360048110610c6b57610c6b612b06565b602002013582610c7c836006612ba8565b610c8790600a612b95565b81518110610c9757610c97612b06565b602002602001018181525050898982818110610cb557610cb5612b06565b905060800201600260048110610ccd57610ccd612b06565b602002013582610cde836006612ba8565b610ce990600b612b95565b81518110610cf957610cf9612b06565b602090810291909101015280610d0e81612bbf565b915050610ab1565b50610d1f612640565b602081602085026020850160085afa945084610d45576000809550955050505050610d52565b5115159450600193505050505b9550959350505050565b80516060906000610d6e826020612b95565b610d79906040612b95565b610d84906004612b95565b6001600160401b03811115610d9b57610d9b61269a565b6040519080825280601f01601f191660200182016040528015610dc5576020820181803683370190505b5060408051606080825260808201909252919250600091906020820181803683370190505090506060820160005b84811015610e0d5760208188018101518383015201610df3565b5083016000815360010160608153600101600081536001810187905260210160208153506000600283604051610e439190612c6f565b602060405180830381855afa158015610e60573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610e839190612c8b565b9050600060429450848452816020850152600160408501536041840188905260206061850153600284604051610eb99190612c6f565b602060405180830381855afa158015610ed6573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610ef99190612c8b565b905080602084015280821880602086015250600260408501536041840188905260206061850153600284604051610f309190612c6f565b602060405180830381855afa158015610f4d573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610f709190612c8b565b905080604084015280821880602086015250600360408501536041840188905260206061850153600284604051610fa79190612c6f565b602060405180830381855afa158015610fc4573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610fe79190612c8b565b606084015250909695505050505050565b61100061265e565b604051638669026f60e01b81526000903090638669026f906110289087908790600401612bd8565b6040805180830381865afa158015611044573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110689190612ca4565b805160405163d58e773360e01b81526004810191909152909150600090309063d58e7733906024016040805180830381865afa1580156110ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d09190612ca4565b602083015160405163d58e773360e01b81526004810191909152909150600090309063d58e7733906024016040805180830381865afa158015611117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113b9190612ca4565b905061114561267c565b825181526020808401518282015282516040808401919091529083015160608301526000908460808460066107d05a03fa9050808061118057fe5b50806111c85760405162461bcd60e51b8152602060048201526017602482015276109314ce88189b881859190818d85b1b0819985a5b1959604a1b60448201526064016103d9565b50919695505050505050565b6111dc61265e565b600080516020612d6383398151915282106112455760405162461bcd60e51b815260206004820152602360248201527f6d6170546f506f696e7446543a20696e76616c6964206669656c6420656c656d604482015262195b9d60ea1b60648201526084016103d9565b81600061125182611790565b9150506000600080516020612d638339815191528061127257611272612cf9565b8384099050600080516020612d638339815191526004820890506000600080516020612d6383398151915277b3c4d79d41a91759a9e4c7e359b6b89eaec68e62effffffd850990506000600080516020612d6383398151915283830990506112d9816117b9565b9050600080516020612d638339815191528283099150600080516020612d638339815191528183099150600080516020612d638339815191528286099150600080516020612d6383398151915261133e83600080516020612d63833981519152612d0f565b7759e26bcea0d48bacd4f263f1acdb5c4f5763473177fffffe089450600080516020612d638339815191528586099150600080516020612d638339815191528583099150600080516020612d6383398151915260038308915060006113a283611790565b909350905080156113ea57846113cd576113ca83600080516020612d63833981519152612d0f565b92505b505060408051808201909152938452602084015250909392505050565b600080516020612d638339815191526001870861141590600080516020612d63833981519152612d0f565b9550600080516020612d638339815191528687099250600080516020612d638339815191528684099250600080516020612d6383398151915260038408925061145d83611790565b9093509050801561148557846113cd576113ca83600080516020612d63833981519152612d0f565b600080516020612d638339815191528485099550600080516020612d638339815191528687099550600080516020612d638339815191528287099550600080516020612d638339815191528287099550600080516020612d63833981519152600187089550600080516020612d638339815191528687099250600080516020612d638339815191528684099250600080516020612d6383398151915260038408925061153083611790565b90935090508061158d5760405162461bcd60e51b815260206004820152602260248201527f424c533a20626164206674206d617070696e6720696d706c656d656e7461746960448201526137b760f11b60648201526084016103d9565b846113cd576113ca83600080516020612d63833981519152612d0f565b600081516020830151600080516020612d63833981519152828309600080516020612d638339815191528382099050600080516020612d63833981519152600382089050600080516020612d6383398151915282830914949350505050565b60008060006040518061018001604052808760006002811061162d5761162d612b06565b602002013581526020018760016002811061164a5761164a612b06565b60200201358152602001600080516020612d438339815191528152602001600080516020612d238339815191528152602001600080516020612d838339815191528152602001600080516020612da38339815191528152602001856000600281106116b7576116b7612b06565b60200201358152602001856001600281106116d4576116d4612b06565b60200201358152602001866001600481106116f1576116f1612b06565b602002013581526020018660006004811061170e5761170e612b06565b602002013581526020018660036004811061172b5761172b612b06565b602002013581526020018660026004811061174857611748612b06565b602002013590529050611759612640565b60006020826101808560085afa90508061177c5760008094509450505050611788565b50511515925060019150505b935093915050565b60008061179c836117c4565b915082600080516020612d63833981519152838409149050915091565b60006103b282611ef9565b6000600080516020612d638339815191528083840991508083830981838209828283098385830984848309858484098684850997508684840987858409945087898a09985087898a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087818a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a09985087898a09985087898a09985087898a09985087818a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087898a09985087898a09985087838a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087818a09985050868889099750868889099750868889099750868889099750868889099750868889099750868489099750868889099750868889099750868889099750868889099750868889099750868989099750868889099750868889099750868889099750868889099750868889099750868889099750868989099750868889099750868889099750868889099750868889099750868889099750868689099750868889099750868889099750868889099750868889099750868889099750868889099750868889099750868889099750868889099750868189099750508587880996508587880996508587880996508585880996508587880996508587880996508587880996508585880996508587880996508587880996508587880996508587880996508587880996508587880996508587880996508587880996508583880996508587880996508587880996508587880996508587880996508581880996508587880996508587880996508587880996508587880996508583880996508587880996508587880996508587880996508584880996508587880996508587880996508587880996508587880996508587880996508581880996505050505050808283099392505050565b6000600080516020612d638339815191528083840991508083830981838209828283098385830984848309858484098684850997508684840987858409945087898a09985087898a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087818a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a09985087898a09985087898a09985087898a09985087818a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087898a09985087898a09985087838a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087818a09985050868889099750868889099750868889099750868889099750868889099750868889099750868489099750868889099750868889099750868889099750868889099750868889099750868989099750868889099750868889099750868889099750868889099750868889099750868889099750868989099750868889099750868889099750868889099750868889099750868889099750868689099750868889099750868889099750868889099750868889099750868889099750868889099750868889099750868889099750868889099750868189099750508587880996508587880996508587880996508585880996508587880996508587880996508587880996508585880996508587880996508587880996508587880996508587880996508587880996508587880996508587880996508587880996508583880996508587880996508587880996508587880996508587880996508581880996505050838586099450838586099450838586099450838586099450838186099450508284850993508284850993508284850993508281850993508284850993508284850993508285850993508284850993508284850993508284850993508284850993508284850993508284850993508281850995945050505050565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156126d2576126d261269a565b60405290565b604051601f8201601f191681016001600160401b03811182821017156127005761270061269a565b604052919050565b60006080828403121561271a57600080fd5b82601f83011261272957600080fd5b604051608081018181106001600160401b038211171561274b5761274b61269a565b60405280608084018581111561276057600080fd5b845b8181101561277a578035835260209283019201612762565b509195945050505050565b60006040828403121561279757600080fd5b82601f8301126127a657600080fd5b6127ae6126b0565b8060408401858111156127c057600080fd5b845b818110156127da5780358452602093840193016127c2565b509095945050505050565b80604081018310156103b257600080fd5b60008083601f84011261280857600080fd5b5081356001600160401b0381111561281f57600080fd5b6020830191508360208260071b850101111561283a57600080fd5b9250929050565b60008060008060a0858703121561285757600080fd5b61286186866127e5565b935060408501356001600160401b0381111561287c57600080fd5b612888878288016127f6565b909450925061289c905086606087016127e5565b905092959194509250565b60006001600160401b038211156128c0576128c061269a565b50601f01601f191660200190565b600080604083850312156128e157600080fd5b8235915060208301356001600160401b038111156128fe57600080fd5b8301601f8101851361290f57600080fd5b803561292261291d826128a7565b6126d8565b81815286602083850101111561293757600080fd5b816020840160208301376000602083830101528093505050509250929050565b60408101818360005b600281101561297f578151835260209283019290910190600101612960565b50505092915050565b6000806000806000608086880312156129a057600080fd5b6129aa87876127e5565b945060408601356001600160401b03808211156129c657600080fd5b6129d289838a016127f6565b909650945060608801359150808211156129eb57600080fd5b818801915088601f8301126129ff57600080fd5b813581811115612a0e57600080fd5b8960208260061b8501011115612a2357600080fd5b9699959850939650602001949392505050565b60005b83811015612a51578181015183820152602001612a39565b50506000910152565b60008151808452612a72816020860160208601612a36565b601f01601f19169290920160200192915050565b602081526000612a996020830184612a5a565b9392505050565b600060208284031215612ab257600080fd5b5035919050565b60008060006101008486031215612acf57600080fd5b612ad985856127e5565b925060c0840185811115612aec57600080fd5b604085019250612afc86826127e5565b9150509250925092565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612b2e57600080fd5b81518015158114612a9957600080fd5b60208082526021908201527f424c533a206e756d626572206f66207075626c6963206b6579206973207a65726040820152606f60f81b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b808201808211156103b2576103b2612b7f565b80820281158282048414176103b2576103b2612b7f565b600060018201612bd157612bd1612b7f565b5060010190565b828152604060208201526000612bf16040830184612a5a565b949350505050565b600060208284031215612c0b57600080fd5b81516001600160401b03811115612c2157600080fd5b8201601f81018413612c3257600080fd5b8051612c4061291d826128a7565b818152856020838501011115612c5557600080fd5b612c66826020830160208601612a36565b95945050505050565b60008251612c81818460208701612a36565b9190910192915050565b600060208284031215612c9d57600080fd5b5051919050565b600060408284031215612cb657600080fd5b82601f830112612cc557600080fd5b612ccd6126b0565b806040840185811115612cdf57600080fd5b845b818110156127da578051845260209384019301612ce1565b634e487b7160e01b600052601260045260246000fd5b818103818111156103b2576103b2612b7f56fe1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c230644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47275dc4a288d1afb3cbb1ac09187524c7db36395df7be3b99e673b13a075a65ec1d9befcd05a5323e6da4d435f3b617cdb3af83285c2df711ef39c01571827f9da264697066735822122085f910855a39dd4d2f9582253d737b6f9c450d7d8e7383f636149d598d69b6ac64736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000000103": { + "code": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212209ebefbbe674f8f0780cb158df4fa624dc1694693fcb1c5952691eb2a55c6f0aa64736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000000105": { + "code": "0x608060405234801561001057600080fd5b50600436106100d55760003560e01c8063947287cf11610087578063947287cf14610183578063972398b61461018c57806397e5230d1461019f57806399248ea7146101a9578063b66ceef6146101c2578063c885bc58146101d5578063cf756fdf146101dd578063e0563ab1146101f057600080fd5b806307358b99146100da57806322009af61461010d578063284017f51461011657806331d7a262146101375780633b878c221461015757806351351d53146101605780638a9cd82d1461016e575b600080fd5b6100fa6100e8366004610b1d565b60366020526000908152604090205481565b6040519081526020015b60405180910390f35b6100fa60355481565b61011f61202081565b6040516001600160a01b039091168152602001610104565b6100fa610145366004610b52565b60376020526000908152604090205481565b61011f61101081565b61011f6002600160a01b0381565b61018161017c366004610b74565b6101f9565b005b6100fa61520881565b60345461011f906001600160a01b031681565b6100fa620249f081565b60325461011f906201000090046001600160a01b031681565b60335461011f906001600160a01b031681565b610181610658565b6101816101eb366004610bf3565b61068e565b61011f61203081565b336002600160a01b03146102425760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064015b60405180910390fd5b6000838152603660205260409020541561029e5760405162461bcd60e51b815260206004820152601a60248201527f5245574152445f414c52454144595f44495354524942555445440000000000006044820152606401610239565b603454604051633f490b0560e21b8152600481018590526000916001600160a01b03169063fd242c1490602401602060405180830381865afa1580156102e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030c9190610c3e565b9050806000036103545760405162461bcd60e51b8152602060048201526013602482015272115413d0d217d393d517d0d3d3535255151151606a1b6044820152606401610239565b60345460408051636265600360e01b815290516000926001600160a01b03169163626560039160048083019260209291908290030181865afa15801561039e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c29190610c3e565b905060006103d1826064610c6d565b836035546103df9190610c6d565b6103ea906064610c6d565b6103f49190610c8a565b603454604051630981b24d60e41b8152600481018990529192506000916001600160a01b039091169063981b24d090602401602060405180830381865afa158015610443573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104679190610c3e565b9050846000805b828110156105f857600089898381811061048a5761048a610cac565b9050604002018036038101906104a09190610cc2565b905087816020015111156104f65760405162461bcd60e51b815260206004820152601b60248201527f5349474e45445f424c4f434b535f455843454544535f544f54414c00000000006044820152606401610239565b603454815160405163277166bf60e11b81526001600160a01b039182166004820152602481018e90526000929190911690634ee2cd7e90604401602060405180830381865afa15801561054d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105719190610c3e565b9050600061057f8a88610c6d565b602084015161058e848b610c6d565b6105989190610c6d565b6105a29190610c8a565b83516001600160a01b03166000908152603760205260408120805492935083929091906105d0908490610d27565b909155506105e090508186610d27565b945050505080806105f090610d3a565b91505061046e565b506000898152603660205260409020819055610613816107f1565b887feaf3d57629d9b1ce95715ccd98d6f5bf48023be1d5a06e09f64ab7f6d8be01d58260405161064591815260200190565b60405180910390a2505050505050505050565b3360008181526037602052604081208054919055603254909161068b916201000090046001600160a01b03169083610815565b50565b603254610100900460ff16158080156106ae5750603254600160ff909116105b806106c85750303b1580156106c8575060325460ff166001145b61072b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610239565b6032805460ff19166001179055801561074e576032805461ff0019166101001790555b603280546001600160a01b03808816620100000262010000600160b01b031990921691909117909155603380548683166001600160a01b0319918216179091556034805492861692909116919091179055603582905580156107ea576032805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b60335460325461068b916001600160a01b036201000090920482169116308461087d565b6040516001600160a01b03831660248201526044810182905261087890849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526108bb565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526108b59085906323b872dd60e01b90608401610841565b50505050565b6000610910826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661098d9092919063ffffffff16565b805190915015610878578080602001905181019061092e9190610d53565b6108785760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610239565b606061099c84846000856109a4565b949350505050565b606082471015610a055760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610239565b600080866001600160a01b03168587604051610a219190610d99565b60006040518083038185875af1925050503d8060008114610a5e576040519150601f19603f3d011682016040523d82523d6000602084013e610a63565b606091505b5091509150610a7487838387610a7f565b979650505050505050565b60608315610aee578251600003610ae7576001600160a01b0385163b610ae75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610239565b508161099c565b61099c8383815115610b035781518083602001fd5b8060405162461bcd60e51b81526004016102399190610db5565b600060208284031215610b2f57600080fd5b5035919050565b80356001600160a01b0381168114610b4d57600080fd5b919050565b600060208284031215610b6457600080fd5b610b6d82610b36565b9392505050565b600080600060408486031215610b8957600080fd5b83359250602084013567ffffffffffffffff80821115610ba857600080fd5b818601915086601f830112610bbc57600080fd5b813581811115610bcb57600080fd5b8760208260061b8501011115610be057600080fd5b6020830194508093505050509250925092565b60008060008060808587031215610c0957600080fd5b610c1285610b36565b9350610c2060208601610b36565b9250610c2e60408601610b36565b9396929550929360600135925050565b600060208284031215610c5057600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610c8457610c84610c57565b92915050565b600082610ca757634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060408284031215610cd457600080fd5b6040516040810181811067ffffffffffffffff82111715610d0557634e487b7160e01b600052604160045260246000fd5b604052610d1183610b36565b8152602083013560208201528091505092915050565b80820180821115610c8457610c84610c57565b600060018201610d4c57610d4c610c57565b5060010190565b600060208284031215610d6557600080fd5b81518015158114610b6d57600080fd5b60005b83811015610d90578181015183820152602001610d78565b50506000910152565b60008251610dab818460208701610d75565b9190910192915050565b6020815260008251806020840152610dd4816040850160208701610d75565b601f01601f1916919091016040019291505056fea2646970667358221220c7e8b508ebaffb4eaa11ba374acb0ddc2570f6351d83600979bf1f82d7cec70564736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001001": { + "code": "0x608060405234801561001057600080fd5b50600436106100e05760003560e01c80639017c127116100875780639017c127146101de578063947287cf146101f157806397e5230d146101fa578063ad240c2a14610204578063c59a18f71461020d578063c6df461714610220578063e0563ab114610233578063eb70ef441461023c57600080fd5b8063196f1b2d146100e557806323e281cf1461010b578063284017f5146101145780633b878c221461013557806349ce89971461013e57806350d5b95b1461018857806351351d531461019d578063544c5e0f146101ab575b600080fd5b6100f86100f3366004610e88565b610271565b6040519081526020015b60405180910390f35b6100f860325481565b61011d61202081565b6040516001600160a01b039091168152602001610102565b61011d61101081565b61016d61014c366004610e88565b60356020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610102565b61019b610196366004610eec565b6102f0565b005b61011d6002600160a01b0381565b6101ce6101b9366004610e88565b60346020526000908152604090205460ff1681565b6040519015158152602001610102565b61019b6101ec366004610f5b565b6103b7565b6100f861520881565b6100f8620249f081565b6100f860335481565b6100f861021b366004610e88565b610557565b61019b61022e366004611007565b610578565b61011d61203081565b61024f61024a366004610e88565b61075c565b6040805182518152602080840151908201529181015190820152606001610102565b60008060358161028260368661081f565b81526020810191909152604001600020600201549050806102ea5760405162461bcd60e51b815260206004820152601d60248201527f537461746552656365697665723a204e4f5f524f4f545f464f525f494400000060448201526064015b60405180910390fd5b92915050565b60006102fc823561075c565b805190915061036c906103109084356110a5565b8251602084015161032191906110a5565b61032c9060016110b8565b83604001518787876040516020016103449190611110565b604051602081830303815290604052805190602001206108cc9095949392919063ffffffff16565b6103a85760405162461bcd60e51b815260206004820152600d60248201526c24a72b20a624a22fa82927a7a360991b60448201526064016102e1565b6103b182610a68565b50505050565b8281811461041a5760405162461bcd60e51b815260206004820152602a60248201527f537461746552656365697665723a20554e4d4154434845445f4c454e4754485f604482015269504152414d455445525360b01b60648201526084016102e1565b60005b8181101561054f57600061045485858481811061043c5761043c6111ac565b905060200281019061044e91906111c2565b3561075c565b905060006105088260000151878786818110610472576104726111ac565b905060200281019061048491906111c2565b61048f9190356110a5565b835160208501516104a091906110a5565b6104ab9060016110b8565b84604001518b8b888181106104c2576104c26111ac565b90506020028101906104d491906111e2565b8b8b8a8181106104e6576104e66111ac565b90506020028101906104f891906111c2565b6040516020016103449190611110565b90508061051957505060010161041d565b61054586868581811061052e5761052e6111ac565b905060200281019061054091906111c2565b610a68565b505060010161041d565b505050505050565b6036818154811061056757600080fd5b600091825260209091200154905081565b336002600160a01b03146105bc5760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064016102e1565b6033546105ca9060016110b8565b85351461060c5760405162461bcd60e51b815260206004820152601060248201526f1253959053125117d4d510549517d25160821b60448201526064016102e1565b8435602086013510156106525760405162461bcd60e51b815260206004820152600e60248201526d1253959053125117d1539117d25160921b60448201526064016102e1565b60408051863560208083019190915287013581830152908601356060820152610697906080016040516020818303038152906040528051906020012085858585610c83565b603280548691603591600091826106ad8361122b565b90915550815260208082019290925260409081016000208335815591830135600183015582013560028201555050603680546001810182556000919091526020868101357f4a11f94e20a93c79f6ec743a1954ec4fc2c08429ae2122118bf234b2185c81b89092018290556033829055604080519088013581528735917f11efd893530b26afc66d488ff54cb15df117cb6e0e4a08c6dcb166d766c3bf3b910160405180910390a35050505050565b604080516060810182526000808252602082018190529181018290529061078460368461081f565b60365490915081036107e45760405162461bcd60e51b815260206004820152602360248201527f537461746552656365697665723a204e4f5f434f4d4d49544d454e545f464f5260448201526217d25160ea1b60648201526084016102e1565b600090815260356020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915292915050565b81546000908103610832575060006102ea565b82546000905b8082101561087f57600061084c8383610d87565b6000878152602090209091508590820154111561086b57809150610879565b6108768160016110b8565b92505b50610838565b6000821180156108ab5750836108a88661089a6001866110a5565b600091825260209091200190565b54145b156108c4576108bb6001836110a5565b925050506102ea565b509392505050565b6000816108da866001610da9565b811461091f5760405162461bcd60e51b81526020600482015260146024820152730929cac82989288bea0a49e9e8cbe988a9c8ea8960631b60448201526064016102e1565b8587106109635760405162461bcd60e51b81526020600482015260126024820152710929cac82989288be988a828cbe929c888ab60731b60448201526064016102e1565b8761099f5760405162461bcd60e51b815260206004820152600c60248201526b24a72b20a624a22fa622a0a360a11b60448201526064016102e1565b8760005b82811015610a595760008686838181106109bf576109bf6111ac565b90506020020135905060028a6109d5919061125a565b600003610a0d576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250610a3a565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b610a4560028b61126e565b99505080610a529061122b565b90506109a3565b50909414979650505050505050565b803560009081526034602052604090205460ff1615610ad85760405162461bcd60e51b815260206004820152602660248201527f537461746552656365697665723a2053544154455f53594e435f49535f50524f60448201526510d154d4d15160d21b60648201526084016102e1565b610ae86060820160408301611282565b6001600160a01b03163b600003610b3c576040805160208082526000908201819052918335917f31c652130602f3ce96ceaf8a4c2b8b49f049166c6fcf2eb31943a75ec7c936ae910160405180910390a350565b8035600090815260346020526040808220805460ff191660011790558190610b6a9060608501908501611282565b6001600160a01b03168335610b856040860160208701611282565b610b92606087018761129d565b604051602401610ba594939291906112e3565b60408051601f198184030181529181526020820180516001600160e01b031663eeb4994560e01b17905251610bda919061133c565b6000604051808303816000865af19150503d8060008114610c17576040519150601f19603f3d011682016040523d82523d6000602084013e610c1c565b606091505b509150915081610c3f5782356000908152603460205260409020805460ff191690555b81151583600001357f31c652130602f3ce96ceaf8a4c2b8b49f049166c6fcf2eb31943a75ec7c936ae83604051610c76919061134e565b60405180910390a3505050565b6000806120306001600160a01b0316620249f08888888888604051602001610caf959493929190611381565b60408051601f1981840301815290829052610cc99161133c565b6000604051808303818686fa925050503d8060008114610d05576040519150601f19603f3d011682016040523d82523d6000602084013e610d0a565b606091505b5091509150600081806020019051810190610d2591906113ba565b9050828015610d315750805b610d7d5760405162461bcd60e51b815260206004820152601d60248201527f5349474e41545552455f564552494649434154494f4e5f4641494c454400000060448201526064016102e1565b5050505050505050565b6000610d96600284841861126e565b610da2908484166110b8565b9392505050565b600080610db584610df4565b90506001836002811115610dcb57610dcb6113dc565b148015610ddb575083816001901b105b610de6576000610de9565b60015b60ff16019392505050565b600080608083901c15610e0957608092831c92015b604083901c15610e1b57604092831c92015b602083901c15610e2d57602092831c92015b601083901c15610e3f57601092831c92015b600883901c15610e5157600892831c92015b600483901c15610e6357600492831c92015b600283901c15610e7557600292831c92015b600183901c156102ea5760010192915050565b600060208284031215610e9a57600080fd5b5035919050565b60008083601f840112610eb357600080fd5b5081356001600160401b03811115610eca57600080fd5b6020830191508360208260051b8501011115610ee557600080fd5b9250929050565b600080600060408486031215610f0157600080fd5b83356001600160401b0380821115610f1857600080fd5b610f2487838801610ea1565b90955093506020860135915080821115610f3d57600080fd5b50840160808187031215610f5057600080fd5b809150509250925092565b60008060008060408587031215610f7157600080fd5b84356001600160401b0380821115610f8857600080fd5b610f9488838901610ea1565b90965094506020870135915080821115610fad57600080fd5b50610fba87828801610ea1565b95989497509550505050565b60008083601f840112610fd857600080fd5b5081356001600160401b03811115610fef57600080fd5b602083019150836020828501011115610ee557600080fd5b600080600080600085870360a081121561102057600080fd5b606081121561102e57600080fd5b5085945060608601356001600160401b038082111561104c57600080fd5b61105889838a01610fc6565b9096509450608088013591508082111561107157600080fd5b5061107e88828901610fc6565b969995985093965092949392505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156102ea576102ea61108f565b808201808211156102ea576102ea61108f565b80356001600160a01b03811681146110e257600080fd5b919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208152813560208201526000611129602084016110cb565b60018060a01b03808216604085015280611145604087016110cb565b16606085015250506060830135601e1984360301811261116457600080fd5b83016020810190356001600160401b0381111561118057600080fd5b80360382131561118f57600080fd5b6080808501526111a360a0850182846110e7565b95945050505050565b634e487b7160e01b600052603260045260246000fd5b60008235607e198336030181126111d857600080fd5b9190910192915050565b6000808335601e198436030181126111f957600080fd5b8301803591506001600160401b0382111561121357600080fd5b6020019150600581901b3603821315610ee557600080fd5b60006001820161123d5761123d61108f565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261126957611269611244565b500690565b60008261127d5761127d611244565b500490565b60006020828403121561129457600080fd5b610da2826110cb565b6000808335601e198436030181126112b457600080fd5b8301803591506001600160401b038211156112ce57600080fd5b602001915036819003821315610ee557600080fd5b8481526001600160a01b038416602082015260606040820181905260009061130e90830184866110e7565b9695505050505050565b60005b8381101561133357818101518382015260200161131b565b50506000910152565b600082516111d8818460208701611318565b602081526000825180602084015261136d816040850160208701611318565b601f01601f19169190910160400192915050565b85815260606020820152600061139b6060830186886110e7565b82810360408401526113ae8185876110e7565b98975050505050505050565b6000602082840312156113cc57600080fd5b81518015158114610da257600080fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220f4843af5244f1ef6b01f5d8fdd49e8f0e76508652a929df5979a03cb0156a6e864736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001002": { + "code": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806316f198311461004657806361bc221a1461005b578063a6f9885c14610076575b600080fd5b61005961005436600461017a565b61007f565b005b61006460005481565b60405190815260200160405180910390f35b61006461080081565b6001600160a01b0383166100cd5760405162461bcd60e51b815260206004820152601060248201526f24a72b20a624a22fa922a1a2a4ab22a960811b60448201526064015b60405180910390fd5b6108008111156101145760405162461bcd60e51b815260206004820152601260248201527108ab0868a8a88a6be9a82b0be988a9c8ea8960731b60448201526064016100c4565b826001600160a01b0316336001600160a01b031660008081546101369061020b565b9190508190557fedaf3c471ebd67d60c29efe34b639ede7d6a1d92eaeb3f503e784971e67118a5858560405161016d929190610232565b60405180910390a4505050565b60008060006040848603121561018f57600080fd5b83356001600160a01b03811681146101a657600080fd5b9250602084013567ffffffffffffffff808211156101c357600080fd5b818601915086601f8301126101d757600080fd5b8135818111156101e657600080fd5b8760208285010111156101f857600080fd5b6020830194508093505050509250925092565b60006001820161022b57634e487b7160e01b600052601160045260246000fd5b5060010190565b60208152816020820152818360408301376000818301604090810191909152601f909201601f1916010191905056fea26469706673582212207637618450354edc5d98998425a0a6500ada60d0a9d2cdc5b2045e291fd737f264736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001003": { + "code": "0x608060405234801561001057600080fd5b50600436106101215760003560e01c806340c10f19116100ad578063a457c2d711610071578063a457c2d71461028b578063a9059cbb1461029e578063dd62ed3e146102b1578063e6198705146102c4578063f6d2ee86146102d557600080fd5b806340c10f191461021f57806370a082311461023257806395d89b411461025b5780639b77ef11146102635780639dc29fac1461027857600080fd5b80631f2d0065116100f45780631f2d00651461018c57806323b872dd146101b15780632d0335ab146101c4578063313ce567146101ed578063395093511461020c57600080fd5b806306fdde0314610126578063095ea7b3146101445780630c53c51c1461016757806318160ddd1461017a575b600080fd5b61012e6102e8565b60405161013b91906113b6565b60405180910390f35b6101576101523660046113ec565b61037a565b604051901515815260200161013b565b61012e610175366004611470565b61039e565b603c545b60405190815260200161013b565b606d546001600160a01b03165b6040516001600160a01b03909116815260200161013b565b6101576101bf3660046114e6565b610681565b61017e6101d2366004611522565b6001600160a01b031660009081526006602052604090205490565b606d54600160a01b900460ff1660405160ff909116815260200161013b565b61015761021a3660046113ec565b6106af565b61015761022d3660046113ec565b6106db565b61017e610240366004611522565b6001600160a01b03166000908152603a602052604090205490565b61012e61071b565b61027661027136600461153d565b61072a565b005b6101576102863660046113ec565b610751565b6101576102993660046113ec565b610788565b6101576102ac3660046113ec565b61080e565b61017e6102bf366004611556565b610826565b606c546001600160a01b0316610199565b6102766102e3366004611589565b610851565b6060603d80546102f79061160d565b80601f01602080910402602001604051908101604052809291908181526020018280546103239061160d565b80156103705780601f1061034557610100808354040283529160200191610370565b820191906000526020600020905b81548152906001019060200180831161035357829003601f168201915b5050505050905090565b600080610385610ad1565b9050610392818585610ae0565b60019150505b92915050565b606060006103e187878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610c0592505050565b90506001600160e01b031960003581169082160361046c5760405162461bcd60e51b815260206004820152603d60248201527f66756e6374696f6e5369676e61747572652063616e206e6f74206265206f662060448201527f657865637574654d6574615472616e73616374696f6e206d6574686f6400000060648201526084015b60405180910390fd5b604080516060810182526001600160a01b038a16600081815260066020908152848220548452808401929092528351601f8b0183900483028101830185528a815290938301918b908b9081908401838280828437600092019190915250505091525090506104dd8982888888610c20565b6105335760405162461bcd60e51b815260206004820152602160248201527f5369676e657220616e64207369676e617475726520646f206e6f74206d6174636044820152600d60fb1b6064820152608401610463565b600660008a6001600160a01b03166001600160a01b031681526020019081526020016000206000815460010191905081905550600080306001600160a01b03168a8a8d60405160200161058893929190611647565b60408051601f19818403018152908290526105a29161166d565b6000604051808303816000865af19150503d80600081146105df576040519150601f19603f3d011682016040523d82523d6000602084013e6105e4565b606091505b5091509150816106365760405162461bcd60e51b815260206004820152601c60248201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c000000006044820152606401610463565b7f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b8b338c8c60405161066b9493929190611689565b60405180910390a19a9950505050505050505050565b60008061068c610ad1565b9050610699858285610cfc565b6106a4858585610d76565b506001949350505050565b6000806106ba610ad1565b90506103928185856106cc8589610826565b6106d691906116d5565b610ae0565b606c546000906001600160a01b031633146107085760405162461bcd60e51b8152600401610463906116f6565b6107128383610f0f565b50600192915050565b6060603e80546102f79061160d565b33600090815260066020526040812080548392906107499084906116d5565b909155505050565b606c546000906001600160a01b0316331461077e5760405162461bcd60e51b8152600401610463906116f6565b6107128383610fbf565b600080610793610ad1565b905060006107a18286610826565b9050838110156108015760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610463565b6106a48286868403610ae0565b600080610819610ad1565b9050610392818585610d76565b6001600160a01b039182166000908152603b6020908152604080832093909416825291909152205490565b600754610100900460ff16158080156108715750600754600160ff909116105b8061088b5750303b15801561088b575060075460ff166001145b6108ee5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610463565b6007805460ff191660011790558015610911576007805461ff0019166101001790555b6001600160a01b0387161580159061092857508415155b801561093357508215155b61097f5760405162461bcd60e51b815260206004820152601e60248201527f4368696c6445524332303a204241445f494e495449414c495a4154494f4e00006044820152606401610463565b606d805460ff8416600160a01b026001600160a81b03199091166001600160a01b038a1617179055606c80546001600160a01b03191633179055604080516020601f8801819004810282018101909252868152610a2a91889088908190840183828082843760009201919091525050604080516020601f8a0181900481028201810190925288815292508891508790819084018382808284376000920191909152506110de92505050565b610a8286868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040805180820190915260018152603160f81b6020820152915061110f9050565b8015610ac8576007805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b6000610adb61117b565b905090565b6001600160a01b038316610b425760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610463565b6001600160a01b038216610ba35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610463565b6001600160a01b038381166000818152603b602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60008151600003610c1857506000919050565b506020015190565b6000806001610c36610c31886111d7565b611254565b6040805160008152602081018083529290925260ff861690820152606081018790526080810186905260a0016020604051602081039080840390855afa158015610c84573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610cdb5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401610463565b866001600160a01b0316816001600160a01b03161491505095945050505050565b6000610d088484610826565b90506000198114610d705781811015610d635760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610463565b610d708484848403610ae0565b50505050565b6001600160a01b038316610dda5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610463565b6001600160a01b038216610e3c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610463565b6001600160a01b0383166000908152603a602052604090205481811015610eb45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610463565b6001600160a01b038085166000818152603a602052604080822086860390559286168082529083902080548601905591516000805160206118ec83398151915290610f029086815260200190565b60405180910390a3610d70565b6001600160a01b038216610f655760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610463565b80603c6000828254610f7791906116d5565b90915550506001600160a01b0382166000818152603a60209081526040808320805486019055518481526000805160206118ec833981519152910160405180910390a35b5050565b6001600160a01b03821661101f5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610463565b6001600160a01b0382166000908152603a6020526040902054818110156110935760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610463565b6001600160a01b0383166000818152603a602090815260408083208686039055603c80548790039055518581529192916000805160206118ec8339815191529101610bf8565b505050565b600754610100900460ff166111055760405162461bcd60e51b815260040161046390611739565b610fbb82826112a2565b815160208084019190912082519183019190912060038290556004819055466001557f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61115d8184846112e2565b600055600280546001600160a01b0319163017905560055550505050565b60003033036111d157600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b031691506111d49050565b50335b90565b60006040518060800160405280604381526020016118a96043913980516020918201208351848301516040808701518051908601209051611237950193845260208401929092526001600160a01b03166040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b600061039861126161132b565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600754610100900460ff166112c95760405162461bcd60e51b815260040161046390611739565b603d6112d583826117e8565b50603e6110d982826117e8565b6040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6002546000906001600160a01b031630148015611349575060015446145b15611355575060005490565b610adb6005546003546004546112e2565b60005b83811015611381578181015183820152602001611369565b50506000910152565b600081518084526113a2816020860160208601611366565b601f01601f19169290920160200192915050565b6020815260006113c9602083018461138a565b9392505050565b80356001600160a01b03811681146113e757600080fd5b919050565b600080604083850312156113ff57600080fd5b611408836113d0565b946020939093013593505050565b60008083601f84011261142857600080fd5b50813567ffffffffffffffff81111561144057600080fd5b60208301915083602082850101111561145857600080fd5b9250929050565b803560ff811681146113e757600080fd5b60008060008060008060a0878903121561148957600080fd5b611492876113d0565b9550602087013567ffffffffffffffff8111156114ae57600080fd5b6114ba89828a01611416565b90965094505060408701359250606087013591506114da6080880161145f565b90509295509295509295565b6000806000606084860312156114fb57600080fd5b611504846113d0565b9250611512602085016113d0565b9150604084013590509250925092565b60006020828403121561153457600080fd5b6113c9826113d0565b60006020828403121561154f57600080fd5b5035919050565b6000806040838503121561156957600080fd5b611572836113d0565b9150611580602084016113d0565b90509250929050565b600080600080600080608087890312156115a257600080fd5b6115ab876113d0565b9550602087013567ffffffffffffffff808211156115c857600080fd5b6115d48a838b01611416565b909750955060408901359150808211156115ed57600080fd5b506115fa89828a01611416565b90945092506114da90506060880161145f565b600181811c9082168061162157607f821691505b60208210810361164157634e487b7160e01b600052602260045260246000fd5b50919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b6000825161167f818460208701611366565b9190910192915050565b6001600160a01b0385811682528416602082015260606040820181905281018290526000828460808401376000608084840101526080601f19601f850116830101905095945050505050565b8082018082111561039857634e487b7160e01b600052601160045260246000fd5b60208082526023908201527f4368696c6445524332303a204f6e6c79207072656469636174652063616e2063604082015262185b1b60ea1b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b601f8211156110d957600081815260208120601f850160051c810160208610156117c15750805b601f850160051c820191505b818110156117e0578281556001016117cd565b505050505050565b815167ffffffffffffffff81111561180257611802611784565b61181681611810845461160d565b8461179a565b602080601f83116001811461184b57600084156118335750858301515b600019600386901b1c1916600185901b1785556117e0565b600085815260208120601f198616915b8281101561187a5788860151825594840194600190910190840161185b565b50858210156118985787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fe4d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e617475726529ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122061cd8aae15b13c732c17323e6cfe2f585db1ab74b2c3384cbb12626088d7caa964736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001004": { + "code": "0x608060405234801561001057600080fd5b50600436106101165760003560e01c806397e5230d116100a2578063d41f177111610071578063d41f17711461023d578063e0563ab114610264578063eeb499451461026d578063f3fef3a314610280578063f64512551461029357600080fd5b806397e5230d146101e6578063b1768065146101f0578063b68ad1e414610217578063c3b35a7e1461022a57600080fd5b80633b878c22116100e95780633b878c221461017c57806351351d531461018557806371cf93b7146101935780637efab4f5146101a6578063947287cf146101cf57600080fd5b806305dc2e8f1461011b5780631459457a1461014b5780631bc114ba14610160578063284017f514610173575b600080fd5b60345461012e906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61015e610159366004610f98565b6102ba565b005b60335461012e906001600160a01b031681565b61012e61202081565b61012e61101081565b61012e6002600160a01b0381565b60355461012e906001600160a01b031681565b61012e6101b4366004611009565b6037602052600090815260409020546001600160a01b031681565b6101d861520881565b604051908152602001610142565b6101d8620249f081565b6101d87f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b60365461012e906001600160a01b031681565b61015e61023836600461102d565b61055a565b6101d87f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b61012e61203081565b61015e61027b36600461106e565b61056a565b61015e61028e3660046110f7565b61073e565b6101d87f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b336002600160a01b03146103035760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064015b60405180910390fd5b600054610100900460ff16158080156103235750600054600160ff909116105b8061033d5750303b15801561033d575060005460ff166001145b6103a05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016102fa565b6000805460ff1916600117905580156103c3576000805461ff0019166101001790555b6001600160a01b038616158015906103e357506001600160a01b03851615155b80156103f757506001600160a01b03841615155b801561040b57506001600160a01b03831615155b6104675760405162461bcd60e51b815260206004820152602760248201527f4368696c6445524332305072656469636174653a204241445f494e495449414c60448201526624ad20aa24a7a760c91b60648201526084016102fa565b603380546001600160a01b03199081166001600160a01b03898116919091179092556034805482168884161790556035805482168784161790556036805490911685831617905582161561050c576001600160a01b03821660008181526037602052604080822080546001600160a01b03191661101090811790915590519092917f46bd56f98e1b14fd35691959270a6e1edf7cb8fcd489e0f9dda89e46c0d1ff0d91a35b8015610552576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b61056583838361074d565b505050565b6034546001600160a01b031633146105d55760405162461bcd60e51b815260206004820152602860248201527f4368696c6445524332305072656469636174653a204f4e4c595f53544154455f6044820152672922a1a2a4ab22a960c11b60648201526084016102fa565b6035546001600160a01b038481169116146106435760405162461bcd60e51b815260206004820152602860248201527f4368696c6445524332305072656469636174653a204f4e4c595f524f4f545f50604482015267524544494341544560c01b60648201526084016102fa565b7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f821610672602060008486611123565b61067b9161114d565b0361069a576106956106908260208186611123565b610ac3565b610738565b7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad6106c9602060008486611123565b6106d29161114d565b036106e1576106958282610d6e565b60405162461bcd60e51b815260206004820152602660248201527f4368696c6445524332305072656469636174653a20494e56414c49445f5349476044820152654e415455524560d01b60648201526084016102fa565b50505050565b61074982338361074d565b5050565b826001600160a01b03163b6000036107b15760405162461bcd60e51b815260206004820152602160248201527f4368696c6445524332305072656469636174653a204e4f545f434f4e545241436044820152601560fa1b60648201526084016102fa565b6000836001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610815919061116b565b6001600160a01b038181166000908152603760205260409020549192508581169116146108545760405162461bcd60e51b81526004016102fa90611188565b6001600160a01b03811661086a5761086a6111cb565b306001600160a01b0316846001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d6919061116b565b6001600160a01b0316146108ec576108ec6111cb565b604051632770a7eb60e21b81526001600160a01b03851690639dc29fac9061091a90339086906004016111e1565b6020604051808303816000875af1158015610939573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095d91906111fa565b6109a95760405162461bcd60e51b815260206004820181905260248201527f4368696c6445524332305072656469636174653a204255524e5f4641494c454460448201526064016102fa565b603354603554604080517f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286960208201526001600160a01b0385811682840152336060830152878116608083015260a08083018890528351808403909101815260c08301938490526316f1983160e01b909352938416936316f1983193610a349391169160c401611262565b600060405180830381600087803b158015610a4e57600080fd5b505af1158015610a62573d6000803e3d6000fd5b50505050826001600160a01b0316846001600160a01b0316826001600160a01b03167fa0923f060a16fc784558d43de424ffde7b01643de5e5d335851b9df94c76bb273386604051610ab59291906111e1565b60405180910390a450505050565b6000808080610ad48587018761128e565b6001600160a01b0380851660009081526037602052604090205494985092965090945092501680610b175760405162461bcd60e51b81526004016102fa90611188565b806001600160a01b03163b600003610b3157610b316111cb565b6000816001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b95919061116b565b9050856001600160a01b0316816001600160a01b031614610bb857610bb86111cb565b6001600160a01b038116610bce57610bce6111cb565b306001600160a01b0316826001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3a919061116b565b6001600160a01b031614610c5057610c506111cb565b6040516340c10f1960e01b81526001600160a01b038316906340c10f1990610c7e90879087906004016111e1565b6020604051808303816000875af1158015610c9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc191906111fa565b610d0d5760405162461bcd60e51b815260206004820181905260248201527f4368696c6445524332305072656469636174653a204d494e545f4641494c454460448201526064016102fa565b836001600160a01b0316826001600160a01b0316876001600160a01b03167fdf34f3a3ed8bedc14a4b284ebaee5374d55b64bac6a84c270dabe8fd6b4cdafd8887604051610d5c9291906111e1565b60405180910390a45050505050505050565b6000808080610d7f85870187611382565b92975090955093509150506001600160a01b038416610da057610da06111cb565b6001600160a01b038481166000908152603760205260409020541615610dc857610dc86111cb565b6036546040516bffffffffffffffffffffffff19606087901b166020820152600091610e18916001600160a01b039091169060340160405160208183030381529060405280519060200120610ee3565b6001600160a01b038681166000908152603760205260409081902080546001600160a01b031916928416928317905551637b69774360e11b81529192509063f6d2ee8690610e7090889088908890889060040161140f565b600060405180830381600087803b158015610e8a57600080fd5b505af1158015610e9e573d6000803e3d6000fd5b50506040516001600160a01b038085169350881691507f46bd56f98e1b14fd35691959270a6e1edf7cb8fcd489e0f9dda89e46c0d1ff0d90600090a350505050505050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b038116610f7a5760405162461bcd60e51b8152602060048201526017602482015276115490cc4c4d8dce8818dc99585d194c8819985a5b1959604a1b60448201526064016102fa565b92915050565b6001600160a01b0381168114610f9557600080fd5b50565b600080600080600060a08688031215610fb057600080fd5b8535610fbb81610f80565b94506020860135610fcb81610f80565b93506040860135610fdb81610f80565b92506060860135610feb81610f80565b91506080860135610ffb81610f80565b809150509295509295909350565b60006020828403121561101b57600080fd5b813561102681610f80565b9392505050565b60008060006060848603121561104257600080fd5b833561104d81610f80565b9250602084013561105d81610f80565b929592945050506040919091013590565b6000806000806060858703121561108457600080fd5b84359350602085013561109681610f80565b9250604085013567ffffffffffffffff808211156110b357600080fd5b818701915087601f8301126110c757600080fd5b8135818111156110d657600080fd5b8860208285010111156110e857600080fd5b95989497505060200194505050565b6000806040838503121561110a57600080fd5b823561111581610f80565b946020939093013593505050565b6000808585111561113357600080fd5b8386111561114057600080fd5b5050820193919092039150565b80356020831015610f7a57600019602084900360031b1b1692915050565b60006020828403121561117d57600080fd5b815161102681610f80565b60208082526023908201527f4368696c6445524332305072656469636174653a20554e4d41505045445f544f60408201526225a2a760e91b606082015260800190565b634e487b7160e01b600052600160045260246000fd5b6001600160a01b03929092168252602082015260400190565b60006020828403121561120c57600080fd5b8151801515811461102657600080fd5b6000815180845260005b8181101561124257602081850181015186830182015201611226565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b03831681526040602082018190526000906112869083018461121c565b949350505050565b600080600080608085870312156112a457600080fd5b84356112af81610f80565b935060208501356112bf81610f80565b925060408501356112cf81610f80565b9396929550929360600135925050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261130657600080fd5b813567ffffffffffffffff80821115611321576113216112df565b604051601f8301601f19908116603f01168101908282118183101715611349576113496112df565b8160405283815286602085880101111561136257600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080600060a0868803121561139a57600080fd5b8535945060208601356113ac81610f80565b9350604086013567ffffffffffffffff808211156113c957600080fd5b6113d589838a016112f5565b945060608801359150808211156113eb57600080fd5b506113f8888289016112f5565b925050608086013560ff81168114610ffb57600080fd5b6001600160a01b03851681526080602082018190526000906114339083018661121c565b8281036040840152611445818661121c565b91505060ff831660608301529594505050505056fea2646970667358221220040c22d73fe8215d2218893f5a7f6ab5ca23133aaf1f7ef7a037b72f1d8fea6d64736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001005": { + "code": "0x608060405234801561001057600080fd5b506004361061014d5760003560e01c806370a08231116100c3578063a22cb4651161007c578063a22cb465146102dd578063b2dc5dc3146102f0578063b88d4fde14610303578063c87b56dd14610316578063e619870514610329578063e985e9c51461033a57600080fd5b806370a08231146102765780637c88e3d914610289578063906571471461029c57806395d89b41146102af5780639b77ef11146102b75780639dc29fac146102ca57600080fd5b80631f2d0065116101155780631f2d0065146101e257806323b872dd146101f35780632d0335ab1461020657806340c10f191461023d57806342842e0e146102505780636352211e1461026357600080fd5b806301ffc9a71461015257806306fdde031461017a578063081812fc1461018f578063095ea7b3146101ba5780630c53c51c146101cf575b600080fd5b610165610160366004611a8c565b61034d565b60405190151581526020015b60405180910390f35b61018261039f565b6040516101719190611af9565b6101a261019d366004611b0c565b610431565b6040516001600160a01b039091168152602001610171565b6101cd6101c8366004611b41565b610458565b005b6101826101dd366004611bb3565b610584565b609f546001600160a01b03166101a2565b6101cd610201366004611c32565b610862565b61022f610214366004611c6e565b6001600160a01b031660009081526006602052604090205490565b604051908152602001610171565b61016561024b366004611b41565b61089a565b6101cd61025e366004611c32565b6108da565b6101a2610271366004611b0c565b6108f5565b61022f610284366004611c6e565b61092a565b610165610297366004611ccd565b6109b0565b6101cd6102aa366004611d38565b610a97565b610182610d05565b6101cd6102c5366004611b0c565b610d14565b6101656102d8366004611b41565b610d3b565b6101cd6102eb366004611db8565b610daa565b6101656102fe366004611df4565b610dc0565b6101cd610311366004611e5c565b610e6d565b610182610324366004611b0c565b610eac565b609e546001600160a01b03166101a2565b610165610348366004611f37565b610f20565b60006001600160e01b031982166380ac58cd60e01b148061037e57506001600160e01b03198216635b5e139f60e01b145b8061039957506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060606c80546103ae90611f6a565b80601f01602080910402602001604051908101604052809291908181526020018280546103da90611f6a565b80156104275780601f106103fc57610100808354040283529160200191610427565b820191906000526020600020905b81548152906001019060200180831161040a57829003601f168201915b5050505050905090565b600061043c82610f4e565b506000908152607060205260409020546001600160a01b031690565b6000610463826108f5565b9050806001600160a01b0316836001600160a01b0316036104d55760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b806001600160a01b03166104e7610f76565b6001600160a01b03161480610503575061050381610348610f76565b6105755760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016104cc565b61057f8383610f85565b505050565b606060006105c787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ff392505050565b90506001600160e01b031960003581169082160361064d5760405162461bcd60e51b815260206004820152603d60248201527f66756e6374696f6e5369676e61747572652063616e206e6f74206265206f662060448201527f657865637574654d6574615472616e73616374696f6e206d6574686f6400000060648201526084016104cc565b604080516060810182526001600160a01b038a16600081815260066020908152848220548452808401929092528351601f8b0183900483028101830185528a815290938301918b908b9081908401838280828437600092019190915250505091525090506106be898288888861100e565b6107145760405162461bcd60e51b815260206004820152602160248201527f5369676e657220616e64207369676e617475726520646f206e6f74206d6174636044820152600d60fb1b60648201526084016104cc565b600660008a6001600160a01b03166001600160a01b031681526020019081526020016000206000815460010191905081905550600080306001600160a01b03168a8a8d60405160200161076993929190611fa4565b60408051601f198184030181529082905261078391611fca565b6000604051808303816000865af19150503d80600081146107c0576040519150601f19603f3d011682016040523d82523d6000602084013e6107c5565b606091505b5091509150816108175760405162461bcd60e51b815260206004820152601c60248201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c0000000060448201526064016104cc565b7f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b8b338c8c60405161084c9493929190611fe6565b60405180910390a19a9950505050505050505050565b61087361086d610f76565b826110ea565b61088f5760405162461bcd60e51b81526004016104cc90612032565b61057f838383611148565b609e546000906001600160a01b031633146108c75760405162461bcd60e51b81526004016104cc9061207f565b6108d1838361129a565b50600192915050565b61057f83838360405180602001604052806000815250610e6d565b6000818152606e60205260408120546001600160a01b0316806103995760405162461bcd60e51b81526004016104cc906120c3565b60006001600160a01b0382166109945760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016104cc565b506001600160a01b03166000908152606f602052604090205490565b609e546000906001600160a01b031633146109dd5760405162461bcd60e51b81526004016104cc9061207f565b83828114610a2d5760405162461bcd60e51b815260206004820152601f60248201527f4368696c644552433732313a204172726179206c656e206d69736d617463680060448201526064016104cc565b60005b81811015610a8857610a80878783818110610a4d57610a4d6120f5565b9050602002016020810190610a629190611c6e565b868684818110610a7457610a746120f5565b9050602002013561129a565b600101610a30565b5060019150505b949350505050565b600754610100900460ff1615808015610ab75750600754600160ff909116105b80610ad15750303b158015610ad1575060075460ff166001145b610b345760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104cc565b6007805460ff191660011790558015610b57576007805461ff0019166101001790555b6001600160a01b03861615801590610b6e57508315155b8015610b7957508115155b610bc55760405162461bcd60e51b815260206004820152601f60248201527f4368696c644552433732313a2042616420696e697469616c697a6174696f6e0060448201526064016104cc565b609f80546001600160a01b0388166001600160a01b031991821617909155609e805490911633179055604080516020601f8701819004810282018101909252858152610c5f91879087908190840183828082843760009201919091525050604080516020601f890181900481028201810190925287815292508791508690819084018382808284376000920191909152506112b492505050565b610cb785858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040805180820190915260018152603160f81b602082015291506112e59050565b8015610cfd576007805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6060606d80546103ae90611f6a565b3360009081526006602052604081208054839290610d3390849061210b565b909155505050565b609e546000906001600160a01b03163314610d685760405162461bcd60e51b81526004016104cc9061207f565b610d71826108f5565b6001600160a01b0316836001600160a01b031614610da15760405162461bcd60e51b81526004016104cc9061212c565b6108d182611351565b610dbc610db5610f76565b83836113d4565b5050565b609e546000906001600160a01b03163314610ded5760405162461bcd60e51b81526004016104cc9061207f565b8160005b81811015610e61576000858583818110610e0d57610e0d6120f5565b905060200201359050610e1f816108f5565b6001600160a01b0316876001600160a01b031614610e4f5760405162461bcd60e51b81526004016104cc9061212c565b610e5881611351565b50600101610df1565b50600195945050505050565b610e7e610e78610f76565b836110ea565b610e9a5760405162461bcd60e51b81526004016104cc90612032565b610ea68484848461149e565b50505050565b6060610eb782610f4e565b6000610ece60408051602081019091526000815290565b90506000815111610eee5760405180602001604052806000815250610f19565b80610ef8846114d1565b604051602001610f09929190612161565b6040516020818303038152906040525b9392505050565b6001600160a01b03918216600090815260716020908152604080832093909416825291909152205460ff1690565b610f5781611563565b610f735760405162461bcd60e51b81526004016104cc906120c3565b50565b6000610f80611580565b905090565b600081815260706020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610fba826108f5565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000815160000361100657506000919050565b506020015190565b600080600161102461101f886115dc565b611659565b6040805160008152602081018083529290925260ff861690820152606081018790526080810186905260a0016020604051602081039080840390855afa158015611072573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166110c95760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b60448201526064016104cc565b866001600160a01b0316816001600160a01b03161491505095945050505050565b6000806110f6836108f5565b9050806001600160a01b0316846001600160a01b0316148061111d575061111d8185610f20565b80610a8f5750836001600160a01b031661113684610431565b6001600160a01b031614949350505050565b826001600160a01b031661115b826108f5565b6001600160a01b0316146111815760405162461bcd60e51b81526004016104cc90612190565b6001600160a01b0382166111e35760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016104cc565b826001600160a01b03166111f6826108f5565b6001600160a01b03161461121c5760405162461bcd60e51b81526004016104cc90612190565b600081815260706020908152604080832080546001600160a01b03199081169091556001600160a01b03878116808652606f8552838620805460001901905590871680865283862080546001019055868652606e909452828520805490921684179091559051849360008051602061244c83398151915291a4505050565b610dbc8282604051806020016040528060008152506116a7565b600754610100900460ff166112db5760405162461bcd60e51b81526004016104cc906121d5565b610dbc82826116da565b815160208084019190912082519183019190912060038290556004819055466001557f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61133381848461171a565b600055600280546001600160a01b0319163017905560055550505050565b600061135c826108f5565b9050611367826108f5565b600083815260706020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552606f84528285208054600019019055878552606e9093528184208054909116905551929350849260008051602061244c833981519152908390a45050565b816001600160a01b0316836001600160a01b0316036114315760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b60448201526064016104cc565b6001600160a01b03838116600081815260716020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6114a9848484611148565b6114b584848484611763565b610ea65760405162461bcd60e51b81526004016104cc90612220565b606060006114de83611868565b60010190506000816001600160401b038111156114fd576114fd611e46565b6040519080825280601f01601f191660200182016040528015611527576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461153157509392505050565b6000908152606e60205260409020546001600160a01b0316151590565b60003033036115d657600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b031691506115d99050565b50335b90565b6000604051806080016040528060438152602001612409604391398051602091820120835184830151604080870151805190860120905161163c950193845260208401929092526001600160a01b03166040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b6000610399611666611940565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6116b1838361197b565b6116be6000848484611763565b61057f5760405162461bcd60e51b81526004016104cc90612220565b600754610100900460ff166117015760405162461bcd60e51b81526004016104cc906121d5565b606c61170d83826122b8565b50606d61057f82826122b8565b6040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60006001600160a01b0384163b1561186057836001600160a01b031663150b7a0261178c610f76565b8786866040518563ffffffff1660e01b81526004016117ae9493929190612377565b6020604051808303816000875af19250505080156117e9575060408051601f3d908101601f191682019092526117e6918101906123b4565b60015b611846573d808015611817576040519150601f19603f3d011682016040523d82523d6000602084013e61181c565b606091505b50805160000361183e5760405162461bcd60e51b81526004016104cc90612220565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610a8f565b506001610a8f565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106118a75772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106118d3576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106118f157662386f26fc10000830492506010015b6305f5e1008310611909576305f5e100830492506008015b612710831061191d57612710830492506004015b6064831061192f576064830492506002015b600a83106103995760010192915050565b6002546000906001600160a01b03163014801561195e575060015446145b1561196a575060005490565b610f8060055460035460045461171a565b6001600160a01b0382166119d15760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016104cc565b6119da81611563565b156119f75760405162461bcd60e51b81526004016104cc906123d1565b611a0081611563565b15611a1d5760405162461bcd60e51b81526004016104cc906123d1565b6001600160a01b0382166000818152606f6020908152604080832080546001019055848352606e90915280822080546001600160a01b03191684179055518392919060008051602061244c833981519152908290a45050565b6001600160e01b031981168114610f7357600080fd5b600060208284031215611a9e57600080fd5b8135610f1981611a76565b60005b83811015611ac4578181015183820152602001611aac565b50506000910152565b60008151808452611ae5816020860160208601611aa9565b601f01601f19169290920160200192915050565b602081526000610f196020830184611acd565b600060208284031215611b1e57600080fd5b5035919050565b80356001600160a01b0381168114611b3c57600080fd5b919050565b60008060408385031215611b5457600080fd5b611b5d83611b25565b946020939093013593505050565b60008083601f840112611b7d57600080fd5b5081356001600160401b03811115611b9457600080fd5b602083019150836020828501011115611bac57600080fd5b9250929050565b60008060008060008060a08789031215611bcc57600080fd5b611bd587611b25565b955060208701356001600160401b03811115611bf057600080fd5b611bfc89828a01611b6b565b9096509450506040870135925060608701359150608087013560ff81168114611c2457600080fd5b809150509295509295509295565b600080600060608486031215611c4757600080fd5b611c5084611b25565b9250611c5e60208501611b25565b9150604084013590509250925092565b600060208284031215611c8057600080fd5b610f1982611b25565b60008083601f840112611c9b57600080fd5b5081356001600160401b03811115611cb257600080fd5b6020830191508360208260051b8501011115611bac57600080fd5b60008060008060408587031215611ce357600080fd5b84356001600160401b0380821115611cfa57600080fd5b611d0688838901611c89565b90965094506020870135915080821115611d1f57600080fd5b50611d2c87828801611c89565b95989497509550505050565b600080600080600060608688031215611d5057600080fd5b611d5986611b25565b945060208601356001600160401b0380821115611d7557600080fd5b611d8189838a01611b6b565b90965094506040880135915080821115611d9a57600080fd5b50611da788828901611b6b565b969995985093965092949392505050565b60008060408385031215611dcb57600080fd5b611dd483611b25565b915060208301358015158114611de957600080fd5b809150509250929050565b600080600060408486031215611e0957600080fd5b611e1284611b25565b925060208401356001600160401b03811115611e2d57600080fd5b611e3986828701611c89565b9497909650939450505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215611e7257600080fd5b611e7b85611b25565b9350611e8960208601611b25565b92506040850135915060608501356001600160401b0380821115611eac57600080fd5b818701915087601f830112611ec057600080fd5b813581811115611ed257611ed2611e46565b604051601f8201601f19908116603f01168101908382118183101715611efa57611efa611e46565b816040528281528a6020848701011115611f1357600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215611f4a57600080fd5b611f5383611b25565b9150611f6160208401611b25565b90509250929050565b600181811c90821680611f7e57607f821691505b602082108103611f9e57634e487b7160e01b600052602260045260246000fd5b50919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b60008251611fdc818460208701611aa9565b9190910192915050565b6001600160a01b0385811682528416602082015260606040820181905281018290526000828460808401376000608084840101526080601f19601f850116830101905095945050505050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526024908201527f4368696c644552433732313a204f6e6c79207072656469636174652063616e2060408201526318d85b1b60e21b606082015260800190565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b8082018082111561039957634e487b7160e01b600052601160045260246000fd5b6020808252818101527f4368696c644552433732313a204f6e6c79206f776e65722063616e206275726e604082015260600190565b60008351612173818460208801611aa9565b835190830190612187818360208801611aa9565b01949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b601f82111561057f57600081815260208120601f850160051c810160208610156122995750805b601f850160051c820191505b81811015610cfd578281556001016122a5565b81516001600160401b038111156122d1576122d1611e46565b6122e5816122df8454611f6a565b84612272565b602080601f83116001811461231a57600084156123025750858301515b600019600386901b1c1916600185901b178555610cfd565b600085815260208120601f198616915b828110156123495788860151825594840194600190910190840161232a565b50858210156123675787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906123aa90830184611acd565b9695505050505050565b6000602082840312156123c657600080fd5b8151610f1981611a76565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060408201526060019056fe4d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e617475726529ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220ea3c02b950248f82ca74449c170966a8d3ba41ec46257d49989e4be74e94e63864736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001006": { + "code": "0x608060405234801561001057600080fd5b50600436106101375760003560e01c8063b68ad1e4116100b8578063e0563ab11161007c578063e0563ab1146102c0578063eeb49945146102c9578063f3fef3a3146102dc578063f6451255146102ef578063f691325c14610316578063f8c8765e1461032957600080fd5b8063b68ad1e414610225578063c3b35a7e14610238578063c5ac2b1c1461024b578063d41f177114610272578063d7c9e3ec1461029957600080fd5b80636f33e695116100ff5780636f33e6951461019f5780637efab4f5146101b4578063947287cf146101dd57806397e5230d146101f4578063b1768065146101fe57600080fd5b806305dc2e8f1461013c5780631bc114ba1461016c578063284017f51461017f5780633b878c221461018857806351351d5314610191575b600080fd5b60345461014f906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60335461014f906001600160a01b031681565b61014f61202081565b61014f61101081565b61014f6002600160a01b0381565b6101b26101ad366004611617565b61033c565b005b61014f6101c2366004611699565b6037602052600090815260409020546001600160a01b031681565b6101e661520881565b604051908152602001610163565b6101e6620249f081565b6101e67f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b60365461014f906001600160a01b031681565b6101b26102463660046116bd565b610350565b6101e67faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d1881565b6101e67f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b6101e67f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed281565b61014f61203081565b6101b26102d73660046116fe565b610360565b6101b26102ea366004611786565b610583565b6101e67f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b60355461014f906001600160a01b031681565b6101b26103373660046117b2565b610592565b61034985858585856107d1565b5050505050565b61035b838383610b35565b505050565b6034546001600160a01b031633146103d15760405162461bcd60e51b815260206004820152602960248201527f4368696c644552433732315072656469636174653a204f4e4c595f53544154456044820152682fa922a1a2a4ab22a960b91b60648201526084015b60405180910390fd5b6035546001600160a01b038481169116146104405760405162461bcd60e51b815260206004820152602960248201527f4368696c644552433732315072656469636174653a204f4e4c595f524f4f545f60448201526850524544494341544560b81b60648201526084016103c8565b7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82161046f60206000848661180e565b61047891611838565b036104975761049261048d826020818661180e565b610e3e565b61057d565b7faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d186104c660206000848661180e565b6104cf91611838565b036104de5761049282826110b4565b7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad61050d60206000848661180e565b61051691611838565b0361052557610492828261131a565b60405162461bcd60e51b815260206004820152602760248201527f4368696c644552433732315072656469636174653a20494e56414c49445f5349604482015266474e415455524560c81b60648201526084016103c8565b50505050565b61058e823383610b35565b5050565b336002600160a01b03146105d65760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064016103c8565b600054610100900460ff16158080156105f65750600054600160ff909116105b806106105750303b158015610610575060005460ff166001145b6106735760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103c8565b6000805460ff191660011790558015610696576000805461ff0019166101001790555b6001600160a01b038516158015906106b657506001600160a01b03841615155b80156106ca57506001600160a01b03831615155b80156106de57506001600160a01b03821615155b61073b5760405162461bcd60e51b815260206004820152602860248201527f4368696c644552433732315072656469636174653a204241445f494e495449416044820152672624ad20aa24a7a760c11b60648201526084016103c8565b603380546001600160a01b038088166001600160a01b031992831617909255603480548784169083161790556035805486841690831617905560368054928516929091169190911790558015610349576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b846107db81611488565b6107f75760405162461bcd60e51b81526004016103c890611856565b6000866001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610837573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085b9190611898565b6001600160a01b0381811660009081526037602052604090205491925088811691161461089a5760405162461bcd60e51b81526004016103c8906118b5565b6001600160a01b0381166108b0576108b06118f9565b306001600160a01b0316876001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091c9190611898565b6001600160a01b031614610932576109326118f9565b84831461098d5760405162461bcd60e51b8152602060048201526024808201527f4368696c644552433732315072656469636174653a20494e56414c49445f4c4560448201526309c8ea8960e31b60648201526084016103c8565b60405163b2dc5dc360e01b81526001600160a01b0388169063b2dc5dc3906109bd90339088908890600401611941565b6020604051808303816000875af11580156109dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a00919061196f565b610a1c5760405162461bcd60e51b81526004016103c890611991565b6033546035546040516001600160a01b03928316926316f19831921690610a73907f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed290869033908d908d908d908d90602001611a1b565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610a9f929190611ab5565b600060405180830381600087803b158015610ab957600080fd5b505af1158015610acd573d6000803e3d6000fd5b50505050336001600160a01b0316876001600160a01b0316826001600160a01b03167fa80bc76d6e1849a9088a9c00a2aeaa54eeb78f15565a18da3e8873438976f52289898989604051610b249493929190611ae1565b60405180910390a450505050505050565b82610b3f81611488565b610b5b5760405162461bcd60e51b81526004016103c890611856565b6000846001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbf9190611898565b6001600160a01b03818116600090815260376020526040902054919250868116911614610bfe5760405162461bcd60e51b81526004016103c8906118b5565b6001600160a01b038116610c1457610c146118f9565b306001600160a01b0316856001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c809190611898565b6001600160a01b031614610c9657610c966118f9565b604051632770a7eb60e21b81526001600160a01b03861690639dc29fac90610cc49033908790600401611b13565b6020604051808303816000875af1158015610ce3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d07919061196f565b610d235760405162461bcd60e51b81526004016103c890611991565b603354603554604080517f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286960208201526001600160a01b0385811682840152336060830152888116608083015260a08083018990528351808403909101815260c08301938490526316f1983160e01b909352938416936316f1983193610dae9391169160c401611ab5565b600060405180830381600087803b158015610dc857600080fd5b505af1158015610ddc573d6000803e3d6000fd5b50505050836001600160a01b0316856001600160a01b0316826001600160a01b03167f1e0ef6131232b1090efc3ec1cf7b53aa17f4b7cd8a4f9e033b49ee237379b0133387604051610e2f929190611b13565b60405180910390a45050505050565b6000808080610e4f85870187611b2c565b6001600160a01b0380851660009081526037602052604090205494985092965090945092501680610e925760405162461bcd60e51b81526004016103c8906118b5565b610e9b81611488565b610ea757610ea76118f9565b6000816001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ee7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0b9190611898565b9050856001600160a01b0316816001600160a01b031614610f2e57610f2e6118f9565b6001600160a01b038116610f4457610f446118f9565b306001600160a01b0316826001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb09190611898565b6001600160a01b031614610fc657610fc66118f9565b6040516340c10f1960e01b81526001600160a01b038316906340c10f1990610ff49087908790600401611b13565b6020604051808303816000875af1158015611013573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611037919061196f565b6110535760405162461bcd60e51b81526004016103c890611b7d565b836001600160a01b0316826001600160a01b0316876001600160a01b03167f37589fd8c906c19ea68eeb7e6b3e03efc06ff8aa4b1830588eba75f4375b161188876040516110a2929190611b13565b60405180910390a45050505050505050565b60008080806110c585870187611c92565b6001600160a01b0380851660009081526037602052604090205494995092975090955093501690508061110a5760405162461bcd60e51b81526004016103c8906118b5565b61111381611488565b61111f5761111f6118f9565b6000816001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa15801561115f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111839190611898565b9050856001600160a01b0316816001600160a01b0316146111a6576111a66118f9565b6001600160a01b0381166111bc576111bc6118f9565b306001600160a01b0316826001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015611204573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112289190611898565b6001600160a01b03161461123e5761123e6118f9565b604051637c88e3d960e01b81526001600160a01b03831690637c88e3d99061126c9087908790600401611d84565b6020604051808303816000875af115801561128b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112af919061196f565b6112cb5760405162461bcd60e51b81526004016103c890611b7d565b846001600160a01b0316826001600160a01b0316876001600160a01b03167fc1b1a5c1b97cc8e5ac82b47496f5ebdadf9c7d119b30a116e2bdafd56f6ed47587876040516110a2929190611d84565b6000808061132a84860186611e77565b91955093509150506001600160a01b038316611348576113486118f9565b6001600160a01b038381166000908152603760205260409020541615611370576113706118f9565b6036546040516bffffffffffffffffffffffff19606086901b1660208201526000916113c0916001600160a01b03909116906034016040516020818303038152906040528051906020012061151d565b6001600160a01b038581166000908152603760205260409081902080546001600160a01b031916928416928317905551639065714760e01b81529192509063906571479061141690879087908790600401611ef6565b600060405180830381600087803b15801561143057600080fd5b505af1158015611444573d6000803e3d6000fd5b50506040516001600160a01b038085169350871691507f46bd56f98e1b14fd35691959270a6e1edf7cb8fcd489e0f9dda89e46c0d1ff0d90600090a3505050505050565b6000816001600160a01b03163b6000036114a457506000919050565b6040516301ffc9a760e01b81526380ac58cd60e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa92505050801561150b575060408051601f3d908101601f191682019092526115089181019061196f565b60015b61151757506000919050565b92915050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b0381166115175760405162461bcd60e51b8152602060048201526017602482015276115490cc4c4d8dce8818dc99585d194c8819985a5b1959604a1b60448201526064016103c8565b6001600160a01b03811681146115c957600080fd5b50565b60008083601f8401126115de57600080fd5b5081356001600160401b038111156115f557600080fd5b6020830191508360208260051b850101111561161057600080fd5b9250929050565b60008060008060006060868803121561162f57600080fd5b853561163a816115b4565b945060208601356001600160401b038082111561165657600080fd5b61166289838a016115cc565b9096509450604088013591508082111561167b57600080fd5b50611688888289016115cc565b969995985093965092949392505050565b6000602082840312156116ab57600080fd5b81356116b6816115b4565b9392505050565b6000806000606084860312156116d257600080fd5b83356116dd816115b4565b925060208401356116ed816115b4565b929592945050506040919091013590565b6000806000806060858703121561171457600080fd5b843593506020850135611726816115b4565b925060408501356001600160401b038082111561174257600080fd5b818701915087601f83011261175657600080fd5b81358181111561176557600080fd5b88602082850101111561177757600080fd5b95989497505060200194505050565b6000806040838503121561179957600080fd5b82356117a4816115b4565b946020939093013593505050565b600080600080608085870312156117c857600080fd5b84356117d3816115b4565b935060208501356117e3816115b4565b925060408501356117f3816115b4565b91506060850135611803816115b4565b939692955090935050565b6000808585111561181e57600080fd5b8386111561182b57600080fd5b5050820193919092039150565b8035602083101561151757600019602084900360031b1b1692915050565b60208082526022908201527f4368696c644552433732315072656469636174653a204e4f545f434f4e54524160408201526110d560f21b606082015260800190565b6000602082840312156118aa57600080fd5b81516116b6816115b4565b60208082526024908201527f4368696c644552433732315072656469636174653a20554e4d41505045445f5460408201526327a5a2a760e11b606082015260800190565b634e487b7160e01b600052600160045260246000fd5b81835260006001600160fb1b0383111561192857600080fd5b8260051b80836020870137939093016020019392505050565b6001600160a01b0384168152604060208201819052600090611966908301848661190f565b95945050505050565b60006020828403121561198157600080fd5b815180151581146116b657600080fd5b60208082526021908201527f4368696c644552433732315072656469636174653a204255524e5f4641494c456040820152601160fa1b606082015260800190565b8183526000602080850194508260005b85811015611a105781356119f5816115b4565b6001600160a01b0316875295820195908201906001016119e2565b509495945050505050565b8781526001600160a01b0387811660208301528616604082015260a060608201819052600090611a4e90830186886119d2565b8281036080840152611a6181858761190f565b9a9950505050505050505050565b6000815180845260005b81811015611a9557602081850181015186830182015201611a79565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b0383168152604060208201819052600090611ad990830184611a6f565b949350505050565b604081526000611af56040830186886119d2565b8281036020840152611b0881858761190f565b979650505050505050565b6001600160a01b03929092168252602082015260400190565b60008060008060808587031215611b4257600080fd5b8435611b4d816115b4565b93506020850135611b5d816115b4565b92506040850135611b6d816115b4565b9396929550929360600135925050565b60208082526021908201527f4368696c644552433732315072656469636174653a204d494e545f4641494c456040820152601160fa1b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611bfc57611bfc611bbe565b604052919050565b60006001600160401b03821115611c1d57611c1d611bbe565b5060051b60200190565b600082601f830112611c3857600080fd5b81356020611c4d611c4883611c04565b611bd4565b82815260059290921b84018101918181019086841115611c6c57600080fd5b8286015b84811015611c875780358352918301918301611c70565b509695505050505050565b600080600080600060a08688031215611caa57600080fd5b85359450602080870135611cbd816115b4565b94506040870135611ccd816115b4565b935060608701356001600160401b0380821115611ce957600080fd5b818901915089601f830112611cfd57600080fd5b8135611d0b611c4882611c04565b81815260059190911b8301840190848101908c831115611d2a57600080fd5b938501935b82851015611d51578435611d42816115b4565b82529385019390850190611d2f565b965050506080890135925080831115611d6957600080fd5b5050611d7788828901611c27565b9150509295509295909350565b604080825283519082018190526000906020906060840190828701845b82811015611dc65781516001600160a01b031684529284019290840190600101611da1565b5050508381038285015284518082528583019183019060005b81811015611dfb57835183529284019291840191600101611ddf565b5090979650505050505050565b600082601f830112611e1957600080fd5b81356001600160401b03811115611e3257611e32611bbe565b611e45601f8201601f1916602001611bd4565b818152846020838601011115611e5a57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215611e8d57600080fd5b843593506020850135611e9f816115b4565b925060408501356001600160401b0380821115611ebb57600080fd5b611ec788838901611e08565b93506060870135915080821115611edd57600080fd5b50611eea87828801611e08565b91505092959194509250565b6001600160a01b0384168152606060208201819052600090611f1a90830185611a6f565b8281036040840152611f2c8185611a6f565b969550505050505056fea26469706673582212208eba5121cb4876752d628bd2b54f4310ad4179b29208ae7a3ec4d01fd9c07df564736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001007": { + "code": "0x608060405234801561001057600080fd5b50600436106101155760003560e01c806357128683116100a2578063e619870511610071578063e619870514610278578063e985e9c514610289578063f242432a146102c5578063f399e22e146102d8578063f5298aca146102eb57600080fd5b8063571286831461022c5780636b20c4541461023f5780639b77ef1114610252578063a22cb4651461026557600080fd5b8063156e29f6116100e9578063156e29f6146101965780631f2d0065146101a95780632d0335ab146101ce5780632eb2c2d6146101f75780634e1273f41461020c57600080fd5b8062fdd58e1461011a57806301ffc9a7146101405780630c53c51c146101635780630e89341c14610183575b600080fd5b61012d610128366004611cee565b6102fe565b6040519081526020015b60405180910390f35b61015361014e366004611d2e565b610399565b6040519015158152602001610137565b610176610171366004611d93565b6103e9565b6040516101379190611e62565b610176610191366004611e75565b6106c7565b6101536101a4366004611e8e565b61075b565b609f546001600160a01b03165b6040516001600160a01b039091168152602001610137565b61012d6101dc366004611ec1565b6001600160a01b031660009081526006602052604090205490565b61020a610205366004612025565b6107ad565b005b61021f61021a3660046120ce565b61080b565b60405161013791906121d3565b61015361023a36600461222a565b610934565b61015361024d3660046122c3565b610a4f565b61020a610260366004611e75565b610af6565b61020a610273366004612343565b610b1d565b609e546001600160a01b03166101b6565b61015361029736600461237f565b6001600160a01b039182166000908152606d6020908152604080832093909416825291909152205460ff1690565b61020a6102d33660046123b2565b610b33565b61020a6102e6366004612416565b610b8a565b6101536102f9366004611e8e565b610d9e565b60006001600160a01b03831661036e5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000818152606c602090815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b14806103ca57506001600160e01b031982166303a24d0760e21b145b8061039357506301ffc9a760e01b6001600160e01b0319831614610393565b6060600061042c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610dd692505050565b90506001600160e01b03196000358116908216036104b25760405162461bcd60e51b815260206004820152603d60248201527f66756e6374696f6e5369676e61747572652063616e206e6f74206265206f662060448201527f657865637574654d6574615472616e73616374696f6e206d6574686f640000006064820152608401610365565b604080516060810182526001600160a01b038a16600081815260066020908152848220548452808401929092528351601f8b0183900483028101830185528a815290938301918b908b9081908401838280828437600092019190915250505091525090506105238982888888610df1565b6105795760405162461bcd60e51b815260206004820152602160248201527f5369676e657220616e64207369676e617475726520646f206e6f74206d6174636044820152600d60fb1b6064820152608401610365565b600660008a6001600160a01b03166001600160a01b031681526020019081526020016000206000815460010191905081905550600080306001600160a01b03168a8a8d6040516020016105ce93929190612468565b60408051601f19818403018152908290526105e89161248e565b6000604051808303816000865af19150503d8060008114610625576040519150601f19603f3d011682016040523d82523d6000602084013e61062a565b606091505b50915091508161067c5760405162461bcd60e51b815260206004820152601c60248201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c000000006044820152606401610365565b7f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b8b338c8c6040516106b194939291906124aa565b60405180910390a19a9950505050505050505050565b6060606e80546106d6906124f6565b80601f0160208091040260200160405190810160405280929190818152602001828054610702906124f6565b801561074f5780601f106107245761010080835404028352916020019161074f565b820191906000526020600020905b81548152906001019060200180831161073257829003601f168201915b50505050509050919050565b609e546000906001600160a01b031633146107885760405162461bcd60e51b815260040161036590612530565b6107a384848460405180602001604052806000815250610ecd565b5060019392505050565b6107b5610fdc565b6001600160a01b0316856001600160a01b031614806107db57506107db85610297610fdc565b6107f75760405162461bcd60e51b815260040161036590612575565b6108048585858585610feb565b5050505050565b606081518351146108705760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610365565b600083516001600160401b0381111561088b5761088b611edc565b6040519080825280602002602001820160405280156108b4578160200160208202803683370190505b50905060005b845181101561092c576108ff8582815181106108d8576108d86125c3565b60200260200101518583815181106108f2576108f26125c3565b60200260200101516102fe565b828281518110610911576109116125c3565b6020908102919091010152610925816125ef565b90506108ba565b509392505050565b609e546000906001600160a01b031633146109615760405162461bcd60e51b815260040161036590612530565b85848114801561097057508083145b6109bc5760405162461bcd60e51b815260206004820181905260248201527f4368696c64455243313135353a206172726179206c656e206d69736d617463686044820152606401610365565b60005b81811015610a4057610a388989838181106109dc576109dc6125c3565b90506020020160208101906109f19190611ec1565b888884818110610a0357610a036125c3565b90506020020135878785818110610a1c57610a1c6125c3565b9050602002013560405180602001604052806000815250610ecd565b6001016109bf565b50600198975050505050505050565b609e546000906001600160a01b03163314610a7c5760405162461bcd60e51b815260040161036590612530565b610aea8686868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525061119592505050565b50600195945050505050565b3360009081526006602052604081208054839290610b15908490612608565b909155505050565b610b2f610b28610fdc565b838361132c565b5050565b610b3b610fdc565b6001600160a01b0316856001600160a01b03161480610b615750610b6185610297610fdc565b610b7d5760405162461bcd60e51b815260040161036590612575565b610804858585858561140c565b600754610100900460ff1615808015610baa5750600754600160ff909116105b80610bc45750303b158015610bc4575060075460ff166001145b610c275760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610365565b6007805460ff191660011790558015610c4a576007805461ff0019166101001790555b6001600160a01b038416610ca05760405162461bcd60e51b815260206004820181905260248201527f4368696c64455243313135353a204241445f494e495449414c495a4154494f4e6044820152606401610365565b609f80546001600160a01b0386166001600160a01b031991821617909155609e805490911633179055604080516020601f8501819004810282018101909252838152610d0691859085908190840183828082843760009201919091525061153392505050565b610d52610d1b856001600160a01b0316611566565b604051602001610d2b919061261b565b60408051601f1981840301815282820190915260018252603160f81b60208301529061157c565b8015610d98576007805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b609e546000906001600160a01b03163314610dcb5760405162461bcd60e51b815260040161036590612530565b6107a38484846115e8565b60008151600003610de957506000919050565b506020015190565b6000806001610e07610e02886116e8565b611765565b6040805160008152602081018083529290925260ff861690820152606081018790526080810186905260a0016020604051602081039080840390855afa158015610e55573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610eac5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401610365565b866001600160a01b0316816001600160a01b03161491505095945050505050565b6001600160a01b038416610f2d5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610365565b6000610f37610fdc565b90506000610f44856117b3565b90506000610f51856117b3565b90506000868152606c602090815260408083206001600160a01b038b16845290915281208054879290610f85908490612608565b909155505060408051878152602081018790526001600160a01b03808a169260009291871691600080516020612b0c833981519152910160405180910390a4610fd3836000898989896117fe565b50505050505050565b6000610fe6611959565b905090565b815183511461100c5760405162461bcd60e51b815260040161036590612650565b6001600160a01b0384166110325760405162461bcd60e51b815260040161036590612698565b600061103c610fdc565b905060005b845181101561112757600085828151811061105e5761105e6125c3565b60200260200101519050600085838151811061107c5761107c6125c3565b6020908102919091018101516000848152606c835260408082206001600160a01b038e1683529093529190912054909150818110156110cd5760405162461bcd60e51b8152600401610365906126dd565b6000838152606c602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061110c908490612608565b9250508190555050505080611120906125ef565b9050611041565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611177929190612727565b60405180910390a461118d8187878787876119b5565b505050505050565b6001600160a01b0383166111bb5760405162461bcd60e51b815260040161036590612755565b80518251146111dc5760405162461bcd60e51b815260040161036590612650565b60006111e6610fdc565b604080516020810190915260009052905060005b83518110156112bf576000848281518110611217576112176125c3565b602002602001015190506000848381518110611235576112356125c3565b6020908102919091018101516000848152606c835260408082206001600160a01b038c1683529093529190912054909150818110156112865760405162461bcd60e51b815260040161036590612798565b6000928352606c602090815260408085206001600160a01b038b16865290915290922091039055806112b7816125ef565b9150506111fa565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611310929190612727565b60405180910390a4604080516020810190915260009052610d98565b816001600160a01b0316836001600160a01b03160361139f5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610365565b6001600160a01b038381166000818152606d6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166114325760405162461bcd60e51b815260040161036590612698565b600061143c610fdc565b90506000611449856117b3565b90506000611456856117b3565b90506000868152606c602090815260408083206001600160a01b038c1684529091529020548581101561149b5760405162461bcd60e51b8152600401610365906126dd565b6000878152606c602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906114da908490612608565b909155505060408051888152602081018890526001600160a01b03808b16928c82169291881691600080516020612b0c833981519152910160405180910390a4611528848a8a8a8a8a6117fe565b505050505050505050565b600754610100900460ff1661155a5760405162461bcd60e51b8152600401610365906127dc565b61156381611a70565b50565b60606103936001600160a01b0383166014611aa0565b815160208084019190912082519183019190912060038290556004819055466001557f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6115ca818484611c42565b600055600280546001600160a01b0319163017905560055550505050565b6001600160a01b03831661160e5760405162461bcd60e51b815260040161036590612755565b6000611618610fdc565b90506000611625846117b3565b90506000611632846117b3565b6040805160208082018352600091829052888252606c81528282206001600160a01b038b16835290522054909150848110156116805760405162461bcd60e51b815260040161036590612798565b6000868152606c602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a9052909290881691600080516020612b0c833981519152910160405180910390a4604080516020810190915260009052610fd3565b6000604051806080016040528060438152602001612b2c6043913980516020918201208351848301516040808701518051908601209051611748950193845260208401929092526001600160a01b03166040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b6000610393611772611c8b565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106117ed576117ed6125c3565b602090810291909101015292915050565b6001600160a01b0384163b1561118d5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906118429089908990889088908890600401612827565b6020604051808303816000875af192505050801561187d575060408051601f3d908101601f1916820190925261187a9181019061286c565b60015b61192957611889612889565b806308c379a0036118c2575061189d6128a4565b806118a857506118c4565b8060405162461bcd60e51b81526004016103659190611e62565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610365565b6001600160e01b0319811663f23a6e6160e01b14610fd35760405162461bcd60e51b81526004016103659061292d565b60003033036119af57600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b031691506119b29050565b50335b90565b6001600160a01b0384163b1561118d5760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906119f99089908990889088908890600401612975565b6020604051808303816000875af1925050508015611a34575060408051601f3d908101601f19168201909252611a319181019061286c565b60015b611a4057611889612889565b6001600160e01b0319811663bc197c8160e01b14610fd35760405162461bcd60e51b81526004016103659061292d565b600754610100900460ff16611a975760405162461bcd60e51b8152600401610365906127dc565b61156381611cc6565b60606000611aaf8360026129d3565b611aba906002612608565b6001600160401b03811115611ad157611ad1611edc565b6040519080825280601f01601f191660200182016040528015611afb576020820181803683370190505b509050600360fc1b81600081518110611b1657611b166125c3565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611b4557611b456125c3565b60200101906001600160f81b031916908160001a9053506000611b698460026129d3565b611b74906001612608565b90505b6001811115611bec576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611ba857611ba86125c3565b1a60f81b828281518110611bbe57611bbe6125c3565b60200101906001600160f81b031916908160001a90535060049490941c93611be5816129ea565b9050611b77565b508315611c3b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610365565b9392505050565b6040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6002546000906001600160a01b031630148015611ca9575060015446145b15611cb5575060005490565b610fe6600554600354600454611c42565b606e610b2f8282612a4c565b80356001600160a01b0381168114611ce957600080fd5b919050565b60008060408385031215611d0157600080fd5b611d0a83611cd2565b946020939093013593505050565b6001600160e01b03198116811461156357600080fd5b600060208284031215611d4057600080fd5b8135611c3b81611d18565b60008083601f840112611d5d57600080fd5b5081356001600160401b03811115611d7457600080fd5b602083019150836020828501011115611d8c57600080fd5b9250929050565b60008060008060008060a08789031215611dac57600080fd5b611db587611cd2565b955060208701356001600160401b03811115611dd057600080fd5b611ddc89828a01611d4b565b9096509450506040870135925060608701359150608087013560ff81168114611e0457600080fd5b809150509295509295509295565b60005b83811015611e2d578181015183820152602001611e15565b50506000910152565b60008151808452611e4e816020860160208601611e12565b601f01601f19169290920160200192915050565b602081526000611c3b6020830184611e36565b600060208284031215611e8757600080fd5b5035919050565b600080600060608486031215611ea357600080fd5b611eac84611cd2565b95602085013595506040909401359392505050565b600060208284031215611ed357600080fd5b611c3b82611cd2565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715611f1757611f17611edc565b6040525050565b60006001600160401b03821115611f3757611f37611edc565b5060051b60200190565b600082601f830112611f5257600080fd5b81356020611f5f82611f1e565b604051611f6c8282611ef2565b83815260059390931b8501820192828101915086841115611f8c57600080fd5b8286015b84811015611fa75780358352918301918301611f90565b509695505050505050565b600082601f830112611fc357600080fd5b81356001600160401b03811115611fdc57611fdc611edc565b604051611ff3601f8301601f191660200182611ef2565b81815284602083860101111561200857600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561203d57600080fd5b61204686611cd2565b945061205460208701611cd2565b935060408601356001600160401b038082111561207057600080fd5b61207c89838a01611f41565b9450606088013591508082111561209257600080fd5b61209e89838a01611f41565b935060808801359150808211156120b457600080fd5b506120c188828901611fb2565b9150509295509295909350565b600080604083850312156120e157600080fd5b82356001600160401b03808211156120f857600080fd5b818501915085601f83011261210c57600080fd5b8135602061211982611f1e565b6040516121268282611ef2565b83815260059390931b850182019282810191508984111561214657600080fd5b948201945b8386101561216b5761215c86611cd2565b8252948201949082019061214b565b9650508601359250508082111561218157600080fd5b5061218e85828601611f41565b9150509250929050565b600081518084526020808501945080840160005b838110156121c8578151875295820195908201906001016121ac565b509495945050505050565b602081526000611c3b6020830184612198565b60008083601f8401126121f857600080fd5b5081356001600160401b0381111561220f57600080fd5b6020830191508360208260051b8501011115611d8c57600080fd5b6000806000806000806060878903121561224357600080fd5b86356001600160401b038082111561225a57600080fd5b6122668a838b016121e6565b9098509650602089013591508082111561227f57600080fd5b61228b8a838b016121e6565b909650945060408901359150808211156122a457600080fd5b506122b189828a016121e6565b979a9699509497509295939492505050565b6000806000806000606086880312156122db57600080fd5b6122e486611cd2565b945060208601356001600160401b038082111561230057600080fd5b61230c89838a016121e6565b9096509450604088013591508082111561232557600080fd5b50612332888289016121e6565b969995985093965092949392505050565b6000806040838503121561235657600080fd5b61235f83611cd2565b91506020830135801515811461237457600080fd5b809150509250929050565b6000806040838503121561239257600080fd5b61239b83611cd2565b91506123a960208401611cd2565b90509250929050565b600080600080600060a086880312156123ca57600080fd5b6123d386611cd2565b94506123e160208701611cd2565b9350604086013592506060860135915060808601356001600160401b0381111561240a57600080fd5b6120c188828901611fb2565b60008060006040848603121561242b57600080fd5b61243484611cd2565b925060208401356001600160401b0381111561244f57600080fd5b61245b86828701611d4b565b9497909650939450505050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b600082516124a0818460208701611e12565b9190910192915050565b6001600160a01b0385811682528416602082015260606040820181905281018290526000828460808401376000608084840101526080601f19601f850116830101905095945050505050565b600181811c9082168061250a57607f821691505b60208210810361252a57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526025908201527f4368696c64455243313135353a204f6e6c79207072656469636174652063616e6040820152640818d85b1b60da1b606082015260800190565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612601576126016125d9565b5060010190565b80820180821115610393576103936125d9565b6c4368696c64455243313135352d60981b81526000825161264381600d850160208701611e12565b91909101600d0192915050565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60408152600061273a6040830185612198565b828103602084015261274c8185612198565b95945050505050565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061286190830184611e36565b979650505050505050565b60006020828403121561287e57600080fd5b8151611c3b81611d18565b600060033d11156119b25760046000803e5060005160e01c90565b600060443d10156128b25790565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156128e157505050505090565b82850191508151818111156128f95750505050505090565b843d87010160208285010111156129135750505050505090565b61292260208286010187611ef2565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b0386811682528516602082015260a0604082018190526000906129a190830186612198565b82810360608401526129b38186612198565b905082810360808401526129c78185611e36565b98975050505050505050565b8082028115828204841417610393576103936125d9565b6000816129f9576129f96125d9565b506000190190565b601f821115612a4757600081815260208120601f850160051c81016020861015612a285750805b601f850160051c820191505b8181101561118d57828155600101612a34565b505050565b81516001600160401b03811115612a6557612a65611edc565b612a7981612a7384546124f6565b84612a01565b602080601f831160018114612aae5760008415612a965750858301515b600019600386901b1c1916600185901b17855561118d565b600085815260208120601f198616915b82811015612add57888601518255948401946001909101908401612abe565b5085821015612afb5787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fec3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f624d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e617475726529a2646970667358221220cf72cc6dfec7557a549ae9a9c0f6f7dbddd3c040da94b9a82892a238de95698864736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001008": { + "code": "0x608060405234801561001057600080fd5b50600436106101375760003560e01c8063b1768065116100b8578063d41f17711161007c578063d41f177114610298578063d7c9e3ec146102bf578063e0563ab1146102e6578063eeb49945146102ef578063f645125514610302578063f8c8765e1461032957600080fd5b8063b176806514610211578063b5c5f67214610238578063b68ad1e41461024b578063b8cd3ec01461025e578063c5ac2b1c1461027157600080fd5b806351351d53116100ff57806351351d53146101a45780637efab4f5146101b257806386937eb4146101db578063947287cf146101f057806397e5230d1461020757600080fd5b8063051eb2e21461013c57806305dc2e8f1461016c5780631bc114ba1461017f578063284017f5146101925780633b878c221461019b575b600080fd5b60355461014f906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60345461014f906001600160a01b031681565b60335461014f906001600160a01b031681565b61014f61202081565b61014f61101081565b61014f6002600160a01b0381565b61014f6101c03660046115f0565b6037602052600090815260409020546001600160a01b031681565b6101ee6101e936600461165f565b61033c565b005b6101f961520881565b604051908152602001610163565b6101f9620249f081565b6101f97f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b6101ee61024636600461170b565b610354565b60365461014f906001600160a01b031681565b6101ee61026c366004611740565b610365565b6101f97faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d1881565b6101f97f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b6101f97f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed281565b61014f61203081565b6101ee6102fd366004611786565b610377565b6101f97f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b6101ee61033736600461180e565b610597565b61034b878787878787876107d8565b50505050505050565b61036083338484610b57565b505050565b61037184848484610b57565b50505050565b6034546001600160a01b031633146103e95760405162461bcd60e51b815260206004820152602a60248201527f4368696c64455243313135355072656469636174653a204f4e4c595f5354415460448201526922afa922a1a2a4ab22a960b11b60648201526084015b60405180910390fd5b6035546001600160a01b038481169116146104595760405162461bcd60e51b815260206004820152602a60248201527f4368696c64455243313135355072656469636174653a204f4e4c595f524f4f546044820152695f50524544494341544560b01b60648201526084016103e0565b7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82161048860206000848661186a565b61049191611894565b036104b0576104ab6104a6826020818661186a565b610e6c565b610371565b7faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d186104df60206000848661186a565b6104e891611894565b036104f7576104ab82826110d7565b7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad61052660206000848661186a565b61052f91611894565b0361053e576104ab8282611344565b60405162461bcd60e51b815260206004820152602860248201527f4368696c64455243313135355072656469636174653a20494e56414c49445f5360448201526749474e415455524560c01b60648201526084016103e0565b336002600160a01b03146105db5760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064016103e0565b600054610100900460ff16158080156105fb5750600054600160ff909116105b806106155750303b158015610615575060005460ff166001145b6106785760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103e0565b6000805460ff19166001179055801561069b576000805461ff0019166101001790555b6001600160a01b038516158015906106bb57506001600160a01b03841615155b80156106cf57506001600160a01b03831615155b80156106e357506001600160a01b03821615155b6107415760405162461bcd60e51b815260206004820152602960248201527f4368696c64455243313135355072656469636174653a204241445f494e49544960448201526820a624ad20aa24a7a760b91b60648201526084016103e0565b603380546001600160a01b038088166001600160a01b0319928316179092556034805487841690831617905560358054868416908316179055603680549285169290911691909117905580156107d1576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b866107e2816114ac565b6107fe5760405162461bcd60e51b81526004016103e0906118b2565b6000886001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa15801561083e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086291906118f5565b6001600160a01b038181166000908152603760205260409020549192508a81169116146108a15760405162461bcd60e51b81526004016103e090611912565b6001600160a01b0381166108b7576108b7611957565b306001600160a01b0316896001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092391906118f5565b6001600160a01b03161461093957610939611957565b868514801561094757508483145b6109a15760405162461bcd60e51b815260206004820152602560248201527f4368696c64455243313135355072656469636174653a20494e56414c49445f4c60448201526408a9c8ea8960db1b60648201526084016103e0565b604051631ac8311560e21b81526001600160a01b038a1690636b20c454906109d59033908a908a908a908a9060040161199f565b6020604051808303816000875af11580156109f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1891906119e3565b610a345760405162461bcd60e51b81526004016103e090611a05565b6033546035546040516001600160a01b03928316926316f19831921690610a8f907f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed290869033908f908f908f908f908f908f90602001611a90565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610abb929190611b41565b600060405180830381600087803b158015610ad557600080fd5b505af1158015610ae9573d6000803e3d6000fd5b50505050336001600160a01b0316896001600160a01b0316826001600160a01b03167f7a10660242ca367951ff3777cdb3c2a761e3ccad204bac118501e24693f3683d8b8b8b8b8b8b604051610b4496959493929190611b6d565b60405180910390a4505050505050505050565b83610b61816114ac565b610b7d5760405162461bcd60e51b81526004016103e0906118b2565b6000856001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be191906118f5565b6001600160a01b03818116600090815260376020526040902054919250878116911614610c205760405162461bcd60e51b81526004016103e090611912565b6001600160a01b038116610c3657610c36611957565b306001600160a01b0316866001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca291906118f5565b6001600160a01b031614610cb857610cb8611957565b604051637a94c56560e11b81526001600160a01b0387169063f5298aca90610ce890339088908890600401611bb6565b6020604051808303816000875af1158015610d07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2b91906119e3565b610d475760405162461bcd60e51b81526004016103e090611a05565b603354603554604080517f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286960208201526001600160a01b0385811682840152336060830152898116608083015260a0820189905260c08083018990528351808403909101815260e08301938490526316f1983160e01b909352938416936316f1983193610dd99391169160e401611b41565b600060405180830381600087803b158015610df357600080fd5b505af1158015610e07573d6000803e3d6000fd5b50505050846001600160a01b0316866001600160a01b0316826001600160a01b03167f2ca9093e8b5356801039806c6a08003e5b7013fb8ae48f720fc90fc1c1a8bec2338888604051610e5c93929190611bb6565b60405180910390a4505050505050565b600080808080610e7e86880188611bd7565b6001600160a01b03808616600090815260376020526040902054959a50939850919650945092501680610ec35760405162461bcd60e51b81526004016103e090611912565b610ecc816114ac565b610ed857610ed8611957565b6000816001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3c91906118f5565b9050866001600160a01b0316816001600160a01b031614610f5f57610f5f611957565b6001600160a01b038116610f7557610f75611957565b306001600160a01b0316826001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe191906118f5565b6001600160a01b031614610ff757610ff7611957565b604051630ab714fb60e11b81526001600160a01b0383169063156e29f69061102790889088908890600401611bb6565b6020604051808303816000875af1158015611046573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106a91906119e3565b6110865760405162461bcd60e51b81526004016103e090611c32565b846001600160a01b0316826001600160a01b0316886001600160a01b03167f2930d932c1cccd6add2e0e2d706ede9015db8a194405f2a3e1783703515e104f898888604051610b4493929190611bb6565b6000808080806110e986880188611d48565b6001600160a01b03808616600090815260376020526040902054959b5093995091975095509350169050806111305760405162461bcd60e51b81526004016103e090611912565b611139816114ac565b61114557611145611957565b6000816001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015611185573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a991906118f5565b9050866001600160a01b0316816001600160a01b0316146111cc576111cc611957565b6001600160a01b0381166111e2576111e2611957565b306001600160a01b0316826001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa15801561122a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124e91906118f5565b6001600160a01b03161461126457611264611957565b604051635712868360e01b81526001600160a01b0383169063571286839061129490889088908890600401611e8d565b6020604051808303816000875af11580156112b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112d791906119e3565b6112f35760405162461bcd60e51b81526004016103e090611c32565b856001600160a01b0316826001600160a01b0316886001600160a01b03167f17304b99f8dfa5a2b8dd5695d82f9947c2abfbc9cb64bab610b9a1a0feadb9a0888888604051610b4493929190611e8d565b60008061135383850185611f02565b9093509150506001600160a01b03821661136f5761136f611957565b6001600160a01b03828116600090815260376020526040902054161561139757611397611957565b6036546040516bffffffffffffffffffffffff19606085901b1660208201526000916113e7916001600160a01b039091169060340160405160208183030381529060405280519060200120611541565b6001600160a01b038481166000908152603760205260409081902080546001600160a01b0319169284169283179055516379ccf11760e11b81529192509063f399e22e9061143b9086908690600401611b41565b600060405180830381600087803b15801561145557600080fd5b505af1158015611469573d6000803e3d6000fd5b50506040516001600160a01b038085169350861691507f46bd56f98e1b14fd35691959270a6e1edf7cb8fcd489e0f9dda89e46c0d1ff0d90600090a35050505050565b6000816001600160a01b03163b6000036114c857506000919050565b6040516301ffc9a760e01b8152636cdb3d1360e11b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa92505050801561152f575060408051601f3d908101601f1916820190925261152c918101906119e3565b60015b61153b57506000919050565b92915050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b03811661153b5760405162461bcd60e51b8152602060048201526017602482015276115490cc4c4d8dce8818dc99585d194c8819985a5b1959604a1b60448201526064016103e0565b6001600160a01b03811681146115ed57600080fd5b50565b60006020828403121561160257600080fd5b813561160d816115d8565b9392505050565b60008083601f84011261162657600080fd5b5081356001600160401b0381111561163d57600080fd5b6020830191508360208260051b850101111561165857600080fd5b9250929050565b60008060008060008060006080888a03121561167a57600080fd5b8735611685816115d8565b965060208801356001600160401b03808211156116a157600080fd5b6116ad8b838c01611614565b909850965060408a01359150808211156116c657600080fd5b6116d28b838c01611614565b909650945060608a01359150808211156116eb57600080fd5b506116f88a828b01611614565b989b979a50959850939692959293505050565b60008060006060848603121561172057600080fd5b833561172b816115d8565b95602085013595506040909401359392505050565b6000806000806080858703121561175657600080fd5b8435611761816115d8565b93506020850135611771816115d8565b93969395505050506040820135916060013590565b6000806000806060858703121561179c57600080fd5b8435935060208501356117ae816115d8565b925060408501356001600160401b03808211156117ca57600080fd5b818701915087601f8301126117de57600080fd5b8135818111156117ed57600080fd5b8860208285010111156117ff57600080fd5b95989497505060200194505050565b6000806000806080858703121561182457600080fd5b843561182f816115d8565b9350602085013561183f816115d8565b9250604085013561184f816115d8565b9150606085013561185f816115d8565b939692955090935050565b6000808585111561187a57600080fd5b8386111561188757600080fd5b5050820193919092039150565b8035602083101561153b57600019602084900360031b1b1692915050565b60208082526023908201527f4368696c64455243313135355072656469636174653a204e4f545f434f4e54526040820152621050d560ea1b606082015260800190565b60006020828403121561190757600080fd5b815161160d816115d8565b60208082526025908201527f4368696c64455243313135355072656469636174653a20554e4d41505045445f6040820152642a27a5a2a760d91b606082015260800190565b634e487b7160e01b600052600160045260246000fd5b81835260006001600160fb1b0383111561198657600080fd5b8260051b80836020870137939093016020019392505050565b6001600160a01b03861681526060602082018190526000906119c4908301868861196d565b82810360408401526119d781858761196d565b98975050505050505050565b6000602082840312156119f557600080fd5b8151801515811461160d57600080fd5b60208082526022908201527f4368696c64455243313135355072656469636174653a204255524e5f4641494c604082015261115160f21b606082015260800190565b8183526000602080850194508260005b85811015611a85578135611a6a816115d8565b6001600160a01b031687529582019590820190600101611a57565b509495945050505050565b8981526001600160a01b0389811660208301528816604082015260c060608201819052600090611ac3908301888a611a47565b8281036080840152611ad681878961196d565b905082810360a0840152611aeb81858761196d565b9c9b505050505050505050505050565b6000815180845260005b81811015611b2157602081850181015186830182015201611b05565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b0383168152604060208201819052600090611b6590830184611afb565b949350505050565b606081526000611b8160608301888a611a47565b8281036020840152611b9481878961196d565b90508281036040840152611ba981858761196d565b9998505050505050505050565b6001600160a01b039390931683526020830191909152604082015260600190565b600080600080600060a08688031215611bef57600080fd5b8535611bfa816115d8565b94506020860135611c0a816115d8565b93506040860135611c1a816115d8565b94979396509394606081013594506080013592915050565b60208082526022908201527f4368696c64455243313135355072656469636174653a204d494e545f4641494c604082015261115160f21b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611cb257611cb2611c74565b604052919050565b60006001600160401b03821115611cd357611cd3611c74565b5060051b60200190565b600082601f830112611cee57600080fd5b81356020611d03611cfe83611cba565b611c8a565b82815260059290921b84018101918181019086841115611d2257600080fd5b8286015b84811015611d3d5780358352918301918301611d26565b509695505050505050565b60008060008060008060c08789031215611d6157600080fd5b86359550602080880135611d74816115d8565b95506040880135611d84816115d8565b945060608801356001600160401b0380821115611da057600080fd5b818a0191508a601f830112611db457600080fd5b8135611dc2611cfe82611cba565b81815260059190911b8301840190848101908d831115611de157600080fd5b938501935b82851015611e08578435611df9816115d8565b82529385019390850190611de6565b9750505060808a0135925080831115611e2057600080fd5b611e2c8b848c01611cdd565b945060a08a0135925080831115611e4257600080fd5b5050611e5089828a01611cdd565b9150509295509295509295565b600081518084526020808501945080840160005b83811015611a8557815187529582019590820190600101611e71565b606080825284519082018190526000906020906080840190828801845b82811015611ecf5781516001600160a01b031684529284019290840190600101611eaa565b50505083810382850152611ee38187611e5d565b9150508281036040840152611ef88185611e5d565b9695505050505050565b600080600060608486031215611f1757600080fd5b83359250602080850135611f2a816115d8565b925060408501356001600160401b0380821115611f4657600080fd5b818701915087601f830112611f5a57600080fd5b813581811115611f6c57611f6c611c74565b611f7e601f8201601f19168501611c8a565b91508082528884828501011115611f9457600080fd5b8084840185840137600084828401015250809350505050925092509256fea26469706673582212200c4c5c9b53a533081213342cd86f6dcc2549159a1a5ec39ac85621bb137a4c8f64736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001010": { + "code": "0x608060405234801561001057600080fd5b50600436106101425760003560e01c806370a08231116100b85780639dc29fac1161007c5780639dc29fac14610278578063a457c2d71461028b578063a9059cbb1461029e578063dd62ed3e146102b1578063e0563ab1146102c4578063e6198705146102cd57600080fd5b806370a082311461022d5780638420ce9914610248578063947287cf1461025d57806395d89b411461026657806397e5230d1461026e57600080fd5b8063284017f51161010a578063284017f5146101d2578063313ce567146101db57806339509351146101f05780633b878c221461020357806340c10f191461020c57806351351d531461021f57600080fd5b806306fdde0314610147578063095ea7b31461016557806318160ddd146101885780631f2d00651461019a57806323b872dd146101bf575b600080fd5b61014f6102de565b60405161015c9190610cfd565b60405180910390f35b610178610173366004610d4c565b610370565b604051901515815260200161015c565b6034545b60405190815260200161015c565b6036546001600160a01b03165b6040516001600160a01b03909116815260200161015c565b6101786101cd366004610d76565b61038a565b6101a761202081565b60395460405160ff909116815260200161015c565b6101786101fe366004610d4c565b6103ae565b6101a761101081565b61017861021a366004610d4c565b6103d0565b6101a76002600160a01b0381565b61018c61023b366004610db2565b6001600160a01b03163190565b61025b610256366004610e1d565b610419565b005b61018c61520881565b61014f6105c8565b61018c620249f081565b610178610286366004610d4c565b6105d7565b610178610299366004610d4c565b61060e565b6101786102ac366004610d4c565b610689565b61018c6102bf366004610ec8565b610697565b6101a761203081565b6035546001600160a01b03166101a7565b6060603780546102ed90610efb565b80601f016020809104026020016040519081016040528092919081815260200182805461031990610efb565b80156103665780601f1061033b57610100808354040283529160200191610366565b820191906000526020600020905b81548152906001019060200180831161034957829003601f168201915b5050505050905090565b60003361037e8185856106c2565b60019150505b92915050565b6000336103988582856107e6565b6103a3858585610860565b506001949350505050565b60003361037e8185856103c18383610697565b6103cb9190610f4b565b6106c2565b6035546000906001600160a01b031633146104065760405162461bcd60e51b81526004016103fd90610f5e565b60405180910390fd5b6104108383610a25565b50600192915050565b600054610100900460ff16158080156104395750600054600160ff909116105b806104535750303b158015610453575060005460ff166001145b6104b65760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103fd565b6000805460ff1916600117905580156104d9576000805461ff0019166101001790555b336002600160a01b031461051d5760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064016103fd565b603580546001600160a01b03808b166001600160a01b03199283161790925560368054928a1692909116919091179055603761055a868883611007565b506038610568848683611007565b506039805460ff191660ff841617905580156105be576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b6060603880546102ed90610efb565b6035546000906001600160a01b031633146106045760405162461bcd60e51b81526004016103fd90610f5e565b6104108383610b7f565b6000338161061c8286610697565b90508381101561067c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103fd565b6103a382868684036106c2565b60003361037e818585610860565b6001600160a01b03918216600090815260336020908152604080832093909416825291909152205490565b6001600160a01b0383166107245760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103fd565b6001600160a01b0382166107855760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103fd565b6001600160a01b0383811660008181526033602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006107f28484610697565b9050600019811461085a578181101561084d5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016103fd565b61085a84848484036106c2565b50505050565b6001600160a01b0383166108c45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103fd565b6001600160a01b0382166109265760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103fd565b6000806120206001600160a01b031685858560405160200161094a939291906110c8565b60408051601f1981840301815290829052610964916110ec565b6000604051808303816000865af19150503d80600081146109a1576040519150601f19603f3d011682016040523d82523d6000602084013e6109a6565b606091505b50915091508180156109c75750808060200190518101906109c79190611108565b6109e35760405162461bcd60e51b81526004016103fd9061112a565b836001600160a01b0316856001600160a01b031660008051602061116e83398151915285604051610a1691815260200190565b60405180910390a35050505050565b6001600160a01b038216610a7b5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103fd565b8060346000828254610a8d9190610f4b565b9091555050604051600090819061202090610ab0908390879087906020016110c8565b60408051601f1981840301815290829052610aca916110ec565b6000604051808303816000865af19150503d8060008114610b07576040519150601f19603f3d011682016040523d82523d6000602084013e610b0c565b606091505b5091509150818015610b2d575080806020019051810190610b2d9190611108565b610b495760405162461bcd60e51b81526004016103fd9061112a565b6040518381526001600160a01b0385169060009060008051602061116e833981519152906020015b60405180910390a350505050565b6001600160a01b038216610bdf5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103fd565b8060346000828254610bf1919061115a565b9091555050604051600090819061202090610c14908690849087906020016110c8565b60408051601f1981840301815290829052610c2e916110ec565b6000604051808303816000865af19150503d8060008114610c6b576040519150601f19603f3d011682016040523d82523d6000602084013e610c70565b606091505b5091509150818015610c91575080806020019051810190610c919190611108565b610cad5760405162461bcd60e51b81526004016103fd9061112a565b6040518381526000906001600160a01b0386169060008051602061116e83398151915290602001610b71565b60005b83811015610cf4578181015183820152602001610cdc565b50506000910152565b6020815260008251806020840152610d1c816040850160208701610cd9565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114610d4757600080fd5b919050565b60008060408385031215610d5f57600080fd5b610d6883610d30565b946020939093013593505050565b600080600060608486031215610d8b57600080fd5b610d9484610d30565b9250610da260208501610d30565b9150604084013590509250925092565b600060208284031215610dc457600080fd5b610dcd82610d30565b9392505050565b60008083601f840112610de657600080fd5b50813567ffffffffffffffff811115610dfe57600080fd5b602083019150836020828501011115610e1657600080fd5b9250929050565b600080600080600080600060a0888a031215610e3857600080fd5b610e4188610d30565b9650610e4f60208901610d30565b9550604088013567ffffffffffffffff80821115610e6c57600080fd5b610e788b838c01610dd4565b909750955060608a0135915080821115610e9157600080fd5b50610e9e8a828b01610dd4565b909450925050608088013560ff81168114610eb857600080fd5b8091505092959891949750929550565b60008060408385031215610edb57600080fd5b610ee483610d30565b9150610ef260208401610d30565b90509250929050565b600181811c90821680610f0f57607f821691505b602082108103610f2f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561038457610384610f35565b60208082526024908201527f4e617469766545524332303a204f6e6c79207072656469636174652063616e2060408201526318d85b1b60e21b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b601f82111561100257600081815260208120601f850160051c81016020861015610fdf5750805b601f850160051c820191505b81811015610ffe57828155600101610feb565b5050505b505050565b67ffffffffffffffff83111561101f5761101f610fa2565b6110338361102d8354610efb565b83610fb8565b6000601f841160018114611067576000851561104f5750838201355b600019600387901b1c1916600186901b1783556110c1565b600083815260209020601f19861690835b828110156110985786850135825560209485019460019092019101611078565b50868210156110b55760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600082516110fe818460208701610cd9565b9190910192915050565b60006020828403121561111a57600080fd5b81518015158114610dcd57600080fd5b60208082526016908201527514149150d3d35412531157d0d0531317d1905253115160521b604082015260600190565b8181038181111561038457610384610f3556feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122020d4a9c065f722d638ec115bf32ed1a8620dca26d052147ca0029d6b7b9aec9d64736f6c63430008130033", + "balance": "0x0" + }, + "0x61324166B0202DB1E7502924326262274Fa4358F": { + "balance": "0xf4240" + }, + "0x9aBb8441A12d4FD8D505C3fc50cDdc45E0df2b1e": { + "balance": "0xd3c21bcecceda1000000" + }, + "0xCaB5AAC79Bebe326e0c80d72b5662E73f5D8ea56": { + "balance": "0xd3c21bcecceda1000000" + }, + "0xFE5E166BA5EA50c04fCa00b07b59966E6C2E9570": { + "balance": "0xd3c21bcecceda1000000" + } + }, + "number": "0x0", + "gasUsed": "0x70000", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "baseFee": "0x0", + "baseFeeEM": "0x0" + }, + "params": { + "forks": { + "homestead": 0, + "byzantium": 0, + "constantinople": 0, + "petersburg": 0, + "istanbul": 0, + "EIP150": 0, + "EIP158": 0, + "EIP155": 0 + }, + "chainID": 0, + "engine": { + "polybft": { + "initialValidatorSet": [ + { + "address": "0x61324166B0202DB1E7502924326262274Fa4358F", + "blsKey": "06d8d9e6af67c28e85ac400b72c2e635e83234f8a380865e050a206554049a222c4792120d84977a6ca669df56ff3a1cf1cfeccddb650e7aacff4ed6c1d4e37b055858209f80117b3c0a6e7a28e456d4caf2270f430f9df2ba37221f23e9bbd313c9ef488e1849cc5c40d18284d019dde5ed86770309b9c24b70ceff6167a6ca", + "balance": "0xf4240", + "stake": "0xd3c21bcecceda1000000", + "multiAddr": "/ip4/127.0.0.1/tcp/30301/p2p/16Uiu2HAmMYyzK7c649Tnn6XdqFLP7fpPB2QWdck1Ee9vj5a7Nhg8" + }, + { + "address": "0xFE5E166BA5EA50c04fCa00b07b59966E6C2E9570", + "blsKey": "0601da8856a6d3d3bb0f3bcbb90ea7b8c0db8271b9203e6123c6804aa3fc5f810be33287968ca1af2be11839516850a6ffef2337d99e679b7531efbbea2e3bf727a053c0cbede71da3d5f489b6ad862ccd8bb0bfb7fa379e3395d3b1142594a73020e87d63c298a3a4eba0ace65727f8659bab6389b9448b72512db72bbe937f", + "balance": "0xd3c21bcecceda1000000", + "stake": "0xd3c21bcecceda1000000", + "multiAddr": "/ip4/127.0.0.1/tcp/30302/p2p/16Uiu2HAmLXVapjR2Yx3B1taCmHnckQ1ph2xrawBjW2kvSErps9CX" + }, + { + "address": "0x9aBb8441A12d4FD8D505C3fc50cDdc45E0df2b1e", + "blsKey": "17c26d9d91dddc3c1318b20a1ddb3322ea1f4e4415c27e9011d706e7407eed672837173d1909cbff6ccdfd110af3b18bdfea878e8120fdb5bae70dc7a044a2f40aa8f118b41704896f474f80fff52d9047fa8e4a464ac86f9d05a0220975d8440e20c6307d866137053cabd4baf6ba84bfa4a22f5f9297c1bfc2380c23535210", + "balance": "0xd3c21bcecceda1000000", + "stake": "0xd3c21bcecceda1000000", + "multiAddr": "/ip4/127.0.0.1/tcp/30303/p2p/16Uiu2HAmGskf5sZ514Ab4SHTPuw8RRBQudyrU211wn3P1knRz9Ed" + }, + { + "address": "0xCaB5AAC79Bebe326e0c80d72b5662E73f5D8ea56", + "blsKey": "1d7bb7d44a2f0ebeae2f4380f88188080de34635d78a36647f0704c7b70de7291e2e3b9a1ef699a078c6cd9bb816ea2917c2c2fc699c6248f1f7812a167caf7e15361ec16df56d194768d57c79897c681c96f4321651464f7b577d08083d8b67213a1e29dc8495d8389e6cbd85fdd738c402a1801198b57b302e0e00dfaf1247", + "balance": "0xd3c21bcecceda1000000", + "stake": "0xd3c21bcecceda1000000", + "multiAddr": "/ip4/127.0.0.1/tcp/30304/p2p/16Uiu2HAm42EFMhJPGcMRFHPaWWxBzoEsWRbGxJnBHMu4VFojg99U" + } + ], + "bridge": null, + "epochSize": 10, + "epochReward": 1, + "sprintSize": 5, + "blockTime": "2s", + "governance": "0x61324166B0202DB1E7502924326262274Fa4358F", + "mintableNative": false, + "nativeTokenConfig": { + "name": "Polygon", + "symbol": "WMATIC", + "decimals": 18 + }, + "initialTrieRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "maxValidatorSetSize": 9007199254740990, + "rewardConfig": { + "rewardTokenAddress": "0x0000000000000000000000000000000000001010", + "rewardWalletAddress": "0x61324166B0202DB1E7502924326262274Fa4358F", + "rewardWalletAmount": "0xf4240" + } + } + }, + "blockGasTarget": 0, + "transactionsAllowList": { + "adminAddresses": [ + "0x061324166B0202Db1E7502924326262274fa4358" + ], + "enabledAddresses": [ + "0x061324166B0202Db1E7502924326262274fa4358" + ] + }, + "burnContract": null + }, + "bootnodes": [ + "/ip4/127.0.0.1/tcp/30301/p2p/16Uiu2HAmMYyzK7c649Tnn6XdqFLP7fpPB2QWdck1Ee9vj5a7Nhg8", + "/ip4/127.0.0.1/tcp/30302/p2p/16Uiu2HAmLXVapjR2Yx3B1taCmHnckQ1ph2xrawBjW2kvSErps9CX", + "/ip4/127.0.0.1/tcp/30303/p2p/16Uiu2HAmGskf5sZ514Ab4SHTPuw8RRBQudyrU211wn3P1knRz9Ed", + "/ip4/127.0.0.1/tcp/30304/p2p/16Uiu2HAm42EFMhJPGcMRFHPaWWxBzoEsWRbGxJnBHMu4VFojg99U" + ] +} +``` + +
+ +
+ + + + + +When setting up the initial chain state for a multiple-host validator setup, you'll need to specify the validator information using the `--validators` flag in the following format: `:::`. + +This follows the [libp2p multiaddr format](../../design/libp2p.md): ``. + +In this example, we will designate the first and second nodes as bootnodes for all other nodes. Nodes connecting to node 1 or 2 will receive information on how to connect to each other through the mutually contacted bootnode. For the ports, we will use `30301` for the first node and `30302` for the second node. Since we are running on localhost, it is safe to assume that the `ip_address` is `127.0.0.1`. If you are not running on your localhost, please update accordingly. + +After assembly, the multiaddr connection string for node 1 and 2 will look something like this: + +- Node 1: `/ip4/127.0.0.1/tcp/30301/p2p/16Uiu2HAmMYyzK7c649Tnn6XdqFLP7fpPB2QWdck1Ee9vj5a7Nhg8` +- Node 2: `/ip4/127.0.0.1/tcp/30302/p2p/16Uiu2HAmLXVapjR2Yx3B1taCmHnckQ1ph2xrawBjW2kvSErps9CX` + +In the following example command, we will set the block gas limit to `10,000,000` and the epoch size to `10` using the `--block-gas-limit` and `--epoch-size` flags, respectively. + +We will also specify the consensus mechanism as PolyBFT using the `--consensus` flag. + +To enable reward distribution, we will define a reward wallet address and its balance using the `--reward-wallet` flag (for this example, we use the first validator as the reward wallet). + +In addition, we can provide the directory where the validator information is stored using the `--validators-path` flag and the prefix for the validator folder names using the `--validators-prefix` flag. + +We also add the `--transactions-allow-list-admin` flag to specify the admin addresses for the transactions allowlist, and the `--transactions-allow-list-enabled` flag to specify the addresses that will be enabled by default in the transactions allowlist, using the first and second validator nodes. + +**You can customize the initial chain state using the flags listed above.** + +```bash +./polygon-edge genesis --block-gas-limit 10000000 --epoch-size 10 \ + --proxy-contracts-admin 0x61324166B0202DB1E7502924326262274Fa4358F \ + --validators "/ip4/127.0.0.1/tcp/30301/p2p/16Uiu2HAmMYyzK7c649Tnn6XdqFLP7fpPB2QWdck1Ee9vj5a7Nhg8:0x61324166B0202DB1E7502924326262274Fa4358F:06d8d9e6af67c28e85ac400b72c2e635e83234f8a380865e050a206554049a222c4792120d84977a6ca669df56ff3a1cf1cfeccddb650e7aacff4ed6c1d4e37b055858209f80117b3c0a6e7a28e456d4caf2270f430f9df2ba37221f23e9bbd313c9ef488e1849cc5c40d18284d019dde5ed86770309b9c24b70ceff6167a6ca" \ + --validators "/ip4/127.0.0.1/tcp/30302/p2p/16Uiu2HAmLXVapjR2Yx3B1taCmHnckQ1ph2xrawBjW2kvSErps9CX:0xFE5E166BA5EA50c04fCa00b07b59966E6C2E9570:0601da8856a6d3d3bb0f3bcbb90ea7b8c0db8271b9203e6123c6804aa3fc5f810be33287968ca1af2be11839516850a6ffef2337d99e679b7531efbbea2e3bf727a053c0cbede71da3d5f489b6ad862ccd8bb0bfb7fa379e3395d3b1142594a73020e87d63c298a3a4eba0ace65727f8659bab6389b9448b72512db72bbe937f" \ + --consensus polybft \ + --reward-wallet 0x61324166B0202DB1E7502924326262274Fa4358F:1000000 \ + --transactions-allow-list-admin 0x61324166B0202DB1E7502924326262274Fa4358F,0xFE5E166BA5EA50c04fCa00b07b59966E6C2E9570 \ + --transactions-allow-list-enabled 0x61324166B0202DB1E7502924326262274Fa4358F,0xFE5E166BA5EA50c04fCa00b07b59966E6C2E9570 \ + --premine 0x0:1000000000000000000000 +``` + +By customizing these flags, we can tailor the network to meet our specific requirements. Remember to consider the impact of these parameters carefully, as they can significantly affect the network's performance, security, and scalability. + +
+Genesis output example + +#### Output: + +```bash +[GENESIS VALIDATORS] +Address=0x61324166B0202DB1E7502924326262274Fa4358F; Balance=1000000; P2P Multi addr=/ip4/127.0.0.1/tcp/30301/p2p/16Uiu2HAmMYyzK7c649Tnn6XdqFLP7fpPB2QWdck1Ee9vj5a7Nhg8; BLS Key=06d8d9e6af67c28e85ac400b72c2e635e83234f8a380865e050a206554049a222c4792120d84977a6ca669df56ff3a1cf1cfeccddb650e7aacff4ed6c1d4e37b055858209f80117b3c0a6e7a28e456d4caf2270f430f9df2ba37221f23e9bbd313c9ef488e1849cc5c40d18284d019dde5ed86770309b9c24b70ceff6167a6ca; +Address=0xFE5E166BA5EA50c04fCa00b07b59966E6C2E9570; Balance=1000000000000000000000000; P2P Multi addr=/ip4/127.0.0.1/tcp/30302/p2p/16Uiu2HAmLXVapjR2Yx3B1taCmHnckQ1ph2xrawBjW2kvSErps9CX; BLS Key=0601da8856a6d3d3bb0f3bcbb90ea7b8c0db8271b9203e6123c6804aa3fc5f810be33287968ca1af2be11839516850a6ffef2337d99e679b7531efbbea2e3bf727a053c0cbede71da3d5f489b6ad862ccd8bb0bfb7fa379e3395d3b1142594a73020e87d63c298a3a4eba0ace65727f8659bab6389b9448b72512db72bbe937f; + +[GENESIS SUCCESS] + +Genesis written to ./genesis.json +``` + +#### genesis.json example: + +```json +{ + "name": "polygon-edge", + "genesis": { + "nonce": "0x0000000000000000", + "timestamp": "0x0", + "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000f901bbf9014ff9014af8a39461324166b0202db1e7502924326262274fa4358fb88006d8d9e6af67c28e85ac400b72c2e635e83234f8a380865e050a206554049a222c4792120d84977a6ca669df56ff3a1cf1cfeccddb650e7aacff4ed6c1d4e37b055858209f80117b3c0a6e7a28e456d4caf2270f430f9df2ba37221f23e9bbd313c9ef488e1849cc5c40d18284d019dde5ed86770309b9c24b70ceff6167a6ca8ad3c21bcecceda100000001f8a394fe5e166ba5ea50c04fca00b07b59966e6c2e9570b8800601da8856a6d3d3bb0f3bcbb90ea7b8c0db8271b9203e6123c6804aa3fc5f810be33287968ca1af2be11839516850a6ffef2337d99e679b7531efbbea2e3bf727a053c0cbede71da3d5f489b6ad862ccd8bb0bfb7fa379e3395d3b1142594a73020e87d63c298a3a4eba0ace65727f8659bab6389b9448b72512db72bbe937f8ad3c21bcecceda100000001c080c0c0f8658080a00000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000", + "gasLimit": "0x989680", + "difficulty": "0x0", + "mixHash": "0xadce6e5230abe012342a44e4e9b6d05997d6f015387ae0e59be924afc7ec70c1", + "coinbase": "0x0000000000000000000000000000000000000000", + "alloc": { + "0x0000000000000000000000000000000000000101": { + "code": "0x608060405234801561001057600080fd5b50600436106101b05760003560e01c806370a08231116100ef578063ce513b6f11610092578063ce513b6f14610398578063dd62ed3e146103ab578063e0563ab1146103be578063ea0fee4f146103c7578063eacdc5ff146103cf578063eeb49945146103d8578063f3f43703146103eb578063fd242c14146103fe57600080fd5b806370a08231146102e7578063947287cf146102fa57806395d89b411461030357806397e5230d1461030b578063981b24d014610315578063a457c2d714610328578063a9059cbb1461033b578063c6b61e4c1461034e57600080fd5b8063395093511161015757806339509351146102735780633b878c22146102865780633ccfd60b1461028f5780633fd50001146102975780634ee2cd7e146102aa57806351351d53146102bd57806361cc2763146102cb57806362656003146102de57600080fd5b806306fdde03146101b5578063095ea7b3146101d35780630f50287c146101f657806318160ddd1461020b57806323b872dd1461021d578063284017f5146102305780632e17de7814610251578063313ce56714610264575b600080fd5b6101bd610411565b6040516101ca91906119ba565b60405180910390f35b6101e66101e13660046119e2565b6104a3565b60405190151581526020016101ca565b610209610204366004611a0e565b6104bd565b005b6035545b6040519081526020016101ca565b6101e661022b366004611a46565b61074f565b61023961202081565b6040516001600160a01b0390911681526020016101ca565b61020961025f366004611a87565b610773565b604051601281526020016101ca565b6101e66102813660046119e2565b61078a565b61023961101081565b6102096107ac565b61020f6102a5366004611a87565b6108bd565b61020f6102b83660046119e2565b6108de565b6102396002600160a01b0381565b6102096102d9366004611b10565b6108f1565b61020f60cc5481565b61020f6102f5366004611c29565b610b1f565b61020f61520881565b6101bd610b3a565b61020f620249f081565b61020f610323366004611a87565b610b49565b6101e66103363660046119e2565b610b54565b6101e66103493660046119e2565b610bcf565b61037d61035c366004611a87565b60ce6020526000908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016101ca565b61020f6103a6366004611c29565b610bdd565b61020f6103b9366004611c46565b610c0b565b61023961203081565b61020f600181565b61020f60cd5481565b6102096103e6366004611c7f565b610c36565b61020f6103f9366004611c29565b610d08565b61020f61040c366004611a87565b610d2f565b60606036805461042090611d08565b80601f016020809104026020016040519081016040528092919081815260200182805461044c90611d08565b80156104995780601f1061046e57610100808354040283529160200191610499565b820191906000526020600020905b81548152906001019060200180831161047c57829003601f168201915b5050505050905090565b6000336104b1818585610d79565b60019150505b92915050565b336002600160a01b03146105065760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064015b60405180910390fd5b60cd80546000918261051783611d58565b9190505590508083146105625760405162461bcd60e51b815260206004820152601360248201527215539156141150d5115117d15413d0d217d251606a1b60448201526064016104fd565b81356020830135116105ac5760405162461bcd60e51b81526020600482015260136024820152721393d7d09313d0d2d4d7d0d3d3535255151151606a1b60448201526064016104fd565b60cc546105be83356020850135611d71565b6105c9906001611d84565b6105d39190611dad565b1561062e5760405162461bcd60e51b815260206004820152602560248201527f45504f43485f4d5553545f42455f444956495349424c455f42595f45504f43486044820152645f53495a4560d81b60648201526084016104fd565b813560ce600061063f600185611d71565b815260200190815260200160002060010154600161065d9190611d84565b146106a05760405162461bcd60e51b8152602060048201526013602482015272494e56414c49445f53544152545f424c4f434b60681b60448201526064016104fd565b600081815260ce6020526040902082906106d182828135815560208201356001820155604082013560028201555050565b505060cf80546001810182556000919091526020838101357facb8d954e2cfef495862221e91bd7523613cf8808827cb33edfe4904cc51bf299092018290556040805190850135815284359186917f0ce8712c4dee4bd5a691f0bc1c39594671591e77395f8ebf6a3fb5f63fbea66a910160405180910390a4505050565b60003361075d858285610e9e565b610768858585610f12565b506001949350505050565b61077d33826110b6565b61078733826111e1565b50565b6000336104b181858561079d8383610c0b565b6107a79190611d84565b610d79565b33600090815260d06020526040812060cd5490919081906107ce90849061125a565b808555604051828152919350915033907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a260c95460cb54604080517f8ca9a95e41b5eece253c93f5b31eed1253aed6b145d8a6e14d913fdf8e7322936020820152338183015260608082018790528251808303909101815260808201928390526316f1983160e01b9092526001600160a01b03938416936316f198319361088693911691608401611dc1565b600060405180830381600087803b1580156108a057600080fd5b505af11580156108b4573d6000803e3d6000fd5b50505050505050565b60cf81815481106108cd57600080fd5b600091825260209091200154905081565b60006108ea83836112cc565b9392505050565b600054610100900460ff16158080156109115750600054600160ff909116105b8061092b5750303b15801561092b575060005460ff166001145b61098e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104fd565b6000805460ff1916600117905580156109b1576000805461ff0019166101001790555b6109fb6040518060400160405280600c81526020016b15985b1a59185d1bdc94d95d60a21b815250604051806040016040528060048152602001631594d15560e21b815250611315565b60c980546001600160a01b038089166001600160a01b03199283161790925560ca805488841690831617905560cb80549287169290911691909117905560cc83905560005b8251811015610a9557610a8d838281518110610a5e57610a5e611de5565b602002602001015160000151848381518110610a7c57610a7c611de5565b60200260200101516020015161134a565b600101610a40565b5060cf80546001818101835560009283527facb8d954e2cfef495862221e91bd7523613cf8808827cb33edfe4904cc51bf299091019190915560cd558015610b17576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6001600160a01b031660009081526033602052604090205490565b60606037805461042090611d08565b60006104b782611354565b60003381610b628286610c0b565b905083811015610bc25760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016104fd565b6107688286868403610d79565b6000336104b1818585610f12565b60cd546001600160a01b038216600090815260d0602052604081209091610c04919061125a565b5092915050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b60ca546001600160a01b031633148015610c5d575060cb546001600160a01b038481169116145b610c9a5760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a2a72222a960911b60448201526064016104fd565b7f1bcc0f4c3fad314e585165815f94ecca9b96690a26d6417d7876448a9a867a69610cc9602060008486611dfb565b610cd291611e25565b03610d0257600080610ce78360208187611dfb565b810190610cf491906119e2565b91509150610b17828261134a565b50505050565b60cd546001600160a01b038216600090815260d06020526040812090916104b7919061137f565b600081815260ce60205260408120600101548015610d7057600083815260ce6020526040902054610d609082611d71565b610d6b906001611d84565b6108ea565b60009392505050565b6001600160a01b038316610ddb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104fd565b6001600160a01b038216610e3c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104fd565b6001600160a01b0383811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6000610eaa8484610c0b565b90506000198114610d025781811015610f055760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016104fd565b610d028484848403610d79565b6001600160a01b038316610f765760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104fd565b6001600160a01b038216610fd85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104fd565b610fe383838361141d565b6001600160a01b0383166000908152603360205260409020548181101561105b5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016104fd565b6001600160a01b038085166000818152603360205260408082208686039055928616808252908390208054860190559151600080516020611fd6833981519152906110a99086815260200190565b60405180910390a3610d02565b6001600160a01b0382166111165760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016104fd565b6111228260008361141d565b6001600160a01b038216600090815260336020526040902054818110156111965760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016104fd565b6001600160a01b0383166000818152603360209081526040808320868603905560358054879003905551858152919291600080516020611fd68339815191529101610e91565b505050565b61121381600160cd546111f49190611d84565b6001600160a01b038516600090815260d0602052604090209190611486565b816001600160a01b03167f655c1cd0236fb6dc4916f34c8ff10e3b18fcaea5b344dfc16c36fbb1bdfc5df28260405161124e91815260200190565b60405180910390a25050565b81546000905b83600101548110156112c5576000818152600285016020908152604091829020825180840190935280548352600101549082018190528410156112a357506112c5565b80516112af9084611d84565b92505080806112bd90611d58565b915050611260565b9250929050565b6001600160a01b0382166000908152606560205260408120819081906112f39085906115b1565b915091508161130a5761130585610b1f565b61130c565b805b95945050505050565b600054610100900460ff1661133c5760405162461bcd60e51b81526004016104fd90611e43565b611346828261169f565b5050565b61134682826116df565b60008060006113648460666115b1565b915091508161137557603554611377565b805b949350505050565b60018201546000908082036113985760009150506104b7565b60006113a5600183611d71565b90505b845481106114155760008181526002860160209081526040918290208251808401909352805483526001015490820181905285106113e65750611415565b80516113f29085611d84565b9350816000036114025750611415565b508061140d81611e8e565b9150506113a8565b505092915050565b6001600160a01b038316158061143a57506001600160a01b038216155b61147b5760405162461bcd60e51b81526020600482015260126024820152712a2920a729a322a92fa327a92124a22222a760711b60448201526064016104fd565b6111dc83838361179a565b8160000361149657611496611ea5565b825460018401548181036114ed576040805180820182528581526020808201868152600085815260028a0190925292812091518255915160019182015586018054916114e183611d58565b91905055505050505050565b600060028601816114ff600185611d71565b81526020019081526020016000206001015490508084101561152357611523611ea5565b83811015611572576040805180820182528681526020808201878152600086815260028b01909252928120915182559151600191820155870180549161156883611d58565b9190505550610b17565b84600287016000611584600186611d71565b815260200190815260200160002060000160008282546115a49190611d84565b9091555050505050505050565b600080600084116115fd5760405162461bcd60e51b815260206004820152601660248201527504552433230536e617073686f743a20696420697320360541b60448201526064016104fd565b60cd5484111561164f5760405162461bcd60e51b815260206004820152601d60248201527f4552433230536e617073686f743a206e6f6e6578697374656e7420696400000060448201526064016104fd565b600061165b84866117e2565b845490915081036116735760008092509250506112c5565b600184600101828154811061168a5761168a611de5565b906000526020600020015492509250506112c5565b600054610100900460ff166116c65760405162461bcd60e51b81526004016104fd90611e43565b60366116d28382611f01565b5060376111dc8282611f01565b6001600160a01b0382166117355760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016104fd565b6117416000838361141d565b80603560008282546117539190611d84565b90915550506001600160a01b038216600081815260336020908152604080832080548601905551848152600080516020611fd6833981519152910160405180910390a35050565b6001600160a01b0383166117b9576117b18261188f565b6111dc6118b9565b6001600160a01b0382166117d0576117b18361188f565b6117d98361188f565b6111dc8261188f565b815460009081036117f5575060006104b7565b82546000905b8082101561184257600061180f83836118c9565b6000878152602090209091508590820154111561182e5780915061183c565b611839816001611d84565b92505b506117fb565b60008211801561186e57508361186b8661185d600186611d71565b600091825260209091200190565b54145b156118875761187e600183611d71565b925050506104b7565b5090506104b7565b6001600160a01b0381166000908152606560205260409020610787906118b483610b1f565b6118e4565b6118c760666118b460355490565b565b60006118d86002848418611fc1565b6108ea90848416611d84565b60006118ef60cd5490565b9050806118fb8461192f565b10156111dc578254600180820185556000858152602080822090930193909355938401805494850181558252902090910155565b8054600090810361194257506000919050565b8154829061195290600190611d71565b8154811061196257611962611de5565b90600052602060002001549050919050565b6000815180845260005b8181101561199a5760208185018101518683018201520161197e565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006108ea6020830184611974565b6001600160a01b038116811461078757600080fd5b600080604083850312156119f557600080fd5b8235611a00816119cd565b946020939093013593505050565b6000808284036080811215611a2257600080fd5b833592506060601f1982011215611a3857600080fd5b506020830190509250929050565b600080600060608486031215611a5b57600080fd5b8335611a66816119cd565b92506020840135611a76816119cd565b929592945050506040919091013590565b600060208284031215611a9957600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715611ad957611ad9611aa0565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611b0857611b08611aa0565b604052919050565b600080600080600060a08688031215611b2857600080fd5b8535611b33816119cd565b9450602086810135611b44816119cd565b9450604087810135611b55816119cd565b945060608801359350608088013567ffffffffffffffff80821115611b7957600080fd5b818a0191508a601f830112611b8d57600080fd5b813581811115611b9f57611b9f611aa0565b611bad858260051b01611adf565b818152858101925060069190911b83018501908c821115611bcd57600080fd5b928501925b81841015611c165784848e031215611bea5760008081fd5b611bf2611ab6565b8435611bfd816119cd565b8152848701358782015283529284019291850191611bd2565b8096505050505050509295509295909350565b600060208284031215611c3b57600080fd5b81356108ea816119cd565b60008060408385031215611c5957600080fd5b8235611c64816119cd565b91506020830135611c74816119cd565b809150509250929050565b60008060008060608587031215611c9557600080fd5b843593506020850135611ca7816119cd565b9250604085013567ffffffffffffffff80821115611cc457600080fd5b818701915087601f830112611cd857600080fd5b813581811115611ce757600080fd5b886020828501011115611cf957600080fd5b95989497505060200194505050565b600181811c90821680611d1c57607f821691505b602082108103611d3c57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600060018201611d6a57611d6a611d42565b5060010190565b818103818111156104b7576104b7611d42565b808201808211156104b7576104b7611d42565b634e487b7160e01b600052601260045260246000fd5b600082611dbc57611dbc611d97565b500690565b6001600160a01b038316815260406020820181905260009061137790830184611974565b634e487b7160e01b600052603260045260246000fd5b60008085851115611e0b57600080fd5b83861115611e1857600080fd5b5050820193919092039150565b803560208310156104b757600019602084900360031b1b1692915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600081611e9d57611e9d611d42565b506000190190565b634e487b7160e01b600052600160045260246000fd5b601f8211156111dc57600081815260208120601f850160051c81016020861015611ee25750805b601f850160051c820191505b81811015610b1757828155600101611eee565b815167ffffffffffffffff811115611f1b57611f1b611aa0565b611f2f81611f298454611d08565b84611ebb565b602080601f831160018114611f645760008415611f4c5750858301515b600019600386901b1c1916600185901b178555610b17565b600085815260208120601f198616915b82811015611f9357888601518255948401946001909101908401611f74565b5085821015611fb15787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082611fd057611fd0611d97565b50049056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220ceae916e2fad24f9aaa4340b6994418d32d33c6ae1f266c50dd4ec5ccbdbce2764736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000000102": { + "code": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c806391ec2d2b1161006657806391ec2d2b1461013b578063a850a9091461015b578063d58e77331461016e578063e242cce914610181578063ebbdac911461019457600080fd5b8063115000fe146100a3578063247dd9fb146100cb5780633e5476ce146100de5780638669026f146101085780639141376314610128575b600080fd5b6100b66100b1366004612708565b6101a7565b60405190151581526020015b60405180910390f35b6100b66100d9366004612785565b61030e565b6100f16100ec366004612841565b6103b8565b6040805192151583529015156020830152016100c2565b61011b6101163660046128ce565b61079f565b6040516100c29190612957565b6100f1610136366004612988565b6108bb565b61014e6101493660046128ce565b610d5c565b6040516100c29190612a86565b61011b6101693660046128ce565b610ff8565b61011b61017c366004612aa0565b6111d4565b6100b661018f366004612785565b6115aa565b6100f16101a2366004612ab9565b611609565b600081516020830151600080516020612d63833981519152828309600080516020612d638339815191528283098182830101600080516020612d638339815191528283840108600080516020612d638339815191528682600080516020612d6383398151915203860109935050600080516020612d638339815191528483600080516020612d63833981519152038301099150600080516020612d638339815191527f2b149d40ceb8aaae81be18991be06ac3b5b4c5e559dbefa33267e6dc24a138e584089450600080516020612d638339815191527e9713b03af0fed4cd2cafadeed8fdf4a74fa084e52d1852e4a2bd0685c315d2830893506040870151925060608701519150600080516020612d638339815191528083600080516020612d63833981519152038508600080516020612d63833981519152848608099050600080516020612d63833981519152828460011b0994149290931491909116949350505050565b8051600090600080516020612d6383398151915211158061034157506020820151600080516020612d6383398151915211155b1561034e57506000919050565b60405163e242cce960e01b8152309063e242cce990610371908590600401612957565b602060405180830381865afa15801561038e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b29190612b1c565b92915050565b60008083806103e25760405162461bcd60e51b81526004016103d990612b3e565b60405180910390fd5b60006103ef826001612b95565b6103fa906006612ba8565b90506000816001600160401b038111156104165761041661269a565b60405190808252806020026020018201604052801561043f578160200160208202803683370190505b50905088600060200201358160008151811061045d5761045d612b06565b602090810291909101015288600160200201358160018151811061048357610483612b06565b602002602001018181525050600080516020612d43833981519152816002815181106104b1576104b1612b06565b602002602001018181525050600080516020612d23833981519152816003815181106104df576104df612b06565b602002602001018181525050600080516020612d838339815191528160048151811061050d5761050d612b06565b602002602001018181525050600080516020612da38339815191528160058151811061053b5761053b612b06565b60200260200101818152505060005b8381101561075a57863582610560836006612ba8565b61056b906006612b95565b8151811061057b5761057b612b06565b602090810291909101015286600160200201358261059a836006612ba8565b6105a5906007612b95565b815181106105b5576105b5612b06565b6020026020010181815250508888828181106105d3576105d3612b06565b9050608002016001600481106105eb576105eb612b06565b6020020135826105fc836006612ba8565b610607906008612b95565b8151811061061757610617612b06565b60200260200101818152505088888281811061063557610635612b06565b90506080020160006004811061064d5761064d612b06565b60200201358261065e836006612ba8565b610669906009612b95565b8151811061067957610679612b06565b60200260200101818152505088888281811061069757610697612b06565b9050608002016003600481106106af576106af612b06565b6020020135826106c0836006612ba8565b6106cb90600a612b95565b815181106106db576106db612b06565b6020026020010181815250508888828181106106f9576106f9612b06565b90506080020160026004811061071157610711612b06565b602002013582610722836006612ba8565b61072d90600b612b95565b8151811061073d5761073d612b06565b60209081029190910101528061075281612bbf565b91505061054a565b50610763612640565b602081602085026020850160085afa945084610789576000809550955050505050610796565b5115159450600193505050505b94509492505050565b6107a761265e565b6040516391ec2d2b60e01b815260009030906391ec2d2b906107cf9087908790600401612bd8565b600060405180830381865afa1580156107ec573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108149190810190612bf9565b9050600080600080601885016001600160c01b0381511693506030860190506001600160c01b038151169450600080516020612d6383398151915285600080516020612d63833981519152600160c01b870908604887015160608801516001600160c01b0390811697501694509250600080516020612d6383398151915290508481600160c01b860908604080518082019091529283526020830152509695505050505050565b60008084806108dc5760405162461bcd60e51b81526004016103d990612b3e565b8084146109495760405162461bcd60e51b815260206004820152603560248201527f424c533a206e756d626572206f66207075626c6963206b65797320616e64206d604482015274195cdcd859d95cc81b5d5cdd08189948195c5d585b605a1b60648201526084016103d9565b6000610956826001612b95565b610961906006612ba8565b90506000816001600160401b0381111561097d5761097d61269a565b6040519080825280602002602001820160405280156109a6578160200160208202803683370190505b5090508960006020020135816000815181106109c4576109c4612b06565b60209081029190910101528960016020020135816001815181106109ea576109ea612b06565b602002602001018181525050600080516020612d4383398151915281600281518110610a1857610a18612b06565b602002602001018181525050600080516020612d2383398151915281600381518110610a4657610a46612b06565b602002602001018181525050600080516020612d8383398151915281600481518110610a7457610a74612b06565b602002602001018181525050600080516020612da383398151915281600581518110610aa257610aa2612b06565b60200260200101818152505060005b83811015610d1657878782818110610acb57610acb612b06565b905060400201600060028110610ae357610ae3612b06565b602002013582610af4836006612ba8565b610aff906006612b95565b81518110610b0f57610b0f612b06565b602002602001018181525050878782818110610b2d57610b2d612b06565b905060400201600160028110610b4557610b45612b06565b602002013582610b56836006612ba8565b610b61906007612b95565b81518110610b7157610b71612b06565b602002602001018181525050898982818110610b8f57610b8f612b06565b905060800201600160048110610ba757610ba7612b06565b602002013582610bb8836006612ba8565b610bc3906008612b95565b81518110610bd357610bd3612b06565b602002602001018181525050898982818110610bf157610bf1612b06565b905060800201600060048110610c0957610c09612b06565b602002013582610c1a836006612ba8565b610c25906009612b95565b81518110610c3557610c35612b06565b602002602001018181525050898982818110610c5357610c53612b06565b905060800201600360048110610c6b57610c6b612b06565b602002013582610c7c836006612ba8565b610c8790600a612b95565b81518110610c9757610c97612b06565b602002602001018181525050898982818110610cb557610cb5612b06565b905060800201600260048110610ccd57610ccd612b06565b602002013582610cde836006612ba8565b610ce990600b612b95565b81518110610cf957610cf9612b06565b602090810291909101015280610d0e81612bbf565b915050610ab1565b50610d1f612640565b602081602085026020850160085afa945084610d45576000809550955050505050610d52565b5115159450600193505050505b9550959350505050565b80516060906000610d6e826020612b95565b610d79906040612b95565b610d84906004612b95565b6001600160401b03811115610d9b57610d9b61269a565b6040519080825280601f01601f191660200182016040528015610dc5576020820181803683370190505b5060408051606080825260808201909252919250600091906020820181803683370190505090506060820160005b84811015610e0d5760208188018101518383015201610df3565b5083016000815360010160608153600101600081536001810187905260210160208153506000600283604051610e439190612c6f565b602060405180830381855afa158015610e60573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610e839190612c8b565b9050600060429450848452816020850152600160408501536041840188905260206061850153600284604051610eb99190612c6f565b602060405180830381855afa158015610ed6573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610ef99190612c8b565b905080602084015280821880602086015250600260408501536041840188905260206061850153600284604051610f309190612c6f565b602060405180830381855afa158015610f4d573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610f709190612c8b565b905080604084015280821880602086015250600360408501536041840188905260206061850153600284604051610fa79190612c6f565b602060405180830381855afa158015610fc4573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610fe79190612c8b565b606084015250909695505050505050565b61100061265e565b604051638669026f60e01b81526000903090638669026f906110289087908790600401612bd8565b6040805180830381865afa158015611044573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110689190612ca4565b805160405163d58e773360e01b81526004810191909152909150600090309063d58e7733906024016040805180830381865afa1580156110ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d09190612ca4565b602083015160405163d58e773360e01b81526004810191909152909150600090309063d58e7733906024016040805180830381865afa158015611117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113b9190612ca4565b905061114561267c565b825181526020808401518282015282516040808401919091529083015160608301526000908460808460066107d05a03fa9050808061118057fe5b50806111c85760405162461bcd60e51b8152602060048201526017602482015276109314ce88189b881859190818d85b1b0819985a5b1959604a1b60448201526064016103d9565b50919695505050505050565b6111dc61265e565b600080516020612d6383398151915282106112455760405162461bcd60e51b815260206004820152602360248201527f6d6170546f506f696e7446543a20696e76616c6964206669656c6420656c656d604482015262195b9d60ea1b60648201526084016103d9565b81600061125182611790565b9150506000600080516020612d638339815191528061127257611272612cf9565b8384099050600080516020612d638339815191526004820890506000600080516020612d6383398151915277b3c4d79d41a91759a9e4c7e359b6b89eaec68e62effffffd850990506000600080516020612d6383398151915283830990506112d9816117b9565b9050600080516020612d638339815191528283099150600080516020612d638339815191528183099150600080516020612d638339815191528286099150600080516020612d6383398151915261133e83600080516020612d63833981519152612d0f565b7759e26bcea0d48bacd4f263f1acdb5c4f5763473177fffffe089450600080516020612d638339815191528586099150600080516020612d638339815191528583099150600080516020612d6383398151915260038308915060006113a283611790565b909350905080156113ea57846113cd576113ca83600080516020612d63833981519152612d0f565b92505b505060408051808201909152938452602084015250909392505050565b600080516020612d638339815191526001870861141590600080516020612d63833981519152612d0f565b9550600080516020612d638339815191528687099250600080516020612d638339815191528684099250600080516020612d6383398151915260038408925061145d83611790565b9093509050801561148557846113cd576113ca83600080516020612d63833981519152612d0f565b600080516020612d638339815191528485099550600080516020612d638339815191528687099550600080516020612d638339815191528287099550600080516020612d638339815191528287099550600080516020612d63833981519152600187089550600080516020612d638339815191528687099250600080516020612d638339815191528684099250600080516020612d6383398151915260038408925061153083611790565b90935090508061158d5760405162461bcd60e51b815260206004820152602260248201527f424c533a20626164206674206d617070696e6720696d706c656d656e7461746960448201526137b760f11b60648201526084016103d9565b846113cd576113ca83600080516020612d63833981519152612d0f565b600081516020830151600080516020612d63833981519152828309600080516020612d638339815191528382099050600080516020612d63833981519152600382089050600080516020612d6383398151915282830914949350505050565b60008060006040518061018001604052808760006002811061162d5761162d612b06565b602002013581526020018760016002811061164a5761164a612b06565b60200201358152602001600080516020612d438339815191528152602001600080516020612d238339815191528152602001600080516020612d838339815191528152602001600080516020612da38339815191528152602001856000600281106116b7576116b7612b06565b60200201358152602001856001600281106116d4576116d4612b06565b60200201358152602001866001600481106116f1576116f1612b06565b602002013581526020018660006004811061170e5761170e612b06565b602002013581526020018660036004811061172b5761172b612b06565b602002013581526020018660026004811061174857611748612b06565b602002013590529050611759612640565b60006020826101808560085afa90508061177c5760008094509450505050611788565b50511515925060019150505b935093915050565b60008061179c836117c4565b915082600080516020612d63833981519152838409149050915091565b60006103b282611ef9565b6000600080516020612d638339815191528083840991508083830981838209828283098385830984848309858484098684850997508684840987858409945087898a09985087898a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087818a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a09985087898a09985087898a09985087898a09985087818a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087898a09985087898a09985087838a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087818a09985050868889099750868889099750868889099750868889099750868889099750868889099750868489099750868889099750868889099750868889099750868889099750868889099750868989099750868889099750868889099750868889099750868889099750868889099750868889099750868989099750868889099750868889099750868889099750868889099750868889099750868689099750868889099750868889099750868889099750868889099750868889099750868889099750868889099750868889099750868889099750868189099750508587880996508587880996508587880996508585880996508587880996508587880996508587880996508585880996508587880996508587880996508587880996508587880996508587880996508587880996508587880996508587880996508583880996508587880996508587880996508587880996508587880996508581880996508587880996508587880996508587880996508587880996508583880996508587880996508587880996508587880996508584880996508587880996508587880996508587880996508587880996508587880996508581880996505050505050808283099392505050565b6000600080516020612d638339815191528083840991508083830981838209828283098385830984848309858484098684850997508684840987858409945087898a09985087898a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087818a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a09985087898a09985087898a09985087898a09985087818a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087878a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a09985087898a09985087898a09985087898a09985087838a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087828a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087848a09985087898a09985087898a09985087898a09985087898a09985087898a09985087868a09985087898a09985087898a099850878a8a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087898a09985087818a09985050868889099750868889099750868889099750868889099750868889099750868889099750868489099750868889099750868889099750868889099750868889099750868889099750868989099750868889099750868889099750868889099750868889099750868889099750868889099750868989099750868889099750868889099750868889099750868889099750868889099750868689099750868889099750868889099750868889099750868889099750868889099750868889099750868889099750868889099750868889099750868189099750508587880996508587880996508587880996508585880996508587880996508587880996508587880996508585880996508587880996508587880996508587880996508587880996508587880996508587880996508587880996508587880996508583880996508587880996508587880996508587880996508587880996508581880996505050838586099450838586099450838586099450838586099450838186099450508284850993508284850993508284850993508281850993508284850993508284850993508285850993508284850993508284850993508284850993508284850993508284850993508284850993508281850995945050505050565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156126d2576126d261269a565b60405290565b604051601f8201601f191681016001600160401b03811182821017156127005761270061269a565b604052919050565b60006080828403121561271a57600080fd5b82601f83011261272957600080fd5b604051608081018181106001600160401b038211171561274b5761274b61269a565b60405280608084018581111561276057600080fd5b845b8181101561277a578035835260209283019201612762565b509195945050505050565b60006040828403121561279757600080fd5b82601f8301126127a657600080fd5b6127ae6126b0565b8060408401858111156127c057600080fd5b845b818110156127da5780358452602093840193016127c2565b509095945050505050565b80604081018310156103b257600080fd5b60008083601f84011261280857600080fd5b5081356001600160401b0381111561281f57600080fd5b6020830191508360208260071b850101111561283a57600080fd5b9250929050565b60008060008060a0858703121561285757600080fd5b61286186866127e5565b935060408501356001600160401b0381111561287c57600080fd5b612888878288016127f6565b909450925061289c905086606087016127e5565b905092959194509250565b60006001600160401b038211156128c0576128c061269a565b50601f01601f191660200190565b600080604083850312156128e157600080fd5b8235915060208301356001600160401b038111156128fe57600080fd5b8301601f8101851361290f57600080fd5b803561292261291d826128a7565b6126d8565b81815286602083850101111561293757600080fd5b816020840160208301376000602083830101528093505050509250929050565b60408101818360005b600281101561297f578151835260209283019290910190600101612960565b50505092915050565b6000806000806000608086880312156129a057600080fd5b6129aa87876127e5565b945060408601356001600160401b03808211156129c657600080fd5b6129d289838a016127f6565b909650945060608801359150808211156129eb57600080fd5b818801915088601f8301126129ff57600080fd5b813581811115612a0e57600080fd5b8960208260061b8501011115612a2357600080fd5b9699959850939650602001949392505050565b60005b83811015612a51578181015183820152602001612a39565b50506000910152565b60008151808452612a72816020860160208601612a36565b601f01601f19169290920160200192915050565b602081526000612a996020830184612a5a565b9392505050565b600060208284031215612ab257600080fd5b5035919050565b60008060006101008486031215612acf57600080fd5b612ad985856127e5565b925060c0840185811115612aec57600080fd5b604085019250612afc86826127e5565b9150509250925092565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612b2e57600080fd5b81518015158114612a9957600080fd5b60208082526021908201527f424c533a206e756d626572206f66207075626c6963206b6579206973207a65726040820152606f60f81b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b808201808211156103b2576103b2612b7f565b80820281158282048414176103b2576103b2612b7f565b600060018201612bd157612bd1612b7f565b5060010190565b828152604060208201526000612bf16040830184612a5a565b949350505050565b600060208284031215612c0b57600080fd5b81516001600160401b03811115612c2157600080fd5b8201601f81018413612c3257600080fd5b8051612c4061291d826128a7565b818152856020838501011115612c5557600080fd5b612c66826020830160208601612a36565b95945050505050565b60008251612c81818460208701612a36565b9190910192915050565b600060208284031215612c9d57600080fd5b5051919050565b600060408284031215612cb657600080fd5b82601f830112612cc557600080fd5b612ccd6126b0565b806040840185811115612cdf57600080fd5b845b818110156127da578051845260209384019301612ce1565b634e487b7160e01b600052601260045260246000fd5b818103818111156103b2576103b2612b7f56fe1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c230644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47275dc4a288d1afb3cbb1ac09187524c7db36395df7be3b99e673b13a075a65ec1d9befcd05a5323e6da4d435f3b617cdb3af83285c2df711ef39c01571827f9da264697066735822122085f910855a39dd4d2f9582253d737b6f9c450d7d8e7383f636149d598d69b6ac64736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000000103": { + "code": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212209ebefbbe674f8f0780cb158df4fa624dc1694693fcb1c5952691eb2a55c6f0aa64736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000000105": { + "code": "0x608060405234801561001057600080fd5b50600436106100d55760003560e01c8063947287cf11610087578063947287cf14610183578063972398b61461018c57806397e5230d1461019f57806399248ea7146101a9578063b66ceef6146101c2578063c885bc58146101d5578063cf756fdf146101dd578063e0563ab1146101f057600080fd5b806307358b99146100da57806322009af61461010d578063284017f51461011657806331d7a262146101375780633b878c221461015757806351351d53146101605780638a9cd82d1461016e575b600080fd5b6100fa6100e8366004610b1d565b60366020526000908152604090205481565b6040519081526020015b60405180910390f35b6100fa60355481565b61011f61202081565b6040516001600160a01b039091168152602001610104565b6100fa610145366004610b52565b60376020526000908152604090205481565b61011f61101081565b61011f6002600160a01b0381565b61018161017c366004610b74565b6101f9565b005b6100fa61520881565b60345461011f906001600160a01b031681565b6100fa620249f081565b60325461011f906201000090046001600160a01b031681565b60335461011f906001600160a01b031681565b610181610658565b6101816101eb366004610bf3565b61068e565b61011f61203081565b336002600160a01b03146102425760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064015b60405180910390fd5b6000838152603660205260409020541561029e5760405162461bcd60e51b815260206004820152601a60248201527f5245574152445f414c52454144595f44495354524942555445440000000000006044820152606401610239565b603454604051633f490b0560e21b8152600481018590526000916001600160a01b03169063fd242c1490602401602060405180830381865afa1580156102e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030c9190610c3e565b9050806000036103545760405162461bcd60e51b8152602060048201526013602482015272115413d0d217d393d517d0d3d3535255151151606a1b6044820152606401610239565b60345460408051636265600360e01b815290516000926001600160a01b03169163626560039160048083019260209291908290030181865afa15801561039e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c29190610c3e565b905060006103d1826064610c6d565b836035546103df9190610c6d565b6103ea906064610c6d565b6103f49190610c8a565b603454604051630981b24d60e41b8152600481018990529192506000916001600160a01b039091169063981b24d090602401602060405180830381865afa158015610443573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104679190610c3e565b9050846000805b828110156105f857600089898381811061048a5761048a610cac565b9050604002018036038101906104a09190610cc2565b905087816020015111156104f65760405162461bcd60e51b815260206004820152601b60248201527f5349474e45445f424c4f434b535f455843454544535f544f54414c00000000006044820152606401610239565b603454815160405163277166bf60e11b81526001600160a01b039182166004820152602481018e90526000929190911690634ee2cd7e90604401602060405180830381865afa15801561054d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105719190610c3e565b9050600061057f8a88610c6d565b602084015161058e848b610c6d565b6105989190610c6d565b6105a29190610c8a565b83516001600160a01b03166000908152603760205260408120805492935083929091906105d0908490610d27565b909155506105e090508186610d27565b945050505080806105f090610d3a565b91505061046e565b506000898152603660205260409020819055610613816107f1565b887feaf3d57629d9b1ce95715ccd98d6f5bf48023be1d5a06e09f64ab7f6d8be01d58260405161064591815260200190565b60405180910390a2505050505050505050565b3360008181526037602052604081208054919055603254909161068b916201000090046001600160a01b03169083610815565b50565b603254610100900460ff16158080156106ae5750603254600160ff909116105b806106c85750303b1580156106c8575060325460ff166001145b61072b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610239565b6032805460ff19166001179055801561074e576032805461ff0019166101001790555b603280546001600160a01b03808816620100000262010000600160b01b031990921691909117909155603380548683166001600160a01b0319918216179091556034805492861692909116919091179055603582905580156107ea576032805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b60335460325461068b916001600160a01b036201000090920482169116308461087d565b6040516001600160a01b03831660248201526044810182905261087890849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526108bb565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526108b59085906323b872dd60e01b90608401610841565b50505050565b6000610910826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661098d9092919063ffffffff16565b805190915015610878578080602001905181019061092e9190610d53565b6108785760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610239565b606061099c84846000856109a4565b949350505050565b606082471015610a055760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610239565b600080866001600160a01b03168587604051610a219190610d99565b60006040518083038185875af1925050503d8060008114610a5e576040519150601f19603f3d011682016040523d82523d6000602084013e610a63565b606091505b5091509150610a7487838387610a7f565b979650505050505050565b60608315610aee578251600003610ae7576001600160a01b0385163b610ae75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610239565b508161099c565b61099c8383815115610b035781518083602001fd5b8060405162461bcd60e51b81526004016102399190610db5565b600060208284031215610b2f57600080fd5b5035919050565b80356001600160a01b0381168114610b4d57600080fd5b919050565b600060208284031215610b6457600080fd5b610b6d82610b36565b9392505050565b600080600060408486031215610b8957600080fd5b83359250602084013567ffffffffffffffff80821115610ba857600080fd5b818601915086601f830112610bbc57600080fd5b813581811115610bcb57600080fd5b8760208260061b8501011115610be057600080fd5b6020830194508093505050509250925092565b60008060008060808587031215610c0957600080fd5b610c1285610b36565b9350610c2060208601610b36565b9250610c2e60408601610b36565b9396929550929360600135925050565b600060208284031215610c5057600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610c8457610c84610c57565b92915050565b600082610ca757634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060408284031215610cd457600080fd5b6040516040810181811067ffffffffffffffff82111715610d0557634e487b7160e01b600052604160045260246000fd5b604052610d1183610b36565b8152602083013560208201528091505092915050565b80820180821115610c8457610c84610c57565b600060018201610d4c57610d4c610c57565b5060010190565b600060208284031215610d6557600080fd5b81518015158114610b6d57600080fd5b60005b83811015610d90578181015183820152602001610d78565b50506000910152565b60008251610dab818460208701610d75565b9190910192915050565b6020815260008251806020840152610dd4816040850160208701610d75565b601f01601f1916919091016040019291505056fea2646970667358221220c7e8b508ebaffb4eaa11ba374acb0ddc2570f6351d83600979bf1f82d7cec70564736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001001": { + "code": "0x608060405234801561001057600080fd5b50600436106100e05760003560e01c80639017c127116100875780639017c127146101de578063947287cf146101f157806397e5230d146101fa578063ad240c2a14610204578063c59a18f71461020d578063c6df461714610220578063e0563ab114610233578063eb70ef441461023c57600080fd5b8063196f1b2d146100e557806323e281cf1461010b578063284017f5146101145780633b878c221461013557806349ce89971461013e57806350d5b95b1461018857806351351d531461019d578063544c5e0f146101ab575b600080fd5b6100f86100f3366004610e88565b610271565b6040519081526020015b60405180910390f35b6100f860325481565b61011d61202081565b6040516001600160a01b039091168152602001610102565b61011d61101081565b61016d61014c366004610e88565b60356020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610102565b61019b610196366004610eec565b6102f0565b005b61011d6002600160a01b0381565b6101ce6101b9366004610e88565b60346020526000908152604090205460ff1681565b6040519015158152602001610102565b61019b6101ec366004610f5b565b6103b7565b6100f861520881565b6100f8620249f081565b6100f860335481565b6100f861021b366004610e88565b610557565b61019b61022e366004611007565b610578565b61011d61203081565b61024f61024a366004610e88565b61075c565b6040805182518152602080840151908201529181015190820152606001610102565b60008060358161028260368661081f565b81526020810191909152604001600020600201549050806102ea5760405162461bcd60e51b815260206004820152601d60248201527f537461746552656365697665723a204e4f5f524f4f545f464f525f494400000060448201526064015b60405180910390fd5b92915050565b60006102fc823561075c565b805190915061036c906103109084356110a5565b8251602084015161032191906110a5565b61032c9060016110b8565b83604001518787876040516020016103449190611110565b604051602081830303815290604052805190602001206108cc9095949392919063ffffffff16565b6103a85760405162461bcd60e51b815260206004820152600d60248201526c24a72b20a624a22fa82927a7a360991b60448201526064016102e1565b6103b182610a68565b50505050565b8281811461041a5760405162461bcd60e51b815260206004820152602a60248201527f537461746552656365697665723a20554e4d4154434845445f4c454e4754485f604482015269504152414d455445525360b01b60648201526084016102e1565b60005b8181101561054f57600061045485858481811061043c5761043c6111ac565b905060200281019061044e91906111c2565b3561075c565b905060006105088260000151878786818110610472576104726111ac565b905060200281019061048491906111c2565b61048f9190356110a5565b835160208501516104a091906110a5565b6104ab9060016110b8565b84604001518b8b888181106104c2576104c26111ac565b90506020028101906104d491906111e2565b8b8b8a8181106104e6576104e66111ac565b90506020028101906104f891906111c2565b6040516020016103449190611110565b90508061051957505060010161041d565b61054586868581811061052e5761052e6111ac565b905060200281019061054091906111c2565b610a68565b505060010161041d565b505050505050565b6036818154811061056757600080fd5b600091825260209091200154905081565b336002600160a01b03146105bc5760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064016102e1565b6033546105ca9060016110b8565b85351461060c5760405162461bcd60e51b815260206004820152601060248201526f1253959053125117d4d510549517d25160821b60448201526064016102e1565b8435602086013510156106525760405162461bcd60e51b815260206004820152600e60248201526d1253959053125117d1539117d25160921b60448201526064016102e1565b60408051863560208083019190915287013581830152908601356060820152610697906080016040516020818303038152906040528051906020012085858585610c83565b603280548691603591600091826106ad8361122b565b90915550815260208082019290925260409081016000208335815591830135600183015582013560028201555050603680546001810182556000919091526020868101357f4a11f94e20a93c79f6ec743a1954ec4fc2c08429ae2122118bf234b2185c81b89092018290556033829055604080519088013581528735917f11efd893530b26afc66d488ff54cb15df117cb6e0e4a08c6dcb166d766c3bf3b910160405180910390a35050505050565b604080516060810182526000808252602082018190529181018290529061078460368461081f565b60365490915081036107e45760405162461bcd60e51b815260206004820152602360248201527f537461746552656365697665723a204e4f5f434f4d4d49544d454e545f464f5260448201526217d25160ea1b60648201526084016102e1565b600090815260356020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915292915050565b81546000908103610832575060006102ea565b82546000905b8082101561087f57600061084c8383610d87565b6000878152602090209091508590820154111561086b57809150610879565b6108768160016110b8565b92505b50610838565b6000821180156108ab5750836108a88661089a6001866110a5565b600091825260209091200190565b54145b156108c4576108bb6001836110a5565b925050506102ea565b509392505050565b6000816108da866001610da9565b811461091f5760405162461bcd60e51b81526020600482015260146024820152730929cac82989288bea0a49e9e8cbe988a9c8ea8960631b60448201526064016102e1565b8587106109635760405162461bcd60e51b81526020600482015260126024820152710929cac82989288be988a828cbe929c888ab60731b60448201526064016102e1565b8761099f5760405162461bcd60e51b815260206004820152600c60248201526b24a72b20a624a22fa622a0a360a11b60448201526064016102e1565b8760005b82811015610a595760008686838181106109bf576109bf6111ac565b90506020020135905060028a6109d5919061125a565b600003610a0d576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250610a3a565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b610a4560028b61126e565b99505080610a529061122b565b90506109a3565b50909414979650505050505050565b803560009081526034602052604090205460ff1615610ad85760405162461bcd60e51b815260206004820152602660248201527f537461746552656365697665723a2053544154455f53594e435f49535f50524f60448201526510d154d4d15160d21b60648201526084016102e1565b610ae86060820160408301611282565b6001600160a01b03163b600003610b3c576040805160208082526000908201819052918335917f31c652130602f3ce96ceaf8a4c2b8b49f049166c6fcf2eb31943a75ec7c936ae910160405180910390a350565b8035600090815260346020526040808220805460ff191660011790558190610b6a9060608501908501611282565b6001600160a01b03168335610b856040860160208701611282565b610b92606087018761129d565b604051602401610ba594939291906112e3565b60408051601f198184030181529181526020820180516001600160e01b031663eeb4994560e01b17905251610bda919061133c565b6000604051808303816000865af19150503d8060008114610c17576040519150601f19603f3d011682016040523d82523d6000602084013e610c1c565b606091505b509150915081610c3f5782356000908152603460205260409020805460ff191690555b81151583600001357f31c652130602f3ce96ceaf8a4c2b8b49f049166c6fcf2eb31943a75ec7c936ae83604051610c76919061134e565b60405180910390a3505050565b6000806120306001600160a01b0316620249f08888888888604051602001610caf959493929190611381565b60408051601f1981840301815290829052610cc99161133c565b6000604051808303818686fa925050503d8060008114610d05576040519150601f19603f3d011682016040523d82523d6000602084013e610d0a565b606091505b5091509150600081806020019051810190610d2591906113ba565b9050828015610d315750805b610d7d5760405162461bcd60e51b815260206004820152601d60248201527f5349474e41545552455f564552494649434154494f4e5f4641494c454400000060448201526064016102e1565b5050505050505050565b6000610d96600284841861126e565b610da2908484166110b8565b9392505050565b600080610db584610df4565b90506001836002811115610dcb57610dcb6113dc565b148015610ddb575083816001901b105b610de6576000610de9565b60015b60ff16019392505050565b600080608083901c15610e0957608092831c92015b604083901c15610e1b57604092831c92015b602083901c15610e2d57602092831c92015b601083901c15610e3f57601092831c92015b600883901c15610e5157600892831c92015b600483901c15610e6357600492831c92015b600283901c15610e7557600292831c92015b600183901c156102ea5760010192915050565b600060208284031215610e9a57600080fd5b5035919050565b60008083601f840112610eb357600080fd5b5081356001600160401b03811115610eca57600080fd5b6020830191508360208260051b8501011115610ee557600080fd5b9250929050565b600080600060408486031215610f0157600080fd5b83356001600160401b0380821115610f1857600080fd5b610f2487838801610ea1565b90955093506020860135915080821115610f3d57600080fd5b50840160808187031215610f5057600080fd5b809150509250925092565b60008060008060408587031215610f7157600080fd5b84356001600160401b0380821115610f8857600080fd5b610f9488838901610ea1565b90965094506020870135915080821115610fad57600080fd5b50610fba87828801610ea1565b95989497509550505050565b60008083601f840112610fd857600080fd5b5081356001600160401b03811115610fef57600080fd5b602083019150836020828501011115610ee557600080fd5b600080600080600085870360a081121561102057600080fd5b606081121561102e57600080fd5b5085945060608601356001600160401b038082111561104c57600080fd5b61105889838a01610fc6565b9096509450608088013591508082111561107157600080fd5b5061107e88828901610fc6565b969995985093965092949392505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156102ea576102ea61108f565b808201808211156102ea576102ea61108f565b80356001600160a01b03811681146110e257600080fd5b919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208152813560208201526000611129602084016110cb565b60018060a01b03808216604085015280611145604087016110cb565b16606085015250506060830135601e1984360301811261116457600080fd5b83016020810190356001600160401b0381111561118057600080fd5b80360382131561118f57600080fd5b6080808501526111a360a0850182846110e7565b95945050505050565b634e487b7160e01b600052603260045260246000fd5b60008235607e198336030181126111d857600080fd5b9190910192915050565b6000808335601e198436030181126111f957600080fd5b8301803591506001600160401b0382111561121357600080fd5b6020019150600581901b3603821315610ee557600080fd5b60006001820161123d5761123d61108f565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261126957611269611244565b500690565b60008261127d5761127d611244565b500490565b60006020828403121561129457600080fd5b610da2826110cb565b6000808335601e198436030181126112b457600080fd5b8301803591506001600160401b038211156112ce57600080fd5b602001915036819003821315610ee557600080fd5b8481526001600160a01b038416602082015260606040820181905260009061130e90830184866110e7565b9695505050505050565b60005b8381101561133357818101518382015260200161131b565b50506000910152565b600082516111d8818460208701611318565b602081526000825180602084015261136d816040850160208701611318565b601f01601f19169190910160400192915050565b85815260606020820152600061139b6060830186886110e7565b82810360408401526113ae8185876110e7565b98975050505050505050565b6000602082840312156113cc57600080fd5b81518015158114610da257600080fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220f4843af5244f1ef6b01f5d8fdd49e8f0e76508652a929df5979a03cb0156a6e864736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001002": { + "code": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806316f198311461004657806361bc221a1461005b578063a6f9885c14610076575b600080fd5b61005961005436600461017a565b61007f565b005b61006460005481565b60405190815260200160405180910390f35b61006461080081565b6001600160a01b0383166100cd5760405162461bcd60e51b815260206004820152601060248201526f24a72b20a624a22fa922a1a2a4ab22a960811b60448201526064015b60405180910390fd5b6108008111156101145760405162461bcd60e51b815260206004820152601260248201527108ab0868a8a88a6be9a82b0be988a9c8ea8960731b60448201526064016100c4565b826001600160a01b0316336001600160a01b031660008081546101369061020b565b9190508190557fedaf3c471ebd67d60c29efe34b639ede7d6a1d92eaeb3f503e784971e67118a5858560405161016d929190610232565b60405180910390a4505050565b60008060006040848603121561018f57600080fd5b83356001600160a01b03811681146101a657600080fd5b9250602084013567ffffffffffffffff808211156101c357600080fd5b818601915086601f8301126101d757600080fd5b8135818111156101e657600080fd5b8760208285010111156101f857600080fd5b6020830194508093505050509250925092565b60006001820161022b57634e487b7160e01b600052601160045260246000fd5b5060010190565b60208152816020820152818360408301376000818301604090810191909152601f909201601f1916010191905056fea26469706673582212207637618450354edc5d98998425a0a6500ada60d0a9d2cdc5b2045e291fd737f264736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001003": { + "code": "0x608060405234801561001057600080fd5b50600436106101215760003560e01c806340c10f19116100ad578063a457c2d711610071578063a457c2d71461028b578063a9059cbb1461029e578063dd62ed3e146102b1578063e6198705146102c4578063f6d2ee86146102d557600080fd5b806340c10f191461021f57806370a082311461023257806395d89b411461025b5780639b77ef11146102635780639dc29fac1461027857600080fd5b80631f2d0065116100f45780631f2d00651461018c57806323b872dd146101b15780632d0335ab146101c4578063313ce567146101ed578063395093511461020c57600080fd5b806306fdde0314610126578063095ea7b3146101445780630c53c51c1461016757806318160ddd1461017a575b600080fd5b61012e6102e8565b60405161013b91906113b6565b60405180910390f35b6101576101523660046113ec565b61037a565b604051901515815260200161013b565b61012e610175366004611470565b61039e565b603c545b60405190815260200161013b565b606d546001600160a01b03165b6040516001600160a01b03909116815260200161013b565b6101576101bf3660046114e6565b610681565b61017e6101d2366004611522565b6001600160a01b031660009081526006602052604090205490565b606d54600160a01b900460ff1660405160ff909116815260200161013b565b61015761021a3660046113ec565b6106af565b61015761022d3660046113ec565b6106db565b61017e610240366004611522565b6001600160a01b03166000908152603a602052604090205490565b61012e61071b565b61027661027136600461153d565b61072a565b005b6101576102863660046113ec565b610751565b6101576102993660046113ec565b610788565b6101576102ac3660046113ec565b61080e565b61017e6102bf366004611556565b610826565b606c546001600160a01b0316610199565b6102766102e3366004611589565b610851565b6060603d80546102f79061160d565b80601f01602080910402602001604051908101604052809291908181526020018280546103239061160d565b80156103705780601f1061034557610100808354040283529160200191610370565b820191906000526020600020905b81548152906001019060200180831161035357829003601f168201915b5050505050905090565b600080610385610ad1565b9050610392818585610ae0565b60019150505b92915050565b606060006103e187878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610c0592505050565b90506001600160e01b031960003581169082160361046c5760405162461bcd60e51b815260206004820152603d60248201527f66756e6374696f6e5369676e61747572652063616e206e6f74206265206f662060448201527f657865637574654d6574615472616e73616374696f6e206d6574686f6400000060648201526084015b60405180910390fd5b604080516060810182526001600160a01b038a16600081815260066020908152848220548452808401929092528351601f8b0183900483028101830185528a815290938301918b908b9081908401838280828437600092019190915250505091525090506104dd8982888888610c20565b6105335760405162461bcd60e51b815260206004820152602160248201527f5369676e657220616e64207369676e617475726520646f206e6f74206d6174636044820152600d60fb1b6064820152608401610463565b600660008a6001600160a01b03166001600160a01b031681526020019081526020016000206000815460010191905081905550600080306001600160a01b03168a8a8d60405160200161058893929190611647565b60408051601f19818403018152908290526105a29161166d565b6000604051808303816000865af19150503d80600081146105df576040519150601f19603f3d011682016040523d82523d6000602084013e6105e4565b606091505b5091509150816106365760405162461bcd60e51b815260206004820152601c60248201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c000000006044820152606401610463565b7f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b8b338c8c60405161066b9493929190611689565b60405180910390a19a9950505050505050505050565b60008061068c610ad1565b9050610699858285610cfc565b6106a4858585610d76565b506001949350505050565b6000806106ba610ad1565b90506103928185856106cc8589610826565b6106d691906116d5565b610ae0565b606c546000906001600160a01b031633146107085760405162461bcd60e51b8152600401610463906116f6565b6107128383610f0f565b50600192915050565b6060603e80546102f79061160d565b33600090815260066020526040812080548392906107499084906116d5565b909155505050565b606c546000906001600160a01b0316331461077e5760405162461bcd60e51b8152600401610463906116f6565b6107128383610fbf565b600080610793610ad1565b905060006107a18286610826565b9050838110156108015760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610463565b6106a48286868403610ae0565b600080610819610ad1565b9050610392818585610d76565b6001600160a01b039182166000908152603b6020908152604080832093909416825291909152205490565b600754610100900460ff16158080156108715750600754600160ff909116105b8061088b5750303b15801561088b575060075460ff166001145b6108ee5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610463565b6007805460ff191660011790558015610911576007805461ff0019166101001790555b6001600160a01b0387161580159061092857508415155b801561093357508215155b61097f5760405162461bcd60e51b815260206004820152601e60248201527f4368696c6445524332303a204241445f494e495449414c495a4154494f4e00006044820152606401610463565b606d805460ff8416600160a01b026001600160a81b03199091166001600160a01b038a1617179055606c80546001600160a01b03191633179055604080516020601f8801819004810282018101909252868152610a2a91889088908190840183828082843760009201919091525050604080516020601f8a0181900481028201810190925288815292508891508790819084018382808284376000920191909152506110de92505050565b610a8286868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040805180820190915260018152603160f81b6020820152915061110f9050565b8015610ac8576007805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b6000610adb61117b565b905090565b6001600160a01b038316610b425760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610463565b6001600160a01b038216610ba35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610463565b6001600160a01b038381166000818152603b602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60008151600003610c1857506000919050565b506020015190565b6000806001610c36610c31886111d7565b611254565b6040805160008152602081018083529290925260ff861690820152606081018790526080810186905260a0016020604051602081039080840390855afa158015610c84573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610cdb5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401610463565b866001600160a01b0316816001600160a01b03161491505095945050505050565b6000610d088484610826565b90506000198114610d705781811015610d635760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610463565b610d708484848403610ae0565b50505050565b6001600160a01b038316610dda5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610463565b6001600160a01b038216610e3c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610463565b6001600160a01b0383166000908152603a602052604090205481811015610eb45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610463565b6001600160a01b038085166000818152603a602052604080822086860390559286168082529083902080548601905591516000805160206118ec83398151915290610f029086815260200190565b60405180910390a3610d70565b6001600160a01b038216610f655760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610463565b80603c6000828254610f7791906116d5565b90915550506001600160a01b0382166000818152603a60209081526040808320805486019055518481526000805160206118ec833981519152910160405180910390a35b5050565b6001600160a01b03821661101f5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610463565b6001600160a01b0382166000908152603a6020526040902054818110156110935760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610463565b6001600160a01b0383166000818152603a602090815260408083208686039055603c80548790039055518581529192916000805160206118ec8339815191529101610bf8565b505050565b600754610100900460ff166111055760405162461bcd60e51b815260040161046390611739565b610fbb82826112a2565b815160208084019190912082519183019190912060038290556004819055466001557f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61115d8184846112e2565b600055600280546001600160a01b0319163017905560055550505050565b60003033036111d157600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b031691506111d49050565b50335b90565b60006040518060800160405280604381526020016118a96043913980516020918201208351848301516040808701518051908601209051611237950193845260208401929092526001600160a01b03166040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b600061039861126161132b565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600754610100900460ff166112c95760405162461bcd60e51b815260040161046390611739565b603d6112d583826117e8565b50603e6110d982826117e8565b6040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6002546000906001600160a01b031630148015611349575060015446145b15611355575060005490565b610adb6005546003546004546112e2565b60005b83811015611381578181015183820152602001611369565b50506000910152565b600081518084526113a2816020860160208601611366565b601f01601f19169290920160200192915050565b6020815260006113c9602083018461138a565b9392505050565b80356001600160a01b03811681146113e757600080fd5b919050565b600080604083850312156113ff57600080fd5b611408836113d0565b946020939093013593505050565b60008083601f84011261142857600080fd5b50813567ffffffffffffffff81111561144057600080fd5b60208301915083602082850101111561145857600080fd5b9250929050565b803560ff811681146113e757600080fd5b60008060008060008060a0878903121561148957600080fd5b611492876113d0565b9550602087013567ffffffffffffffff8111156114ae57600080fd5b6114ba89828a01611416565b90965094505060408701359250606087013591506114da6080880161145f565b90509295509295509295565b6000806000606084860312156114fb57600080fd5b611504846113d0565b9250611512602085016113d0565b9150604084013590509250925092565b60006020828403121561153457600080fd5b6113c9826113d0565b60006020828403121561154f57600080fd5b5035919050565b6000806040838503121561156957600080fd5b611572836113d0565b9150611580602084016113d0565b90509250929050565b600080600080600080608087890312156115a257600080fd5b6115ab876113d0565b9550602087013567ffffffffffffffff808211156115c857600080fd5b6115d48a838b01611416565b909750955060408901359150808211156115ed57600080fd5b506115fa89828a01611416565b90945092506114da90506060880161145f565b600181811c9082168061162157607f821691505b60208210810361164157634e487b7160e01b600052602260045260246000fd5b50919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b6000825161167f818460208701611366565b9190910192915050565b6001600160a01b0385811682528416602082015260606040820181905281018290526000828460808401376000608084840101526080601f19601f850116830101905095945050505050565b8082018082111561039857634e487b7160e01b600052601160045260246000fd5b60208082526023908201527f4368696c6445524332303a204f6e6c79207072656469636174652063616e2063604082015262185b1b60ea1b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b601f8211156110d957600081815260208120601f850160051c810160208610156117c15750805b601f850160051c820191505b818110156117e0578281556001016117cd565b505050505050565b815167ffffffffffffffff81111561180257611802611784565b61181681611810845461160d565b8461179a565b602080601f83116001811461184b57600084156118335750858301515b600019600386901b1c1916600185901b1785556117e0565b600085815260208120601f198616915b8281101561187a5788860151825594840194600190910190840161185b565b50858210156118985787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fe4d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e617475726529ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122061cd8aae15b13c732c17323e6cfe2f585db1ab74b2c3384cbb12626088d7caa964736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001004": { + "code": "0x608060405234801561001057600080fd5b50600436106101165760003560e01c806397e5230d116100a2578063d41f177111610071578063d41f17711461023d578063e0563ab114610264578063eeb499451461026d578063f3fef3a314610280578063f64512551461029357600080fd5b806397e5230d146101e6578063b1768065146101f0578063b68ad1e414610217578063c3b35a7e1461022a57600080fd5b80633b878c22116100e95780633b878c221461017c57806351351d531461018557806371cf93b7146101935780637efab4f5146101a6578063947287cf146101cf57600080fd5b806305dc2e8f1461011b5780631459457a1461014b5780631bc114ba14610160578063284017f514610173575b600080fd5b60345461012e906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61015e610159366004610f98565b6102ba565b005b60335461012e906001600160a01b031681565b61012e61202081565b61012e61101081565b61012e6002600160a01b0381565b60355461012e906001600160a01b031681565b61012e6101b4366004611009565b6037602052600090815260409020546001600160a01b031681565b6101d861520881565b604051908152602001610142565b6101d8620249f081565b6101d87f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b60365461012e906001600160a01b031681565b61015e61023836600461102d565b61055a565b6101d87f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b61012e61203081565b61015e61027b36600461106e565b61056a565b61015e61028e3660046110f7565b61073e565b6101d87f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b336002600160a01b03146103035760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064015b60405180910390fd5b600054610100900460ff16158080156103235750600054600160ff909116105b8061033d5750303b15801561033d575060005460ff166001145b6103a05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016102fa565b6000805460ff1916600117905580156103c3576000805461ff0019166101001790555b6001600160a01b038616158015906103e357506001600160a01b03851615155b80156103f757506001600160a01b03841615155b801561040b57506001600160a01b03831615155b6104675760405162461bcd60e51b815260206004820152602760248201527f4368696c6445524332305072656469636174653a204241445f494e495449414c60448201526624ad20aa24a7a760c91b60648201526084016102fa565b603380546001600160a01b03199081166001600160a01b03898116919091179092556034805482168884161790556035805482168784161790556036805490911685831617905582161561050c576001600160a01b03821660008181526037602052604080822080546001600160a01b03191661101090811790915590519092917f46bd56f98e1b14fd35691959270a6e1edf7cb8fcd489e0f9dda89e46c0d1ff0d91a35b8015610552576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b61056583838361074d565b505050565b6034546001600160a01b031633146105d55760405162461bcd60e51b815260206004820152602860248201527f4368696c6445524332305072656469636174653a204f4e4c595f53544154455f6044820152672922a1a2a4ab22a960c11b60648201526084016102fa565b6035546001600160a01b038481169116146106435760405162461bcd60e51b815260206004820152602860248201527f4368696c6445524332305072656469636174653a204f4e4c595f524f4f545f50604482015267524544494341544560c01b60648201526084016102fa565b7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f821610672602060008486611123565b61067b9161114d565b0361069a576106956106908260208186611123565b610ac3565b610738565b7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad6106c9602060008486611123565b6106d29161114d565b036106e1576106958282610d6e565b60405162461bcd60e51b815260206004820152602660248201527f4368696c6445524332305072656469636174653a20494e56414c49445f5349476044820152654e415455524560d01b60648201526084016102fa565b50505050565b61074982338361074d565b5050565b826001600160a01b03163b6000036107b15760405162461bcd60e51b815260206004820152602160248201527f4368696c6445524332305072656469636174653a204e4f545f434f4e545241436044820152601560fa1b60648201526084016102fa565b6000836001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610815919061116b565b6001600160a01b038181166000908152603760205260409020549192508581169116146108545760405162461bcd60e51b81526004016102fa90611188565b6001600160a01b03811661086a5761086a6111cb565b306001600160a01b0316846001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d6919061116b565b6001600160a01b0316146108ec576108ec6111cb565b604051632770a7eb60e21b81526001600160a01b03851690639dc29fac9061091a90339086906004016111e1565b6020604051808303816000875af1158015610939573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095d91906111fa565b6109a95760405162461bcd60e51b815260206004820181905260248201527f4368696c6445524332305072656469636174653a204255524e5f4641494c454460448201526064016102fa565b603354603554604080517f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286960208201526001600160a01b0385811682840152336060830152878116608083015260a08083018890528351808403909101815260c08301938490526316f1983160e01b909352938416936316f1983193610a349391169160c401611262565b600060405180830381600087803b158015610a4e57600080fd5b505af1158015610a62573d6000803e3d6000fd5b50505050826001600160a01b0316846001600160a01b0316826001600160a01b03167fa0923f060a16fc784558d43de424ffde7b01643de5e5d335851b9df94c76bb273386604051610ab59291906111e1565b60405180910390a450505050565b6000808080610ad48587018761128e565b6001600160a01b0380851660009081526037602052604090205494985092965090945092501680610b175760405162461bcd60e51b81526004016102fa90611188565b806001600160a01b03163b600003610b3157610b316111cb565b6000816001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b95919061116b565b9050856001600160a01b0316816001600160a01b031614610bb857610bb86111cb565b6001600160a01b038116610bce57610bce6111cb565b306001600160a01b0316826001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3a919061116b565b6001600160a01b031614610c5057610c506111cb565b6040516340c10f1960e01b81526001600160a01b038316906340c10f1990610c7e90879087906004016111e1565b6020604051808303816000875af1158015610c9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc191906111fa565b610d0d5760405162461bcd60e51b815260206004820181905260248201527f4368696c6445524332305072656469636174653a204d494e545f4641494c454460448201526064016102fa565b836001600160a01b0316826001600160a01b0316876001600160a01b03167fdf34f3a3ed8bedc14a4b284ebaee5374d55b64bac6a84c270dabe8fd6b4cdafd8887604051610d5c9291906111e1565b60405180910390a45050505050505050565b6000808080610d7f85870187611382565b92975090955093509150506001600160a01b038416610da057610da06111cb565b6001600160a01b038481166000908152603760205260409020541615610dc857610dc86111cb565b6036546040516bffffffffffffffffffffffff19606087901b166020820152600091610e18916001600160a01b039091169060340160405160208183030381529060405280519060200120610ee3565b6001600160a01b038681166000908152603760205260409081902080546001600160a01b031916928416928317905551637b69774360e11b81529192509063f6d2ee8690610e7090889088908890889060040161140f565b600060405180830381600087803b158015610e8a57600080fd5b505af1158015610e9e573d6000803e3d6000fd5b50506040516001600160a01b038085169350881691507f46bd56f98e1b14fd35691959270a6e1edf7cb8fcd489e0f9dda89e46c0d1ff0d90600090a350505050505050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b038116610f7a5760405162461bcd60e51b8152602060048201526017602482015276115490cc4c4d8dce8818dc99585d194c8819985a5b1959604a1b60448201526064016102fa565b92915050565b6001600160a01b0381168114610f9557600080fd5b50565b600080600080600060a08688031215610fb057600080fd5b8535610fbb81610f80565b94506020860135610fcb81610f80565b93506040860135610fdb81610f80565b92506060860135610feb81610f80565b91506080860135610ffb81610f80565b809150509295509295909350565b60006020828403121561101b57600080fd5b813561102681610f80565b9392505050565b60008060006060848603121561104257600080fd5b833561104d81610f80565b9250602084013561105d81610f80565b929592945050506040919091013590565b6000806000806060858703121561108457600080fd5b84359350602085013561109681610f80565b9250604085013567ffffffffffffffff808211156110b357600080fd5b818701915087601f8301126110c757600080fd5b8135818111156110d657600080fd5b8860208285010111156110e857600080fd5b95989497505060200194505050565b6000806040838503121561110a57600080fd5b823561111581610f80565b946020939093013593505050565b6000808585111561113357600080fd5b8386111561114057600080fd5b5050820193919092039150565b80356020831015610f7a57600019602084900360031b1b1692915050565b60006020828403121561117d57600080fd5b815161102681610f80565b60208082526023908201527f4368696c6445524332305072656469636174653a20554e4d41505045445f544f60408201526225a2a760e91b606082015260800190565b634e487b7160e01b600052600160045260246000fd5b6001600160a01b03929092168252602082015260400190565b60006020828403121561120c57600080fd5b8151801515811461102657600080fd5b6000815180845260005b8181101561124257602081850181015186830182015201611226565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b03831681526040602082018190526000906112869083018461121c565b949350505050565b600080600080608085870312156112a457600080fd5b84356112af81610f80565b935060208501356112bf81610f80565b925060408501356112cf81610f80565b9396929550929360600135925050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261130657600080fd5b813567ffffffffffffffff80821115611321576113216112df565b604051601f8301601f19908116603f01168101908282118183101715611349576113496112df565b8160405283815286602085880101111561136257600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080600060a0868803121561139a57600080fd5b8535945060208601356113ac81610f80565b9350604086013567ffffffffffffffff808211156113c957600080fd5b6113d589838a016112f5565b945060608801359150808211156113eb57600080fd5b506113f8888289016112f5565b925050608086013560ff81168114610ffb57600080fd5b6001600160a01b03851681526080602082018190526000906114339083018661121c565b8281036040840152611445818661121c565b91505060ff831660608301529594505050505056fea2646970667358221220040c22d73fe8215d2218893f5a7f6ab5ca23133aaf1f7ef7a037b72f1d8fea6d64736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001005": { + "code": "0x608060405234801561001057600080fd5b506004361061014d5760003560e01c806370a08231116100c3578063a22cb4651161007c578063a22cb465146102dd578063b2dc5dc3146102f0578063b88d4fde14610303578063c87b56dd14610316578063e619870514610329578063e985e9c51461033a57600080fd5b806370a08231146102765780637c88e3d914610289578063906571471461029c57806395d89b41146102af5780639b77ef11146102b75780639dc29fac146102ca57600080fd5b80631f2d0065116101155780631f2d0065146101e257806323b872dd146101f35780632d0335ab1461020657806340c10f191461023d57806342842e0e146102505780636352211e1461026357600080fd5b806301ffc9a71461015257806306fdde031461017a578063081812fc1461018f578063095ea7b3146101ba5780630c53c51c146101cf575b600080fd5b610165610160366004611a8c565b61034d565b60405190151581526020015b60405180910390f35b61018261039f565b6040516101719190611af9565b6101a261019d366004611b0c565b610431565b6040516001600160a01b039091168152602001610171565b6101cd6101c8366004611b41565b610458565b005b6101826101dd366004611bb3565b610584565b609f546001600160a01b03166101a2565b6101cd610201366004611c32565b610862565b61022f610214366004611c6e565b6001600160a01b031660009081526006602052604090205490565b604051908152602001610171565b61016561024b366004611b41565b61089a565b6101cd61025e366004611c32565b6108da565b6101a2610271366004611b0c565b6108f5565b61022f610284366004611c6e565b61092a565b610165610297366004611ccd565b6109b0565b6101cd6102aa366004611d38565b610a97565b610182610d05565b6101cd6102c5366004611b0c565b610d14565b6101656102d8366004611b41565b610d3b565b6101cd6102eb366004611db8565b610daa565b6101656102fe366004611df4565b610dc0565b6101cd610311366004611e5c565b610e6d565b610182610324366004611b0c565b610eac565b609e546001600160a01b03166101a2565b610165610348366004611f37565b610f20565b60006001600160e01b031982166380ac58cd60e01b148061037e57506001600160e01b03198216635b5e139f60e01b145b8061039957506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060606c80546103ae90611f6a565b80601f01602080910402602001604051908101604052809291908181526020018280546103da90611f6a565b80156104275780601f106103fc57610100808354040283529160200191610427565b820191906000526020600020905b81548152906001019060200180831161040a57829003601f168201915b5050505050905090565b600061043c82610f4e565b506000908152607060205260409020546001600160a01b031690565b6000610463826108f5565b9050806001600160a01b0316836001600160a01b0316036104d55760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b806001600160a01b03166104e7610f76565b6001600160a01b03161480610503575061050381610348610f76565b6105755760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016104cc565b61057f8383610f85565b505050565b606060006105c787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610ff392505050565b90506001600160e01b031960003581169082160361064d5760405162461bcd60e51b815260206004820152603d60248201527f66756e6374696f6e5369676e61747572652063616e206e6f74206265206f662060448201527f657865637574654d6574615472616e73616374696f6e206d6574686f6400000060648201526084016104cc565b604080516060810182526001600160a01b038a16600081815260066020908152848220548452808401929092528351601f8b0183900483028101830185528a815290938301918b908b9081908401838280828437600092019190915250505091525090506106be898288888861100e565b6107145760405162461bcd60e51b815260206004820152602160248201527f5369676e657220616e64207369676e617475726520646f206e6f74206d6174636044820152600d60fb1b60648201526084016104cc565b600660008a6001600160a01b03166001600160a01b031681526020019081526020016000206000815460010191905081905550600080306001600160a01b03168a8a8d60405160200161076993929190611fa4565b60408051601f198184030181529082905261078391611fca565b6000604051808303816000865af19150503d80600081146107c0576040519150601f19603f3d011682016040523d82523d6000602084013e6107c5565b606091505b5091509150816108175760405162461bcd60e51b815260206004820152601c60248201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c0000000060448201526064016104cc565b7f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b8b338c8c60405161084c9493929190611fe6565b60405180910390a19a9950505050505050505050565b61087361086d610f76565b826110ea565b61088f5760405162461bcd60e51b81526004016104cc90612032565b61057f838383611148565b609e546000906001600160a01b031633146108c75760405162461bcd60e51b81526004016104cc9061207f565b6108d1838361129a565b50600192915050565b61057f83838360405180602001604052806000815250610e6d565b6000818152606e60205260408120546001600160a01b0316806103995760405162461bcd60e51b81526004016104cc906120c3565b60006001600160a01b0382166109945760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016104cc565b506001600160a01b03166000908152606f602052604090205490565b609e546000906001600160a01b031633146109dd5760405162461bcd60e51b81526004016104cc9061207f565b83828114610a2d5760405162461bcd60e51b815260206004820152601f60248201527f4368696c644552433732313a204172726179206c656e206d69736d617463680060448201526064016104cc565b60005b81811015610a8857610a80878783818110610a4d57610a4d6120f5565b9050602002016020810190610a629190611c6e565b868684818110610a7457610a746120f5565b9050602002013561129a565b600101610a30565b5060019150505b949350505050565b600754610100900460ff1615808015610ab75750600754600160ff909116105b80610ad15750303b158015610ad1575060075460ff166001145b610b345760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104cc565b6007805460ff191660011790558015610b57576007805461ff0019166101001790555b6001600160a01b03861615801590610b6e57508315155b8015610b7957508115155b610bc55760405162461bcd60e51b815260206004820152601f60248201527f4368696c644552433732313a2042616420696e697469616c697a6174696f6e0060448201526064016104cc565b609f80546001600160a01b0388166001600160a01b031991821617909155609e805490911633179055604080516020601f8701819004810282018101909252858152610c5f91879087908190840183828082843760009201919091525050604080516020601f890181900481028201810190925287815292508791508690819084018382808284376000920191909152506112b492505050565b610cb785858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250506040805180820190915260018152603160f81b602082015291506112e59050565b8015610cfd576007805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6060606d80546103ae90611f6a565b3360009081526006602052604081208054839290610d3390849061210b565b909155505050565b609e546000906001600160a01b03163314610d685760405162461bcd60e51b81526004016104cc9061207f565b610d71826108f5565b6001600160a01b0316836001600160a01b031614610da15760405162461bcd60e51b81526004016104cc9061212c565b6108d182611351565b610dbc610db5610f76565b83836113d4565b5050565b609e546000906001600160a01b03163314610ded5760405162461bcd60e51b81526004016104cc9061207f565b8160005b81811015610e61576000858583818110610e0d57610e0d6120f5565b905060200201359050610e1f816108f5565b6001600160a01b0316876001600160a01b031614610e4f5760405162461bcd60e51b81526004016104cc9061212c565b610e5881611351565b50600101610df1565b50600195945050505050565b610e7e610e78610f76565b836110ea565b610e9a5760405162461bcd60e51b81526004016104cc90612032565b610ea68484848461149e565b50505050565b6060610eb782610f4e565b6000610ece60408051602081019091526000815290565b90506000815111610eee5760405180602001604052806000815250610f19565b80610ef8846114d1565b604051602001610f09929190612161565b6040516020818303038152906040525b9392505050565b6001600160a01b03918216600090815260716020908152604080832093909416825291909152205460ff1690565b610f5781611563565b610f735760405162461bcd60e51b81526004016104cc906120c3565b50565b6000610f80611580565b905090565b600081815260706020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610fba826108f5565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000815160000361100657506000919050565b506020015190565b600080600161102461101f886115dc565b611659565b6040805160008152602081018083529290925260ff861690820152606081018790526080810186905260a0016020604051602081039080840390855afa158015611072573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166110c95760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b60448201526064016104cc565b866001600160a01b0316816001600160a01b03161491505095945050505050565b6000806110f6836108f5565b9050806001600160a01b0316846001600160a01b0316148061111d575061111d8185610f20565b80610a8f5750836001600160a01b031661113684610431565b6001600160a01b031614949350505050565b826001600160a01b031661115b826108f5565b6001600160a01b0316146111815760405162461bcd60e51b81526004016104cc90612190565b6001600160a01b0382166111e35760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016104cc565b826001600160a01b03166111f6826108f5565b6001600160a01b03161461121c5760405162461bcd60e51b81526004016104cc90612190565b600081815260706020908152604080832080546001600160a01b03199081169091556001600160a01b03878116808652606f8552838620805460001901905590871680865283862080546001019055868652606e909452828520805490921684179091559051849360008051602061244c83398151915291a4505050565b610dbc8282604051806020016040528060008152506116a7565b600754610100900460ff166112db5760405162461bcd60e51b81526004016104cc906121d5565b610dbc82826116da565b815160208084019190912082519183019190912060038290556004819055466001557f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61133381848461171a565b600055600280546001600160a01b0319163017905560055550505050565b600061135c826108f5565b9050611367826108f5565b600083815260706020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552606f84528285208054600019019055878552606e9093528184208054909116905551929350849260008051602061244c833981519152908390a45050565b816001600160a01b0316836001600160a01b0316036114315760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b60448201526064016104cc565b6001600160a01b03838116600081815260716020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6114a9848484611148565b6114b584848484611763565b610ea65760405162461bcd60e51b81526004016104cc90612220565b606060006114de83611868565b60010190506000816001600160401b038111156114fd576114fd611e46565b6040519080825280601f01601f191660200182016040528015611527576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461153157509392505050565b6000908152606e60205260409020546001600160a01b0316151590565b60003033036115d657600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b031691506115d99050565b50335b90565b6000604051806080016040528060438152602001612409604391398051602091820120835184830151604080870151805190860120905161163c950193845260208401929092526001600160a01b03166040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b6000610399611666611940565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6116b1838361197b565b6116be6000848484611763565b61057f5760405162461bcd60e51b81526004016104cc90612220565b600754610100900460ff166117015760405162461bcd60e51b81526004016104cc906121d5565b606c61170d83826122b8565b50606d61057f82826122b8565b6040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60006001600160a01b0384163b1561186057836001600160a01b031663150b7a0261178c610f76565b8786866040518563ffffffff1660e01b81526004016117ae9493929190612377565b6020604051808303816000875af19250505080156117e9575060408051601f3d908101601f191682019092526117e6918101906123b4565b60015b611846573d808015611817576040519150601f19603f3d011682016040523d82523d6000602084013e61181c565b606091505b50805160000361183e5760405162461bcd60e51b81526004016104cc90612220565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610a8f565b506001610a8f565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106118a75772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106118d3576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106118f157662386f26fc10000830492506010015b6305f5e1008310611909576305f5e100830492506008015b612710831061191d57612710830492506004015b6064831061192f576064830492506002015b600a83106103995760010192915050565b6002546000906001600160a01b03163014801561195e575060015446145b1561196a575060005490565b610f8060055460035460045461171a565b6001600160a01b0382166119d15760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016104cc565b6119da81611563565b156119f75760405162461bcd60e51b81526004016104cc906123d1565b611a0081611563565b15611a1d5760405162461bcd60e51b81526004016104cc906123d1565b6001600160a01b0382166000818152606f6020908152604080832080546001019055848352606e90915280822080546001600160a01b03191684179055518392919060008051602061244c833981519152908290a45050565b6001600160e01b031981168114610f7357600080fd5b600060208284031215611a9e57600080fd5b8135610f1981611a76565b60005b83811015611ac4578181015183820152602001611aac565b50506000910152565b60008151808452611ae5816020860160208601611aa9565b601f01601f19169290920160200192915050565b602081526000610f196020830184611acd565b600060208284031215611b1e57600080fd5b5035919050565b80356001600160a01b0381168114611b3c57600080fd5b919050565b60008060408385031215611b5457600080fd5b611b5d83611b25565b946020939093013593505050565b60008083601f840112611b7d57600080fd5b5081356001600160401b03811115611b9457600080fd5b602083019150836020828501011115611bac57600080fd5b9250929050565b60008060008060008060a08789031215611bcc57600080fd5b611bd587611b25565b955060208701356001600160401b03811115611bf057600080fd5b611bfc89828a01611b6b565b9096509450506040870135925060608701359150608087013560ff81168114611c2457600080fd5b809150509295509295509295565b600080600060608486031215611c4757600080fd5b611c5084611b25565b9250611c5e60208501611b25565b9150604084013590509250925092565b600060208284031215611c8057600080fd5b610f1982611b25565b60008083601f840112611c9b57600080fd5b5081356001600160401b03811115611cb257600080fd5b6020830191508360208260051b8501011115611bac57600080fd5b60008060008060408587031215611ce357600080fd5b84356001600160401b0380821115611cfa57600080fd5b611d0688838901611c89565b90965094506020870135915080821115611d1f57600080fd5b50611d2c87828801611c89565b95989497509550505050565b600080600080600060608688031215611d5057600080fd5b611d5986611b25565b945060208601356001600160401b0380821115611d7557600080fd5b611d8189838a01611b6b565b90965094506040880135915080821115611d9a57600080fd5b50611da788828901611b6b565b969995985093965092949392505050565b60008060408385031215611dcb57600080fd5b611dd483611b25565b915060208301358015158114611de957600080fd5b809150509250929050565b600080600060408486031215611e0957600080fd5b611e1284611b25565b925060208401356001600160401b03811115611e2d57600080fd5b611e3986828701611c89565b9497909650939450505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215611e7257600080fd5b611e7b85611b25565b9350611e8960208601611b25565b92506040850135915060608501356001600160401b0380821115611eac57600080fd5b818701915087601f830112611ec057600080fd5b813581811115611ed257611ed2611e46565b604051601f8201601f19908116603f01168101908382118183101715611efa57611efa611e46565b816040528281528a6020848701011115611f1357600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215611f4a57600080fd5b611f5383611b25565b9150611f6160208401611b25565b90509250929050565b600181811c90821680611f7e57607f821691505b602082108103611f9e57634e487b7160e01b600052602260045260246000fd5b50919050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b60008251611fdc818460208701611aa9565b9190910192915050565b6001600160a01b0385811682528416602082015260606040820181905281018290526000828460808401376000608084840101526080601f19601f850116830101905095945050505050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526024908201527f4368696c644552433732313a204f6e6c79207072656469636174652063616e2060408201526318d85b1b60e21b606082015260800190565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b8082018082111561039957634e487b7160e01b600052601160045260246000fd5b6020808252818101527f4368696c644552433732313a204f6e6c79206f776e65722063616e206275726e604082015260600190565b60008351612173818460208801611aa9565b835190830190612187818360208801611aa9565b01949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b601f82111561057f57600081815260208120601f850160051c810160208610156122995750805b601f850160051c820191505b81811015610cfd578281556001016122a5565b81516001600160401b038111156122d1576122d1611e46565b6122e5816122df8454611f6a565b84612272565b602080601f83116001811461231a57600084156123025750858301515b600019600386901b1c1916600185901b178555610cfd565b600085815260208120601f198616915b828110156123495788860151825594840194600190910190840161232a565b50858210156123675787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906123aa90830184611acd565b9695505050505050565b6000602082840312156123c657600080fd5b8151610f1981611a76565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060408201526060019056fe4d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e617475726529ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220ea3c02b950248f82ca74449c170966a8d3ba41ec46257d49989e4be74e94e63864736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001006": { + "code": "0x608060405234801561001057600080fd5b50600436106101375760003560e01c8063b68ad1e4116100b8578063e0563ab11161007c578063e0563ab1146102c0578063eeb49945146102c9578063f3fef3a3146102dc578063f6451255146102ef578063f691325c14610316578063f8c8765e1461032957600080fd5b8063b68ad1e414610225578063c3b35a7e14610238578063c5ac2b1c1461024b578063d41f177114610272578063d7c9e3ec1461029957600080fd5b80636f33e695116100ff5780636f33e6951461019f5780637efab4f5146101b4578063947287cf146101dd57806397e5230d146101f4578063b1768065146101fe57600080fd5b806305dc2e8f1461013c5780631bc114ba1461016c578063284017f51461017f5780633b878c221461018857806351351d5314610191575b600080fd5b60345461014f906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60335461014f906001600160a01b031681565b61014f61202081565b61014f61101081565b61014f6002600160a01b0381565b6101b26101ad366004611617565b61033c565b005b61014f6101c2366004611699565b6037602052600090815260409020546001600160a01b031681565b6101e661520881565b604051908152602001610163565b6101e6620249f081565b6101e67f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b60365461014f906001600160a01b031681565b6101b26102463660046116bd565b610350565b6101e67faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d1881565b6101e67f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b6101e67f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed281565b61014f61203081565b6101b26102d73660046116fe565b610360565b6101b26102ea366004611786565b610583565b6101e67f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b60355461014f906001600160a01b031681565b6101b26103373660046117b2565b610592565b61034985858585856107d1565b5050505050565b61035b838383610b35565b505050565b6034546001600160a01b031633146103d15760405162461bcd60e51b815260206004820152602960248201527f4368696c644552433732315072656469636174653a204f4e4c595f53544154456044820152682fa922a1a2a4ab22a960b91b60648201526084015b60405180910390fd5b6035546001600160a01b038481169116146104405760405162461bcd60e51b815260206004820152602960248201527f4368696c644552433732315072656469636174653a204f4e4c595f524f4f545f60448201526850524544494341544560b81b60648201526084016103c8565b7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82161046f60206000848661180e565b61047891611838565b036104975761049261048d826020818661180e565b610e3e565b61057d565b7faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d186104c660206000848661180e565b6104cf91611838565b036104de5761049282826110b4565b7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad61050d60206000848661180e565b61051691611838565b0361052557610492828261131a565b60405162461bcd60e51b815260206004820152602760248201527f4368696c644552433732315072656469636174653a20494e56414c49445f5349604482015266474e415455524560c81b60648201526084016103c8565b50505050565b61058e823383610b35565b5050565b336002600160a01b03146105d65760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064016103c8565b600054610100900460ff16158080156105f65750600054600160ff909116105b806106105750303b158015610610575060005460ff166001145b6106735760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103c8565b6000805460ff191660011790558015610696576000805461ff0019166101001790555b6001600160a01b038516158015906106b657506001600160a01b03841615155b80156106ca57506001600160a01b03831615155b80156106de57506001600160a01b03821615155b61073b5760405162461bcd60e51b815260206004820152602860248201527f4368696c644552433732315072656469636174653a204241445f494e495449416044820152672624ad20aa24a7a760c11b60648201526084016103c8565b603380546001600160a01b038088166001600160a01b031992831617909255603480548784169083161790556035805486841690831617905560368054928516929091169190911790558015610349576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b846107db81611488565b6107f75760405162461bcd60e51b81526004016103c890611856565b6000866001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610837573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085b9190611898565b6001600160a01b0381811660009081526037602052604090205491925088811691161461089a5760405162461bcd60e51b81526004016103c8906118b5565b6001600160a01b0381166108b0576108b06118f9565b306001600160a01b0316876001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091c9190611898565b6001600160a01b031614610932576109326118f9565b84831461098d5760405162461bcd60e51b8152602060048201526024808201527f4368696c644552433732315072656469636174653a20494e56414c49445f4c4560448201526309c8ea8960e31b60648201526084016103c8565b60405163b2dc5dc360e01b81526001600160a01b0388169063b2dc5dc3906109bd90339088908890600401611941565b6020604051808303816000875af11580156109dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a00919061196f565b610a1c5760405162461bcd60e51b81526004016103c890611991565b6033546035546040516001600160a01b03928316926316f19831921690610a73907f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed290869033908d908d908d908d90602001611a1b565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610a9f929190611ab5565b600060405180830381600087803b158015610ab957600080fd5b505af1158015610acd573d6000803e3d6000fd5b50505050336001600160a01b0316876001600160a01b0316826001600160a01b03167fa80bc76d6e1849a9088a9c00a2aeaa54eeb78f15565a18da3e8873438976f52289898989604051610b249493929190611ae1565b60405180910390a450505050505050565b82610b3f81611488565b610b5b5760405162461bcd60e51b81526004016103c890611856565b6000846001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbf9190611898565b6001600160a01b03818116600090815260376020526040902054919250868116911614610bfe5760405162461bcd60e51b81526004016103c8906118b5565b6001600160a01b038116610c1457610c146118f9565b306001600160a01b0316856001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c809190611898565b6001600160a01b031614610c9657610c966118f9565b604051632770a7eb60e21b81526001600160a01b03861690639dc29fac90610cc49033908790600401611b13565b6020604051808303816000875af1158015610ce3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d07919061196f565b610d235760405162461bcd60e51b81526004016103c890611991565b603354603554604080517f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286960208201526001600160a01b0385811682840152336060830152888116608083015260a08083018990528351808403909101815260c08301938490526316f1983160e01b909352938416936316f1983193610dae9391169160c401611ab5565b600060405180830381600087803b158015610dc857600080fd5b505af1158015610ddc573d6000803e3d6000fd5b50505050836001600160a01b0316856001600160a01b0316826001600160a01b03167f1e0ef6131232b1090efc3ec1cf7b53aa17f4b7cd8a4f9e033b49ee237379b0133387604051610e2f929190611b13565b60405180910390a45050505050565b6000808080610e4f85870187611b2c565b6001600160a01b0380851660009081526037602052604090205494985092965090945092501680610e925760405162461bcd60e51b81526004016103c8906118b5565b610e9b81611488565b610ea757610ea76118f9565b6000816001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ee7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0b9190611898565b9050856001600160a01b0316816001600160a01b031614610f2e57610f2e6118f9565b6001600160a01b038116610f4457610f446118f9565b306001600160a01b0316826001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb09190611898565b6001600160a01b031614610fc657610fc66118f9565b6040516340c10f1960e01b81526001600160a01b038316906340c10f1990610ff49087908790600401611b13565b6020604051808303816000875af1158015611013573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611037919061196f565b6110535760405162461bcd60e51b81526004016103c890611b7d565b836001600160a01b0316826001600160a01b0316876001600160a01b03167f37589fd8c906c19ea68eeb7e6b3e03efc06ff8aa4b1830588eba75f4375b161188876040516110a2929190611b13565b60405180910390a45050505050505050565b60008080806110c585870187611c92565b6001600160a01b0380851660009081526037602052604090205494995092975090955093501690508061110a5760405162461bcd60e51b81526004016103c8906118b5565b61111381611488565b61111f5761111f6118f9565b6000816001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa15801561115f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111839190611898565b9050856001600160a01b0316816001600160a01b0316146111a6576111a66118f9565b6001600160a01b0381166111bc576111bc6118f9565b306001600160a01b0316826001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015611204573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112289190611898565b6001600160a01b03161461123e5761123e6118f9565b604051637c88e3d960e01b81526001600160a01b03831690637c88e3d99061126c9087908790600401611d84565b6020604051808303816000875af115801561128b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112af919061196f565b6112cb5760405162461bcd60e51b81526004016103c890611b7d565b846001600160a01b0316826001600160a01b0316876001600160a01b03167fc1b1a5c1b97cc8e5ac82b47496f5ebdadf9c7d119b30a116e2bdafd56f6ed47587876040516110a2929190611d84565b6000808061132a84860186611e77565b91955093509150506001600160a01b038316611348576113486118f9565b6001600160a01b038381166000908152603760205260409020541615611370576113706118f9565b6036546040516bffffffffffffffffffffffff19606086901b1660208201526000916113c0916001600160a01b03909116906034016040516020818303038152906040528051906020012061151d565b6001600160a01b038581166000908152603760205260409081902080546001600160a01b031916928416928317905551639065714760e01b81529192509063906571479061141690879087908790600401611ef6565b600060405180830381600087803b15801561143057600080fd5b505af1158015611444573d6000803e3d6000fd5b50506040516001600160a01b038085169350871691507f46bd56f98e1b14fd35691959270a6e1edf7cb8fcd489e0f9dda89e46c0d1ff0d90600090a3505050505050565b6000816001600160a01b03163b6000036114a457506000919050565b6040516301ffc9a760e01b81526380ac58cd60e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa92505050801561150b575060408051601f3d908101601f191682019092526115089181019061196f565b60015b61151757506000919050565b92915050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b0381166115175760405162461bcd60e51b8152602060048201526017602482015276115490cc4c4d8dce8818dc99585d194c8819985a5b1959604a1b60448201526064016103c8565b6001600160a01b03811681146115c957600080fd5b50565b60008083601f8401126115de57600080fd5b5081356001600160401b038111156115f557600080fd5b6020830191508360208260051b850101111561161057600080fd5b9250929050565b60008060008060006060868803121561162f57600080fd5b853561163a816115b4565b945060208601356001600160401b038082111561165657600080fd5b61166289838a016115cc565b9096509450604088013591508082111561167b57600080fd5b50611688888289016115cc565b969995985093965092949392505050565b6000602082840312156116ab57600080fd5b81356116b6816115b4565b9392505050565b6000806000606084860312156116d257600080fd5b83356116dd816115b4565b925060208401356116ed816115b4565b929592945050506040919091013590565b6000806000806060858703121561171457600080fd5b843593506020850135611726816115b4565b925060408501356001600160401b038082111561174257600080fd5b818701915087601f83011261175657600080fd5b81358181111561176557600080fd5b88602082850101111561177757600080fd5b95989497505060200194505050565b6000806040838503121561179957600080fd5b82356117a4816115b4565b946020939093013593505050565b600080600080608085870312156117c857600080fd5b84356117d3816115b4565b935060208501356117e3816115b4565b925060408501356117f3816115b4565b91506060850135611803816115b4565b939692955090935050565b6000808585111561181e57600080fd5b8386111561182b57600080fd5b5050820193919092039150565b8035602083101561151757600019602084900360031b1b1692915050565b60208082526022908201527f4368696c644552433732315072656469636174653a204e4f545f434f4e54524160408201526110d560f21b606082015260800190565b6000602082840312156118aa57600080fd5b81516116b6816115b4565b60208082526024908201527f4368696c644552433732315072656469636174653a20554e4d41505045445f5460408201526327a5a2a760e11b606082015260800190565b634e487b7160e01b600052600160045260246000fd5b81835260006001600160fb1b0383111561192857600080fd5b8260051b80836020870137939093016020019392505050565b6001600160a01b0384168152604060208201819052600090611966908301848661190f565b95945050505050565b60006020828403121561198157600080fd5b815180151581146116b657600080fd5b60208082526021908201527f4368696c644552433732315072656469636174653a204255524e5f4641494c456040820152601160fa1b606082015260800190565b8183526000602080850194508260005b85811015611a105781356119f5816115b4565b6001600160a01b0316875295820195908201906001016119e2565b509495945050505050565b8781526001600160a01b0387811660208301528616604082015260a060608201819052600090611a4e90830186886119d2565b8281036080840152611a6181858761190f565b9a9950505050505050505050565b6000815180845260005b81811015611a9557602081850181015186830182015201611a79565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b0383168152604060208201819052600090611ad990830184611a6f565b949350505050565b604081526000611af56040830186886119d2565b8281036020840152611b0881858761190f565b979650505050505050565b6001600160a01b03929092168252602082015260400190565b60008060008060808587031215611b4257600080fd5b8435611b4d816115b4565b93506020850135611b5d816115b4565b92506040850135611b6d816115b4565b9396929550929360600135925050565b60208082526021908201527f4368696c644552433732315072656469636174653a204d494e545f4641494c456040820152601160fa1b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611bfc57611bfc611bbe565b604052919050565b60006001600160401b03821115611c1d57611c1d611bbe565b5060051b60200190565b600082601f830112611c3857600080fd5b81356020611c4d611c4883611c04565b611bd4565b82815260059290921b84018101918181019086841115611c6c57600080fd5b8286015b84811015611c875780358352918301918301611c70565b509695505050505050565b600080600080600060a08688031215611caa57600080fd5b85359450602080870135611cbd816115b4565b94506040870135611ccd816115b4565b935060608701356001600160401b0380821115611ce957600080fd5b818901915089601f830112611cfd57600080fd5b8135611d0b611c4882611c04565b81815260059190911b8301840190848101908c831115611d2a57600080fd5b938501935b82851015611d51578435611d42816115b4565b82529385019390850190611d2f565b965050506080890135925080831115611d6957600080fd5b5050611d7788828901611c27565b9150509295509295909350565b604080825283519082018190526000906020906060840190828701845b82811015611dc65781516001600160a01b031684529284019290840190600101611da1565b5050508381038285015284518082528583019183019060005b81811015611dfb57835183529284019291840191600101611ddf565b5090979650505050505050565b600082601f830112611e1957600080fd5b81356001600160401b03811115611e3257611e32611bbe565b611e45601f8201601f1916602001611bd4565b818152846020838601011115611e5a57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215611e8d57600080fd5b843593506020850135611e9f816115b4565b925060408501356001600160401b0380821115611ebb57600080fd5b611ec788838901611e08565b93506060870135915080821115611edd57600080fd5b50611eea87828801611e08565b91505092959194509250565b6001600160a01b0384168152606060208201819052600090611f1a90830185611a6f565b8281036040840152611f2c8185611a6f565b969550505050505056fea26469706673582212208eba5121cb4876752d628bd2b54f4310ad4179b29208ae7a3ec4d01fd9c07df564736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001007": { + "code": "0x608060405234801561001057600080fd5b50600436106101155760003560e01c806357128683116100a2578063e619870511610071578063e619870514610278578063e985e9c514610289578063f242432a146102c5578063f399e22e146102d8578063f5298aca146102eb57600080fd5b8063571286831461022c5780636b20c4541461023f5780639b77ef1114610252578063a22cb4651461026557600080fd5b8063156e29f6116100e9578063156e29f6146101965780631f2d0065146101a95780632d0335ab146101ce5780632eb2c2d6146101f75780634e1273f41461020c57600080fd5b8062fdd58e1461011a57806301ffc9a7146101405780630c53c51c146101635780630e89341c14610183575b600080fd5b61012d610128366004611cee565b6102fe565b6040519081526020015b60405180910390f35b61015361014e366004611d2e565b610399565b6040519015158152602001610137565b610176610171366004611d93565b6103e9565b6040516101379190611e62565b610176610191366004611e75565b6106c7565b6101536101a4366004611e8e565b61075b565b609f546001600160a01b03165b6040516001600160a01b039091168152602001610137565b61012d6101dc366004611ec1565b6001600160a01b031660009081526006602052604090205490565b61020a610205366004612025565b6107ad565b005b61021f61021a3660046120ce565b61080b565b60405161013791906121d3565b61015361023a36600461222a565b610934565b61015361024d3660046122c3565b610a4f565b61020a610260366004611e75565b610af6565b61020a610273366004612343565b610b1d565b609e546001600160a01b03166101b6565b61015361029736600461237f565b6001600160a01b039182166000908152606d6020908152604080832093909416825291909152205460ff1690565b61020a6102d33660046123b2565b610b33565b61020a6102e6366004612416565b610b8a565b6101536102f9366004611e8e565b610d9e565b60006001600160a01b03831661036e5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000818152606c602090815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b14806103ca57506001600160e01b031982166303a24d0760e21b145b8061039357506301ffc9a760e01b6001600160e01b0319831614610393565b6060600061042c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610dd692505050565b90506001600160e01b03196000358116908216036104b25760405162461bcd60e51b815260206004820152603d60248201527f66756e6374696f6e5369676e61747572652063616e206e6f74206265206f662060448201527f657865637574654d6574615472616e73616374696f6e206d6574686f640000006064820152608401610365565b604080516060810182526001600160a01b038a16600081815260066020908152848220548452808401929092528351601f8b0183900483028101830185528a815290938301918b908b9081908401838280828437600092019190915250505091525090506105238982888888610df1565b6105795760405162461bcd60e51b815260206004820152602160248201527f5369676e657220616e64207369676e617475726520646f206e6f74206d6174636044820152600d60fb1b6064820152608401610365565b600660008a6001600160a01b03166001600160a01b031681526020019081526020016000206000815460010191905081905550600080306001600160a01b03168a8a8d6040516020016105ce93929190612468565b60408051601f19818403018152908290526105e89161248e565b6000604051808303816000865af19150503d8060008114610625576040519150601f19603f3d011682016040523d82523d6000602084013e61062a565b606091505b50915091508161067c5760405162461bcd60e51b815260206004820152601c60248201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c000000006044820152606401610365565b7f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b8b338c8c6040516106b194939291906124aa565b60405180910390a19a9950505050505050505050565b6060606e80546106d6906124f6565b80601f0160208091040260200160405190810160405280929190818152602001828054610702906124f6565b801561074f5780601f106107245761010080835404028352916020019161074f565b820191906000526020600020905b81548152906001019060200180831161073257829003601f168201915b50505050509050919050565b609e546000906001600160a01b031633146107885760405162461bcd60e51b815260040161036590612530565b6107a384848460405180602001604052806000815250610ecd565b5060019392505050565b6107b5610fdc565b6001600160a01b0316856001600160a01b031614806107db57506107db85610297610fdc565b6107f75760405162461bcd60e51b815260040161036590612575565b6108048585858585610feb565b5050505050565b606081518351146108705760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610365565b600083516001600160401b0381111561088b5761088b611edc565b6040519080825280602002602001820160405280156108b4578160200160208202803683370190505b50905060005b845181101561092c576108ff8582815181106108d8576108d86125c3565b60200260200101518583815181106108f2576108f26125c3565b60200260200101516102fe565b828281518110610911576109116125c3565b6020908102919091010152610925816125ef565b90506108ba565b509392505050565b609e546000906001600160a01b031633146109615760405162461bcd60e51b815260040161036590612530565b85848114801561097057508083145b6109bc5760405162461bcd60e51b815260206004820181905260248201527f4368696c64455243313135353a206172726179206c656e206d69736d617463686044820152606401610365565b60005b81811015610a4057610a388989838181106109dc576109dc6125c3565b90506020020160208101906109f19190611ec1565b888884818110610a0357610a036125c3565b90506020020135878785818110610a1c57610a1c6125c3565b9050602002013560405180602001604052806000815250610ecd565b6001016109bf565b50600198975050505050505050565b609e546000906001600160a01b03163314610a7c5760405162461bcd60e51b815260040161036590612530565b610aea8686868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a0282810182019093528982529093508992508891829185019084908082843760009201919091525061119592505050565b50600195945050505050565b3360009081526006602052604081208054839290610b15908490612608565b909155505050565b610b2f610b28610fdc565b838361132c565b5050565b610b3b610fdc565b6001600160a01b0316856001600160a01b03161480610b615750610b6185610297610fdc565b610b7d5760405162461bcd60e51b815260040161036590612575565b610804858585858561140c565b600754610100900460ff1615808015610baa5750600754600160ff909116105b80610bc45750303b158015610bc4575060075460ff166001145b610c275760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610365565b6007805460ff191660011790558015610c4a576007805461ff0019166101001790555b6001600160a01b038416610ca05760405162461bcd60e51b815260206004820181905260248201527f4368696c64455243313135353a204241445f494e495449414c495a4154494f4e6044820152606401610365565b609f80546001600160a01b0386166001600160a01b031991821617909155609e805490911633179055604080516020601f8501819004810282018101909252838152610d0691859085908190840183828082843760009201919091525061153392505050565b610d52610d1b856001600160a01b0316611566565b604051602001610d2b919061261b565b60408051601f1981840301815282820190915260018252603160f81b60208301529061157c565b8015610d98576007805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b609e546000906001600160a01b03163314610dcb5760405162461bcd60e51b815260040161036590612530565b6107a38484846115e8565b60008151600003610de957506000919050565b506020015190565b6000806001610e07610e02886116e8565b611765565b6040805160008152602081018083529290925260ff861690820152606081018790526080810186905260a0016020604051602081039080840390855afa158015610e55573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610eac5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401610365565b866001600160a01b0316816001600160a01b03161491505095945050505050565b6001600160a01b038416610f2d5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610365565b6000610f37610fdc565b90506000610f44856117b3565b90506000610f51856117b3565b90506000868152606c602090815260408083206001600160a01b038b16845290915281208054879290610f85908490612608565b909155505060408051878152602081018790526001600160a01b03808a169260009291871691600080516020612b0c833981519152910160405180910390a4610fd3836000898989896117fe565b50505050505050565b6000610fe6611959565b905090565b815183511461100c5760405162461bcd60e51b815260040161036590612650565b6001600160a01b0384166110325760405162461bcd60e51b815260040161036590612698565b600061103c610fdc565b905060005b845181101561112757600085828151811061105e5761105e6125c3565b60200260200101519050600085838151811061107c5761107c6125c3565b6020908102919091018101516000848152606c835260408082206001600160a01b038e1683529093529190912054909150818110156110cd5760405162461bcd60e51b8152600401610365906126dd565b6000838152606c602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061110c908490612608565b9250508190555050505080611120906125ef565b9050611041565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611177929190612727565b60405180910390a461118d8187878787876119b5565b505050505050565b6001600160a01b0383166111bb5760405162461bcd60e51b815260040161036590612755565b80518251146111dc5760405162461bcd60e51b815260040161036590612650565b60006111e6610fdc565b604080516020810190915260009052905060005b83518110156112bf576000848281518110611217576112176125c3565b602002602001015190506000848381518110611235576112356125c3565b6020908102919091018101516000848152606c835260408082206001600160a01b038c1683529093529190912054909150818110156112865760405162461bcd60e51b815260040161036590612798565b6000928352606c602090815260408085206001600160a01b038b16865290915290922091039055806112b7816125ef565b9150506111fa565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611310929190612727565b60405180910390a4604080516020810190915260009052610d98565b816001600160a01b0316836001600160a01b03160361139f5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610365565b6001600160a01b038381166000818152606d6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166114325760405162461bcd60e51b815260040161036590612698565b600061143c610fdc565b90506000611449856117b3565b90506000611456856117b3565b90506000868152606c602090815260408083206001600160a01b038c1684529091529020548581101561149b5760405162461bcd60e51b8152600401610365906126dd565b6000878152606c602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906114da908490612608565b909155505060408051888152602081018890526001600160a01b03808b16928c82169291881691600080516020612b0c833981519152910160405180910390a4611528848a8a8a8a8a6117fe565b505050505050505050565b600754610100900460ff1661155a5760405162461bcd60e51b8152600401610365906127dc565b61156381611a70565b50565b60606103936001600160a01b0383166014611aa0565b815160208084019190912082519183019190912060038290556004819055466001557f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6115ca818484611c42565b600055600280546001600160a01b0319163017905560055550505050565b6001600160a01b03831661160e5760405162461bcd60e51b815260040161036590612755565b6000611618610fdc565b90506000611625846117b3565b90506000611632846117b3565b6040805160208082018352600091829052888252606c81528282206001600160a01b038b16835290522054909150848110156116805760405162461bcd60e51b815260040161036590612798565b6000868152606c602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a9052909290881691600080516020612b0c833981519152910160405180910390a4604080516020810190915260009052610fd3565b6000604051806080016040528060438152602001612b2c6043913980516020918201208351848301516040808701518051908601209051611748950193845260208401929092526001600160a01b03166040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b6000610393611772611c8b565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106117ed576117ed6125c3565b602090810291909101015292915050565b6001600160a01b0384163b1561118d5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906118429089908990889088908890600401612827565b6020604051808303816000875af192505050801561187d575060408051601f3d908101601f1916820190925261187a9181019061286c565b60015b61192957611889612889565b806308c379a0036118c2575061189d6128a4565b806118a857506118c4565b8060405162461bcd60e51b81526004016103659190611e62565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610365565b6001600160e01b0319811663f23a6e6160e01b14610fd35760405162461bcd60e51b81526004016103659061292d565b60003033036119af57600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b031691506119b29050565b50335b90565b6001600160a01b0384163b1561118d5760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906119f99089908990889088908890600401612975565b6020604051808303816000875af1925050508015611a34575060408051601f3d908101601f19168201909252611a319181019061286c565b60015b611a4057611889612889565b6001600160e01b0319811663bc197c8160e01b14610fd35760405162461bcd60e51b81526004016103659061292d565b600754610100900460ff16611a975760405162461bcd60e51b8152600401610365906127dc565b61156381611cc6565b60606000611aaf8360026129d3565b611aba906002612608565b6001600160401b03811115611ad157611ad1611edc565b6040519080825280601f01601f191660200182016040528015611afb576020820181803683370190505b509050600360fc1b81600081518110611b1657611b166125c3565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611b4557611b456125c3565b60200101906001600160f81b031916908160001a9053506000611b698460026129d3565b611b74906001612608565b90505b6001811115611bec576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611ba857611ba86125c3565b1a60f81b828281518110611bbe57611bbe6125c3565b60200101906001600160f81b031916908160001a90535060049490941c93611be5816129ea565b9050611b77565b508315611c3b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610365565b9392505050565b6040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6002546000906001600160a01b031630148015611ca9575060015446145b15611cb5575060005490565b610fe6600554600354600454611c42565b606e610b2f8282612a4c565b80356001600160a01b0381168114611ce957600080fd5b919050565b60008060408385031215611d0157600080fd5b611d0a83611cd2565b946020939093013593505050565b6001600160e01b03198116811461156357600080fd5b600060208284031215611d4057600080fd5b8135611c3b81611d18565b60008083601f840112611d5d57600080fd5b5081356001600160401b03811115611d7457600080fd5b602083019150836020828501011115611d8c57600080fd5b9250929050565b60008060008060008060a08789031215611dac57600080fd5b611db587611cd2565b955060208701356001600160401b03811115611dd057600080fd5b611ddc89828a01611d4b565b9096509450506040870135925060608701359150608087013560ff81168114611e0457600080fd5b809150509295509295509295565b60005b83811015611e2d578181015183820152602001611e15565b50506000910152565b60008151808452611e4e816020860160208601611e12565b601f01601f19169290920160200192915050565b602081526000611c3b6020830184611e36565b600060208284031215611e8757600080fd5b5035919050565b600080600060608486031215611ea357600080fd5b611eac84611cd2565b95602085013595506040909401359392505050565b600060208284031215611ed357600080fd5b611c3b82611cd2565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715611f1757611f17611edc565b6040525050565b60006001600160401b03821115611f3757611f37611edc565b5060051b60200190565b600082601f830112611f5257600080fd5b81356020611f5f82611f1e565b604051611f6c8282611ef2565b83815260059390931b8501820192828101915086841115611f8c57600080fd5b8286015b84811015611fa75780358352918301918301611f90565b509695505050505050565b600082601f830112611fc357600080fd5b81356001600160401b03811115611fdc57611fdc611edc565b604051611ff3601f8301601f191660200182611ef2565b81815284602083860101111561200857600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561203d57600080fd5b61204686611cd2565b945061205460208701611cd2565b935060408601356001600160401b038082111561207057600080fd5b61207c89838a01611f41565b9450606088013591508082111561209257600080fd5b61209e89838a01611f41565b935060808801359150808211156120b457600080fd5b506120c188828901611fb2565b9150509295509295909350565b600080604083850312156120e157600080fd5b82356001600160401b03808211156120f857600080fd5b818501915085601f83011261210c57600080fd5b8135602061211982611f1e565b6040516121268282611ef2565b83815260059390931b850182019282810191508984111561214657600080fd5b948201945b8386101561216b5761215c86611cd2565b8252948201949082019061214b565b9650508601359250508082111561218157600080fd5b5061218e85828601611f41565b9150509250929050565b600081518084526020808501945080840160005b838110156121c8578151875295820195908201906001016121ac565b509495945050505050565b602081526000611c3b6020830184612198565b60008083601f8401126121f857600080fd5b5081356001600160401b0381111561220f57600080fd5b6020830191508360208260051b8501011115611d8c57600080fd5b6000806000806000806060878903121561224357600080fd5b86356001600160401b038082111561225a57600080fd5b6122668a838b016121e6565b9098509650602089013591508082111561227f57600080fd5b61228b8a838b016121e6565b909650945060408901359150808211156122a457600080fd5b506122b189828a016121e6565b979a9699509497509295939492505050565b6000806000806000606086880312156122db57600080fd5b6122e486611cd2565b945060208601356001600160401b038082111561230057600080fd5b61230c89838a016121e6565b9096509450604088013591508082111561232557600080fd5b50612332888289016121e6565b969995985093965092949392505050565b6000806040838503121561235657600080fd5b61235f83611cd2565b91506020830135801515811461237457600080fd5b809150509250929050565b6000806040838503121561239257600080fd5b61239b83611cd2565b91506123a960208401611cd2565b90509250929050565b600080600080600060a086880312156123ca57600080fd5b6123d386611cd2565b94506123e160208701611cd2565b9350604086013592506060860135915060808601356001600160401b0381111561240a57600080fd5b6120c188828901611fb2565b60008060006040848603121561242b57600080fd5b61243484611cd2565b925060208401356001600160401b0381111561244f57600080fd5b61245b86828701611d4b565b9497909650939450505050565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b600082516124a0818460208701611e12565b9190910192915050565b6001600160a01b0385811682528416602082015260606040820181905281018290526000828460808401376000608084840101526080601f19601f850116830101905095945050505050565b600181811c9082168061250a57607f821691505b60208210810361252a57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526025908201527f4368696c64455243313135353a204f6e6c79207072656469636174652063616e6040820152640818d85b1b60da1b606082015260800190565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612601576126016125d9565b5060010190565b80820180821115610393576103936125d9565b6c4368696c64455243313135352d60981b81526000825161264381600d850160208701611e12565b91909101600d0192915050565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60408152600061273a6040830185612198565b828103602084015261274c8185612198565b95945050505050565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061286190830184611e36565b979650505050505050565b60006020828403121561287e57600080fd5b8151611c3b81611d18565b600060033d11156119b25760046000803e5060005160e01c90565b600060443d10156128b25790565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156128e157505050505090565b82850191508151818111156128f95750505050505090565b843d87010160208285010111156129135750505050505090565b61292260208286010187611ef2565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b0386811682528516602082015260a0604082018190526000906129a190830186612198565b82810360608401526129b38186612198565b905082810360808401526129c78185611e36565b98975050505050505050565b8082028115828204841417610393576103936125d9565b6000816129f9576129f96125d9565b506000190190565b601f821115612a4757600081815260208120601f850160051c81016020861015612a285750805b601f850160051c820191505b8181101561118d57828155600101612a34565b505050565b81516001600160401b03811115612a6557612a65611edc565b612a7981612a7384546124f6565b84612a01565b602080601f831160018114612aae5760008415612a965750858301515b600019600386901b1c1916600185901b17855561118d565b600085815260208120601f198616915b82811015612add57888601518255948401946001909101908401612abe565b5085821015612afb5787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fec3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f624d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e617475726529a2646970667358221220cf72cc6dfec7557a549ae9a9c0f6f7dbddd3c040da94b9a82892a238de95698864736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001008": { + "code": "0x608060405234801561001057600080fd5b50600436106101375760003560e01c8063b1768065116100b8578063d41f17711161007c578063d41f177114610298578063d7c9e3ec146102bf578063e0563ab1146102e6578063eeb49945146102ef578063f645125514610302578063f8c8765e1461032957600080fd5b8063b176806514610211578063b5c5f67214610238578063b68ad1e41461024b578063b8cd3ec01461025e578063c5ac2b1c1461027157600080fd5b806351351d53116100ff57806351351d53146101a45780637efab4f5146101b257806386937eb4146101db578063947287cf146101f057806397e5230d1461020757600080fd5b8063051eb2e21461013c57806305dc2e8f1461016c5780631bc114ba1461017f578063284017f5146101925780633b878c221461019b575b600080fd5b60355461014f906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60345461014f906001600160a01b031681565b60335461014f906001600160a01b031681565b61014f61202081565b61014f61101081565b61014f6002600160a01b0381565b61014f6101c03660046115f0565b6037602052600090815260409020546001600160a01b031681565b6101ee6101e936600461165f565b61033c565b005b6101f961520881565b604051908152602001610163565b6101f9620249f081565b6101f97f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286981565b6101ee61024636600461170b565b610354565b60365461014f906001600160a01b031681565b6101ee61026c366004611740565b610365565b6101f97faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d1881565b6101f97f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82181565b6101f97f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed281565b61014f61203081565b6101ee6102fd366004611786565b610377565b6101f97f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad81565b6101ee61033736600461180e565b610597565b61034b878787878787876107d8565b50505050505050565b61036083338484610b57565b505050565b61037184848484610b57565b50505050565b6034546001600160a01b031633146103e95760405162461bcd60e51b815260206004820152602a60248201527f4368696c64455243313135355072656469636174653a204f4e4c595f5354415460448201526922afa922a1a2a4ab22a960b11b60648201526084015b60405180910390fd5b6035546001600160a01b038481169116146104595760405162461bcd60e51b815260206004820152602a60248201527f4368696c64455243313135355072656469636174653a204f4e4c595f524f4f546044820152695f50524544494341544560b01b60648201526084016103e0565b7f87a7811f4bfedea3d341ad165680ae306b01aaeacc205d227629cf157dd9f82161048860206000848661186a565b61049191611894565b036104b0576104ab6104a6826020818661186a565b610e6c565b610371565b7faf50c8eab81226bc79eee3a10e3fe25db1a2be7241130e392b0675df839b6d186104df60206000848661186a565b6104e891611894565b036104f7576104ab82826110d7565b7f2cef46a936bdc5b7e6e8c71aa04560c41cf7d88bb26901a7e7f4936ff02accad61052660206000848661186a565b61052f91611894565b0361053e576104ab8282611344565b60405162461bcd60e51b815260206004820152602860248201527f4368696c64455243313135355072656469636174653a20494e56414c49445f5360448201526749474e415455524560c01b60648201526084016103e0565b336002600160a01b03146105db5760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064016103e0565b600054610100900460ff16158080156105fb5750600054600160ff909116105b806106155750303b158015610615575060005460ff166001145b6106785760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103e0565b6000805460ff19166001179055801561069b576000805461ff0019166101001790555b6001600160a01b038516158015906106bb57506001600160a01b03841615155b80156106cf57506001600160a01b03831615155b80156106e357506001600160a01b03821615155b6107415760405162461bcd60e51b815260206004820152602960248201527f4368696c64455243313135355072656469636174653a204241445f494e49544960448201526820a624ad20aa24a7a760b91b60648201526084016103e0565b603380546001600160a01b038088166001600160a01b0319928316179092556034805487841690831617905560358054868416908316179055603680549285169290911691909117905580156107d1576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b866107e2816114ac565b6107fe5760405162461bcd60e51b81526004016103e0906118b2565b6000886001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa15801561083e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086291906118f5565b6001600160a01b038181166000908152603760205260409020549192508a81169116146108a15760405162461bcd60e51b81526004016103e090611912565b6001600160a01b0381166108b7576108b7611957565b306001600160a01b0316896001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092391906118f5565b6001600160a01b03161461093957610939611957565b868514801561094757508483145b6109a15760405162461bcd60e51b815260206004820152602560248201527f4368696c64455243313135355072656469636174653a20494e56414c49445f4c60448201526408a9c8ea8960db1b60648201526084016103e0565b604051631ac8311560e21b81526001600160a01b038a1690636b20c454906109d59033908a908a908a908a9060040161199f565b6020604051808303816000875af11580156109f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1891906119e3565b610a345760405162461bcd60e51b81526004016103e090611a05565b6033546035546040516001600160a01b03928316926316f19831921690610a8f907f5fb452c5a8f2b7c7ef2984e2f1063c7ee9b80b110cdc98ccb98f6654e10b5ed290869033908f908f908f908f908f908f90602001611a90565b6040516020818303038152906040526040518363ffffffff1660e01b8152600401610abb929190611b41565b600060405180830381600087803b158015610ad557600080fd5b505af1158015610ae9573d6000803e3d6000fd5b50505050336001600160a01b0316896001600160a01b0316826001600160a01b03167f7a10660242ca367951ff3777cdb3c2a761e3ccad204bac118501e24693f3683d8b8b8b8b8b8b604051610b4496959493929190611b6d565b60405180910390a4505050505050505050565b83610b61816114ac565b610b7d5760405162461bcd60e51b81526004016103e0906118b2565b6000856001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be191906118f5565b6001600160a01b03818116600090815260376020526040902054919250878116911614610c205760405162461bcd60e51b81526004016103e090611912565b6001600160a01b038116610c3657610c36611957565b306001600160a01b0316866001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca291906118f5565b6001600160a01b031614610cb857610cb8611957565b604051637a94c56560e11b81526001600160a01b0387169063f5298aca90610ce890339088908890600401611bb6565b6020604051808303816000875af1158015610d07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2b91906119e3565b610d475760405162461bcd60e51b81526004016103e090611a05565b603354603554604080517f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286960208201526001600160a01b0385811682840152336060830152898116608083015260a0820189905260c08083018990528351808403909101815260e08301938490526316f1983160e01b909352938416936316f1983193610dd99391169160e401611b41565b600060405180830381600087803b158015610df357600080fd5b505af1158015610e07573d6000803e3d6000fd5b50505050846001600160a01b0316866001600160a01b0316826001600160a01b03167f2ca9093e8b5356801039806c6a08003e5b7013fb8ae48f720fc90fc1c1a8bec2338888604051610e5c93929190611bb6565b60405180910390a4505050505050565b600080808080610e7e86880188611bd7565b6001600160a01b03808616600090815260376020526040902054959a50939850919650945092501680610ec35760405162461bcd60e51b81526004016103e090611912565b610ecc816114ac565b610ed857610ed8611957565b6000816001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3c91906118f5565b9050866001600160a01b0316816001600160a01b031614610f5f57610f5f611957565b6001600160a01b038116610f7557610f75611957565b306001600160a01b0316826001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe191906118f5565b6001600160a01b031614610ff757610ff7611957565b604051630ab714fb60e11b81526001600160a01b0383169063156e29f69061102790889088908890600401611bb6565b6020604051808303816000875af1158015611046573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106a91906119e3565b6110865760405162461bcd60e51b81526004016103e090611c32565b846001600160a01b0316826001600160a01b0316886001600160a01b03167f2930d932c1cccd6add2e0e2d706ede9015db8a194405f2a3e1783703515e104f898888604051610b4493929190611bb6565b6000808080806110e986880188611d48565b6001600160a01b03808616600090815260376020526040902054959b5093995091975095509350169050806111305760405162461bcd60e51b81526004016103e090611912565b611139816114ac565b61114557611145611957565b6000816001600160a01b0316631f2d00656040518163ffffffff1660e01b8152600401602060405180830381865afa158015611185573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a991906118f5565b9050866001600160a01b0316816001600160a01b0316146111cc576111cc611957565b6001600160a01b0381166111e2576111e2611957565b306001600160a01b0316826001600160a01b031663e61987056040518163ffffffff1660e01b8152600401602060405180830381865afa15801561122a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124e91906118f5565b6001600160a01b03161461126457611264611957565b604051635712868360e01b81526001600160a01b0383169063571286839061129490889088908890600401611e8d565b6020604051808303816000875af11580156112b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112d791906119e3565b6112f35760405162461bcd60e51b81526004016103e090611c32565b856001600160a01b0316826001600160a01b0316886001600160a01b03167f17304b99f8dfa5a2b8dd5695d82f9947c2abfbc9cb64bab610b9a1a0feadb9a0888888604051610b4493929190611e8d565b60008061135383850185611f02565b9093509150506001600160a01b03821661136f5761136f611957565b6001600160a01b03828116600090815260376020526040902054161561139757611397611957565b6036546040516bffffffffffffffffffffffff19606085901b1660208201526000916113e7916001600160a01b039091169060340160405160208183030381529060405280519060200120611541565b6001600160a01b038481166000908152603760205260409081902080546001600160a01b0319169284169283179055516379ccf11760e11b81529192509063f399e22e9061143b9086908690600401611b41565b600060405180830381600087803b15801561145557600080fd5b505af1158015611469573d6000803e3d6000fd5b50506040516001600160a01b038085169350861691507f46bd56f98e1b14fd35691959270a6e1edf7cb8fcd489e0f9dda89e46c0d1ff0d90600090a35050505050565b6000816001600160a01b03163b6000036114c857506000919050565b6040516301ffc9a760e01b8152636cdb3d1360e11b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa92505050801561152f575060408051601f3d908101601f1916820190925261152c918101906119e3565b60015b61153b57506000919050565b92915050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b03811661153b5760405162461bcd60e51b8152602060048201526017602482015276115490cc4c4d8dce8818dc99585d194c8819985a5b1959604a1b60448201526064016103e0565b6001600160a01b03811681146115ed57600080fd5b50565b60006020828403121561160257600080fd5b813561160d816115d8565b9392505050565b60008083601f84011261162657600080fd5b5081356001600160401b0381111561163d57600080fd5b6020830191508360208260051b850101111561165857600080fd5b9250929050565b60008060008060008060006080888a03121561167a57600080fd5b8735611685816115d8565b965060208801356001600160401b03808211156116a157600080fd5b6116ad8b838c01611614565b909850965060408a01359150808211156116c657600080fd5b6116d28b838c01611614565b909650945060608a01359150808211156116eb57600080fd5b506116f88a828b01611614565b989b979a50959850939692959293505050565b60008060006060848603121561172057600080fd5b833561172b816115d8565b95602085013595506040909401359392505050565b6000806000806080858703121561175657600080fd5b8435611761816115d8565b93506020850135611771816115d8565b93969395505050506040820135916060013590565b6000806000806060858703121561179c57600080fd5b8435935060208501356117ae816115d8565b925060408501356001600160401b03808211156117ca57600080fd5b818701915087601f8301126117de57600080fd5b8135818111156117ed57600080fd5b8860208285010111156117ff57600080fd5b95989497505060200194505050565b6000806000806080858703121561182457600080fd5b843561182f816115d8565b9350602085013561183f816115d8565b9250604085013561184f816115d8565b9150606085013561185f816115d8565b939692955090935050565b6000808585111561187a57600080fd5b8386111561188757600080fd5b5050820193919092039150565b8035602083101561153b57600019602084900360031b1b1692915050565b60208082526023908201527f4368696c64455243313135355072656469636174653a204e4f545f434f4e54526040820152621050d560ea1b606082015260800190565b60006020828403121561190757600080fd5b815161160d816115d8565b60208082526025908201527f4368696c64455243313135355072656469636174653a20554e4d41505045445f6040820152642a27a5a2a760d91b606082015260800190565b634e487b7160e01b600052600160045260246000fd5b81835260006001600160fb1b0383111561198657600080fd5b8260051b80836020870137939093016020019392505050565b6001600160a01b03861681526060602082018190526000906119c4908301868861196d565b82810360408401526119d781858761196d565b98975050505050505050565b6000602082840312156119f557600080fd5b8151801515811461160d57600080fd5b60208082526022908201527f4368696c64455243313135355072656469636174653a204255524e5f4641494c604082015261115160f21b606082015260800190565b8183526000602080850194508260005b85811015611a85578135611a6a816115d8565b6001600160a01b031687529582019590820190600101611a57565b509495945050505050565b8981526001600160a01b0389811660208301528816604082015260c060608201819052600090611ac3908301888a611a47565b8281036080840152611ad681878961196d565b905082810360a0840152611aeb81858761196d565b9c9b505050505050505050505050565b6000815180845260005b81811015611b2157602081850181015186830182015201611b05565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b0383168152604060208201819052600090611b6590830184611afb565b949350505050565b606081526000611b8160608301888a611a47565b8281036020840152611b9481878961196d565b90508281036040840152611ba981858761196d565b9998505050505050505050565b6001600160a01b039390931683526020830191909152604082015260600190565b600080600080600060a08688031215611bef57600080fd5b8535611bfa816115d8565b94506020860135611c0a816115d8565b93506040860135611c1a816115d8565b94979396509394606081013594506080013592915050565b60208082526022908201527f4368696c64455243313135355072656469636174653a204d494e545f4641494c604082015261115160f21b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611cb257611cb2611c74565b604052919050565b60006001600160401b03821115611cd357611cd3611c74565b5060051b60200190565b600082601f830112611cee57600080fd5b81356020611d03611cfe83611cba565b611c8a565b82815260059290921b84018101918181019086841115611d2257600080fd5b8286015b84811015611d3d5780358352918301918301611d26565b509695505050505050565b60008060008060008060c08789031215611d6157600080fd5b86359550602080880135611d74816115d8565b95506040880135611d84816115d8565b945060608801356001600160401b0380821115611da057600080fd5b818a0191508a601f830112611db457600080fd5b8135611dc2611cfe82611cba565b81815260059190911b8301840190848101908d831115611de157600080fd5b938501935b82851015611e08578435611df9816115d8565b82529385019390850190611de6565b9750505060808a0135925080831115611e2057600080fd5b611e2c8b848c01611cdd565b945060a08a0135925080831115611e4257600080fd5b5050611e5089828a01611cdd565b9150509295509295509295565b600081518084526020808501945080840160005b83811015611a8557815187529582019590820190600101611e71565b606080825284519082018190526000906020906080840190828801845b82811015611ecf5781516001600160a01b031684529284019290840190600101611eaa565b50505083810382850152611ee38187611e5d565b9150508281036040840152611ef88185611e5d565b9695505050505050565b600080600060608486031215611f1757600080fd5b83359250602080850135611f2a816115d8565b925060408501356001600160401b0380821115611f4657600080fd5b818701915087601f830112611f5a57600080fd5b813581811115611f6c57611f6c611c74565b611f7e601f8201601f19168501611c8a565b91508082528884828501011115611f9457600080fd5b8084840185840137600084828401015250809350505050925092509256fea26469706673582212200c4c5c9b53a533081213342cd86f6dcc2549159a1a5ec39ac85621bb137a4c8f64736f6c63430008130033", + "balance": "0x0" + }, + "0x0000000000000000000000000000000000001010": { + "code": "0x608060405234801561001057600080fd5b50600436106101425760003560e01c806370a08231116100b85780639dc29fac1161007c5780639dc29fac14610278578063a457c2d71461028b578063a9059cbb1461029e578063dd62ed3e146102b1578063e0563ab1146102c4578063e6198705146102cd57600080fd5b806370a082311461022d5780638420ce9914610248578063947287cf1461025d57806395d89b411461026657806397e5230d1461026e57600080fd5b8063284017f51161010a578063284017f5146101d2578063313ce567146101db57806339509351146101f05780633b878c221461020357806340c10f191461020c57806351351d531461021f57600080fd5b806306fdde0314610147578063095ea7b31461016557806318160ddd146101885780631f2d00651461019a57806323b872dd146101bf575b600080fd5b61014f6102de565b60405161015c9190610cfd565b60405180910390f35b610178610173366004610d4c565b610370565b604051901515815260200161015c565b6034545b60405190815260200161015c565b6036546001600160a01b03165b6040516001600160a01b03909116815260200161015c565b6101786101cd366004610d76565b61038a565b6101a761202081565b60395460405160ff909116815260200161015c565b6101786101fe366004610d4c565b6103ae565b6101a761101081565b61017861021a366004610d4c565b6103d0565b6101a76002600160a01b0381565b61018c61023b366004610db2565b6001600160a01b03163190565b61025b610256366004610e1d565b610419565b005b61018c61520881565b61014f6105c8565b61018c620249f081565b610178610286366004610d4c565b6105d7565b610178610299366004610d4c565b61060e565b6101786102ac366004610d4c565b610689565b61018c6102bf366004610ec8565b610697565b6101a761203081565b6035546001600160a01b03166101a7565b6060603780546102ed90610efb565b80601f016020809104026020016040519081016040528092919081815260200182805461031990610efb565b80156103665780601f1061033b57610100808354040283529160200191610366565b820191906000526020600020905b81548152906001019060200180831161034957829003601f168201915b5050505050905090565b60003361037e8185856106c2565b60019150505b92915050565b6000336103988582856107e6565b6103a3858585610860565b506001949350505050565b60003361037e8185856103c18383610697565b6103cb9190610f4b565b6106c2565b6035546000906001600160a01b031633146104065760405162461bcd60e51b81526004016103fd90610f5e565b60405180910390fd5b6104108383610a25565b50600192915050565b600054610100900460ff16158080156104395750600054600160ff909116105b806104535750303b158015610453575060005460ff166001145b6104b65760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103fd565b6000805460ff1916600117905580156104d9576000805461ff0019166101001790555b336002600160a01b031461051d5760405163973d02cb60e01b815260206004820152600a60248201526914d654d5115350d0531360b21b60448201526064016103fd565b603580546001600160a01b03808b166001600160a01b03199283161790925560368054928a1692909116919091179055603761055a868883611007565b506038610568848683611007565b506039805460ff191660ff841617905580156105be576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b6060603880546102ed90610efb565b6035546000906001600160a01b031633146106045760405162461bcd60e51b81526004016103fd90610f5e565b6104108383610b7f565b6000338161061c8286610697565b90508381101561067c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103fd565b6103a382868684036106c2565b60003361037e818585610860565b6001600160a01b03918216600090815260336020908152604080832093909416825291909152205490565b6001600160a01b0383166107245760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103fd565b6001600160a01b0382166107855760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103fd565b6001600160a01b0383811660008181526033602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006107f28484610697565b9050600019811461085a578181101561084d5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016103fd565b61085a84848484036106c2565b50505050565b6001600160a01b0383166108c45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103fd565b6001600160a01b0382166109265760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103fd565b6000806120206001600160a01b031685858560405160200161094a939291906110c8565b60408051601f1981840301815290829052610964916110ec565b6000604051808303816000865af19150503d80600081146109a1576040519150601f19603f3d011682016040523d82523d6000602084013e6109a6565b606091505b50915091508180156109c75750808060200190518101906109c79190611108565b6109e35760405162461bcd60e51b81526004016103fd9061112a565b836001600160a01b0316856001600160a01b031660008051602061116e83398151915285604051610a1691815260200190565b60405180910390a35050505050565b6001600160a01b038216610a7b5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103fd565b8060346000828254610a8d9190610f4b565b9091555050604051600090819061202090610ab0908390879087906020016110c8565b60408051601f1981840301815290829052610aca916110ec565b6000604051808303816000865af19150503d8060008114610b07576040519150601f19603f3d011682016040523d82523d6000602084013e610b0c565b606091505b5091509150818015610b2d575080806020019051810190610b2d9190611108565b610b495760405162461bcd60e51b81526004016103fd9061112a565b6040518381526001600160a01b0385169060009060008051602061116e833981519152906020015b60405180910390a350505050565b6001600160a01b038216610bdf5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103fd565b8060346000828254610bf1919061115a565b9091555050604051600090819061202090610c14908690849087906020016110c8565b60408051601f1981840301815290829052610c2e916110ec565b6000604051808303816000865af19150503d8060008114610c6b576040519150601f19603f3d011682016040523d82523d6000602084013e610c70565b606091505b5091509150818015610c91575080806020019051810190610c919190611108565b610cad5760405162461bcd60e51b81526004016103fd9061112a565b6040518381526000906001600160a01b0386169060008051602061116e83398151915290602001610b71565b60005b83811015610cf4578181015183820152602001610cdc565b50506000910152565b6020815260008251806020840152610d1c816040850160208701610cd9565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114610d4757600080fd5b919050565b60008060408385031215610d5f57600080fd5b610d6883610d30565b946020939093013593505050565b600080600060608486031215610d8b57600080fd5b610d9484610d30565b9250610da260208501610d30565b9150604084013590509250925092565b600060208284031215610dc457600080fd5b610dcd82610d30565b9392505050565b60008083601f840112610de657600080fd5b50813567ffffffffffffffff811115610dfe57600080fd5b602083019150836020828501011115610e1657600080fd5b9250929050565b600080600080600080600060a0888a031215610e3857600080fd5b610e4188610d30565b9650610e4f60208901610d30565b9550604088013567ffffffffffffffff80821115610e6c57600080fd5b610e788b838c01610dd4565b909750955060608a0135915080821115610e9157600080fd5b50610e9e8a828b01610dd4565b909450925050608088013560ff81168114610eb857600080fd5b8091505092959891949750929550565b60008060408385031215610edb57600080fd5b610ee483610d30565b9150610ef260208401610d30565b90509250929050565b600181811c90821680610f0f57607f821691505b602082108103610f2f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561038457610384610f35565b60208082526024908201527f4e617469766545524332303a204f6e6c79207072656469636174652063616e2060408201526318d85b1b60e21b606082015260800190565b634e487b7160e01b600052604160045260246000fd5b601f82111561100257600081815260208120601f850160051c81016020861015610fdf5750805b601f850160051c820191505b81811015610ffe57828155600101610feb565b5050505b505050565b67ffffffffffffffff83111561101f5761101f610fa2565b6110338361102d8354610efb565b83610fb8565b6000601f841160018114611067576000851561104f5750838201355b600019600387901b1c1916600186901b1783556110c1565b600083815260209020601f19861690835b828110156110985786850135825560209485019460019092019101611078565b50868210156110b55760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600082516110fe818460208701610cd9565b9190910192915050565b60006020828403121561111a57600080fd5b81518015158114610dcd57600080fd5b60208082526016908201527514149150d3d35412531157d0d0531317d1905253115160521b604082015260600190565b8181038181111561038457610384610f3556feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122020d4a9c065f722d638ec115bf32ed1a8620dca26d052147ca0029d6b7b9aec9d64736f6c63430008130033", + "balance": "0x0" + }, + "0x61324166B0202DB1E7502924326262274Fa4358F": { + "balance": "0xf4240" + }, + "0xFE5E166BA5EA50c04fCa00b07b59966E6C2E9570": { + "balance": "0xd3c21bcecceda1000000" + } + }, + "number": "0x0", + "gasUsed": "0x70000", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "baseFee": "0x0", + "baseFeeEM": "0x0" + }, + "params": { + "forks": { + "homestead": 0, + "byzantium": 0, + "constantinople": 0, + "petersburg": 0, + "istanbul": 0, + "EIP150": 0, + "EIP158": 0, + "EIP155": 0 + }, + "chainID": 0, + "engine": { + "polybft": { + "initialValidatorSet": [ + { + "address": "0x61324166B0202DB1E7502924326262274Fa4358F", + "blsKey": "06d8d9e6af67c28e85ac400b72c2e635e83234f8a380865e050a206554049a222c4792120d84977a6ca669df56ff3a1cf1cfeccddb650e7aacff4ed6c1d4e37b055858209f80117b3c0a6e7a28e456d4caf2270f430f9df2ba37221f23e9bbd313c9ef488e1849cc5c40d18284d019dde5ed86770309b9c24b70ceff6167a6ca", + "balance": "0xf4240", + "stake": "0xd3c21bcecceda1000000", + "multiAddr": "/ip4/127.0.0.1/tcp/30301/p2p/16Uiu2HAmMYyzK7c649Tnn6XdqFLP7fpPB2QWdck1Ee9vj5a7Nhg8" + }, + { + "address": "0xFE5E166BA5EA50c04fCa00b07b59966E6C2E9570", + "blsKey": "0601da8856a6d3d3bb0f3bcbb90ea7b8c0db8271b9203e6123c6804aa3fc5f810be33287968ca1af2be11839516850a6ffef2337d99e679b7531efbbea2e3bf727a053c0cbede71da3d5f489b6ad862ccd8bb0bfb7fa379e3395d3b1142594a73020e87d63c298a3a4eba0ace65727f8659bab6389b9448b72512db72bbe937f", + "balance": "0xd3c21bcecceda1000000", + "stake": "0xd3c21bcecceda1000000", + "multiAddr": "/ip4/127.0.0.1/tcp/30302/p2p/16Uiu2HAmLXVapjR2Yx3B1taCmHnckQ1ph2xrawBjW2kvSErps9CX" + } + ], + "bridge": null, + "epochSize": 10, + "epochReward": 1, + "sprintSize": 5, + "blockTime": "2s", + "governance": "0x61324166B0202DB1E7502924326262274Fa4358F", + "mintableNative": false, + "nativeTokenConfig": { + "name": "Polygon", + "symbol": "WMATIC", + "decimals": 18 + }, + "initialTrieRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "maxValidatorSetSize": 9007199254740990, + "rewardConfig": { + "rewardTokenAddress": "0x0000000000000000000000000000000000001010", + "rewardWalletAddress": "0x61324166B0202DB1E7502924326262274Fa4358F", + "rewardWalletAmount": "0xf4240" + } + } + }, + "blockGasTarget": 0, + "transactionsAllowList": { + "adminAddresses": [ + "0x061324166B0202Db1E7502924326262274fa4358" + ], + "enabledAddresses": [ + "0x061324166B0202Db1E7502924326262274fa4358" + ] + }, + "burnContract": null + }, + "bootnodes": [ + "/ip4/127.0.0.1/tcp/30301/p2p/16Uiu2HAmMYyzK7c649Tnn6XdqFLP7fpPB2QWdck1Ee9vj5a7Nhg8", + "/ip4/127.0.0.1/tcp/30302/p2p/16Uiu2HAmLXVapjR2Yx3B1taCmHnckQ1ph2xrawBjW2kvSErps9CX" + ] +} +``` + +
+ +
+
+ +## 4. Next Steps + +With a **genesis.json** file containing the initial chain state, validator nodes, and chain admins for your new childchain instance, you are ready to proceed. + +To configure the associated rootchain of the Edge-powered chain and deploy the essential rootchain core contracts, navigate to the [Rootchain Deployment guide](rootchain-config.md). diff --git a/docs/docs/operate/deploy/index.md b/docs/docs/operate/deploy/index.md new file mode 100644 index 0000000000..4c40efbae4 --- /dev/null +++ b/docs/docs/operate/deploy/index.md @@ -0,0 +1,164 @@ +This serves as an index for the Edge deployment guides. +The guides explain the end-to-end process for setting up and deploying a local Edge-powered chain. + +## Prerequisites + +Before diving into any of the tutorials, make sure your environment meets the necessary prerequisites. They can be found **[here](../system.md)**. + +### Before starting + +!!! info "Don't use the develop branch for deployments" + + Please ensure that you are not running on the `develop` branch, which is the active development branch and include changes that are still being tested and not compatible with the current process. + + Instead, use the [latest release](../install.md) for deployments. + +!!! caution "Key management and secure values" + When passing values, it is important to keep sensitive values like private keys and API keys secure. + + The sample commands provided in this guide use sample private keys for demonstration purposes only, in order to show the format and expected value of the parameter. It is important to note that hardcoding or directly passing private keys should never be done in a development or production environment. + +!!! info + Here are some options for securely storing and retrieving private keys ↓ + + - **Environment Variables:** You can store the private key as an environment variable and access it in your code. For example, in Linux, you can set an environment variable like this: `export PRIVATE_KEY="my_private_key"`. Then, in your code, you can retrieve the value of the environment variable using `os.Getenv("PRIVATE_KEY")`. + + - **Configuration Files:** You can store the private key in a configuration file and read it in your session. Be sure to keep the configuration file in a secure location and restrict access to it. + + - **Vaults and Key Management Systems:** If you are working with sensitive data, you might consider using a vault or key management system like a keystore to store your private keys. These systems provide additional layers of security and can help ensure that your private keys are kept safe. + + + +Regardless of how a private key is stored and retrieved, it's important to keep it secure and not expose it unnecessarily. + + +## What you'll learn + +In this tutorial, you will learn how to set up and initialize an Edge-powered chain with multiple nodes. You will learn the complete end-to-end genesis workflow of building an Edge-powered chain, including: + +- Generating private keys for PolyBFT nodes. +- Deploying and initializing rootchain contracts. +- Configuring the rootchain by allowlisting and registering validators, performing initial staking, and finalizing the validator set. +- Generating the genesis file and chain configuration. +- Funding validators on the rootchain. +- Running an (Edge) cluster consisting of multiple PolyBFT nodes. + +By the end of this tutorial, you will have a fully functional Edge test network that can be used to process transactions with high throughput and low latency. + +## What you'll do + +The deployment guides will cover the steps outlined below. If you are deploying an Edge-powered chain for the first time, please navigate each section in order. + +1. [Spawn a New Edge-powered chain](local-chain.md) +2. [Configure Your New Edge-powered chain](genesis.md) +3. [Configure the Rootchain](rootchain-config.md) +4. [Configure the Initial Validator Set](genesis-validators.md) +5. [Start Your New Edge-powered chain](start-chain.md) + +
+Fast-track guide ↓ + +**Here's the fast-track guide if you're looking for a quick guide on the essential commands needed to set up a local Edge-powered chain.** + +1. Init secrets: + + ```bash + ./polygon-edge polybft-secrets --data-dir test-chain- --num 4 + ``` + +2. Create chain configuration: + + Single host: + + ```bash + ./polygon-edge genesis --block-gas-limit 10000000 --epoch-size 10 [--validators-path ./] [--validators-prefix test-chain-] [--consensus polybft] [--reward-wallet address:amount] + + Multi-host: + + ```bash + ./polygon-edge genesis --block-gas-limit 10000000 --epoch-size 10 --validators /ip4/127.0.0.1/tcp/30301/p2p/16Uiu2HAmV5hqAp77untfJRorxqKmyUxgaVn8YHFjBJm9gKMms3mr:0xDcBe0024206ec42b0Ef4214Ac7B71aeae1A11af0:1cf134e02c6b2afb2ceda50bf2c9a01da367ac48f7783ee6c55444e1cab418ec0f52837b90a4d8cf944814073fc6f2bd96f35366a3846a8393e3cb0b19197cde23e2b40c6401fa27ff7d0c36779d9d097d1393cab6fc1d332f92fb3df850b78703b2989d567d1344e219f0667a1863f52f7663092276770cf513f9704b5351c4:11b18bde524f4b02258a8d196b687f8d8e9490d536718666dc7babca14eccb631c238fb79aa2b44a5a4dceccad2dd797f537008dda185d952226a814c1acf7c2] + ``` + +3. Deploy and initialize rootchain contracts: + + [FOR GETH ONLY] Start rootchain server: + + ```bash + ./polygon-edge rootchain server + ``` + + ```bash + ./polygon-edge rootchain deploy --deployer-key [--genesis ./genesis.json] [--json-rpc http://127.0.0.1:8545] [--test] + ``` + +4. Fund validators on rootchain: + + ```bash + ./polygon-edge rootchain fund --data-dir ./test-chain-1 + ``` + +5. Allowlist validators on rootchain: + + ```bash + ./polygon-edge polybft whitelist-validators --private-key --addresses --supernet-manager + ``` + +6. Register validators on rootchain: + + ```bash + ./polygon-edge polybft register-validator --data-dir ./test-chain-1 --supernet-manager + ``` + +7. Initial staking on rootchain: + + ```bash + ./polygon-edge polybft stake --data-dir ./test-chain-1 --chain-id --amount --stake-manager --native-root-token + ``` + +8. Finalize genesis validator set on rootchain: + + ```bash + ./polygon-edge polybft supernet --private-key \ + --genesis \ + --supernet-manager \ + --stake-manager \ + --finalize-genesis --enable-staking + ``` + +9. Run (child chain) cluster: + + ```bash + ./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :5001 --libp2p :30301 --jsonrpc :10001 \ + --seal --log-level DEBUG + + ./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json --grpc-address :5002 --libp2p :30302 --jsonrpc :10002 \ + --seal --log-level DEBUG + + ./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json --grpc-address :5003 --libp2p :30303 --jsonrpc :10003 \ + --seal --log-level DEBUG + + ./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json --grpc-address :5004 --libp2p :30304 --jsonrpc :10004 \ + --seal --log-level DEBUG + ``` + + Starting node in relayer mode: + + ```bash + ./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :5001 --libp2p :30301 --jsonrpc :10001 \ + --seal --log-level DEBUG --relayer + ``` + +
+ +## Cloud Deployments + +!!! caution "Content disclaimer" + + Please view the third-party content disclaimer [here]/disclaimer/). + + +| Platform | Guide | +| --- | --- | +| Amazon Web Services | To set up a devnet on AWS, you can refer to the AWS deployment guide available [here](https://github.com/maticnetwork/terraform-polygon-supernets). The guide provides comprehensive instructions on how to use Terraform to set up a Virtual Private Cloud (VPC), subnets, security groups, and EC2 instances, followed by instructions on configuring nodes using Ansible. | +| Microsoft Azure | To set up a devnet on Azure, you can refer to the Azure deployment guide available [here](https://github.com/caleteeter/polygon-azure). This repository offers an Azure template that can be deployed through the Azure and Bicep CLI, or directly through the "Deploy to Azure" button. Additionally, the deployment can be viewed via the "Visualize" button available in the repository. | +| Google Cloud Platform | To set up a devnet on GCP, you can refer to the GCP deployment guide available [here](https://github.com/IntellectEU/gcp-polygon-supernets). The guide provides comprehensive instructions on how to use Terraform to set up a Virtual Private Cloud (VPC), subnets, firewall rules, the Service Account and GCE instances, followed by instructions on configuring nodes using Ansible. | diff --git a/docs/docs/operate/deploy/local-chain.md b/docs/docs/operate/deploy/local-chain.md new file mode 100644 index 0000000000..d6d7ef4027 --- /dev/null +++ b/docs/docs/operate/deploy/local-chain.md @@ -0,0 +1,140 @@ +In this section, we'll prepare initiate a new chain with PolyBFT consensus and prepare the initial Edge nodes. + +## 1. Generate Keys + +To initialize PolyBFT consensus, we need to generate the necessary secrets for each node. + +The `polygon-edge polybft-secrets` command is used to generate account secrets for validators. The command initializes private keys for the consensus client (validators + networking) to a Secrets Manager config file. + +
+Flags ↓ + +| Flag | Description | Example | +|-----------------|-----------------------------------------------------------------------------------------------------------|----------------------------| +| `--account` | The flag indicating whether a new account is created (default true). | | +| `--config` | The path to the SecretsManager config file. If omitted, the local FS secrets manager is used. | `--config /path/to/config` | +| `--data-dir` | The directory for the Polygon Edge data if the local FS is used. | `--data-dir /path/to/dir` | +| `--insecure` | The flag indicating whether the secrets stored on the local storage should be encrypted. | | +| `--network` | The flag indicating whether a new Network key is created (default true). | | +| `--num` | The flag indicating how many secrets should be created, only for the local FS (default 1). | `--num 4` | +| `--output` | The flag indicating to output existing secrets. | `--output` | +| `--private` | The flag indicating whether the private key is printed. | `--private` | + +
+ + ```bash + ./polygon-edge polybft-secrets --insecure --data-dir test-chain- --num 4 + ``` + +
+Output example ↓ + +```bash +[WARNING: INSECURE LOCAL SECRETS - SHOULD NOT BE RUN IN PRODUCTION] + +[SECRETS GENERATED] +network-key, validator-key, validator-bls-key + +[SECRETS INIT] +Public key (address) = 0x61324166B0202DB1E7502924326262274Fa4358F +BLS Public key = 06d8d9e6af67c28e85ac400b72c2e635e83234f8a380865e050a206554049a222c4792120d84977a6ca669df56ff3a1cf1cfeccddb650e7aacff4ed6c1d4e37b055858209f80117b3c0a6e7a28e456d4caf2270f430f9df2ba37221f23e9bbd313c9ef488e1849cc5c40d18284d019dde5ed86770309b9c24b70ceff6167a6ca +Node ID = 16Uiu2HAmMYyzK7c649Tnn6XdqFLP7fpPB2QWdck1Ee9vj5a7Nhg8 + +[WARNING: INSECURE LOCAL SECRETS - SHOULD NOT BE RUN IN PRODUCTION] + +[SECRETS GENERATED] +network-key, validator-key, validator-bls-key + +[SECRETS INIT] +Public key (address) = 0xFE5E166BA5EA50c04fCa00b07b59966E6C2E9570 +BLS Public key = 0601da8856a6d3d3bb0f3bcbb90ea7b8c0db8271b9203e6123c6804aa3fc5f810be33287968ca1af2be11839516850a6ffef2337d99e679b7531efbbea2e3bf727a053c0cbede71da3d5f489b6ad862ccd8bb0bfb7fa379e3395d3b1142594a73020e87d63c298a3a4eba0ace65727f8659bab6389b9448b72512db72bbe937f +Node ID = 16Uiu2HAmLXVapjR2Yx3B1taCmHnckQ1ph2xrawBjW2kvSErps9CX + +[WARNING: INSECURE LOCAL SECRETS - SHOULD NOT BE RUN IN PRODUCTION] + +[SECRETS GENERATED] +network-key, validator-key, validator-bls-key + +[SECRETS INIT] +Public key (address) = 0x9aBb8441A12d4FD8D505C3fc50cDdc45E0df2b1e +BLS Public key = 17c26d9d91dddc3c1318b20a1ddb3322ea1f4e4415c27e9011d706e7407eed672837173d1909cbff6ccdfd110af3b18bdfea878e8120fdb5bae70dc7a044a2f40aa8f118b41704896f474f80fff52d9047fa8e4a464ac86f9d05a0220975d8440e20c6307d866137053cabd4baf6ba84bfa4a22f5f9297c1bfc2380c23535210 +Node ID = 16Uiu2HAmGskf5sZ514Ab4SHTPuw8RRBQudyrU211wn3P1knRz9Ed + +[WARNING: INSECURE LOCAL SECRETS - SHOULD NOT BE RUN IN PRODUCTION] + +[SECRETS GENERATED] +network-key, validator-key, validator-bls-key + +[SECRETS INIT] +Public key (address) = 0xCaB5AAC79Bebe326e0c80d72b5662E73f5D8ea56 +BLS Public key = 1d7bb7d44a2f0ebeae2f4380f88188080de34635d78a36647f0704c7b70de7291e2e3b9a1ef699a078c6cd9bb816ea2917c2c2fc699c6248f1f7812a167caf7e15361ec16df56d194768d57c79897c681c96f4321651464f7b577d08083d8b67213a1e29dc8495d8389e6cbd85fdd738c402a1801198b57b302e0e00dfaf1247 +Node ID = 16Uiu2HAm42EFMhJPGcMRFHPaWWxBzoEsWRbGxJnBHMu4VFojg99U +``` + +
+ +:::info Example with AWS Secrets + +### Prerequisites + +1. You need to have [AWS CLI](https://aws.amazon.com/cli/) installed and configured on your machine. +2. An [AWS SSO account](https://aws.amazon.com/iam/identity-center/) with the right permissions to access the SSM Parameter Store is required. + +### Step 1: AWS SSO Login + +The first step is to log in to your AWS SSO account. In your terminal, run the following command: + +```bash +aws sso login +``` + +Follow the prompts to complete the login process. + +### Step 2: Create Config.json File + +Next, create a config.json file within your polygon-edge directory with the following contents: + +```json +{ + "Type": "aws-ssm", + "Name": "validator1", + "Extra": { + "region": "us-west-2", + "ssm-parameter-path": "/test" + } +} +``` + +Ensure to replace the "Name" value with the name you wish to use for your validator, and the "ssm-parameter-path" with the path in AWS SSM Parameter Store where your parameters will be stored. + +### Step 3: Run the Secret Generation Command + +To generate the necessary secrets for your validator node, run the polybft-secrets command. In your terminal, input: + +```bash +go run main.go polybft-secrets --config config.json +``` + +This will generate the secrets and store them in the AWS SSM Parameter Store as defined in your config.json file. + +### Step 4: Check Outputs in AWS SSM Parameter Store + +Check your AWS SSM Parameter Store to verify that the secrets have been generated successfully. This can be done via the AWS console. + +> Note: In this tutorial, the example shown generated the following secrets: network-key, validator-key, and validator-bls-key. Your output will also show the public key (address), BLS public key, and Node ID. + +::: + +### Understand the Generated Secrets + +The generated secrets include the following information for each validator node: + +- **ECDSA Private and Public Keys**: These keys are used to sign and verify transactions on the blockchain. +- **BLS Private and Public Keys**: These keys are used in the Byzantine fault-tolerant (BFT) consensus protocol to aggregate and verify signatures efficiently. +- **P2P Networking Node ID**: This is a unique identifier for each validator node in the network, allowing them to establish and maintain connections with other nodes. + +> The secrets output can be retrieved again if needed by running the following command: `./polygon-edge polybft-secrets --data-dir test-chain-X/` + +## 2. Next Steps + +As the next step, navigate to the [Configure a New Childchain](genesis.md) deployment guide. This will enable you to generate a new genesis file and define the initial validator set, facilitating the setup and configuration of the childchain's initial state. diff --git a/docs/docs/operate/deploy/rootchain-config.md b/docs/docs/operate/deploy/rootchain-config.md new file mode 100644 index 0000000000..bd3f4a9842 --- /dev/null +++ b/docs/docs/operate/deploy/rootchain-config.md @@ -0,0 +1,652 @@ +In this section, we'll configure the associated rootchain of the Edge-powered chain and deploy the necessary rootchain core contracts. + +After generating the initial chain state for your Edge-powered chain, the next step is to connect and initialize the rootchain contracts. This can be done using either a demo Geth instance or any EVM-compatible rootchain. The demo Geth instance is a local instance of a Geth node running in development mode, which simulates the Ethereum network and is **only intended for testing purposes**. + +## 1. Deploy and Initialize Rootchain Contracts + + + + + + + + + + + +### i. Start the Geth Node + +The `polygon-edge` rootchain server command starts an ethereum/client-go container, which runs a new Geth node. +To do this, open a new terminal session and run: + + ```bash + ./polygon-edge rootchain server + ``` + +
+Output example ↓ + +You should see output similar to the following, indicating that the rootchain server is now running: + + ```bash + {"status":"Pulling from 0xpolygon/go-ethereum-console","id":"latest"} + {"status":"Digest: sha256:6aad124b6775b96d05c94850dcafde45911f7bb2b473328dc4a792b1ffb2bdb6"} + {"status":"Status: Image is up to date for ghcr.io/0xpolygon/go-ethereum-console:latest"} + INFO [05-04|09:48:51.496] Starting Geth in ephemeral dev mode... + WARN [05-04|09:48:51.498] You are running Geth in --dev mode. Please note the following: + + 1. This mode is only intended for fast, iterative development without assumptions on + security or persistence. + 2. The database is created in memory unless specified otherwise. Therefore, shutting down + your computer or losing power will wipe your entire block data and chain state for + your dev environment. + 3. A random, pre-allocated developer account will be available and unlocked as + eth.coinbase, which can be used for testing. The random dev account is temporary, + stored on a ramdisk, and will be lost if your machine is restarted. + 4. Mining is enabled by default. However, the client will only seal blocks if transactions + are pending in the mempool. The miner's minimum accepted gas price is 1. + 5. Networking is disabled; there is no listen-address, the maximum number of peers is set + to 0, and discovery is disabled. + + INFO [05-04|09:48:51.515] Maximum peer count ETH=50 LES=0 total=50 + INFO [05-04|09:48:51.524] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory" + INFO [05-04|09:48:51.576] Set global gas cap cap=50,000,000 + INFO [05-04|09:48:52.676] Using developer account address=0xd8aC7c1C8A8F34392aD45C250489DeE5D1dC5F51 + INFO [05-04|09:48:52.682] Allocated cache and file handles database=/eth1data/geth/chaindata cache=512.00MiB handles=524,288 + INFO [05-04|09:48:52.807] Opened ancient database database=/eth1data/geth/chaindata/ancient/chain readonly=false + INFO [05-04|09:48:52.824] Allocated trie memory caches clean=154.00MiB dirty=256.00MiB + INFO [05-04|09:48:52.827] Allocated cache and file handles database=/eth1data/geth/chaindata cache=512.00MiB handles=524,288 + INFO [05-04|09:48:52.987] Opened ancient database database=/eth1data/geth/chaindata/ancient/chain readonly=false + INFO [05-04|09:48:53.003] Initialising Ethereum protocol network=1337 dbversion= + INFO [05-04|09:48:53.005] Writing custom genesis block + INFO [05-04|09:48:53.018] Persisted trie from memory database nodes=12 size=1.82KiB time=2.892875ms gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B + INFO [05-04|09:48:53.029] + INFO [05-04|09:48:53.029] --------------------------------------------------------------------------------------------------------------------------------------------------------- + INFO [05-04|09:48:53.030] Chain ID: 1337 (unknown) + INFO [05-04|09:48:53.030] Consensus: Clique (proof-of-authority) + INFO [05-04|09:48:53.030] + INFO [05-04|09:48:53.030] Pre-Merge hard forks: + INFO [05-04|09:48:53.031] - Homestead: 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/homestead.md) + INFO [05-04|09:48:53.031] - Tangerine Whistle (EIP 150): 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/tangerine-whistle.md) + INFO [05-04|09:48:53.031] - Spurious Dragon/1 (EIP 155): 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/spurious-dragon.md) + INFO [05-04|09:48:53.031] - Spurious Dragon/2 (EIP 158): 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/spurious-dragon.md) + INFO [05-04|09:48:53.032] - Byzantium: 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/byzantium.md) + INFO [05-04|09:48:53.032] - Constantinople: 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/constantinople.md) + INFO [05-04|09:48:53.032] - Petersburg: 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/petersburg.md) + INFO [05-04|09:48:53.032] - Istanbul: 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/istanbul.md) + INFO [05-04|09:48:53.032] - Muir Glacier: 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/muir-glacier.md) + INFO [05-04|09:48:53.033] - Berlin: 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/berlin.md) + INFO [05-04|09:48:53.033] - London: 0 (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/london.md) + INFO [05-04|09:48:53.033] + INFO [05-04|09:48:53.033] The Merge is not yet available for this network! + INFO [05-04|09:48:53.033] - Hard-fork specification: https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/paris.md + INFO [05-04|09:48:53.034] --------------------------------------------------------------------------------------------------------------------------------------------------------- + INFO [05-04|09:48:53.034] + INFO [05-04|09:48:53.039] Loaded most recent local header number=0 hash=368c9f..43bc46 td=1 age=54y1mo1w + INFO [05-04|09:48:53.040] Loaded most recent local full block number=0 hash=368c9f..43bc46 td=1 age=54y1mo1w + INFO [05-04|09:48:53.040] Loaded most recent local fast block number=0 hash=368c9f..43bc46 td=1 age=54y1mo1w + WARN [05-04|09:48:53.043] Failed to load snapshot err="missing or corrupted snapshot" + INFO [05-04|09:48:53.045] Rebuilding state snapshot + INFO [05-04|09:48:53.048] Resuming state snapshot generation root=1e8d18..71da09 accounts=0 slots=0 storage=0.00B dangling=0 elapsed=2.311ms + INFO [05-04|09:48:53.060] Regenerated local transaction journal transactions=0 accounts=0 + INFO [05-04|09:48:53.064] Generated state snapshot accounts=10 slots=0 storage=412.00B dangling=0 elapsed=18.140ms + INFO [05-04|09:48:53.066] Gasprice oracle is ignoring threshold set threshold=2 + WARN [05-04|09:48:53.071] Error reading unclean shutdown markers error="leveldb: not found" + WARN [05-04|09:48:53.072] Engine API enabled protocol=eth + WARN [05-04|09:48:53.072] Engine API started but chain not configured for merge yet + INFO [05-04|09:48:53.073] Stored checkpoint snapshot to disk number=0 hash=368c9f..43bc46 + INFO [05-04|09:48:53.076] Starting peer-to-peer node instance=Geth/v1.11.0-unstable-b590faff-20221007/linux-amd64/go1.18.6 + WARN [05-04|09:48:53.077] P2P server will be useless, neither dialing nor listening + INFO [05-04|09:48:53.137] New local node record seq=1,683,193,733,117 id=bb78e0f3d24eccb1 ip=127.0.0.1 udp=0 tcp=0 + INFO [05-04|09:48:53.145] Started P2P networking self=enode://d1a6c5a13a7469707feec8af30254f4fba1035fee47c56514790020dacbcbaeace23943e0838e7dd6555f6f723cf1d4c9ff3a00ebdf2bb796c71787fbd6407cc@127.0.0.1:0 + INFO [05-04|09:48:53.151] IPC endpoint opened url=/eth1data/geth.ipc + INFO [05-04|09:48:53.159] Generated JWT secret path=/eth1data/geth/jwtsecret + INFO [05-04|09:48:53.163] HTTP server started endpoint=[::]:8545 auth=false prefix= cors= vhosts=localhost + INFO [05-04|09:48:53.163] WebSocket enabled url=ws://[::]:8546 + INFO [05-04|09:48:53.168] WebSocket enabled url=ws://127.0.0.1:8551 + INFO [05-04|09:48:53.168] HTTP server started endpoint=127.0.0.1:8551 auth=true prefix= cors=localhost vhosts=localhost + INFO [05-04|09:48:53.174] Transaction pool price threshold updated price=0 + INFO [05-04|09:48:53.175] Updated mining threads threads=0 + INFO [05-04|09:48:53.175] Transaction pool price threshold updated price=1 + INFO [05-04|09:48:53.175] Etherbase automatically configured address=0xd8aC7c1C8A8F34392aD45C250489DeE5D1dC5F51 + INFO [05-04|09:48:53.179] Commit new sealing work number=1 sealhash=c40800..8372ed uncles=0 txs=0 gas=0 fees=0 elapsed=2.295ms + INFO [05-04|09:48:53.180] Commit new sealing work number=1 sealhash=c40800..8372ed uncles=0 txs=0 gas=0 fees=0 elapsed=3.644ms + INFO [05-04|09:48:53.185] Successfully sealed new block number=1 sealhash=c40800..8372ed hash=75c2e6..45c554 elapsed=6.768ms + ``` + +
+ +This will start the rootchain server on the default JSON-RPC port of `8545`. + +### ii. Deploy StakeManager Contract + +:::caution + +If you have already deployed the StakeManager, you may skip the step and move onto [Deploy rootchain contracts](#deploy-rootchain-contracts). + +::: + +If the `StakeManager` hasn't been deployed to the rootchain, you need to carry out this step. This command also contains a test flag. This flag is strictly for testing purposes, and its usage results in deploying a mock ERC-20 token that will serve for staking. + + ```bash + ./polygon-edge polybft stake-manager-deploy \ + --proxy-contracts-admin 0xaddressOfProxyContractsAdmin \ + --private-key \ + --genesis ./genesis.json \ + --jsonrpc http://127.0.0.1:8545 \ + --stake-token 0xaddressOfStakeToken \ + --test + ``` + +
+Flags ↓ + +| Flag | Description | Example | +|------------------------------|-------------------------------------------------------------------------------|-------------------------------------------------| +| `--config` | The path to the SecretsManager config file. If omitted, the local FS secrets manager is used. | `--config /path/to/config` | +| `--data-dir` | The directory for the Polygon Edge data if the local FS is used. | `--data-dir test-chain-` | +| `--genesis` | Genesis file path, which contains chain configuration. | `--genesis ./genesis.json` | +| `-h, --help` | Help for stake-manager-deploy. | | +| `--jsonrpc` | The JSON-RPC interface. | `--jsonrpc http://0.0.0.0:8545` | +| `--private-key` | Hex-encoded private key of the account which executes rootchain commands. | `--private-key ` | +| `--proxy-contracts-admin` | Admin for proxy contracts. | `--proxy-contracts-admin ` | +| `--stake-token` | Address of ERC20 token used for staking on rootchain. | `--stake-token ` | +| `--test` | Indicates if the command is run in test mode. If test mode is used, the contract will be deployed using a test account, and a test stake ERC20 token will be deployed for staking. | `--test` | + +
+ +## 2. Deployment Considerations + +To deploy the rootchain contracts, we use the `polygon-edge rootchain deploy` command. Before deployment, consider the following actions: + +### i. Funding Required for Nodes + +Before initializing the contracts on the rootchain, we need to make sure that the nodes are funded with sufficient funds to cover the gas cost of deploying the contracts. Otherwise, the initialization process may fail due to a lack of funds. + +Note that the demo server already funds the default test account. If you're not omitting `--deployer-key`, ensure that you pass the correct key; otherwise, you may encounter an error due to insufficient funds, such as the following: + +```bash +failed to deploy rootchain contracts: {"code":-32000,"message":"INTERNAL_ERROR: insufficient funds"} +``` + +You can also create a rootchain wallet and fund the nodes by using `polygon-cli`. +Follow the steps outlined [here](https://github.com/maticnetwork/polygon-cli). + +### ii. Using an Existing ERC-20 as the Native Gas Token + +If you already have an ERC-20 token deployed on the rootchain that you want to use as the gas token, you can specify its address using the `--erc20-token` flag when deploying the rootchain contracts. For example: + +
+Example ↓ + +```bash +./polygon-edge rootchain deploy \ + --genesis ./genesis.json \ + --json-rpc http://127.0.0.1:8545 \ + --erc20-token +``` + +
+ +Replace `` with the address of your existing ERC-20 token on the rootchain. + +To deposit a desired amount and mint it on the childchain, please refer to the guidelines outlined in the deposit guide [here](transfers/deposit.md). + +### iii. Proxy Contract Admin + +The introduction of the proxy contract admin in v1.3 brings about new considerations for deployment and contract interaction. + +### Issue with Proxy Contract Fallback + +A notable issue arises when the proxy contract's admin attempts to fallback to the proxy target. Specifically, the initialization on the StakeManager seems to be invoked using the admin account, which is set by the `--proxy-contracts-admin` flag. + +> According to the design of the [TransparentUpgradeableProxy](https://docs.openzeppelin.com/contracts/4.x/api/proxy#TransparentUpgradeableProxy), the admin account for the proxy contract is prohibited from calling any function on the implementation contract. This design choice ensures that the admin account's privileges are strictly limited to administrative tasks, preventing potential misuse or unintended interactions. + +### Recommendations + +1. **Exclusive Use of Admin Account**: Ensure that the address specified in the `--proxy-contracts-admin` flag is used exclusively for administrative functions. This includes tasks such as updating the implementation contract address and modifying the admin. + +2. **Avoid Using Admin as Deployer**: Ensure that the address used in the `--proxy-contracts-admin` flag is not employed as a contract deployer. This is especially important in cases like the stake manager deployment. + +3. **Restricted Function Calls**: The admin account should never be used to invoke any function on the implementation contract. This restriction is in line with the design of the `TransparentUpgradeableProxy` and ensures that the admin account remains solely for administrative tasks. + +## 3. Deploy Rootchain Contracts + +Using the `--deployer-key` flag, you will need to replace `` with the hex-encoded private key of the deployer account that will be used to deploy the smart contracts. If you omit the `--deployer-key` option, the default account in your local client will be used. + +> The user is responsible for providing the deployer key, which should correspond to an address with sufficient funds for deployment. It is recommended to ensure the account is pre-funded before initiating the deployment process. + +To run the deployment in test mode and use the test account provided by the Geth dev instance as the depositor, add the `--test` flag. In this case, you may omit the `--deployer-key` flag, and the default test account will be used as the depositor. + +
+Flags ↓ + +| Flag | Description | Example | +|------------------------------|-------------------------------------------------------------------------------|-------------------------------------------------| +| `--deployer-key` | Hex-encoded private key of the account which deploys rootchain contracts | `--deployer-key ` | +| `--erc20-token` | Existing root chain root native token address | `--erc20-token ` | +| `--genesis` | Genesis file path, which contains chain configuration (default "./genesis.json") | `--genesis ./genesis.json` | +| `-h, --help` | Help for deploy | | +| `--json-rpc` | The JSON RPC rootchain IP address (default "http://127.0.0.1:8545") | `--json-rpc http://127.0.0.1:8545` | +| `--proxy-contracts-admin` | Admin for proxy contracts | `--proxy-contracts-admin ` | +| `--stake-manager` | Address of stake manager contract | `--stake-manager ` | +| `--stake-token` | Address of ERC20 token used for staking on rootchain | `--stake-token ` | +| `--test` | Indicates whether rootchain contracts deployer is hardcoded test account | `--test` | + +
+ + ```bash + ./polygon-edge rootchain deploy \ + --deployer-key \ + --stake-manager \ + --stake-token 0xaddressOfStakeToken \ + --proxy-contracts-admin 0xaddressOfProxyContractsAdmin \ + --genesis ./genesis.json \ + --json-rpc http://127.0.0.1:8545 \ + --test + ``` + +The above example will get the `stake-manager` and `stake-token` addresses directly from the `genesis.json` file. + +
+Core contract deployment output example + +```bash +[ROOTCHAIN - CONTRACTS DEPLOYMENT] started... Rootchain JSON RPC address http://127.0.0.1:8545. + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = RootERC20 +Contract (address) = 0x6FE03c2768C9d800AF3Dedf1878b5687FE120a27 +Transaction (hash) = 0x5c77b2fbc658c97ceba964efd512f6fb01224ca0f81b6f97fbc0f258c7ae3b2b + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = RootERC721 +Contract (address) = 0x3d46A809D5767B81a8836f0E79145ba615A2Dd61 +Transaction (hash) = 0xdb3051d76de9296e3e2f8e723b85bc679e183bdbd47820506af61828bec17da3 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = RootERC1155 +Contract (address) = 0x72E1C51FE6dABF2e3d5701170cf5aD3620E6B8ba +Transaction (hash) = 0x99f8897fe1d921b58aac44fef3d35e986186dee8d2ea8f06b55ca3c5e775c431 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = StateSender +Contract (address) = 0x436604426F31A05f905C64edc973E575BdB46471 +Transaction (hash) = 0xcb1d9674f1c928527a470d74532a6fe1e755e64909c8ecd5cce014d7330fb500 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = CheckpointManager +Contract (address) = 0x947a581B2713F58A8145201DA41BCb6aAE90196B +Transaction (hash) = 0xf6bb5054971c0d0a135ae63767a39d4cd6f1401a961e6abcfca47351576a1235 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = BLS +Contract (address) = 0x1BfAdFDc7554f618665e3EAE7C22DE2B5ab54786 +Transaction (hash) = 0xecad816ee9c8cee2bf646dd077ca26ac9d07f1593967c3b94ff7fa1110e0cd73 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = BN256G2 +Contract (address) = 0x22C246401ed6e52C525644659C5304aed63516C7 +Transaction (hash) = 0xf220bb6dcd40eef63df0517cb4ed768dfcb5f432644937b7dcaedcc7b4b5342e + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = ExitHelper +Contract (address) = 0x88d3678C1e99Fc0b699fCA4cf2BC1c2C75C7f272 +Transaction (hash) = 0xa77415d8d06f6fd0973cd844ba67582afd34808c9943a9c2f8305a4f53ea66de + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = RootERC20Predicate +Contract (address) = 0xB3A64e1ffB0867E93665Da1052b3dbAb427A538C +Transaction (hash) = 0xdada762e15613a41b3cd37bc8f1c6750d2498f9bd743769549e8b4b6fbba07e1 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = ERC20Template +Contract (address) = 0xaCB3Eb2f3c167B56410F0351B6C6EBac9256f553 +Transaction (hash) = 0xb53e9bc41aca03ea51cd82de944bd84618c25976b475bba9615eef2bf449c5d3 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = RootERC721Predicate +Contract (address) = 0xA1DFe8536732EB98BBCA36A7f97C72e3395EaB8E +Transaction (hash) = 0x4ee43d7754f03e4322ac8eb29bfd2c8410e837f42a786ae0f13f6aee4795c815 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = ERC721Template +Contract (address) = 0x8d83F76FB303d30d35E1A8FAafB69294C8bD4069 +Transaction (hash) = 0x242d30e721e5a9a4324f92e5874a62de6bc65089b51013a4fbac6033cdf2a6fc + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = RootERC1155Predicate +Contract (address) = 0x0e3C79887960455083c5F063035C723c61906811 +Transaction (hash) = 0x89013a2cfe0c68b73c226cb917822159ae68167b1f8a178e1e63dd8077e245d0 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = ERC1155Template +Contract (address) = 0x7e5BB8F3721C594Af6aB04D5bDf5C52742F37403 +Transaction (hash) = 0x3415e2fb208fb0307746d3a0a35794a5de759fd77109d6a043dea7420c8da230 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = StakeManager +Contract (address) = 0x811068e4106f7A70D443684FF4927eC3940439Ec +Transaction (hash) = 0xe7ab6d4e5002a84b168b195affbf9cdf7bc1f67d05bbeb78e62e4517393626d7 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = CustomSupernetManager +Contract (address) = 0x75aA024A2292A3FD3C17d67b54B3d00435437246 +Transaction (hash) = 0xbe80f099313c6505176a6bc888062ccb124deb83f2e413b0bf076ae5d6b9f6e5 + +[ROOTCHAIN - CONTRACTS DEPLOYMENT] StakeManager contract is initialized + +[ROOTCHAIN - CONTRACTS DEPLOYMENT] CustomSupernetManager contract is initialized + +[ROOTCHAIN - CONTRACTS DEPLOYMENT] [VALIDATORS] +Address=0x61324166B0202DB1E7502924326262274Fa4358F; Balance=1000000; P2P Multi addr=/ip4/127.0.0.1/tcp/30301/p2p/16Uiu2HAmMYyzK7c649Tnn6XdqFLP7fpPB2QWdck1Ee9vj5a7Nhg8; BLS Key=06d8d9e6af67c28e85ac400b72c2e635e83234f8a380865e050a206554049a222c4792120d84977a6ca669df56ff3a1cf1cfeccddb650e7aacff4ed6c1d4e37b055858209f80117b3c0a6e7a28e456d4caf2270f430f9df2ba37221f23e9bbd313c9ef488e1849cc5c40d18284d019dde5ed86770309b9c24b70ceff6167a6ca; +Address=0xFE5E166BA5EA50c04fCa00b07b59966E6C2E9570; Balance=1000000000000000000000000; P2P Multi addr=/ip4/127.0.0.1/tcp/30302/p2p/16Uiu2HAmLXVapjR2Yx3B1taCmHnckQ1ph2xrawBjW2kvSErps9CX; BLS Key=0601da8856a6d3d3bb0f3bcbb90ea7b8c0db8271b9203e6123c6804aa3fc5f810be33287968ca1af2be11839516850a6ffef2337d99e679b7531efbbea2e3bf727a053c0cbede71da3d5f489b6ad862ccd8bb0bfb7fa379e3395d3b1142594a73020e87d63c298a3a4eba0ace65727f8659bab6389b9448b72512db72bbe937f; +[ROOTCHAIN - CONTRACTS DEPLOYMENT] Validators hash: 0x9d31cd8a803b09a9c5e054301977b1f5b758c56f811351e937a0a3792e2ef8b1 +[ROOTCHAIN - CONTRACTS DEPLOYMENT] CheckpointManager contract is initialized + +[ROOTCHAIN - CONTRACTS DEPLOYMENT] ExitHelper contract is initialized + +[ROOTCHAIN - CONTRACTS DEPLOYMENT] RootERC20Predicate contract is initialized + +[ROOTCHAIN - CONTRACTS DEPLOYMENT] RootERC721Predicate contract is initialized + +[ROOTCHAIN - CONTRACTS DEPLOYMENT] RootERC1155Predicate contract is initialized + +[ROOTCHAIN - CONTRACTS DEPLOYMENT] finished. All contracts are successfully deployed and initialized. +``` + +
+ +
+ + + + + +### i. Deploy StakeManager Contract + +:::caution + +If you have already deployed the StakeManager, you may skip the step and move onto [Deploy rootchain contracts](#deploy-rootchain-contracts). + +::: + +This command includes a test flag, which is intended solely for testing scenarios. When this flag is used, a mock ERC-20 token is deployed for staking. However, in non-testing environments, remember to specify the `stake-token` flag with the address of the token that's already deployed on the rootchain and will be used for staking. + + ```bash + ./polygon-edge polybft stake-manager-deploy \ + --proxy-contracts-admin 0xaddressOfProxyContractsAdmin \ + --deployer-key \ + --genesis ./genesis.json \ + --jsonrpc http://127.0.0.1:8545 \ + --stake-token 0xaddressOfStakeToken \ + --test + ``` + +
+Flags ↓ + +| Flag | Description | Example | +|-----------------|--------------------------------------------------------------------------------------------------------|---------| +| `--config` | Path to the SecretsManager config file, if omitted, the local FS secrets manager is used | | +| `--data-dir` | Directory for the Polygon Edge data if the local FS is used | | +| `--genesis` | Genesis file path, which contains chain configuration (default "./genesis.json") | | +| `--jsonrpc` | The JSON-RPC interface (default "0.0.0.0:8545") | | +| `--private-key` | Hex-encoded private key of the account which executes rootchain commands | | +| `--stake-token` | Address of ERC20 token used for staking on rootchain | | +| `--test` | Contract will be deployed using test account and a test stake ERC20 token will be deployed for staking | | + +
+ +## 2. Deployment Considerations + +To deploy the rootchain contracts, we use the `polygon-edge rootchain deploy` command. Before deployment, consider the following actions: + +### i. Funding Required for Nodes + +Before initializing the contracts on the rootchain, we need to make sure that the nodes are funded with sufficient funds to cover the gas cost of deploying the contracts. Otherwise, the initialization process may fail due to a lack of funds. + +Note that the demo server already funds the default test account. If you're not omitting `--deployer-key`, ensure that you pass the correct key; otherwise, you may encounter an error due to insufficient funds, such as the following: + +```bash +failed to deploy rootchain contracts: {"code":-32000,"message":"INTERNAL_ERROR: insufficient funds"} +``` + +You can also create a rootchain wallet and fund the nodes by using `polygon-cli`. +Follow the steps outlined [here](https://github.com/maticnetwork/polygon-cli). + +### ii. Using an Existing ERC-20 as the Native Gas Token + +If you already have an ERC-20 token deployed on the rootchain that you want to use as the gas token, you can specify its address using the `--erc20-token` flag when deploying the rootchain contracts. For example: + +
+Example ↓ + +```bash +./polygon-edge rootchain deploy \ + --genesis ./genesis.json \ + --json-rpc http://127.0.0.1:8545 \ + --erc20-token +``` + +
+ +Replace `` with the address of your existing ERC-20 token on the rootchain. + +To deposit a desired amount and mint it on the childchain, please refer to the guidelines outlined in the deposit guide [here](transfers/deposit.md). + +## 3. Deploy Rootchain Contracts + +Using the `--deployer-key` flag, you will need to replace `` with the hex-encoded private key of the deployer account that will be used to deploy the smart contracts. If you omit the `--deployer-key` option, the default account in your local client will be used. + +You also need to specify the path to the genesis file using the `--genesis` option, and the endpoint for the JSON-RPC endpoint for the rootchain using the `--json-rpc` option. + +
+Flags ↓ + +| Flag | Description | Example | +|-----------------------|--------------------------------------------------------------------------|-----------------------------------------------| +| `--deployer-key` | Hex encoded private key of the account which deploys rootchain contracts | `--deployer-key ` | +| `--json-rpc` | The JSON RPC rootchain IP address (e.g. http://127.0.0.1:8545) | `--json-rpc http://127.0.0.1:8545` | +| `--genesis` | Genesis file path that contains chain configuration | `--genesis ./genesis.json` | +| `--erc20-token` | Existing rootchain ERC-20 token address | `--erc20-token ` | +| `--stake-manager` | Address of stake manager contract | `--stake-manager ` | +| `--stake-token` | Address of ERC20 token used for staking on rootchain | `--stake-token ` | +| `--test` | Indicates whether rootchain contracts deployer is hardcoded test account | `--test` | + +
+ +```bash +./polygon-edge rootchain deploy \ + --deployer-key 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \ + --genesis ./genesis.json \ + --json-rpc http://127.0.0.1:8545 \ +``` + +
+Core contract deployment output example ↓ + +```bash +[ROOTCHAIN - CONTRACTS DEPLOYMENT] started... Rootchain JSON RPC address http://127.0.0.1:8545. + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = RootERC20 +Contract (address) = 0x6FE03c2768C9d800AF3Dedf1878b5687FE120a27 +Transaction (hash) = 0x5c77b2fbc658c97ceba964efd512f6fb01224ca0f81b6f97fbc0f258c7ae3b2b + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = RootERC721 +Contract (address) = 0x3d46A809D5767B81a8836f0E79145ba615A2Dd61 +Transaction (hash) = 0xdb3051d76de9296e3e2f8e723b85bc679e183bdbd47820506af61828bec17da3 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = RootERC1155 +Contract (address) = 0x72E1C51FE6dABF2e3d5701170cf5aD3620E6B8ba +Transaction (hash) = 0x99f8897fe1d921b58aac44fef3d35e986186dee8d2ea8f06b55ca3c5e775c431 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = StateSender +Contract (address) = 0x436604426F31A05f905C64edc973E575BdB46471 +Transaction (hash) = 0xcb1d9674f1c928527a470d74532a6fe1e755e64909c8ecd5cce014d7330fb500 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = CheckpointManager +Contract (address) = 0x947a581B2713F58A8145201DA41BCb6aAE90196B +Transaction (hash) = 0xf6bb5054971c0d0a135ae63767a39d4cd6f1401a961e6abcfca47351576a1235 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = BLS +Contract (address) = 0x1BfAdFDc7554f618665e3EAE7C22DE2B5ab54786 +Transaction (hash) = 0xecad816ee9c8cee2bf646dd077ca26ac9d07f1593967c3b94ff7fa1110e0cd73 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = BN256G2 +Contract (address) = 0x22C246401ed6e52C525644659C5304aed63516C7 +Transaction (hash) = 0xf220bb6dcd40eef63df0517cb4ed768dfcb5f432644937b7dcaedcc7b4b5342e + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = ExitHelper +Contract (address) = 0x88d3678C1e99Fc0b699fCA4cf2BC1c2C75C7f272 +Transaction (hash) = 0xa77415d8d06f6fd0973cd844ba67582afd34808c9943a9c2f8305a4f53ea66de + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = RootERC20Predicate +Contract (address) = 0xB3A64e1ffB0867E93665Da1052b3dbAb427A538C +Transaction (hash) = 0xdada762e15613a41b3cd37bc8f1c6750d2498f9bd743769549e8b4b6fbba07e1 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = ERC20Template +Contract (address) = 0xaCB3Eb2f3c167B56410F0351B6C6EBac9256f553 +Transaction (hash) = 0xb53e9bc41aca03ea51cd82de944bd84618c25976b475bba9615eef2bf449c5d3 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = RootERC721Predicate +Contract (address) = 0xA1DFe8536732EB98BBCA36A7f97C72e3395EaB8E +Transaction (hash) = 0x4ee43d7754f03e4322ac8eb29bfd2c8410e837f42a786ae0f13f6aee4795c815 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = ERC721Template +Contract (address) = 0x8d83F76FB303d30d35E1A8FAafB69294C8bD4069 +Transaction (hash) = 0x242d30e721e5a9a4324f92e5874a62de6bc65089b51013a4fbac6033cdf2a6fc + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = RootERC1155Predicate +Contract (address) = 0x0e3C79887960455083c5F063035C723c61906811 +Transaction (hash) = 0x89013a2cfe0c68b73c226cb917822159ae68167b1f8a178e1e63dd8077e245d0 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = ERC1155Template +Contract (address) = 0x7e5BB8F3721C594Af6aB04D5bDf5C52742F37403 +Transaction (hash) = 0x3415e2fb208fb0307746d3a0a35794a5de759fd77109d6a043dea7420c8da230 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = StakeManager +Contract (address) = 0x811068e4106f7A70D443684FF4927eC3940439Ec +Transaction (hash) = 0xe7ab6d4e5002a84b168b195affbf9cdf7bc1f67d05bbeb78e62e4517393626d7 + + +[ROOTCHAIN - DEPLOY CONTRACT] +Name = CustomSupernetManager +Contract (address) = 0x75aA024A2292A3FD3C17d67b54B3d00435437246 +Transaction (hash) = 0xbe80f099313c6505176a6bc888062ccb124deb83f2e413b0bf076ae5d6b9f6e5 + +[ROOTCHAIN - CONTRACTS DEPLOYMENT] StakeManager contract is initialized + +[ROOTCHAIN - CONTRACTS DEPLOYMENT] CustomSupernetManager contract is initialized + +[ROOTCHAIN - CONTRACTS DEPLOYMENT] [VALIDATORS] +Address=0x61324166B0202DB1E7502924326262274Fa4358F; Balance=1000000; P2P Multi addr=/ip4/127.0.0.1/tcp/30301/p2p/16Uiu2HAmMYyzK7c649Tnn6XdqFLP7fpPB2QWdck1Ee9vj5a7Nhg8; BLS Key=06d8d9e6af67c28e85ac400b72c2e635e83234f8a380865e050a206554049a222c4792120d84977a6ca669df56ff3a1cf1cfeccddb650e7aacff4ed6c1d4e37b055858209f80117b3c0a6e7a28e456d4caf2270f430f9df2ba37221f23e9bbd313c9ef488e1849cc5c40d18284d019dde5ed86770309b9c24b70ceff6167a6ca; +Address=0xFE5E166BA5EA50c04fCa00b07b59966E6C2E9570; Balance=1000000000000000000000000; P2P Multi addr=/ip4/127.0.0.1/tcp/30302/p2p/16Uiu2HAmLXVapjR2Yx3B1taCmHnckQ1ph2xrawBjW2kvSErps9CX; BLS Key=0601da8856a6d3d3bb0f3bcbb90ea7b8c0db8271b9203e6123c6804aa3fc5f810be33287968ca1af2be11839516850a6ffef2337d99e679b7531efbbea2e3bf727a053c0cbede71da3d5f489b6ad862ccd8bb0bfb7fa379e3395d3b1142594a73020e87d63c298a3a4eba0ace65727f8659bab6389b9448b72512db72bbe937f; +[ROOTCHAIN - CONTRACTS DEPLOYMENT] Validators hash: 0x9d31cd8a803b09a9c5e054301977b1f5b758c56f811351e937a0a3792e2ef8b1 +[ROOTCHAIN - CONTRACTS DEPLOYMENT] CheckpointManager contract is initialized + +[ROOTCHAIN - CONTRACTS DEPLOYMENT] ExitHelper contract is initialized + +[ROOTCHAIN - CONTRACTS DEPLOYMENT] RootERC20Predicate contract is initialized + +[ROOTCHAIN - CONTRACTS DEPLOYMENT] RootERC721Predicate contract is initialized + +[ROOTCHAIN - CONTRACTS DEPLOYMENT] RootERC1155Predicate contract is initialized + +[ROOTCHAIN - CONTRACTS DEPLOYMENT] finished. All contracts are successfully deployed and initialized. +``` + +
+ +
+
+ +## 4. Funding Validators on the Rootchain + +Before deploying validator nodes on the Edge-powered chain, we need to ensure that the validators have sufficient funds on the rootchain network. It's crucial to have enough funds in the validator account, as they need to cover the gas fees associated with their transactions on the rootchain. + +To fund the validators' accounts on the rootchain, we use the `polygon-edge rootchain fund` command. When executed with the appropriate flags, it will: + +1. Retrieve the validator account from the secrets manager. +2. Send a transaction to fund the validator account on the rootchain with a value of 10,000 $token (the network's native token). +3. Repeat steps 1 and 2 for each validator. + +**It's important to note that this command is also for testing purposes only.** + +In a production environment, you would need to ensure that the validators have sufficient funds on the rootchain network to cover the gas fees associated with their transactions. + +Here's an example of how to fund a validator account (replace address value with your own): + + ```bash + ./polygon-edge rootchain fund --addresses 0x77C1eedFf656477462ce16084fE5Dc7F8a2507B9 --amounts 1000000000000000000 + ``` + +
+Funding output example ↓ + + ```bash + [ROOTCHAIN FUND] + Validator (address) = 0x77C1eedFf656477462ce16084fE5Dc7F8a2507B9 + Transaction (hash) = 0x294952b29e3e8ba15fefe28934090dc0d249d71d48c6b19ebe534840703030a9 + Is minted = false + ``` + +
+ +## 5. Next Steps + +Now that we have successfully configured the initial setup of your Edge-powered chain, including both the childchain and rootchain, we can proceed to the next crucial step: rootchain staking and allowlisting through the configuration of the initial validator set. + +To accomplish this, navigate to the [Configure the Initial Validator Set](genesis-validators.md) deployment guide. diff --git a/docs/docs/operate/deploy/staking/stake.md b/docs/docs/operate/deploy/staking/stake.md new file mode 100644 index 0000000000..031ebd1012 --- /dev/null +++ b/docs/docs/operate/deploy/staking/stake.md @@ -0,0 +1,75 @@ +In this section, we'll walkthrough how to stake WMATIC on the associated rootchain. + +## i. Initial Staking on the Rootchain + +Each validator needs to perform initial staking on the rootchain `StakeManager` contract. This is done using the `polygon-edge root stake` command. **Note that this command is for testing purposes only.** + +
+Flags ↓ + +|| Flag | Description | Example | +| -----------------------------| --------------------------------------------------------------------------------- | ---------------------------------------- | +| `--amount ` | The amount to stake | `--amount 5000000000000000000` | +| `--supernet-id` | The ID of the supernet provided by stake manager on supernet registration | `--chain-id 100` | +| `--config ` | The path to the SecretsManager config file | `--config /path/to/config/file.yaml` | +| `--data-dir` | The directory for the Polygon Edge data | `--data-dir ./polygon-edge/data` | +| `--jsonrpc` | The JSON-RPC interface | `--jsonrpc 0.0.0.0:8545` | +| `--stake-token ` | The address of ERC20 Token used for staking on rootchain | `--native-root-token 0x` | +| `--stake-manager` | The address of the stake manager contract | `--stake-manager 0x` | + +
+ +In the following example command, we use the validator key and the rootchain `StakeManager` contract address that was generated earlier. We also set the staking amount to `1000000000000000000` which is equivalent to 1 token. The `--native-root-token` flag is used to specify the address of the native token of the rootchain. + +:::info Staking requirement: wrapping a non-ERC-20 token + +Edge allows for the customization of the gas token and mandate the use of ERC-20 tokens for staking instead of the rootchain's native token. + +When performing rootchain staking on the Polygon PoS Mainnet, [WMATIC](https://polygonscan.com/token/0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270?a=0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45) (wrapped MATIC) is the required token. This is due to the ERC-20 standard requirement for staking, which MATIC doesn't meet. + +WMATIC is deployed at `0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270`. + +This principle also applies to the Mumbai Testnet, where wrapped test MATIC must be used instead of test MATIC. + +If you currently hold MATIC tokens, you can convert them to WMATIC through various methods. One common method is to use a decentralized exchange (DEX) like Uniswap, where you can swap your MATIC tokens for WMATIC. **Always ensure you're using a reputable platform for this conversion and double-check that the contract address for WMATIC is correct to ensure the security of your tokens.** + +
+Obtaining native root token address + +For example, if you are using the Mumbai test network, you can obtain the address of the MATIC testnet token by sending a GET request to the Mumbai network's JSON-RPC endpoint: + +```bash +curl \ +-X POST \ +-H "Content-Type: application/json" \ +--data '{"jsonrpc":"2.0","method":"eth_contractAddress","params":["MaticToken"],"id":1}' +``` + +
+ +::: + +```bash +./polygon-edge polybft stake \ +--data-dir ./test-chain-1 \ +--chain-id 100 \ +--amount 1000000000000000000 \ +--stake-manager 0x6ceCFe1Db48Ab97fA89b06Df6Bd0bBdE6E64e6F7 \ +--native-root-token 0x559Dd13d8A3CAb3Ff127c408f2A08A8a2AEfC56c +``` + +## ii. Finalize Validator Set on the Rootchain + +After all validators from the genesis block have performed initial staking on the rootchain, the final step required before starting the chain is to finalize the genesis validator set on the `SupernetManager` contract on the rootchain. This can be done using the `polygon-edge polybft supernet` command. + +The deployer of the `SupernetManager` contract can specify their hex-encoded private key or use the `--data-dir` flag if they have initialized their secrets. If the `--enable-staking` flag is provided, validators will be able to continue staking on the rootchain. If not, genesis validators will not be able to update their stake or unstake, nor will newly registered validators after genesis be able to stake tokens on the rootchain. The enabling of staking can be done through this command or later after the chain starts. + +In the following example command, we use a placeholder hex-encoded private key of the `SupernetManager` contract deployer. The addresses of the `SupernetManager` and `StakeManager` contracts are the addresses that were generated earlier. We also use the `--finalize-genesis` and `--enable-staking` flags to enable staking and finalize the genesis state. + +```bash + ./polygon-edge polybft supernet --private-key 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \ + --genesis /path/to/genesis/file \ + --supernet-manager 0x75aA024A2292A3FD3C17d67b54B3d00435437246 \ + --stake-manager 0x811068e4106f7A70D443684FF4927eC3940439Ec \ + --finalize-genesis --enable-staking +``` diff --git a/docs/docs/operate/deploy/staking/unstake.md b/docs/docs/operate/deploy/staking/unstake.md new file mode 100644 index 0000000000..769cd6e94a --- /dev/null +++ b/docs/docs/operate/deploy/staking/unstake.md @@ -0,0 +1,137 @@ +In this section, we'll go over how to unstake a validator's staked tokens and withdraw them to an external address. + +## Unstake + +:::info Check validator information + +First, check your validator information by running the `polygon-edge polybft validator-info` command. + +
+Flags ↓ + +| Flag | Description | Example | +|------|-------------|---------| +| `--chain-id` | ID of Supernet | `137` | +| `--config` | The path to the SecretsManager config file, if omitted, the local FS secrets manager is used | `/path/to/config.yaml` | +| `--data-dir` | The directory for the Polygon Edge data if the local FS is used | `/path/to/data/dir` | +| `-h`, `--help` | Help for validator-info | | +| `--jsonrpc` | The JSON-RPC interface (default "0.0.0.0:8545") | `http://localhost:8545` | +| `--stake-manager` | Address of stake manager contract | `0x123...` | +| `--supernet-manager` | Address of manager contract | `0x456...` | + +
+ +```bash +./polygon-edge polybft validator-info --data-dir ./test-chain-1 +``` + +This will show you information about your validator account, including the staked amount. + +::: + +To unstake, use the `polygon-edge polybft unstake` command. + +
+Flags ↓ + +| Flag | Description | Example | +|---------------------|------------------------------------------------------------|---------------------------------------| +| --amount | Amount to unstake from validator | --amount 1000 | +| --config | Path to the SecretsManager config file | --config /path/to/config/file | +| --data-dir | Directory for the Polygon Edge data if the local FS is used | --data-dir /path/to/data/dir | +| --jsonrpc | JSON-RPC interface | --jsonrpc 0.0.0.0:8545 | + +
+ +```bash +./polygon-edge polybft unstake \ + --account-dir \ + --jsonrpc \ + --amount +``` + +## Withdraw + +Once you have successfully unstaked, you will need to withdraw your unstaked tokens from the Edge-powered chain to the rootchain. To do so, use the `polygon-edge polybft withdraw-child` command. + +
+Flags ↓ + +| Flag | Description | Example | +|------|-------------|---------| +| `--config` | The path to the SecretsManager config file, if omitted, the local FS secrets manager is used | `~/secrets.json` | +| `--data-dir` | The directory for the Polygon Edge data if the local FS is used | `~/polygon-edge/data` | +| `--jsonrpc` | The JSON-RPC interface (default "0.0.0.0:8545") | `127.0.0.1:8545` | + +
+ +```bash +./polygon-edge polybft withdraw-child \ + --account-dir \ + --jsonrpc +``` + +This command will bridge the unstaked amount to the rootchain (`StakeManager`), where the given amount of tokens will become released on the given contract. + +#### Wait for Checkpoint + +Next, you will need to wait for the exit event (bridge event) to be included in a checkpoint. +You can confirm that the checkpoint has been successfully processed by checking the processed checkpoints on a blockchain explorer. + +### Send an Exit Transaction + +Once the exit event has been included in a checkpoint, you can send an exit transaction to execute the transaction on the rootchain. To do so, use the `polygon-edge bridge exit` command. + +
+Flags ↓ + +| Flag | Description | Example | +|----------------------|---------------------------------------------------------------------|--------------------------------------| +| --child-json-rpc | The JSON RPC Supernet endpoint. | --child-json-rpc=http://127.0.0.1:9545 | +| --exit-helper | Address of ExitHelper smart contract on rootchain. | --exit-helper= | +| --exit-id | Supernet exit event ID. | --exit-id= | +| --root-json-rpc | The JSON RPC rootchain endpoint. | --root-json-rpc=http://127.0.0.1:8545 | +| --sender-key | Hex encoded private key of the account which sends exit transaction to the rootchain. | --sender-key= | +| --test | Test indicates whether exit transaction sender is hardcoded test account. | --test | + +
+ + ```bash + ./polygon-edge bridge exit \ + --sender-key \ + --exit-helper \ + --exit-id \ + --root-json-rpc \ + --child-json-rpc + ``` + +This will trigger the withdrawal of the specified amount of tokens from the rootchain. + +### Withdraw from Root + +Finally, you can withdraw your tokens from the rootchain to your address by using the `polygon-edge polybft withdraw-root` command. + +
+Flags ↓ + +| Flag | Description | Example | +|------------------------|-----------------------------------------|------------------------------------| +| --amount | amount to withdraw | --amount 1000000000000000000 | +| --config | path to the SecretsManager config file | --config /path/to/config | +| --data-dir | directory for the Polygon Edge data | --data-dir /path/to/data/dir | +| --jsonrpc | JSON-RPC interface | --jsonrpc 0.0.0.0:8545 | +| --stake-manager | address of stake manager contract | --stake-manager 0x123abc | +| --to | address where to withdraw | --to 0x456def | + +
+ + ```bash + ./polygon-edge polybft withdraw-root \ + --account-dir \ + --to \ + --amount \ + --stake-manager \ + --jsonrpc + ``` + +This will transfer your withdrawn tokens back to the specified withdrawal address. diff --git a/docs/docs/operate/deploy/start-chain.md b/docs/docs/operate/deploy/start-chain.md new file mode 100644 index 0000000000..f8ec096d26 --- /dev/null +++ b/docs/docs/operate/deploy/start-chain.md @@ -0,0 +1,70 @@ + +To run an Edge cluster, we use the `polygon-edge server` command with the following options: + +
+Flags ↓ + +| Flag | Description | Example | +|----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------| +| `--access-control-allow-origins` | The CORS header indicating whether any JSON-RPC response can be shared with the specified origin. | `--access-control-allow-origins "*"` | +| `--block-gas-target` | The target block gas limit for the chain. | `--block-gas-target "0x0"` | +| `--chain` | The genesis file used for starting the chain. | `--chain "./genesis.json"` | +| `--config` | The path to the CLI config. | `--config "/path/to/config.json"` | +| `--data-dir` | The data directory used for storing Polygon Edge client data. | `--data-dir "/path/to/data-dir"` | +| `--dns` | The host DNS address which can be used by a remote peer for connection. | `--dns "example.com"` | +| `--grpc-address` | The GRPC interface. | `--grpc-address "127.0.0.1:9632"` | +| `--json-rpc-batch-request-limit` | Max length to be considered when handling JSON-RPC batch requests. | `--json-rpc-batch-request-limit 20` | +| `--json-rpc-block-range-limit` | Max block range to be considered when executing JSON-RPC requests that consider fromBlock/toBlock values. | `--json-rpc-block-range-limit 1000` | +| `--jsonrpc` | The JSON-RPC interface. | `--jsonrpc "0.0.0.0:8545"` | +| `--libp2p` | The address and port for the libp2p service. | `--libp2p "127.0.0.1:1478"` | +| `--log-level` | The log level for console output. | `--log-level "INFO"` | +| `--log-to` | Write all logs to the file at specified location instead of writing them to console. |` --log-to "/path/to/log-file.log"` | +| `--max-enqueued` | Maximum number of enqueued transactions per account. | `--max-enqueued 128` | +| `--max-inbound-peers` | The client's max number of inbound peers allowed. | `--max-inbound-peers 32` | +| `--max-outbound-peers` | The client's max number of outbound peers allowed. | `--max-outbound-peers 8` | +| `--max-peers` | The client's max number of peers allowed. | `--max-peers 40` | +| `--max-slots` | Maximum slots in the pool. | `--max-slots 4096` | +| `--nat` | The external IP address without port, as can be seen by peers. | `--nat "203.0.113.1"` | +| `--no-discover` | Prevent the client from discovering other peers. | `--no-discover` | +| `--num-block-confirmations` | Minimal number of child blocks required for the parent block to be considered final. | `--num-block-confirmations 64` | +| `--price-limit` | The minimum gas price limit to enforce for acceptance into the pool. | `--price-limit 0` | +| `--prometheus` | The address and port for the Prometheus instrumentation service. If only port is defined, it will bind to all available network interfaces. |`--prometheus 0.0.0.0:9090` | +| `--relayer` | Start the state sync relayer service. PolyBFT only. | | +| `--restore` | The path to the archive blockchain data to restore on initialization. | `--restore /path/to/archive` | +| `--seal` | The flag indicating that the client should seal blocks. | | +| `--secrets-config` | The path to the SecretsManager config file. Used for Hashicorp Vault. If omitted, the local FS secrets manager is used. | `--secrets-config /path/to/secrets/config` | + +
+ + ```bash + ./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --grpc-address :5001 --libp2p :30301 --jsonrpc :10001 --seal --log-level DEBUG + + ./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json --grpc-address :5002 --libp2p :30302 --jsonrpc :10002 --seal --log-level DEBUG + + ./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json --grpc-address :5003 --libp2p :30303 --jsonrpc :10003 --seal --log-level DEBUG + + ./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json --grpc-address :5004 --libp2p :30304 --jsonrpc :10004 --seal --log-level DEBUG + ``` + +
+Dialing output example + + ```bash + [ROOTCHAIN FUND] + Validator (address) = 0x0D09C4A285fdde3D6e5aD5DE819E3478554646D3 + Transaction (hash) = 0xb587d3fa31f8bc59ecc807145d95d76a454967e28223d0f3b82abdd6bd84c043 + + [ROOTCHAIN FUND] + Validator (address) = 0x30aC45469E94DE3645Eb4D8Ce102a3092ee76157 + Transaction (hash) = 0x3e9b26da5e89aa8ca2b4935ce35ddedc1f8d9b37c56d5eb0f040787aa84a3bcb + + [ROOTCHAIN FUND] + Validator (address) = 0x9E1bFa593cAcD77BfcF9a8Dda0462da251566ae0 + Transaction (hash) = 0x1aa158ed2ba1e8ec98b1f4fd649c9a499b72c58a48b1a1dd9978ee16cc7fb741 + + [ROOTCHAIN FUND] + Validator (address) = 0x82e3D3e4222Cc872C5552363c86287B796312E27 + Transaction (hash) = 0xd51e7f8b69071f88b5f7870c31c6942ed78c5c48f88594ed135f096b5f17a540 + ``` + +
diff --git a/docs/docs/operate/deploy/transfers/deposit.md b/docs/docs/operate/deploy/transfers/deposit.md new file mode 100644 index 0000000000..1017a4accc --- /dev/null +++ b/docs/docs/operate/deploy/transfers/deposit.md @@ -0,0 +1,217 @@ + +## Prerequisites + +You'll need to have a successful bridge deployment to make any cross-chain transactions. If you haven't done so already, check out the local deployment guide [here](../local-chain.md). + +:::caution Key management and secure values +When passing values to run transactions, it is important to keep sensitive values like private keys and API keys secure. + +The sample commands provided in this guide use sample private keys for demonstration purposes only, in order to show the format and expected value of the parameter. It is important to note that hardcoding or directly passing private keys should never be done in a development or production environment. + +
+Here are some options for securely storing and retrieving private keys ↓ + +- **Environment Variables:** You can store the private key as an environment variable and access it in your code. For example, in Linux, you can set an environment variable like this: `export PRIVATE_KEY="my_private_key"`. Then, in your code, you can retrieve the value of the environment variable using `os.Getenv("PRIVATE_KEY")`. + +- **Configuration Files:** You can store the private key in a configuration file and read it in your session. Be sure to keep the configuration file in a secure location and restrict access to it. + +- **Vaults and Key Management Systems:** If you are working with sensitive data, you might consider using a vault or key management system like a keystore to store your private keys. These systems provide additional layers of security and can help ensure that your private keys are kept safe. + +
+ +Regardless of how a private key is stored and retrieved, it's important to keep it secure and not expose it unnecessarily. + +::: + +### Depositing from the Rootchain + +
+ bridge +
+ +### Depositing from the Childchain + +
+ bridge +
+ +For a detailed understanding of how bridging works, please refer to the sequence diagrams available [here](https://github.com/0xPolygon/polygon-edge/blob/develop/docs/bridge/sequences.md). + + + + + + + + + + + + + + + +This command deposits ERC-20 tokens from a rootchain to a Edge-powered chain. + +- Replace `hex_encoded_depositor_private_key` with the private key of the account that will be depositing the tokens. +- Replace `receivers_addresses` with a comma-separated list of Ethereum addresses that will receive the tokens. +- Replace `amounts` with a comma-separated list of token amounts to be deposited for each receiver. +- Replace `root_erc20_token_address` with the address of the ERC-20 token contract on the rootchain. +- Replace `root_erc20_predicate_address` with the address of the ERC-20 predicate contract on the rootchain. +- Replace `root_chain_json_rpc_endpoint` with the JSON-RPC endpoint of the rootchain. +- Replace `minter-key` with the private key of the minter account. If the private key is provided, tokens are minted to the sender account prior to depositing them. + +```bash +./polygon-edge bridge deposit-erc20 \ + --sender-key \ + --receivers \ + --amounts \ + --root-token \ + --root-predicate \ + --json-rpc + --minter-key +``` + +
+Example ↓ + +In this example, we're depositing ERC-20 tokens to a test Edge instance: + +- We're using a private key of `0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`. +- We're depositing tokens to two receiver addresses: `0x1111111111111111111111111111111111111111` and `0x2222222222222222222222222222222222222222`. +- We're depositing `100` tokens to the first receiver and `200` tokens to the second receiver. +- The address of the ERC-20 token contract on the rootchain is `0x123456789abcdef0123456789abcdef01234567`. +- The address of the ERC-20 predicate contract on the rootchain is `0x23456789abcdef0123456789abcdef012345678`. +- The JSON-RPC endpoint for the rootchain is `http://root-chain-json-rpc-endpoint.com:8545`. +- We're using a minter key of `0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`. + +```bash +./polygon-edge bridge deposit-erc20 \ + --sender-key 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \ + --receivers 0x1111111111111111111111111111111111111111,0x2222222222222222222222222222222222222222 \ + --amounts 100,200 \ + --root-token 0x123456789abcdef0123456789abcdef01234567 \ + --root-predicate 0x23456789abcdef0123456789abcdef012345678 \ + --json-rpc http://root-chain-json-rpc-endpoint.com:8545 + --minter-key 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef +``` + +
+
+ + + + + + + +This command deposits ERC-721 tokens from a rootchain to a Edge-powered chain. + +- Replace `hex_encoded_depositor_private_key` with the private key of the account that will be depositing the tokens. +- Replace `receivers_addresses` with a comma-separated list of Ethereum addresses that will receive the tokens. +- Replace `token_ids` with a comma-separated list of token IDs that will be sent to the receivers' accounts. +- Replace `root_erc721_token_address` with the address of the ERC-721 token contract on the rootchain. +- Replace `root_erc721_predicate_address` with the address of the ERC-721 predicate contract on the rootchain. +- Replace `root_chain_json_rpc_endpoint` with the JSON-RPC endpoint of the rootchain. +- Replace `minter-key` with the private key of the minter account. If the private key is provided, tokens are minted to the sender account prior to depositing them. + +```bash +./polygon-edge bridge deposit-erc721 \ + --sender-key \ + --receivers \ + --token-ids \ + --root-token \ + --root-predicate \ + --json-rpc + --minter-key +``` + +
+Example ↓ + +In this example, we're depositing ERC-721 tokens to a test Edge instance: + +- We're using a private key of `0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`. +- We're depositing tokens with IDs `123` and `456` to two receiver addresses: `0x1111111111111111111111111111111111111111` and `0x2222222222222222222222222222222222222222`. +- The address of the ERC-721 token contract on the rootchain is `0x0123456789abcdef0123456789abcdef01234567`. +- The address of the ERC-721 predicate contract on the rootchain is `0x0123456789abcdef0123456789abcdef01234568`. +- The JSON-RPC endpoint for the rootchain is `https://rpc-mainnet.maticvigil.com`. +- We're using a minter key of `0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`. + +```bash +./polygon-edge bridge deposit-erc721 \ + --sender-key 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \ + --receivers 0x1111111111111111111111111111111111111111,0x2222222222222222222222222222222222222222 \ + --token-ids 123,456 \ + --root-token 0x0123456789abcdef0123456789abcdef01234567 \ + --root-predicate 0x0123456789abcdef0123456789abcdef01234568 \ + --json-rpc https://rpc-mainnet.maticvigil.com + --minter-key 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef +``` +
+
+ + + + + + + +This command deposits ERC-1155 tokens from the rootchain to the Edge-powered chain. + +- Replace `depositor_private_key` with the private key of the account that will be depositing the tokens. +- Replace `receivers_addresses` with a comma-separated list of Ethereum addresses that will receive the tokens. +- Replace `amounts` with a comma-separated list of token amounts to be deposited for each receiver. +- Replace `token_ids` with a comma-separated list of token IDs to be deposited. +- Replace `root_erc1155_token_address` with the address of the ERC-1155 token contract on the rootchain. +- Replace `root_erc1155_predicate_address` with the address of the ERC-1155 predicate contract on the rootchain. +- Replace `root_chain_json_rpc_endpoint` with the JSON-RPC endpoint of the rootchain. +- Replace `minter-key` with the private key of the minter account. If the private key is provided, tokens are minted to the sender account prior to depositing them. + +```bash +./polygon-edge bridge deposit-erc1155 \ + --sender-key \ + --receivers \ + --amounts \ + --token-ids \ + --root-token \ + --root-predicate \ + --json-rpc + --minter-key +``` + +
+Example ↓ + +In this example, we're depositing ERC-1155 tokens to a test Edge instance: + +- We're using a private key of `0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`. +- We're depositing tokens to two receiver addresses: `0x0123456789abcdef0123456789abcdef01234567` and `0x89abcdef0123456789abcdef0123456789abcdef`. +- We're depositing `10` tokens to the first receiver and `20` tokens to the second receiver. +- The address of the ERC-1155 token contract on the rootchain is `0x0123456789abcdef0123456789abcdef01234567`. +- The address of the ERC-1155 predicate contract on the rootchain is `0x89abcdef0123456789abcdef0123456789abcdef`. +- The JSON-RPC endpoint for the rootchain is `http://localhost:8545`. +- We're using a minter key of `0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`. + +```bash +./polygon-edge bridge deposit-erc1155 \ + --sender-key 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \ + --receivers 0x0123456789abcdef0123456789abcdef01234567,0x89abcdef0123456789abcdef0123456789abcdef \ + --amounts 10,20 \ + --token-ids 1,2 \ + --root-token 0x0123456789abcdef0123456789abcdef01234567 \ + --root-predicate 0x89abcdef0123456789abcdef0123456789abcdef \ + --json-rpc http://localhost:8545 + --minter-key 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef +``` + +
+
+
diff --git a/docs/docs/operate/deploy/transfers/withdraw.md b/docs/docs/operate/deploy/transfers/withdraw.md new file mode 100644 index 0000000000..d4ac1901dc --- /dev/null +++ b/docs/docs/operate/deploy/transfers/withdraw.md @@ -0,0 +1,322 @@ +## Prerequisites + +You'll need to have a successful bridge deployment to make any cross-chain transactions. If you haven't done so already, check out the local deployment guide [here](../local-chain.md). + +:::caution Key management and secure values +When passing values to run transactions, it is important to keep sensitive values like private keys and API keys secure. + +The sample commands provided in this guide use sample private keys for demonstration purposes only, in order to show the format and expected value of the parameter. It is important to note that hardcoding or directly passing private keys should never be done in a development or production environment. + +
+Here are some options for securely storing and retrieving private keys ↓ + +- **Environment Variables:** You can store the private key as an environment variable and access it in your code. For example, in Linux, you can set an environment variable like this: `export PRIVATE_KEY="my_private_key"`. Then, in your code, you can retrieve the value of the environment variable using `os.Getenv("PRIVATE_KEY")`. + +- **Configuration Files:** You can store the private key in a configuration file and read it in your session. Be sure to keep the configuration file in a secure location and restrict access to it. + +- **Vaults and Key Management Systems:** If you are working with sensitive data, you might consider using a vault or key management system like a keystore to store your private keys. These systems provide additional layers of security and can help ensure that your private keys are kept safe. + +
+ +Regardless of how a private key is stored and retrieved, it's important to keep it secure and not expose it unnecessarily. + +::: + +### Withdrawing from the Rootchain + +
+ bridge +
+ +### Withdrawing from the Childchain + +
+ bridge +
+ +For a detailed understanding of how bridging works, please refer to the sequence diagrams available [here](https://github.com/0xPolygon/polygon-edge/blob/develop/docs/bridge/sequences.md). + + + + + + + + + + + + + + + +## Withdraw + +This command withdraws ERC-20 tokens from an Edge-powered chain to a rootchain. + +- Replace `hex_encoded_txn_sender_private_key` with the private key of the account that will be sending the transaction. +- Replace `receivers_addresses` with a comma-separated list of Ethereum addresses that will receive the tokens. +- Replace `amounts` with a comma-separated list of token amounts to be withdrawn for each receiver. +- Replace `child_erc20_predicate_address` with the address of the ERC-20 predicate contract on the Edge-powered chain. +- Replace `child_erc20_token_address` with the address of the ERC-20 token contract on the Edge-powered chain (optional, only required if the token is not a default ERC-20 token). +- Replace `child_chain_json_rpc_endpoint` with the JSON-RPC endpoint of the Edge-powered chain. + +```bash + ./polygon-edge bridge withdraw-erc20 \ + --sender-key \ + --receivers \ + --amounts \ + --child-predicate \ + --child-token \ + --json-rpc +``` + +
+Example ↓ + +- We're using a private key of `0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`. +- We're withdrawing tokens from two receiver addresses: `0x1111111111111111111111111111111111111111` and `0x2222222222222222222222222222222222222222`. +- We're withdrawing `100` tokens from the first receiver and `200` tokens from the second receiver. +- The address of the ERC-20 predicate contract on the Edge-powered chain is `0x3456789abcdef0123456789abcdef0123456789`. +- The address of the ERC-20 token contract on the Edge-powered chain is `0x456789abcdef0123456789abcdef0123456789`. +- The JSON-RPC endpoint for the Edge-powered chain is `http://json-rpc-endpoint.com:8545`. + +```bash +./polygon-edge bridge withdraw-erc20 \ + --sender-key 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \ + --receivers 0x1111111111111111111111111111111111111111,0x2222222222222222222222222222222222222222 \ + --amounts 100,200 \ + --child-predicate 0x3456789abcdef0123456789abcdef0123456789 \ + --child-token 0x456789abcdef0123456789abcdef0123456789 \ + --json-rpc http://json-rpc-endpoint.com:8545 +``` + +
+ +## Exit + +This command sends an exit transaction to the `ExitHelper` contract on the rootchain for a token that was deposited on the Edge-powered chain. It basically finalizes a withdrawal (initiated on the Edge-powered chain) and transfers assets to receiving address on a rootchain. + +- Replace `hex_encoded_txn_sender_private_key` with the private key of the account that will send the exit transaction. +- Replace `exit_helper_address` with the address of the `ExitHelper` contract on the rootchain. +- Replace `exit_id` with the ID of the exit event. +- Replace `root_chain_json_rpc_endpoint` with the JSON-RPC endpoint of the rootchain. +- Replace `child_chain_json_rpc_endpoint` with the JSON-RPC endpoint of the Edge-powered chain. + +```bash +./polygon-edge bridge exit \ + --sender-key \ + --exit-helper \ + --exit-id \ + --root-json-rpc \ + --child-json-rpc +``` + +
+Example ↓ + +In this example, we're sending an exit transaction on a test Edge instance: + +- We're using a private key of `0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`. +- The address of the `ExitHelper` contract on the rootchain is `0x123456789abcdef0123456789abcdef01234567`. +- The ID of the exit event is `42`. +- The JSON-RPC endpoint for the rootchain is `http://root-chain-json-rpc-endpoint.com:8545`, and the JSON-RPC endpoint for the Edge-powered chain is `http://json-rpc-endpoint.com:8545`. + +```bash +./polygon-edge bridge exit \ + --sender-key 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \ + --exit-helper 0x123456789abcdef0123456789abcdef01234567 \ + --exit-id 42 \ + --root-json-rpc http://root-chain-json-rpc-endpoint.com:8545 \ + --child-json-rpc http://json-rpc-endpoint.com:8545 +``` + +
+ +
+ + + + + + + +## Withdraw + +This command withdraws ERC-721 tokens from an Edge-powered chain to a rootchain. + +- Replace `hex_encoded_sender_private_key` with the private key of the account that will initiate the withdrawal. +- Replace `receivers_addresses` with a comma-separated list of Ethereum addresses that will receive the withdrawn tokens on the rootchain. +- Replace `token_ids` with a comma-separated list of token IDs to be withdrawn. +- Replace `child_predicate_address` with the address of the predicate contract on the Edge-powered chain that holds the tokens being withdrawn. +- Replace `child_token_address` with the address of the ERC-721 token contract on the Edge-powered chain that holds the tokens being withdrawn. +- Replace `child_chain_json_rpc_endpoint` with the JSON-RPC endpoint of the Edge-powered chain. + +```bash +./polygon-edge bridge withdraw-erc721 \ + --sender-key \ + --receivers \ + --token-ids \ + --child-predicate \ + --child-token \ + --jsonrpc +``` + +
+Example ↓ + +In this example, we're withdrawing ERC-721 tokens from a test Edge instance: + +- We're using a private key of `0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`. +- We're withdrawing tokens with IDs `123` and `456`. +- The address of the ERC-721 Edge-powered chain predicate contract is `0x23456789abcdef0123456789abcdef012345678`. +- The address of the ERC-721 Edge-powered chain token contract is `0x3456789abcdef0123456789abcdef012345678`. +- The JSON-RPC endpoint for the Edge-powered chain is `http://json-rpc-endpoint.com:8545`. + +
+ +## Exit + +This command sends an exit transaction to the `ExitHelper` contract on the rootchain for a token that was deposited on the Edge-powered chain. It basically finalizes a withdrawal (initiated on the Edge-powered chain) and transfers assets to receiving address on a rootchain. + +- Replace `hex_encoded_txn_sender_private_key` with the private key of the account that will send the exit transaction. +- Replace `exit_helper_address` with the address of the `ExitHelper` contract on the rootchain. +- Replace `exit_id` with the ID of the exit event. +- Replace `root_chain_json_rpc_endpoint` with the JSON-RPC endpoint of the rootchain. +- Replace `child_chain_json_rpc_endpoint` with the JSON-RPC endpoint of the Edge-powered chain. + +```bash +./polygon-edge bridge exit \ + --sender-key \ + --exit-helper \ + --exit-id \ + --root-json-rpc \ + --child-json-rpc +``` + +
+Example ↓ + +In this example, we're sending an exit transaction on a test Edge instance: + +- We're using a private key of `0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`. +- The address of the `ExitHelper` contract on the rootchain is `0x123456789abcdef0123456789abcdef01234567`. +- The ID of the exit event is `42`. +- The JSON-RPC endpoint for the rootchain is `http://root-chain-json-rpc-endpoint.com:8545`, and the JSON-RPC endpoint for the Edge-powered chain is `http://json-rpc-endpoint.com:8545`. + +```bash +./polygon-edge bridge exit \ + --sender-key 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \ + --exit-helper 0x123456789abcdef0123456789abcdef01234567 \ + --exit-id 42 \ + --root-json-rpc http://root-chain-json-rpc-endpoint.com:8545 \ + --child-json-rpc http://json-rpc-endpoint.com:8545 +``` + +
+ +
+ + + + + + + +## Withdraw + +This command withdraws ERC-1155 tokens from the Edge-powered chain to the rootchain. + +- Replace `hex_encoded_withdrawer_private_key` with the private key of the account that will be withdrawing the tokens. +- Replace `receivers_addresses` with a comma-separated list of Ethereum addresses that will receive the tokens. +- Replace `amounts` with a comma-separated list of token amounts to be withdrawn for each receiver. +- Replace `token_ids` with a comma-separated list of token IDs to be withdrawn. +- Replace `root_erc1155_token_address` with the address of the ERC-1155 token contract on the rootchain. +- Replace `root_erc1155_predicate_address` with the address of the ERC-1155 predicate contract on the rootchain. +- Replace `child_chain_json_rpc_endpoint` with the JSON-RPC endpoint of the Edge-powered chain. + +```bash +./polygon-edge bridge withdraw-erc1155 \ + --sender-key \ + --receivers \ + --amounts \ + --token-ids \ + --root-token \ + --root-predicate \ + --json-rpc +``` + +
+Example ↓ + +In this example, we're withdrawing ERC-1155 tokens from a test Edge instance to the rootchain: + +- We're using a private key of `0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`. +- We're withdrawing tokens to a single receiver address: `0x1111111111111111111111111111111111111111`. +- We're withdrawing `100` tokens with ID `1`. +- The address of the ERC-1155 token contract on the rootchain is `0x123456789abcdef0123456789abcdef01234567`. +- The address of the ERC-1155 predicate contract on the rootchain is `0x23456789abcdef0123456789abcdef012345678`. +- The JSON-RPC endpoint for the Edge-powered chain is `http://json-rpc-endpoint.com:8545`. + +```bash +./polygon-edge bridge withdraw-erc1155 \ + --sender-key 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \ + --receivers 0x1111111111111111111111111111111111111111 \ + --amounts 100 \ + --token-ids 1 \ + --root-token 0x123456789abcdef0123456789abcdef01234567 \ + --root-predicate 0x23456789abcdef0123456789abcdef012345678 \ + --json-rpc http://json-rpc-endpoint.com:8545 +``` + +
+ +## Exit + +This command sends an exit transaction to the `ExitHelper` contract on the rootchain for a token that was deposited on the Edge-powered chain. It basically finalizes a withdrawal (initiated on the Edge-powered chain) and transfers assets to receiving address on a rootchain. + +- Replace `hex_encoded_txn_sender_private_key` with the private key of the account that will send the exit transaction. +- Replace `exit_helper_address` with the address of the `ExitHelper` contract on the rootchain. +- Replace `exit_id` with the ID of the exit event. +- Replace `root_chain_json_rpc_endpoint` with the JSON-RPC endpoint of the rootchain. +- Replace `child_chain_json_rpc_endpoint` with the JSON-RPC endpoint of the Edge-powered chain. + +```bash +./polygon-edge bridge exit \ + --sender-key \ + --exit-helper \ + --exit-id \ + --root-json-rpc \ + --child-json-rpc +``` + +
+Example ↓ + +In this example, we're sending an exit transaction on a test Edge instance: + +- We're using a private key of `0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`. +- The address of the `ExitHelper` contract on the rootchain is `0x123456789abcdef0123456789abcdef01234567`. +- The ID of the exit event is `42`. +- The JSON-RPC endpoint for the rootchain is `http://root-chain-json-rpc-endpoint.com:8545`, and the JSON-RPC endpoint for the Edge-powered chain is `http://json-rpc-endpoint.com:8545`. + +```bash +./polygon-edge bridge exit \ + --sender-key 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \ + --exit-helper 0x123456789abcdef0123456789abcdef01234567 \ + --exit-id 42 \ + --root-json-rpc http://root-chain-json-rpc-endpoint.com:8545 \ + --child-json-rpc http://json-rpc-endpoint.com:8545 +``` + +
+ +
+
diff --git a/docs/docs/operate/deploy/upgrades/hardfork.md b/docs/docs/operate/deploy/upgrades/hardfork.md new file mode 100644 index 0000000000..01453cea21 --- /dev/null +++ b/docs/docs/operate/deploy/upgrades/hardfork.md @@ -0,0 +1,185 @@ + +Drawing from a real-world example, this guide delves into the process of introducing a new feature via a hardfork in an Edge-powered chain, utilizing a fork manager to manage the activation and behavior of the fork. + +## 1. Adding Fields + +Add the `ExtraData` field to Extra. Before block 100, the field will be ignored. After block 100, it will be used. Your Extra struct should look like this: + +```go +type Extra struct { + Validators *validator.ValidatorSetDelta + Parent *Signature + Committed *Signature + Checkpoint *CheckpointData + ExtraData []byte // NewField + BlockNumber uint64 // field used by forking manager +} +``` + +The `ExtraData` field is a byte slice (`[]byte`), which can hold any kind of data. + +## 2. Implement Extra.Marshal() Behavior + +The marshaling process will need to account for the ExtraData field after block 100. + +```go +type ExtraHandlerNewField struct { +} + +// MarshalRLPWith defines the marshal function implementation for Extra +func (e *ExtraHandlerNewField) MarshalRLPWith(extra *Extra, ar *fastrlp.Arena) *fastrlp.Value { + vv := extraMarshalBaseFields(extra, ar, ar.NewArray()) + vv.Set(ar.NewBytes(extra.ExtraData)) + return vv +} +``` + +This code creates a new type `ExtraHandlerNewField` which has a method `MarshalRLPWith`. This method handles the marshaling of the `Extra` struct and specifically takes into account the `ExtraData` field. + +## 3. Register the Fork in chain/params.go + +`chain/params.go` is where the details about the fork are specified, such as its name, when it is activated, and how to determine its activity at a given block. + +### 3.1 Define the Fork’s Name + +We first define a constant string to represent the name of the fork. + +```go +const ( +... + NewFieldForkName = "newFieldFork" +) +``` + +### 3.2 Add the Fork as a Supported Fork + +We then include the fork in the `ForksInTime` struct to mark it as a supported fork. + +```go +type ForksInTime struct { +... + NewFieldFork bool +} +``` + +### 3.3 Include the Fork into the genesis.json + +Next, we include the fork in the `genesis.json`. + +```go +var AllForksEnabled = &Forks{ +... + NewFieldForkName: NewFork(0), +} +``` + +### 3.4 Add Support to Read if the Fork is Active at the Current Block + +Finally, we add the ability to read if the fork is active at a specific block. + +```go +func (f *Forks) At(block uint64) ForksInTime { + return ForksInTime{ +... + NewFieldFork: f.IsActive(NewFieldForkName, block), + } +} +``` + +## 4. Register Fork Handlers + +Fork handlers are the functions that are run when a fork becomes active. Here, we register a handler for our new fork, as well as a default handler for blocks before the fork. + +``` +func (f *Forks) At(block uint64) ForksInTime { + return ForksInTime{ +... + NewFieldFork: f.IsActive(NewFieldForkName, block), + } +} +``` + +## 5. Fork Management + +In the `chain/params.go` file, define the parameters related to the fork. They should always be pointer values. For example: + +```go +type ForkParams struct { + MaxValidatorSetSize *uint64 `json:"maxValidatorSetSize,omitempty"` + ... +} +``` + +These parameters represent new rules or behaviors to be introduced. + +## 6. Configuring the Fork in genesis.json + +In the genesis.json file, specify all available forks and their parameters. For instance: + +```json +"forks": { + "EIP150": { + "block": 0 + }, + ... + "myFork": { + "block": 10, + "params": { + "maxValidatorSetSize": 20 + } + }, +} +``` + +Here, a new fork named `myFork` is added with specific parameters and values. For this fork, `maxValidatorSetSize` will be 20. + +## 7. Accessing and Using Fork Parameters in Code + +You can access these parameters in the code using the fork manager. For example: + +```go +maxValidatorSetSize := 100 // default value +ps := forkmanager.GetInstance().GetParam(blockNumber) +if ps != nil { + maxValidatorSetSize = ps.MaxValidatorSetSize +} +``` + +For `blockNumber` < 10, `maxValidatorSetSize` will be set to 100. For `blockNumber` >= 10, the `maxValidatorSetSize` will be 20, the value specified for the `myFork` fork. + +## 8. Setting Default Parameter Values + +If you don't want to use if statements in the code and always want to have default values for the parameters, change the consensus factory method defined in `server/builtin.go`: + +```go +func ForkManagerInitialParamsFactory(config *chain.Chain) (*chain.ForkParams, error) { + pbftConfig, err := GetPolyBFTConfig(config) + if err != nil { + return nil, err + } +​ + return &chain.ForkParams{ + MaxValidatorSetSize: &pbftConfig.MaxValidatorSetSize, + ... + }, nil +} +``` + +Each fork doesn't need to specify all parameters, only the ones that have changed between forks. Other parameters take the value from the previous fork. + +## 9. Network Upgrade + +The introduction of a hard fork necessitates an upgrade process across the network. Nodes need to update their software to incorporate the new fork code, and the new `ExtraData` field becomes active upon reaching the designated block height. Here's an example of the step-by-step process that follows the example used above: + +1. **Generate New Genesis File**: Create a new genesis.json using the updated Edge implementation that includes the fork. +2. **Edit Activation Block**: Set the fork's activation block to 100 in the genesis.json file, as in "MyFirstForkName": 100. +3. **Distribute Genesis File**: Share the updated genesis.json file with all network nodes. + + For a step-by-step guide on generating a new genesis file, please consult the chain configuration deployment guide + [here](../genesis.md). + +4. **Stop Client**: Pause the Edge client on all network nodes before block 100. +5. **Replace Files**: Replace the existing genesis.json and Edge files with the updated versions. +6. **Restart Edge**: Restart the Edge client to apply the hard fork updates. + +Remember, communication with network participants about the specific process and timeline is crucial for a successful upgrade. diff --git a/docs/docs/operate/deploy/upgrades/v1.1.md b/docs/docs/operate/deploy/upgrades/v1.1.md new file mode 100644 index 0000000000..74aca08034 --- /dev/null +++ b/docs/docs/operate/deploy/upgrades/v1.1.md @@ -0,0 +1,95 @@ +The Edge v1.1 release includes crucial adjustments through two hard forks: `quorumcalcalignment` and `txHashWithType`. +This guide provides details on these changes and the requirements for implementing this upgrade. + +While these are important changes at the technical level, they **do not affect the user experience** and **user data remains unaltered**. +It's also important to note that the upgrade process will involve some downtime as the nodes need to be stopped, updated, and then restarted. + +## Node Upgrade Process + +Follow these steps to upgrade your nodes and implement the hard forks: + +1. **Stop the node(s).** The ideal scenario would be to halt all nodes simultaneously, but if that isn't feasible, ensure at least the majority are stopped around the same time. + +2. **Update the binaries.** Replace the old Edge binary with the new one which incorporates the necessary changes for both the `quorumcalcalignment` and `txHashWithType` forks. + + > For different methods on downloading the latest release, check out the installation guide available [here](../../install.md). + +3. **Update the `genesis.json` file.** Include both the new forks in the `genesis.json` file and specify a block from which each becomes active. The block number for each fork should be greater than the current maximum block number across all nodes. + + Here's an example: + + ```json + "params": { + "forks": { + "txHashWithType": { + "block": 100 + }, + "quorumcalcalignment": { + "block": 120 + }, + ... + } + } + ``` + +4. **Restart the nodes.** Once the binary and `genesis.json` are updated, the node can be restarted. + +## Understanding the Forks + +### `quorumcalcalignment` + +This fork corrects the calculation of the quorum, aligning it with the IBFT paper. This prevents issues that arise when there are a number of validators divisible by 3. + +### `txHashWithType` + +This fork introduces dynamic fee transaction hash calculations that include the transaction type and the correct chainID. The new binary includes a new transaction hash calculation algorithm but will also support the old one until the fork block. Consequently, the hash calculation algorithm will now depend on the block number. + +> Note: It's crucial to ensure no dynamic fee transactions from the block occur when the node is restarted until the `txHashWithType` fork block. The new binary will reject all dynamic fee transactions received from json-rpc or gossip until the fork block is reached. + +Please follow these guidelines carefully to ensure a successful transition while upgrading to Edge v1.1. + +## Additional Details on Quorum Calculation Discrepancy + +Before the Edge v1.1 release, the quorum was calculated by taking the ceiling of `(2*totalVotingPower)/3`, deviating from the specifications of the IBFT paper. With total voting power of 6, where each validator has one token staked, the calculation resulted in: + +`CEILING(2*6/3) = 4 -> 2 faulty -> INCORRECT` + +The correct formula, per the IBFT paper, should be: + +`FLOOR(2*6/3) + 1 = 5 -> 1 faulty -> CORRECT` + +This discrepancy arose between the core contracts and the client side of quorum calculations. + +**Core Contract Side:** The calculation is: `aggVotingPower > ((2 * totalVotingPower) / 3)` +[Reference CheckpointManager.sol](https://github.com/0xPolygon/core-contracts/blob/2de13ae801cb2e9b50bce7f062b5a86dcbd149dc/contracts/root/CheckpointManager.sol#L197) + +**Client Side:** The calculation is: `aggVotingPower >= math.Ceil(2 * totalVotingPower) / 3)` +[Reference validator_set.go](https://github.com/0xPolygon/polygon-edge/blob/develop/consensus/polybft/validator/validator_set.go#L113) + +The client side equation adheres to the IBFT paper's specifications: [arxiv.org/pdf/1909.10194.pdf](https://arxiv.org/pdf/1909.10194.pdf) (page 7, lines 2 and 4) + +### Core Issue + +Problems arise when the number of validators can be divided by 3 (such as 6, 9, 12, etc.). For instance, given 6 validators each with voting powers equal to 1, and 4 out of 6 validators have voted (`aggVotingPower = 4`): + +- The **Core Contract** will check: `4 > (2 * 6)/3 → 4 > 4 → false` +- The **Client Side** will check: `4 >= math.Ceil((2 * 6)/3) → 4 >= 4 → true` + +In this case, the client side reaches the quorum, but the core contract does not. This inconsistency prevents the checkpoint from passing, causing the bridging from the edge to rootchain to halt. The `quorumcalcalignment` hard fork resolves this issue. + +## Additional Details on Transaction Hash Fork - `txHashWithType` + +The `txHashWithType` fork is implemented to enhance dynamic fee transaction hash calculations, including the transaction type and the correct chainID. + +After implementing this fork, the new binary includes a revised transaction hash calculation algorithm, while still supporting the old one until the fork block. As a result, the hash calculation algorithm depends on the block number, i.e., the block number determines which hash algorithm—old or new—should be used. + +For instance, if we call `tx.ComputeHash(blockNumber)` for a dynamic fee `tx`, we get: + +- For block number < 100, the old hash without the type +- For block number >= 100, the new hash with the type and the correct chain ID + +A transaction hash is computed as soon as a transaction enters a node's transaction pool. At that point, the latest block number from the blockchain is used for hash calculation. Later, if the transaction is needed, it's read from storage, deserialized, and the hash is recalculated using the block number of the block containing the transaction. + +Given this, it's crucial to ensure that no dynamic fee transactions from the block occur when the node is restarted until the `txHashWithType` fork block. The new binary rejects all dynamic fee transactions received from json-rpc or gossip until the fork block is reached. + +> Note: Select a sufficiently large block number for the `txHashWithType` fork to prevent dynamic fee transactions with old hashes from being included in blocks after the fork block. After replacing the new binary, updating `genesis.json`, and restarting the node, there will be a period during which the node won't be able to accept new dynamic fee transactions either from json-rpc or gossip. Ensure enough "room" between the latest block synced/validated and the fork block on the node. diff --git a/docs/docs/operate/install.md b/docs/docs/operate/install.md new file mode 100644 index 0000000000..b3ce379560 --- /dev/null +++ b/docs/docs/operate/install.md @@ -0,0 +1,41 @@ +!!! tip + + We recommend using the pre-built releases and verifying the provided checksums for security. + + The Docker image is also a convenient option for containerized deployment. Building from source provides greater flexibility, but requires a [suitable development environment](system.md). + +## Pre-built releases + +To access the pre-built releases, visit the [GitHub releases page](https://github.com/0xPolygon/polygon-edge/releases). +The client provides cross-compiled AMD64/ARM64 binaries for Darwin and Linux. + +!!! info "Latest release: 1.3.0" + + **The latest stable test release is [v1.3.0](https://github.com/0xPolygon/polygon-edge/releases/tag/v1.3.0).** + +## Docker image + +To use Docker, you will need to have it installed on your system. If you haven't already installed Docker, you can follow the instructions on the +[official Docker website](https://www.docker.com/) for your operating system. + +You can access the official Polygon Edge Docker images hosted under the [0xPolygon registry](https://hub.docker.com/r/0xpolygon/polygon-edge) using the following command: + + ```bash + docker pull 0xpolygon/polygon-edge:latest + ``` + +## Build from source + +> Before getting started, ensure you have [Go](https://go.dev/) installed on your system (version >= 1.15 and <= 1.19). +> Compatibility is being worked on for other versions and will be available in the near future. + +> To install Go, run the following command in your CLI (we are using 1.18 in this example): `sudo apt-get install golang-1.18`. +> Or, use a package manager like [Snapcraft](https://snapcraft.io/go) for Linux, [Homebrew](https://formulae.brew.sh/formula/go) for Mac, and [Chocolatey](https://community.chocolatey.org/packages/golang) for Windows. + +Use the following commands to clone the Polygon Edge repository and build from source: + + ```bash + git clone https://github.com/0xPolygon/polygon-edge.git + cd polygon-edge/ + go build -o polygon-edge . + ``` diff --git a/docs/docs/operate/param-reference.md b/docs/docs/operate/param-reference.md new file mode 100644 index 0000000000..6b8f1c1ea7 --- /dev/null +++ b/docs/docs/operate/param-reference.md @@ -0,0 +1,153 @@ + +Configuration parameters are crucial for setting up and operating a Edge-powered chain. You can configure these parameters using the genesis and server commands. Before running these commands, it is essential to generate keys using the polybft-secrets command. + +For information on the available configuration flags and their descriptions for customizing the genesis configuration of an Edge-powered chain, refer to the categorized tabs below. + + + + + + + + + +## PolyBFT Configuration Parameter Reference + +| Parameter | Description | Default Value | Mandatory | +| :-------- | :--------------------------------------------------------------- | :------------ | :-------- | +| `--account` | The flag indicating whether a new account is created | TRUE | NO | +| `--config string` | The path to the SecretsManager config file | "" | NO | +| `--data-dir string` | The directory for the Polygon Edge data if the local FS is used | "" | YES | +| `--insecure` | The flag indicating whether the secrets stored locally are encrypted | FALSE | NO | +| `--network` | The flag indicating whether a new Network key is created | TRUE | NO | +| `--num int` | The number of secrets to be created (only for local FS) | 1 | NO | +| `--output` | The flag indicating whether to output existing secrets | FALSE | NO | +| `--private` | The flag indicating whether the private key is printed | FALSE | NO | + +:::info Mutually Exclusive Paramaters + +- `--config` and `--data-dir`: These flags are mutually exclusive. Use either `--config` to specify the path to the SecretsManager config file or `--data-dir` to set the directory for the Polygon Edge data if the local FS is used. + +- `--num` and `--config`: These flags are mutually exclusive. Set `--num` to define the number of secrets to be created (only for local FS) or use `--config` to provide the SecretsManager config file path. + +::: + + + + + + + + + +## Genesis Configuration Parameter Reference + +| Parameter | Description | Default Value | Mandatory | Example | Reconfigurable at Runtime | +| :-------- | :---------- | :------------ | :-------- | :------ | :----------------------- | +| `--block-tracker-poll-interval` | Interval (number of seconds) at which block tracker polls for latest block at rootchain. | 1s | NO | `genesis --block-tracker-poll-interval "1s"` | NO | +| `--bridge-allow-list-admin` | List of addresses to use as admin accounts in the bridge allow list. | []string{} | NO | `genesis --bridge-allow-list-admin "0x2f82ad5785F6f3Fd242e7EC7a03c2cDfBA6cC6D1"` | NO | +| `--bridge-allow-list-enabled` | List of addresses to enable by default in the bridge allow list. | []string{} | NO | `genesis --bridge-allow-list-enabled "0xbB39871E4e399b22428FdfA9E4e4Ca67842EA8Cd"` | NO | +| `--bridge-block-list-admin` | List of addresses to use as admin accounts in the bridge block list. | N/A | NO | `genesis --bridge-block-list-admin "0xAddress1"` | NO | +| `--bridge-block-list-enabled` | List of addresses to enable by default in the bridge block list. | N/A | NO | `genesis --bridge-block-list-enabled "0xAddress2"` | NO | +| `--chain-id` | The ID of the chain. | 100 | NO | `genesis --chain-id "100"` | NO | +| `--contract-deployer-allow-list-admin` | List of addresses to use as admin accounts in the contract deployer allow list. | N/A | NO | `genesis --contract-deployer-allow-list-admin "0xAddress3"` | NO | +| `--contract-deployer-allow-list-enabled` | List of addresses to enable by default in the contract deployer allow list. | N/A | NO | `genesis --contract-deployer-allow-list-enabled "0xAddress4"` | NO | +| `--contract-deployer-block-list-admin` | List of addresses to use as admin accounts in the contract deployer block list. | N/A | NO | `genesis --contract-deployer-block-list-admin "0xAddress5"` | NO | +| `--contract-deployer-block-list-enabled` | List of addresses to enable by default in the contract deployer block list. | N/A | NO | `genesis --contract-deployer-block-list-enabled "0xAddress6"` | NO | +| `--ibft-validator` | Addresses to be used as IBFT validators. | N/A | NO | `genesis --ibft-validator "0xAddress7"` | NO | +| `--ibft-validator-type` | The type of validators in IBFT. | "bls" | NO | `genesis --ibft-validator-type "bls"` | NO | +| `--ibft-validators-prefix-path` | Prefix path for validator folder directory. | N/A | NO | `genesis --ibft-validators-prefix-path "/path/to/validators"` | NO | +| `--max-validator-count` | The maximum number of validators in the validator set for PoS. | 9007199254740990 | NO | `genesis --max-validator-count "9007199254740990"` | NO | +| `--min-validator-count` | The minimum number of validators in the validator set for PoS. | 1 | NO | `genesis --min-validator-count "1"` | NO | +| `--pos` | Flag indicating use of Proof of Stake IBFT. | N/A | NO | `genesis --pos` | NO | +| `--proxy-contracts-admin` | Admin for proxy contracts. | N/A | NO | `genesis --proxy-contracts-admin "0xAddress8"` | NO | +| `--reward-token-code` | Hex encoded reward token byte code. | N/A | NO | `genesis --reward-token-code "0xHexCode"` | NO | +| `--transactions-allow-list-admin` | List of addresses to use as admin accounts in the transactions allow list. | N/A | NO | `genesis --transactions-allow-list-admin "0xAddress9"` | NO | +| `--transactions-allow-list-enabled` | List of addresses to enable by default in the transactions allow list. | N/A | NO | `genesis --transactions-allow-list-enabled "0xAddress10"` | NO | +| `--transactions-block-list-admin` | List of addresses to use as admin accounts in the transactions block list. | N/A | NO | `genesis --transactions-block-list-admin "0xAddress11"` | NO | +| `--transactions-block-list-enabled` | List of addresses to enable by default in the transactions block list. | N/A | NO | `genesis --transactions-block-list-enabled "0xAddress12"` | NO | +| `--block-gas-limit` | The maximum amount of gas used by all transactions in a block | 5242880 | NO | `genesis --block-gas-limit "10000000"` | NO | +| `--block-time` | The predefined period which determines block creation frequency | 2s | NO | `genesis --block-time "10s"` | NO | +| `--block-time-drift` | Configuration for block time drift value (in seconds). Defines the time slot in which a new block can be created | 10 | NO | `genesis --block-time-drift "20"` | NO | +| `--bootnode` | MultiAddr URL for p2p discovery bootstrap. This flag can be used multiple times. | N/A | NO | `genesis --bootnode "/ip4/127.0.0.1/tcp/30301/p2p/16Uiu2HAmBW3zAvTEHGj5DDygJ5AzuvaRdY5wtSLNmkvXfaQensBu"` | NO | +| `--burn-contract` | The burn contract blocks and addresses (format: [block]:[address]) | []string{} | NO | `genesis --burn-contract "0:0x0000000000000000000000000000000000000000"` | NO | +| `--consensus` | The consensus protocol to be used | "polybft" | NO | `genesis --consensus polybft` | NO | +| `--dir` | Represents the file path for the genesis data | "./genesis.json" | NO | `genesis --dir "/data/genesis.json"` | NO | +| `--epoch-reward` | Reward size for block sealing | 1 | NO | `genesis --epoch-reward "10"` | NO | +| `--epoch-size` | The epoch size for the chain | 100000 | NO | `genesis --epoch-size "10"` | NO | +| `--name` | The name for the chain | "polygon-edge" | NO | `genesis --name "test-chain"` | NO | +| `--premine` | The premined accounts and balances | []string{} | NO | `genesis --premine 0x85da99c8a7c2c95964c8efd687e95e632fc533d6:1000000000000000000000` | NO | +| `--sprint-size` | The number of blocks included into a sprint | 5 | NO | `genesis --sprint-size "2"` | NO | +| `--trieroot` | Trie root from the corresponding triedb | "" | NO | `genesis --trieroot "0xabc123"` | NO | +| `--validators` | Initial validator addresses for the chain | []string{} | YES | `genesis --validators "0x9c106ada8a2a36a9de8d67b347c07156033882e0"` | NO | +| `--validators-path` | Root path containing polybft validators' secrets | "./" | NO | `genesis --validators-path "/data/validators"` | NO | +| `--validators-secret` | Validators secrets | []string{} | NO | `genesis --validators-secret "0x0101010101010101010101010101010101010101010101010101010101010101"` | NO | + +:::info Mutually Exclusive Paramaters + +- `--validators`: Validators defined by the user (format: `::`). If this flag is set, the entire multi address must be specified. If not set, validators configuration will be read from `--validators-path`. +- `--validators-path`: Root path containing polybft validators' secrets. If `--validators` flag is not specified, validators' configuration will be read from this path. +- `--validators-prefix`: Folder prefix names for polybft validators' secrets. If `--validators` flag is set, this prefix will be used for folder names. + +::: + + + + + + + + + +## Server Configuration Parameter Reference + +| Parameter | Description | Default Value | Mandatory | Example | Reconfigurable at Runtime | +| :-------- | :---------- | :------------ | :-------- | :------ | :----------------------- | +| `--grpc-address` string | The address of the GRPC interface. | "127.0.0.1:9632" | NO | Command: server Flag: --grpc-address “0.0.0.0:10000” | NO | +| `--jsonrpc` string | The address of the JSON-RPC interface. | "0.0.0.0:8545" | NO | Command: server Flag: --jsonrpc “0.0.0.0:10002” | NO | +| `--log-level` string | The log level for the console output. | “INFO” | NO | Command: server Flag: --log-level “DEBUG” | NO | +| `--chain` string | The genesis file used for starting the chain. The genesis file is generated by running the genesis CLI command. | "./genesis.json" | NO | Command: server Flag: --chain “genesis.json” | NO | +| `--config` string | The path to the CLI config. Supported extensions are: .json, .hcl, .yaml and .yml. If this flag is set, other flags will be overridden. If some value that will be overridden is not specified in a config file, default value for that parameter is used. | “” | NO | Command: server Flag: --config “config.json” | NO | +| `--data-dir` string | The data directory used for storing Polygon Edge client data. | “” | YES | Command: server Flag:--data-dir “./test-chain-1” | NO | +| `--libp2p` string | The address and port for the libp2p service. | “127.0.0.1:1478” | NO | Command: server Flag: --libp2p “0.0.0.0:30301” | NO | +| `--prometheus` string | The address and port for the prometheus instrumentation service (address:port). If only port is defined (:port) it will bind to 0.0.0.0:port. | “” | NO | Command: server Flag: --prometheus “0.0.0.0:5001” | NO | +| `--nat` string | The external IP address without port, as can be seen by peers. The string specidied can be in IPv4 dotted decimal ("192.0.2.1"), IPv6 ("2001:db8::68"), or IPv4-mapped IPv6 ("::ffff:192.0.2.1") form. | “” | NO | Command: server Flag:--nat "192.0.2.1" | NO | +| `--dns` string | The host DNS address which can be used by a remote peer for connection. | “” | NO | Command: server Flag: --dns "www.example.com" | NO | +| `--block-gas-target` string | The target block gas limit for the chain. If omitted, the value of the parent block is used which will be the value set by the `--block-gas-limit` flag of the genesis command. If this flag is set, the block fill take block gas limit of the parent block and increment it by small delta (parentGasLimit /1024). If the block gas target is reached that the value of it will be set as a gas limit for the current block. | 0x0 | NO | Command: server Flag: --block-gas-target “10000000” | YES, this parameter can be changed by stopping the node and then starting it again with the server command and specifying --block-gas-target flag providing the new value e.g. --block-gas-target “60000000” | +| `--secrets-config` string | The path to the SecretsManager config file. Used for Hashicorp Vault. If omitted, the local FS secrets manager is used. | “” | NO | Command: server Flag: --secret-config “hashicorp.json” | NO | +| `--restore` string | The path to the archive blockchain data to restore on initialization. | “” | NO | Command: server Flag: --restore | NO | +| `--seal` | The flag indicating that the client should seal blocks. | TRUE | NO | Command: server Flag: --seal | NO | +| `--no-discover` | Prevent the client from discovering other peers. | FALSE | NO | Command: server Flag: --no-discover | NO | +| `--max-peers` int | The client's max number of peers allowed. | 40 | NO | Command: server Flag: --max-peers “70” | NO | +| `--max-inbound-peers` int | The client's max number of inbound peers allowed. | 32 | NO | Command: server Flag:--max-inbound-peers “50” | NO | +| `--max-outbound-peers` int | The client's max number of outbound peers allowed. | 8 | NO | Command: server Flag: --max-outbound-peers “20” | NO | +| `--price-limit` uint | The minimum gas price limit to enforce for acceptance into the pool. | 0 | NO | Command: server Flag: --price-limit “1” | YES, this parameter can be changed by stopping the node and then starting it again with the server command and specifying --price-limit flag providing the new value e.g. --price-limit “5” | +| `--max-slots` uint | Maximum slots in the transaction pool. When the maximum capacity is reached, transaction is not stored in the pool. One transaction occupies txSize/32kB number of slots. If e.g. --max-slots is 5, and there are tx1 which has 2kB and tx2 which has 33kB, that means that 3 slots are occupied and there are 2 free slots left. This parameter refers to the enqueued and promoted transactions in the pool. | 4096 | NO | Command: server Flag: --max-slots “100000” | NO | +| `--max-enqueued` uint | Maximum number of enqueued transactions in the pool per account. | 128 | NO | Command: server Flag: --max-enqueued “200” | NO | +| `--access-control-allow-origins` stringArray | The CORS(cross origin resource sharing) header indicating whether any JSON-RPC response can be shared with the specified origin. | []string{"*"} | NO | Command: server Flag: --access-control-allow-origins “https://foo.example” | NO | +| `--json-rpc-batch-request-limit` uint | Max length to be considered when handling json-rpc batch requests, value of 0 disables it. | 20 | NO | Command: server Flag: --json-rpc-batch-request-limit | NO | +| `--json-rpc-block-range-limit` uint | Max block range to be considered when executing json-rpc requests that consider fromBlock/toBlock values (e.g. eth_getLogs), value of 0 disables it. | 1000 | NO | Command: server Flag: --json-rpc-block-range-limit “2000” | NO | +| `--log-to` string | Write all logs to the file at specified location instead of writing them to console. | “” | NO | Command: server Flag: --log-to “edge-log.log” | NO | +| `--relayer` | Start the state sync relayer service. | FALSE | NO | Command: server Flag: --relayer | NO | +| `--num-block-confirmations` uint | Minimal number of child blocks required for the parent block to be considered final. This parameter is used by the event Tracker when reading logs from the parent chain. | 64 | NO | Command: server Flag: --num-block-confirmations “2” | NO | +| `--concurrent-requests-debug` uint | Maximal number of concurrent requests for debug endpoints. | 32 | NO | `server --concurrent-requests-debug "50"` | NO | +| `--websocket-read-limit` uint | Maximum size in bytes for a message read from the peer by websocket. | 8192 | NO | `server --websocket-read-limit "16384"` | NO | +| `--relayer-poll-interval` duration | Interval (number of seconds) at which relayer's tracker polls for latest block at childchain. | 1s | NO | `server --relayer-poll-interval "2s"` | NO | +| `--metrics-interval` duration | The interval (in seconds) at which special metrics are generated. A value of zero means the metrics are disabled. | 8s | NO | `server --metrics-interval "10s"` | NO | + +:::info Mutually Exclusive Paramaters + +- `--max-inbound-peers`: The client's maximum number of inbound peers allowed. Default value is 32. +- `--max-outbound-peers`: The client's maximum number of outbound peers allowed. Default value is 8. + +::: + + + diff --git a/docs/docs/operate/system.md b/docs/docs/operate/system.md new file mode 100644 index 0000000000..279bf0dd11 --- /dev/null +++ b/docs/docs/operate/system.md @@ -0,0 +1,38 @@ +## Minimum Hardware Configuration + +!!! tip "Hardware environment tips" + + While we do not favor any operating system, more secure and stable Linux server distributions (like CentOS) should be preferred over desktop operating systems (like Mac OS and Windows). + + The minimum storage requirements will change over time as the network grows. It is recommended to use more than the minimum requirements to run a robust full node. + +This is the minimum hardware configuration required to set up a Edge-powered chain: + +| Component | Minimum Requirement | Recommended | +| --------- | ------------------- | ----------- | +| Processor | 4-core CPU | 8-core CPU | +| Memory | 8 GB RAM | 16 GB RAM | +| Storage | 200 GB SSD | 1 TB SSD | +| Network | High-speed internet connection | Dedicated server with gigabit connection | + +> Note that these minimum requirements are based on the x2iezn.2xlarge instance type used in the [performance tests](benchmarks.md), which demonstrated satisfactory performance. However, for better performance and higher transaction throughput, consider using more powerful hardware configurations, such as those equivalent to x2iezn.4xlarge or x2iezn.8xlarge instance types. + +## Prerequisites + +Before starting any of the tutorials, you should understand the basics of blockchain technology and be familiar with command-line interfaces. It would help if you also had the `polygon-edge` binary installed on your machine. Check out the [installation guide](install.md) for more information if you haven't already. + +Ensure you have the following system prerequisites: + +| Prerequisite | Description | +| --- | --- | +| Golang (v1.15-1.19) | Install Go using CLI or package manager like [Snapcraft](https://snapcraft.io/go) for Linux, [Homebrew](https://formulae.brew.sh/formula/go) for Mac, or [Chocolatey](https://community.chocolatey.org/packages/golang) for Windows. Compatibility for other versions coming soon. | +| Docker | Required to run the geth instance. Follow [official Docker documentation](https://www.docker.com/) for installation instructions. | +| Internet connection | Stable internet connection required. | +| Network security | Ensure that network ports used by Polygon Edge are not blocked by firewalls or other security measures. | +| Operating system | Ensure that the latest security patches and updates are installed. | + +!!! caution "Solidity v0.8.19 or earlier recommended" + + [Solidity v0.8.20](https://blog.soliditylang.org/2023/05/10/solidity-0.8.20-release-announcement/) introduces new features, including the implementation of `PUSH0` opcode, which is not yet supported in Edge. If you decide to use v0.8.20, ensure that you set your EVM version to "Paris" in the framework you use to deploy your contracts. + + For now, we recommend using Solidity v0.8.19 or earlier. diff --git a/docs/docs/quickstart.md b/docs/docs/quickstart.md new file mode 100644 index 0000000000..fdc0fff254 --- /dev/null +++ b/docs/docs/quickstart.md @@ -0,0 +1,347 @@ +Before proceeding, ensure that your system meets the necessary [system requirements](operate/system.md). + +To access the pre-built releases, visit the [GitHub releases page](https://github.com/0xPolygon/polygon-edge/releases). The client provides cross-compiled AMD64/ARM64 binaries for Darwin and Linux. + +To locally run the Edge test environment, run the following command from the project's root: + + ```bash + ./scripts/cluster polybft + ``` + +**That's it! You should have successfully been able to start a local Edge-powered chain just by running the script.** + +> - Stop the network: "CTRL/Command C" or `./scripts/cluster polybft stop`. +> - Destroy the network: `./scripts/cluster polybft destroy`. + + +## Deployment script details + +The script is available under the "scripts" directory of the client. +These are the optional configuration parameters you can pass to the script: + +### Flags + +| Flag | Description | Default Value | +|------|-------------|---------------| +| --block-gas-limit | Maximum gas allowed for a block. | 10000000 | +| --premine | Address and amount of tokens to premine in the genesis block. | 0x85da99c8a7c2c95964c8efd687e95e632fc533d6:1000000000000000000000 | +| --epoch-size | Number of blocks per epoch. | 10 | +| --data-dir | Directory to store chain data. | test-chain- | +| --num | Number of nodes in the network. | 4 | +| --bootnode | Bootstrap node address in multiaddress format. | /ip4/127.0.0.1/tcp/30301/p2p/... | +| --insecure | Disable TLS. | | +| --log-level | Logging level for validators. | INFO | +| --seal | Enable block sealing. | | +| --help | Print usage information. | | + +After running the command, the test network will be initialized with PolyBFT consensus engine and the genesis file will be created. Then, the four validators will start running, and their log outputs will be displayed in the terminal. + +By default, this will start an Edge network with PolyBFT consensus engine, four validators, and premine of 1 billion tokens at address `0x85da99c8a7c2c95964c8efd687e95e632fc533d6`. + +The nodes will continue to run until stopped manually. To stop the network, open a new session and use the following command, or, simply press "CTRL/Command C" in the CLI: + + ```bash + ./scripts/cluster polybft stop + ``` + +If you want to destroy the environment, use the following command: + + ```bash + ./scripts/cluster polybft destroy + ``` + +### Explanation of the deployment script + +The deployment script is a wrapper script for starting an Edge test network with PolyBFT consensus engine. +It offers the following functionality: + +- Initialize the network with either IBFT or PolyBFT consensus engine. +- Create the genesis file for the test network. +- Start the validators on four separate ports. +- Write the logs to separate log files for each validator. +- Stop and destroy the environment when no longer needed. +- The script also allows you to choose between running the environment from a local binary or a Docker container. + +## Deployment script + +
+Click to open + +```sh +#!/usr/bin/env bash + +dp_error_flag=0 + +# Check if jq is installed +if [[ "$1" == "polybft" ]] && ! command -v jq >/dev/null 2>&1; then + echo "jq is not installed." + echo "Manual installation instructions: Visit https://jqlang.github.io/jq/ for more information." + dp_error_flag=1 +fi + +# Check if curl is installed +if [[ "$1" == "polybft" ]] && ! command -v curl >/dev/null 2>&1; then + echo "curl is not installed." + echo "Manual installation instructions: Visit https://everything.curl.dev/get/ for more information." + dp_error_flag=1 +fi + +# Check if docker-compose is installed +if [[ "$2" == "--docker" ]] && ! command -v docker-compose >/dev/null 2>&1; then + echo "docker-compose is not installed." + echo "Manual installation instructions: Visit https://docs.docker.com/compose/install/ for more information." + dp_error_flag=1 +fi + +# Stop script if any of the dependencies have failed +if [[ "$dp_error_flag" -eq 1 ]]; then + echo "Missing dependencies. Please install them and run the script again." + exit 1 +fi + +function showhelp(){ + echo "Usage: cluster {consensus} [{command}] [{flags}]" + echo "Consensus:" + echo " ibft Start Supernets test environment locally with ibft consensus" + echo " polybft Start Supernets test environment locally with polybft consensus" + echo "Commands:" + echo " stop Stop the running environment" + echo " destroy Destroy the running environment" + echo " write-logs Writes STDOUT and STDERR output to log file. Not applicable when using --docker flag." + echo "Flags:" + echo " --docker Run using Docker (requires docker-compose)." + echo " --help Display this help information" + echo "Examples:" + echo " cluster polybft -- Run the script with the polybft consensus" + echo " cluster polybft --docker -- Run the script with the polybft consensus using docker" + echo " cluster polybft stop -- Stop the running environment" +} + +function initIbftConsensus() { + echo "Running with ibft consensus" + ./polygon-edge secrets init --insecure --data-dir test-chain- --num 4 + + node1_id=$(./polygon-edge secrets output --data-dir test-chain-1 | grep Node | head -n 1 | awk -F ' ' '{print $4}') + node2_id=$(./polygon-edge secrets output --data-dir test-chain-2 | grep Node | head -n 1 | awk -F ' ' '{print $4}') + + genesis_params="--consensus ibft --ibft-validators-prefix-path test-chain- \ + --bootnode /ip4/127.0.0.1/tcp/30301/p2p/$node1_id \ + --bootnode /ip4/127.0.0.1/tcp/30302/p2p/$node2_id" +} + +function initPolybftConsensus() { + echo "Running with polybft consensus" + genesis_params="--consensus polybft" + + address1=$(./polygon-edge polybft-secrets --insecure --data-dir test-chain-1 | grep Public | head -n 1 | awk -F ' ' '{print $5}') + address2=$(./polygon-edge polybft-secrets --insecure --data-dir test-chain-2 | grep Public | head -n 1 | awk -F ' ' '{print $5}') + address3=$(./polygon-edge polybft-secrets --insecure --data-dir test-chain-3 | grep Public | head -n 1 | awk -F ' ' '{print $5}') + address4=$(./polygon-edge polybft-secrets --insecure --data-dir test-chain-4 | grep Public | head -n 1 | awk -F ' ' '{print $5}') +} + +function createGenesis() { + ./polygon-edge genesis $genesis_params \ + --block-gas-limit 10000000 \ + --premine 0x85da99c8a7c2c95964c8efd687e95e632fc533d6:1000000000000000000000 \ + --premine 0x0000000000000000000000000000000000000000 \ + --epoch-size 10 \ + --reward-wallet 0xDEADBEEF:1000000 \ + --native-token-config "Polygon:MATIC:18:true:$address1" \ + --burn-contract 0:0x0000000000000000000000000000000000000000 \ + --proxy-contracts-admin 0x5aaeb6053f3e94c9b9a09f33669435e7ef1beaed +} + +function initRootchain() { + echo "Initializing rootchain" + + if [ "$1" == "write-logs" ]; then + echo "Writing rootchain server logs to the file..." + ./polygon-edge rootchain server 2>&1 | tee ./rootchain-server.log & + else + ./polygon-edge rootchain server >/dev/null & + fi + + set +e + while true; do + if curl -sSf -o /dev/null http://127.0.0.1:8545; then + break + fi + sleep 1 + done + set -e + + proxyContractsAdmin=0x5aaeb6053f3e94c9b9a09f33669435e7ef1beaed + + ./polygon-edge polybft stake-manager-deploy \ + --jsonrpc http://127.0.0.1:8545 \ + --proxy-contracts-admin ${proxyContractsAdmin} \ + --test + + stakeManagerAddr=$(cat genesis.json | jq -r '.params.engine.polybft.bridge.stakeManagerAddr') + stakeToken=$(cat genesis.json | jq -r '.params.engine.polybft.bridge.stakeTokenAddr') + + ./polygon-edge rootchain deploy \ + --stake-manager ${stakeManagerAddr} \ + --stake-token ${stakeToken} \ + --proxy-contracts-admin ${proxyContractsAdmin} \ + --test + + customSupernetManagerAddr=$(cat genesis.json | jq -r '.params.engine.polybft.bridge.customSupernetManagerAddr') + supernetID=$(cat genesis.json | jq -r '.params.engine.polybft.supernetID') + + ./polygon-edge rootchain fund \ + --stake-token ${stakeToken} \ + --mint \ + --addresses ${address1},${address2},${address3},${address4} \ + --amounts 1000000000000000000000000,1000000000000000000000000,1000000000000000000000000,1000000000000000000000000 + + ./polygon-edge polybft whitelist-validators \ + --addresses ${address1},${address2},${address3},${address4} \ + --supernet-manager ${customSupernetManagerAddr} \ + --private-key aa75e9a7d427efc732f8e4f1a5b7646adcc61fd5bae40f80d13c8419c9f43d6d \ + --jsonrpc http://127.0.0.1:8545 + + counter=1 + while [ $counter -le 4 ]; do + echo "Registering validator: ${counter}" + + ./polygon-edge polybft register-validator \ + --supernet-manager ${customSupernetManagerAddr} \ + --data-dir test-chain-${counter} \ + --jsonrpc http://127.0.0.1:8545 + + ./polygon-edge polybft stake \ + --data-dir test-chain-${counter} \ + --amount 1000000000000000000000000 \ + --supernet-id ${supernetID} \ + --stake-manager ${stakeManagerAddr} \ + --stake-token ${stakeToken} \ + --jsonrpc http://127.0.0.1:8545 + + ((counter++)) + done + + ./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 +} + +function startServerFromBinary() { + if [ "$1" == "write-logs" ]; then + echo "Writing validators logs to the files..." + ./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json \ + --grpc-address :10000 --libp2p :30301 --jsonrpc :10002 --relayer \ + --num-block-confirmations 2 --seal --log-level DEBUG 2>&1 | tee ./validator-1.log & + ./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json \ + --grpc-address :20000 --libp2p :30302 --jsonrpc :20002 \ + --num-block-confirmations 2 --seal --log-level DEBUG 2>&1 | tee ./validator-2.log & + ./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json \ + --grpc-address :30000 --libp2p :30303 --jsonrpc :30002 \ + --num-block-confirmations 2 --seal --log-level DEBUG 2>&1 | tee ./validator-3.log & + ./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json \ + --grpc-address :40000 --libp2p :30304 --jsonrpc :40002 \ + --num-block-confirmations 2 --seal --log-level DEBUG 2>&1 | tee ./validator-4.log & + wait + else + ./polygon-edge server --data-dir ./test-chain-1 --chain genesis.json \ + --grpc-address :10000 --libp2p :30301 --jsonrpc :10002 --relayer \ + --num-block-confirmations 2 --seal --log-level DEBUG & + ./polygon-edge server --data-dir ./test-chain-2 --chain genesis.json \ + --grpc-address :20000 --libp2p :30302 --jsonrpc :20002 \ + --num-block-confirmations 2 --seal --log-level DEBUG & + ./polygon-edge server --data-dir ./test-chain-3 --chain genesis.json \ + --grpc-address :30000 --libp2p :30303 --jsonrpc :30002 \ + --num-block-confirmations 2 --seal --log-level DEBUG & + ./polygon-edge server --data-dir ./test-chain-4 --chain genesis.json \ + --grpc-address :40000 --libp2p :30304 --jsonrpc :40002 \ + --num-block-confirmations 2 --seal --log-level DEBUG & + wait + fi +} + +function startServerFromDockerCompose() { + if [ "$1" != "polybft" ]; then + export EDGE_CONSENSUS="$1" + fi + + docker-compose -f ./docker/local/docker-compose.yml up -d --build +} + +function destroyDockerEnvironment() { + docker-compose -f ./docker/local/docker-compose.yml down -v +} + +function stopDockerEnvironment() { + docker-compose -f ./docker/local/docker-compose.yml stop +} + +set -e + +# Show help if help flag is entered or no arguments are provided +if [[ "$1" == "--help" ]] || [[ $# -eq 0 ]]; then + showhelp + exit 0 +fi + +# Reset test-dirs +rm -rf test-chain-* +rm -f genesis.json + +# Build binary +go build -o polygon-edge . + +# If --docker flag is set run docker environment otherwise run from binary +case "$2" in +"--docker") + # cluster {consensus} --docker destroy + if [ "$3" == "destroy" ]; then + destroyDockerEnvironment + echo "Docker $1 environment destroyed!" + exit 0 + # cluster {consensus} --docker stop + elif [ "$3" == "stop" ]; then + stopDockerEnvironment + echo "Docker $1 environment stopped!" + exit 0 + fi + + # cluster {consensus} --docker + echo "Running $1 docker environment..." + startServerFromDockerCompose $1 + echo "Docker $1 environment deployed." + exit 0 + ;; +# cluster {consensus} +*) + echo "Running $1 environment from local binary..." + # Initialize ibft or polybft consensus + if [ "$1" == "ibft" ]; then + # Initialize ibft consensus + initIbftConsensus + # Create genesis file and start the server from binary + createGenesis + startServerFromBinary $2 + exit 0 + elif [ "$1" == "polybft" ]; then + # Initialize polybft consensus + initPolybftConsensus + # Create genesis file and start the server from binary + createGenesis + initRootchain $2 + startServerFromBinary $2 + exit 0 + else + echo "Unsupported consensus mode. Supported modes are: ibft and polybft." + showhelp + exit 1 + fi + ;; +esac +``` + +
+
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 0000000000..b6642bd515 --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,119 @@ +site_name: Polygon Edge docs + +theme: + name: material + palette: + scheme: slate + +nav: + - What is Edge: index.md + - Quickstart: quickstart.md + - System design: + - Overview: design/overview.md + - Consensus: + - Consensus protocol: design/consensus/polybft/protocol.md + - Polygon Byzantine Fault Tolerance (PolyBFT): design/consensus/polybft/overview.md + - Istanbul Byzantine Fault Tolerance (IBFT) 2.0: design/consensus/polybft/ibft.md + - Bridge: + - Overview: design/bridge/overview.md + - StateSyncs: design/bridge/statesync.md + - Checkpoints: design/bridge/checkpoint.md + - Assets: + - ERC-20: design/bridge/assets/erc/erc20.md + - ERC-721: design/bridge/assets/erc/erc721.md + - ERC-1155: design/bridge/assets/erc/erc1155.md + - Sequences: design/bridge/sequences.md + - Networking: design/libp2p.md + - Runtime: + - Overview: design/runtime/overview.md + - Access control list: design/runtime/allowlist.md + - Blockchain: design/blockchain.md + - MemoryPool: design/mempool.md + - Transaction pool: design/txpool.md + - Transaction relayer: design/txrelayer.md + - JSON-RPC: design/jsonrpc.md + - GRPC: design/grpc.md + - Build an Edge-powered chain: + - Prepare your environment: + - System requirements: operate/system.md + - Install binaries: operate/install.md + - Deploy a chain: + - Get started: operate/deploy/index.md + - How to spawn a new child chain: operate/deploy/local-chain.md + - How to configure a new child chain: operate/deploy/genesis.md + - How to configure the rootchain: operate/deploy/rootchain-config.md + - How to configure the initial validator set: operate/deploy/genesis-validators.md + - How to start your chain: operate/deploy/start-chain.md + - Operate your chain: + - Access control: + - How to add and remove accounts: operate/deploy/access-control/allowlist-general.md + - Staking: + - How to stake: operate/deploy/staking/stake.md + - How to unstake: operate/deploy/staking/unstake.md + - Transfers: + - How to deposit (rootchain->childchain): operate/deploy/transfers/deposit.md + - How to withdrw (childchain->rootchain): operate/deploy/transfers/withdraw.md + - Upgrade your chain: + - Upgrade using hardfork: operate/deploy/upgrades/hardfork.md + - Edge v1.1 upgrade requirements: operate/deploy/upgrades/v1.1.md + - Reference: + #- Contracts: + # - Checkpoint manager: contracts/checkpoint-manager.md + # - Exit helper: contracts/exit-helper.md + # - Reward pool: contracts/reward-pool.md + # - State receiver: contracts/state-receiver.md + # - State sender: contracts/state-sender.md + # - Validator set: contracts/validator-set.md + # - Withdrawal queue: contracts/withdrawal-queue.md + - Config parameter reference: operate/param-reference.md + - Smart contract interfaces: + - ERC20: + - NativeERC20: interfaces/erc20/native-erc20.md + - ChildERC20Predicate: interfaces/erc20/childerc20-predicate.md + - ChildERC20: interfaces/erc20/childerc20.md + - RootERC20Predicate: interfaces/erc20/rooterc20-predicate.md + - ERC721: + - ChildERC721: interfaces/erc721/childerc721.md + - ChildERC721Predicate: interfaces/erc721/childerc721-predicate.md + - RootERC721Predicate: interfaces/erc721/rooterc721-predicate.md + - ERC1155: + - ChildERC1155: interfaces/erc1155/childerc1155.md + - ChildERC1155Predicate: interfaces/erc1155/childerc1155-predicate.md + - RootERC1155Predicate: interfaces/erc1155/rooterc1155-predicate.md + - EIP1559Burn: interfaces/eip1559.md + - Network: + - CheckpointManager: interfaces/network/checkpoint-manager.md + - ExitHelper: interfaces/network/exit-helper.md + - StateReceiver: interfaces/network/state-receiver.md + - StateSender: interfaces/network/state-sender.md + - Validators: + - ValidatorSetBase: interfaces/validators/validator-set-base.md + - Staking: + - StakeManager: interfaces/staking/stake-manager.md + - SupernetManager: interfaces/staking/supernet-manager.md + - CustomSupernetManager: interfaces/staking/custom-supernet-manager.md + - Cryptography: + - BLS: interfaces/cryptography/bls.md + - BN256G2: interfaces/cryptography/bn256g2.md + - RPC APIs: + - Ethereum: api/json-rpc-eth.md + - Net: api/json-rpc-net.md + - Web3: api/json-rpc-web3.md + - TxPool: api/json-rpc-txpool.md + - Debug: api/json-rpc-debug.md + - Bridge: api/json-rpc-bridge.md + - Performance benchmarks: operate/benchmarks.md + - Disclaimer: disclaimer.md + + + + +markdown_extensions: + - admonition + - pymdownx.details + - pymdownx.superfences + - pymdownx.tabbed + + +validation: + absolute_links: warn \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100755 index 0000000000..8610e1ce91 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,4 @@ +mkdocs-material==9.4.8 +markdown-include==0.8.1 +mkdocs-git-revision-date-localized-plugin==1.2.1 +mkdocs-open-in-new-tab==1.0.3 diff --git a/docs/run.sh b/docs/run.sh new file mode 100755 index 0000000000..2d247d0d53 --- /dev/null +++ b/docs/run.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail + +virtualenv venv +source venv/bin/activate +pip3 install -r requirements.txt +mkdocs serve --strict +