diff --git a/package.json b/package.json index f7e0385d..be989c03 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@0xpolygonhermez/zkevm-commonjs", "description": "Javascript library implementing common utilities for zkevm", - "version": "0.4.0.1", + "version": "0.6.0.0", "main": "index.js", "scripts": { "setup": "npm i", @@ -34,7 +34,7 @@ }, "homepage": "https://github.com/0xPolygonHermez/zkevm-commonjs#readme", "devDependencies": { - "@0xpolygonhermez/contracts-zkevm": "github:0xPolygonHermez/zkevm-contracts#v0.0.7", + "@0xpolygonhermez/zkevm-contracts": "github:0xPolygonHermez/zkevm-contracts#v0.6.0.0", "@ethersproject/abi": "^5.6.4", "@nomiclabs/hardhat-ethers": "^2.1.0", "@nomiclabs/hardhat-waffle": "^2.0.2", @@ -48,12 +48,12 @@ }, "dependencies": { "@ethereumjs/block": "^3.6.2", - "@ethereumjs/common": "^2.6.0", "@ethereumjs/tx": "^3.4.0", - "@polygon-hermez/vm": "5.7.22", + "@polygon-hermez/common": "2.6.4", + "@polygon-hermez/vm": "5.7.28", "ethereumjs-util": "^7.1.4", "ethers": "^5.5.4", - "ffjavascript": "^0.2.46", + "ffjavascript": "^0.2.55", "lodash": "^4.17.21" } } diff --git a/src/constants.js b/src/constants.js index 7b527433..72bb83af 100644 --- a/src/constants.js +++ b/src/constants.js @@ -4,10 +4,12 @@ const { Scalar } = require('ffjavascript'); // Database keys module.exports.DB_LAST_BATCH = ethers.utils.id(('ZKEVM_DB_LAST_BATCH')); module.exports.DB_STATE_ROOT = ethers.utils.id(('ZKEVM_DB_STATE_ROOT')); -module.exports.DB_LOCAL_EXIT_ROOT = ethers.utils.id(('ZKEVM_DB_DB_LOCAL_EXIT_ROOT')); +module.exports.DB_ACC_INPUT_HASH = ethers.utils.id(('ZKEVM_DB_ACC_INPUT_HASH')); +module.exports.DB_LOCAL_EXIT_ROOT = ethers.utils.id(('ZKEVM_DB_LOCAL_EXIT_ROOT')); module.exports.DB_GLOBAL_EXIT_ROOT = ethers.utils.id(('ZKEVM_DB_GLOBAL_EXIT_ROOT')); module.exports.DB_ADDRESS_STORAGE = ethers.utils.id(('ZKEVM_DB_ADDRESS_STORAGE')); module.exports.DB_TOUCHED_ACCOUNTS = ethers.utils.id(('ZKEVM_DB_TOUCHED_ACCOUNTS')); +module.exports.DB_STARK_INPUT = ethers.utils.id(('ZKEVM_DB_STARK_INPUT')); // Default values and global constants module.exports.DEFAULT_MAX_TX = 1000; @@ -35,5 +37,10 @@ module.exports.GLOBAL_EXIT_ROOT_STORAGE_POS = 0; module.exports.LOCAL_EXIT_ROOT_STORAGE_POS = 1; module.exports.BATCH_GAS_LIMIT = 30000000; module.exports.BATCH_DIFFICULTY = 0; -module.exports.ADDRESS_SYSTEM = '0x0000000000000000000000000000000000000000'; -module.exports.STATE_ROOT_STORAGE_POS = 0; +module.exports.ADDRESS_SYSTEM = '0x000000000000000000000000000000005ca1ab1e'; +module.exports.STATE_ROOT_STORAGE_POS = 1; +module.exports.LAST_TX_STORAGE_POS = 0; + +// Bridge Leaf Types +module.exports.BRIDGE_LEAF_TYPE_ASSET = 0; +module.exports.BRIDGE_LEAF_TYPE_MESSAGE = 1; diff --git a/src/contract-utils.js b/src/contract-utils.js index 84aeb200..6be1edf6 100644 --- a/src/contract-utils.js +++ b/src/contract-utils.js @@ -1,47 +1,33 @@ const ethers = require('ethers'); const { Scalar } = require('ffjavascript'); const { sha256Snark, padZeros } = require('./utils'); -const { string2fea } = require('./smt-utils'); -const getPoseidon = require('./poseidon'); /** - * Compute globalHash for STARK circuit - * @param {String} currentStateRoot - Current state Root - * @param {String} currentLocalExitRoot - Current local exit root - * @param {String} newStateRoot - New State root once the batch is processed - * @param {String} newLocalExitRoot - New local exit root once the batch is processed + * Compute accumulateInputHash = Keccak256(oldAccInputHash, batchHashData, globalExitRoot, timestamp, seqAddress) + * @param {String} oldAccInputHash - old accumulateInputHash * @param {String} batchHashData - Batch hash data - * @param {Number} numBatch - Batch number + * @param {String} globalExitRoot - Global Exit Root * @param {Number} timestamp - Block timestamp - * @param {Number} chainID - L2 chainID - * @returns {String} - global hash in hex encoding + * @param {String} sequencerAddress - Sequencer address + * @returns {String} - accumulateInputHash in hex encoding */ -function calculateStarkInput( - currentStateRoot, - currentLocalExitRoot, - newStateRoot, - newLocalExitRoot, +function calculateAccInputHash( + oldAccInputHash, batchHashData, - numBatch, + globalExitRoot, timestamp, - chainID, + sequencerAddress, ) { - const currentStateRootHex = `0x${Scalar.e(currentStateRoot).toString(16).padStart(64, '0')}`; - const currentLocalExitRootHex = `0x${Scalar.e(currentLocalExitRoot).toString(16).padStart(64, '0')}`; - const newStateRootHex = `0x${Scalar.e(newStateRoot).toString(16).padStart(64, '0')}`; - const newLocalExitRootHex = `0x${Scalar.e(newLocalExitRoot).toString(16).padStart(64, '0')}`; + const oldAccInputHashHex = `0x${Scalar.e(oldAccInputHash).toString(16).padStart(64, '0')}`; const hashKeccak = ethers.utils.solidityKeccak256( - ['bytes32', 'bytes32', 'bytes32', 'bytes32', 'bytes32', 'uint64', 'uint64', 'uint64'], + ['bytes32', 'bytes32', 'bytes32', 'uint64', 'address'], [ - currentStateRootHex, - currentLocalExitRootHex, - newStateRootHex, - newLocalExitRootHex, + oldAccInputHashHex, batchHashData, - numBatch, + globalExitRoot, timestamp, - chainID, + sequencerAddress, ], ); @@ -49,55 +35,66 @@ function calculateStarkInput( } /** - * Compute input for SNARK circuit - * @param {String} currentStateRoot - Current state Root - * @param {String} currentLocalExitRoot - Current local exit root + * Compute input for SNARK circuit: sha256(aggrAddress, oldStateRoot, oldAccInputHash, oldNumBatch, chainID, newStateRoot, newAccInputHash, newLocalExitRoot, newNumBatch) % FrSNARK + * @param {String} oldStateRoot - Current state Root * @param {String} newStateRoot - New State root once the batch is processed - * @param {String} newLocalExitRoot - New local exit root once the batch is processed - * @param {String} batchHashData - Batch hash data - * @param {Number} numBatch - Batch number - * @param {Number} timestamp - Block timestamp + * @param {String} oldAccInputHash - initial accumulateInputHash + * @param {String} newAccInputHash - final accumulateInputHash + * @param {String} newLocalExitRoot - New local exit root once the all batches is processed + * @param {Number} oldNumBatch - initial batch number + * @param {Number} newNumBatch - final batch number * @param {Number} chainID - L2 chainID * @param {String} aggregatorAddress - Aggregator Ethereum address in hex string - * @returns {String} - sha256(globalHash, aggregatorAddress) % FrSNARK in hex encoding + * @returns {String} - input snark in hex encoding */ async function calculateSnarkInput( - currentStateRoot, - currentLocalExitRoot, + oldStateRoot, newStateRoot, newLocalExitRoot, - batchHashData, - numBatch, - timestamp, + oldAccInputHash, + newAccInputHash, + oldNumBatch, + newNumBatch, chainID, aggregatorAddress, ) { - const poseidon = await getPoseidon(); - const { F } = poseidon; - - const hashKeccak = calculateStarkInput( - currentStateRoot, - currentLocalExitRoot, - newStateRoot, - newLocalExitRoot, - batchHashData, - numBatch, - timestamp, - chainID, - ); - - // 20 bytes agggregator adsress + // 20 bytes agggregator address const strAggregatorAddress = padZeros((Scalar.fromString(aggregatorAddress, 16)).toString(16), 40); - // 8 bytes each field element - const feaHashKeccak = string2fea(F, hashKeccak); - const strFea = feaHashKeccak.reduce( - (previousValue, currentValue) => previousValue + padZeros(currentValue.toString(16), 16), - '', - ); + // 32 bytes each field element for oldStateRoot + const strOldStateRoot = padZeros((Scalar.fromString(oldStateRoot, 16)).toString(16), 64); + + // 32 bytes each field element for oldStateRoot + const strOldAccInputHash = padZeros((Scalar.fromString(oldAccInputHash, 16)).toString(16), 64); + + // 8 bytes for oldNumBatch + const strOldNumBatch = padZeros(Scalar.e(oldNumBatch).toString(16), 16); + + // 8 bytes for chainID + const strChainID = padZeros(Scalar.e(chainID).toString(16), 16); + + // 32 bytes each field element for oldStateRoot + const strNewStateRoot = padZeros((Scalar.fromString(newStateRoot, 16)).toString(16), 64); + + // 32 bytes each field element for oldStateRoot + const strNewAccInputHash = padZeros((Scalar.fromString(newAccInputHash, 16)).toString(16), 64); + + // 32 bytes each field element for oldStateRoot + const strNewLocalExitRoot = padZeros((Scalar.fromString(newLocalExitRoot, 16)).toString(16), 64); + + // 8 bytes for newNumBatch + const strNewNumBatch = padZeros(Scalar.e(newNumBatch).toString(16), 16); // build final bytes sha256 - const finalStr = strAggregatorAddress.concat(strFea); + const finalStr = strAggregatorAddress + .concat(strOldStateRoot) + .concat(strOldAccInputHash) + .concat(strOldNumBatch) + .concat(strChainID) + .concat(strNewStateRoot) + .concat(strNewAccInputHash) + .concat(strNewLocalExitRoot) + .concat(strNewNumBatch); return sha256Snark(finalStr); } @@ -105,23 +102,15 @@ async function calculateSnarkInput( /** * Batch hash data * @param {String} transactions - All raw transaction data concatenated - * @param {String} globalExitRoot - Global Exit Root - * @param {String} sequencerAddress - Sequencer address * @returns {String} - Batch hash data */ function calculateBatchHashData( transactions, - globalExitRoot, - sequencerAddress, ) { - const globalExitRootHex = `0x${Scalar.e(globalExitRoot).toString(16).padStart(64, '0')}`; - return ethers.utils.solidityKeccak256( - ['bytes', 'bytes32', 'address'], + ['bytes'], [ transactions, - globalExitRootHex, - sequencerAddress, ], ); } @@ -160,7 +149,7 @@ function generateSolidityInputs( } module.exports = { - calculateStarkInput, + calculateAccInputHash, calculateSnarkInput, calculateBatchHashData, generateSolidityInputs, diff --git a/src/mt-bridge-utils.js b/src/mt-bridge-utils.js index 6060102b..70618095 100644 --- a/src/mt-bridge-utils.js +++ b/src/mt-bridge-utils.js @@ -38,16 +38,17 @@ function verifyMerkleProof(leaf, smtProof, index, root) { /** * Calculate leaf value + * @param {Number} leafType - Leaf Type * @param {Number} originNetwork - Original network - * @param {String} originTokenAddress - Token address + * @param {String} originAddress - Token address * @param {Number} destinationNetwork - Destination network * @param {String} destinationAddress - Destination address * @param {BigNumber} amount - Amount of tokens * @param {BigNumber} metadataHash - Hash of the metadata * @returns {Boolean} - Leaf value */ -function getLeafValue(originNetwork, originTokenAddress, destinationNetwork, destinationAddress, amount, metadataHash) { - return ethers.utils.solidityKeccak256(['uint32', 'address', 'uint32', 'address', 'uint256', 'bytes32'], [originNetwork, originTokenAddress, destinationNetwork, destinationAddress, amount, metadataHash]); +function getLeafValue(leafType, originNetwork, originAddress, destinationNetwork, destinationAddress, amount, metadataHash) { + return ethers.utils.solidityKeccak256(['uint8', 'uint32', 'address', 'uint32', 'address', 'uint256', 'bytes32'], [leafType, originNetwork, originAddress, destinationNetwork, destinationAddress, amount, metadataHash]); } module.exports = { diff --git a/src/processor-utils.js b/src/processor-utils.js index 2d090497..9192bc6a 100644 --- a/src/processor-utils.js +++ b/src/processor-utils.js @@ -239,15 +239,18 @@ function decodeCustomRawTxProverMethod(encodedTransactions) { offset += decodedData.consumed; txDecoded.data = decodedData.result; - // chainID READ - const decodedChainID = decodeNextShortStringRLP(encodedTxBytes, offset); - offset += decodedChainID.consumed; - txDecoded.chainID = decodedChainID.result; + // Don't decode chainId if tx is legacy + if (txListLength + headerLength !== offset) { + // chainID READ + const decodedChainID = decodeNextShortStringRLP(encodedTxBytes, offset); + offset += decodedChainID.consumed; + txDecoded.chainID = decodedChainID.result; - if ((encodedTxBytes[offset] !== 0x80) || encodedTxBytes[offset + 1] !== 0x80) { - throw new Error('The last 2 values should be 0x8080'); + if ((encodedTxBytes[offset] !== 0x80) || encodedTxBytes[offset + 1] !== 0x80) { + throw new Error('The last 2 values should be 0x8080'); + } + offset += 2; } - offset += 2; if (txListLength + headerLength !== offset) { throw new Error('Invalid list length'); diff --git a/src/processor.js b/src/processor.js index 2dc3e500..3ef4ff5c 100644 --- a/src/processor.js +++ b/src/processor.js @@ -15,39 +15,43 @@ const stateUtils = require('./state-utils'); const smtUtils = require('./smt-utils'); const { getCurrentDB } = require('./smt-utils'); -const { calculateStarkInput, calculateSnarkInput, calculateBatchHashData } = require('./contract-utils'); +const { calculateAccInputHash, calculateSnarkInput, calculateBatchHashData } = require('./contract-utils'); const { decodeCustomRawTxProverMethod } = require('./processor-utils'); module.exports = class Processor { /** * constructor Processor class * @param {Object} db - database - * @param {Number} batchNumber - batch number + * @param {Number} numBatch - batch number * @param {Object} poseidon - hash function * @param {Number} maxNTx - maximum number of transaction allowed * @param {Array[Field]} root - state root * @param {String} sequencerAddress . sequencer address - * @param {Array[Field]} localExitRoot - local exit root + * @param {Array[Field]} accInputHash - accumulate input hash * @param {Array[Field]} globalExitRoot - global exit root * @param {Number} timestamp - Timestamp of the batch * @param {Number} chainID - L2 chainID * @param {Object} vm - vm instance + * @param {Object} options - batch options + * @param {Bool} options.skipUpdateSystemStorage Skips updates on system smrt contract at the end of processable transactions */ constructor( db, - batchNumber, + numBatch, poseidon, maxNTx, root, sequencerAddress, - localExitRoot, + accInputHash, globalExitRoot, timestamp, chainID, vm, + options, ) { this.db = db; - this.batchNumber = batchNumber; + this.newNumBatch = numBatch; + this.oldNumBatch = numBatch - 1; this.poseidon = poseidon; this.maxNTx = maxNTx; this.F = poseidon.F; @@ -61,8 +65,7 @@ module.exports = class Processor { this.contractsBytecode = {}; this.oldStateRoot = root; this.currentStateRoot = root; - this.oldLocalExitRoot = localExitRoot; - this.newLocalExitRoot = localExitRoot; + this.oldAccInputHash = accInputHash; this.globalExitRoot = globalExitRoot; this.batchHashData = '0x'; @@ -75,6 +78,8 @@ module.exports = class Processor { this.vm = vm; this.evmSteps = []; this.updatedAccounts = {}; + this.isLegacyTx = false; + this.options = options; } /** @@ -98,9 +103,6 @@ module.exports = class Processor { // Check the validity of rawTxs await this._decodeAndCheckRawTx(); - // Set oldStateRoot to system contract - await this._setBatchHash(); - // Set global exit root await this._setGlobalExitRoot(); @@ -147,10 +149,11 @@ module.exports = class Processor { continue; } txDecoded.from = undefined; - txDecoded.chainID = Number(txDecoded.chainID); - // B: Valid chainID - if (txDecoded.chainID !== this.chainID) { + // B: Valid chainID if EIP-155 + this.isLegacyTx = typeof txDecoded.chainID === 'undefined'; + txDecoded.chainID = this.isLegacyTx ? txDecoded.chainID : Number(txDecoded.chainID); + if (!this.isLegacyTx && txDecoded.chainID !== this.chainID) { this.decodedTxs.push({ isInvalid: true, reason: 'TX INVALID: Chain ID does not match', tx: txDecoded }); continue; } @@ -184,54 +187,36 @@ module.exports = class Processor { } /** - * Set the old state root exit root in a specific storage slot of the system smart contract for both vm and SMT + * Set the global exit root in a specific storage slot of the globalExitRootManagerL2 for both vm and SMT + * Not store global exit root if it is zero + * Not overwrite storage position if timestamp is already set * This will be performed before process the transactions */ - async _setBatchHash() { - const newStorageEntry = {}; - const stateRootPos = ethers.utils.solidityKeccak256(['uint256', 'uint256'], [this.batchNumber - 1, Constants.STATE_ROOT_STORAGE_POS]); - newStorageEntry[stateRootPos] = smtUtils.h4toString(this.oldStateRoot); + async _setGlobalExitRoot() { + // return if globalExitRoot is 0 + if (Scalar.eq(smtUtils.h4toScalar(this.globalExitRoot), Scalar.e(0))) { + return; + } - this.currentStateRoot = await stateUtils.setContractStorage( - Constants.ADDRESS_SYSTEM, + // check if timestamp is already set + const globalExitRootPos = ethers.utils.solidityKeccak256(['uint256', 'uint256'], [smtUtils.h4toString(this.globalExitRoot), Constants.GLOBAL_EXIT_ROOT_STORAGE_POS]); + const globalExitRootPosScalar = Scalar.e(globalExitRootPos).toString(); + + const resTimestamp = await stateUtils.getContractStorage( + Constants.ADDRESS_GLOBAL_EXIT_ROOT_MANAGER_L2, this.smt, this.currentStateRoot, - newStorageEntry, + [globalExitRootPos], ); - const addressInstance = new Address(toBuffer(Constants.ADDRESS_SYSTEM)); - await this.vm.stateManager.putContractStorage( - addressInstance, - toBuffer(stateRootPos), - toBuffer(smtUtils.h4toString(this.oldStateRoot)), - ); - - // store data in internal DB - const keyDumpStorage = Scalar.add(Constants.DB_ADDRESS_STORAGE, Scalar.fromString(Constants.ADDRESS_SYSTEM, 16)); - - // add address to updatedAccounts - const account = await this.vm.stateManager.getAccount(addressInstance); - this.updatedAccounts[Constants.ADDRESS_SYSTEM.toLowerCase()] = account; - - // update its storage - const sto = await this.vm.stateManager.dumpStorage(addressInstance); - const storage = {}; - const keys = Object.keys(sto).map((v) => `0x${v}`); - const values = Object.values(sto).map((v) => `0x${v}`); - for (let k = 0; k < keys.length; k++) { - storage[keys[k]] = ethers.utils.RLP.decode(values[k]); + if (Scalar.neq(resTimestamp[globalExitRootPosScalar], Scalar.e(0))) { + return; } - await this.db.setValue(keyDumpStorage, storage); - } - /** - * Set the global exit root in a specific storage slot of the globalExitRootManagerL2 for both vm and SMT - * This will be performed before process the transactions - */ - async _setGlobalExitRoot() { + // Set globalExitRoot - timestamp const newStorageEntry = {}; - const globalExitRootPos = ethers.utils.solidityKeccak256(['uint256', 'uint256'], [smtUtils.h4toString(this.globalExitRoot), Constants.GLOBAL_EXIT_ROOT_STORAGE_POS]); - newStorageEntry[globalExitRootPos] = this.batchNumber; + newStorageEntry[globalExitRootPos] = this.timestamp; + this.currentStateRoot = await stateUtils.setContractStorage( Constants.ADDRESS_GLOBAL_EXIT_ROOT_MANAGER_L2, this.smt, @@ -243,7 +228,7 @@ module.exports = class Processor { await this.vm.stateManager.putContractStorage( addressInstance, toBuffer(globalExitRootPos), - toBuffer(this.batchNumber), + toBuffer(this.timestamp), ); // store data in internal DB @@ -327,6 +312,14 @@ module.exports = class Processor { currentDecodedTx.reason = 'TX INVALID: Not enough funds to pay total transaction cost'; continue; } + const v = this.isLegacyTx ? currenTx.v : Number(currenTx.v) - 27 + currenTx.chainID * 2 + 35; + + const bytecodeLength = await stateUtils.getContractBytecodeLength(currenTx.from, this.smt, this.currentStateRoot); + if (bytecodeLength > 0) { + currentDecodedTx.isInvalid = true; + currentDecodedTx.reason = 'TX INVALID: EIP3607 Do not allow transactions for which tx.sender has any code deployed'; + continue; + } // Run tx in the EVM const evmTx = Transaction.fromTxData({ @@ -336,7 +329,7 @@ module.exports = class Processor { to: currenTx.to, value: currenTx.value, data: currenTx.data, - v: Number(currenTx.v) - 27 + currenTx.chainID * 2 + 35, + v, r: currenTx.r, s: currenTx.s, }); @@ -345,64 +338,74 @@ module.exports = class Processor { const blockData = {}; blockData.header = {}; blockData.header.timestamp = new BN(Scalar.e(this.timestamp)); - blockData.header.number = new BN(Scalar.e(this.batchNumber)); blockData.header.coinbase = new Address(toBuffer(this.sequencerAddress)); blockData.header.gasLimit = new BN(Scalar.e(Constants.BATCH_GAS_LIMIT)); blockData.header.difficulty = new BN(Scalar.e(Constants.BATCH_DIFFICULTY)); const evmBlock = Block.fromBlockData(blockData, { common: evmTx.common }); - const txResult = await this.vm.runTx({ tx: evmTx, block: evmBlock }); + try { + const txResult = await this.vm.runTx({ tx: evmTx, block: evmBlock }); + + this.evmSteps.push(txResult.execResult.evmSteps); + + // Check transaction completed + if (txResult.execResult.exceptionError) { + currentDecodedTx.isInvalid = true; + if (txResult.execResult.returnValue.toString()) { + const abiCoder = ethers.utils.defaultAbiCoder; + const revertReasonHex = `0x${txResult.execResult.returnValue.toString('hex').slice(8)}`; + try { + [currentDecodedTx.reason] = abiCoder.decode(['string'], revertReasonHex); + } catch (e) { + currentDecodedTx.reason = txResult.execResult.exceptionError; + } + } else currentDecodedTx.reason = txResult.execResult.exceptionError; + + // UPDATE sender account adding the nonce and substracting the gas spended + const senderAcc = await this.vm.stateManager.getAccount(Address.fromString(currenTx.from)); + this.updatedAccounts[currenTx.from] = senderAcc; + // Update smt with touched accounts + this.currentStateRoot = await stateUtils.setAccountState( + currenTx.from, + this.smt, + this.currentStateRoot, + Scalar.e(senderAcc.balance), + Scalar.e(senderAcc.nonce), + ); - this.evmSteps.push(txResult.execResult.evmSteps); + /* + * UPDATE miner Acc + * Get touched evm account + */ + const addressSeq = Address.fromString(this.sequencerAddress); + const accountSeq = await this.vm.stateManager.getAccount(addressSeq); - // Check transaction completed - if (txResult.execResult.exceptionError) { - currentDecodedTx.isInvalid = true; - if (txResult.execResult.returnValue.toString()) { - const abiCoder = ethers.utils.defaultAbiCoder; - const revertReasonHex = `0x${txResult.execResult.returnValue.toString('hex').slice(8)}`; - try { - [currentDecodedTx.reason] = abiCoder.decode(['string'], revertReasonHex); - } catch (e) { - currentDecodedTx.reason = txResult.execResult.exceptionError; - } - } else currentDecodedTx.reason = txResult.execResult.exceptionError; + // Update batch touched stack + this.updatedAccounts[this.sequencerAddress] = accountSeq; - // UPDATE sender account adding the nonce and substracting the gas spended - const senderAcc = await this.vm.stateManager.getAccount(txResult.execResult.runState.caller); - this.updatedAccounts[currenTx.from] = senderAcc; - // Update smt with touched accounts - this.currentStateRoot = await stateUtils.setAccountState( - currenTx.from, - this.smt, - this.currentStateRoot, - Scalar.e(senderAcc.balance), - Scalar.e(senderAcc.nonce), - ); + // Update smt with touched accounts + this.currentStateRoot = await stateUtils.setAccountState( + this.sequencerAddress, + this.smt, + this.currentStateRoot, + Scalar.e(accountSeq.balance), + Scalar.e(accountSeq.nonce), + ); - /* - * UPDATE miner Acc - * Get touched evm account - */ - const addressSeq = Address.fromString(this.sequencerAddress); - const accountSeq = await this.vm.stateManager.getAccount(addressSeq); + await this._updateSystemStorage(); - // Update batch touched stack - this.updatedAccounts[this.sequencerAddress] = accountSeq; + // Clear touched accounts + this.vm.stateManager._customTouched.clear(); - // Update smt with touched accounts - this.currentStateRoot = await stateUtils.setAccountState( - this.sequencerAddress, - this.smt, - this.currentStateRoot, - Scalar.e(accountSeq.balance), - Scalar.e(accountSeq.nonce), - ); - - // Clear touched accounts - this.vm.stateManager._customTouched.clear(); - - continue; + continue; + } + } catch (e) { + // If base fee exceeds the gas limit, it is an instrisic error and the state will not be affected + if (e.toString().includes('base fee exceeds gas limit')) { + continue; + } else { + throw Error(e); + } } // PROCESS TX in the smt updating the touched accounts from the EVM @@ -447,8 +450,8 @@ module.exports = class Processor { const sto = await this.vm.stateManager.dumpStorage(addressInstance); const storage = {}; - const keys = Object.keys(sto).map((v) => `0x${v}`); - const values = Object.values(sto).map((v) => `0x${v}`); + const keys = Object.keys(sto).map((k) => `0x${k}`); + const values = Object.values(sto).map((k) => `0x${k}`); for (let k = 0; k < keys.length; k++) { storage[keys[k]] = ethers.utils.RLP.decode(values[k]); } @@ -466,13 +469,12 @@ module.exports = class Processor { ); await this.db.setValue(keyDumpStorage, storage); } else { - // handle self-destruct const sto = await this.vm.stateManager.dumpStorage(addressInstance); if (Object.keys(sto).length > 0) { const keyDumpStorage = Scalar.add(Constants.DB_ADDRESS_STORAGE, Scalar.fromString(address, 16)); const storage = {}; - const keys = Object.keys(sto).map((v) => `0x${v}`); - const values = Object.values(sto).map((v) => `0x${v}`); + const keys = Object.keys(sto).map((k) => `0x${k}`); + const values = Object.values(sto).map((k) => `0x${k}`); for (let k = 0; k < keys.length; k++) { storage[keys[k]] = ethers.utils.RLP.decode(values[k]); } @@ -484,28 +486,82 @@ module.exports = class Processor { ); await this.db.setValue(keyDumpStorage, storage); } - - const oldHashBytecode = await stateUtils.getContractHashBytecode(address, this.smt, this.currentStateRoot); - - if (oldHashBytecode !== Constants.BYTECODE_EMPTY) { - // delete leaf bytecode - this.currentStateRoot = await stateUtils.setContractBytecode( - address, - this.smt, - this.currentStateRoot, - '0x', - true, - ); - } } } + await this._updateSystemStorage(); + // Clear touched accounts this.vm.stateManager._customTouched.clear(); } } } + /** + * Updates system storage with new state root after finishing transaction + */ + async _updateSystemStorage() { + if (this.options.skipUpdateSystemStorage) return; + + // Set system addres storage with updated values + const lastTxCount = await stateUtils.getContractStorage( + Constants.ADDRESS_SYSTEM, + this.smt, + this.currentStateRoot, + [Constants.LAST_TX_STORAGE_POS], // Storage key of last tx count + ); + const newTxCount = Number(Scalar.add(lastTxCount[Constants.LAST_TX_STORAGE_POS], 1n)); + // Update smt with new last tx count + this.currentStateRoot = await stateUtils.setContractStorage( + Constants.ADDRESS_SYSTEM, + this.smt, + this.currentStateRoot, + { [Constants.LAST_TX_STORAGE_POS]: newTxCount }, + ); + // Update vm with new last tx count + const addressInstance = new Address(toBuffer(Constants.ADDRESS_SYSTEM)); + + await this.vm.stateManager.putContractStorage( + addressInstance, + toBuffer(`0x${Constants.LAST_TX_STORAGE_POS.toString(16).padStart(64, '0')}`), + toBuffer(Number(newTxCount)), + ); + + // Update smt with new state root + const stateRootPos = ethers.utils.solidityKeccak256(['uint256', 'uint256'], [newTxCount, Constants.STATE_ROOT_STORAGE_POS]); + const tmpStateRoot = smtUtils.h4toString(this.currentStateRoot); + this.currentStateRoot = await stateUtils.setContractStorage( + Constants.ADDRESS_SYSTEM, + this.smt, + this.currentStateRoot, + { [stateRootPos]: smtUtils.h4toString(this.currentStateRoot) }, + ); + + // Update vm with new state root + await this.vm.stateManager.putContractStorage( + addressInstance, + toBuffer(stateRootPos), + toBuffer(tmpStateRoot), + ); + + // store data in internal DB + const keyDumpStorage = Scalar.add(Constants.DB_ADDRESS_STORAGE, Scalar.fromString(Constants.ADDRESS_SYSTEM, 16)); + + // add address to updatedAccounts + const account = await this.vm.stateManager.getAccount(addressInstance); + this.updatedAccounts[Constants.ADDRESS_SYSTEM.toLowerCase()] = account; + + // update its storage + const sto = await this.vm.stateManager.dumpStorage(addressInstance); + const storage = {}; + const keys = Object.keys(sto).map((k) => `0x${k}`); + const values = Object.values(sto).map((k) => `0x${k}`); + for (let k = 0; k < keys.length; k++) { + storage[keys[k]] = ethers.utils.RLP.decode(values[k]); + } + await this.db.setValue(keyDumpStorage, storage); + } + /** * Compute stark input */ @@ -513,42 +569,40 @@ module.exports = class Processor { // compute circuit inputs const oldStateRoot = smtUtils.h4toString(this.oldStateRoot); const newStateRoot = smtUtils.h4toString(this.currentStateRoot); - const oldLocalExitRoot = smtUtils.h4toString(this.oldLocalExitRoot); + const oldAccInputHash = smtUtils.h4toString(this.oldAccInputHash); const newLocalExitRoot = smtUtils.h4toString(this.newLocalExitRoot); const globalExitRoot = smtUtils.h4toString(this.globalExitRoot); this.batchHashData = calculateBatchHashData( this.getBatchL2Data(), - globalExitRoot, - this.sequencerAddress, ); - this.inputHash = calculateStarkInput( - oldStateRoot, - oldLocalExitRoot, - newStateRoot, - newLocalExitRoot, + const newAccInputHash = calculateAccInputHash( + oldAccInputHash, this.batchHashData, - this.batchNumber, + globalExitRoot, this.timestamp, - this.chainID, + this.sequencerAddress, ); + this.newAccInputHash = smtUtils.stringToH4(newAccInputHash); + this.starkInput = { oldStateRoot, - db: await getCurrentDB(this.oldStateRoot, this.db, this.F), - sequencerAddr: this.sequencerAddress, + newStateRoot, // output + oldAccInputHash, + newAccInputHash, // output + newLocalExitRoot, // output + oldNumBatch: this.oldNumBatch, + newNumBatch: this.newNumBatch, // output + chainID: this.chainID, batchL2Data: this.getBatchL2Data(), - newStateRoot, - oldLocalExitRoot, - newLocalExitRoot, globalExitRoot, - batchHashData: this.batchHashData, - inputHash: this.inputHash, - numBatch: this.batchNumber, timestamp: this.timestamp, - chainID: this.chainID, + sequencerAddr: this.sequencerAddress, + batchHashData: this.batchHashData, // sanity check contractsBytecode: this.contractsBytecode, + db: await getCurrentDB(this.oldStateRoot, this.db, this.F), }; } @@ -561,17 +615,18 @@ module.exports = class Processor { // compute circuit inputs const oldStateRoot = smtUtils.h4toString(this.oldStateRoot); const newStateRoot = smtUtils.h4toString(this.currentStateRoot); - const oldLocalExitRoot = smtUtils.h4toString(this.oldLocalExitRoot); + const oldAccInputHash = smtUtils.h4toString(this.oldAccInputHash); + const newAccInputHash = smtUtils.h4toString(this.newAccInputHash); const newLocalExitRoot = smtUtils.h4toString(this.newLocalExitRoot); return calculateSnarkInput( oldStateRoot, - oldLocalExitRoot, newStateRoot, + oldAccInputHash, + newAccInputHash, newLocalExitRoot, - this.batchHashData, - this.batchNumber, - this.timestamp, + this.oldNumBatch, + this.newNumBatch, this.chainID, aggregatorAddress, ); diff --git a/src/state-utils.js b/src/state-utils.js index 9af67d18..b17390a6 100644 --- a/src/state-utils.js +++ b/src/state-utils.js @@ -86,23 +86,16 @@ async function getContractBytecodeLength(ethAddr, smt, root) { * @param {Bool} flagDelete flag to set bytecode to 0 * @returns {Array[Field]} new state root */ -async function setContractBytecode(ethAddr, smt, root, bytecode, flagDelete) { +async function setContractBytecode(ethAddr, smt, root, bytecode) { const keyContractCode = await smtUtils.keyContractCode(ethAddr); const keyContractLength = await smtUtils.keyContractLength(ethAddr); - let res; - - if (flagDelete === true) { - res = await smt.set(root, keyContractCode, Scalar.e(0)); - res = await smt.set(res.newRoot, keyContractLength, Scalar.e(0)); - } else { - const hashByteCode = await smtUtils.hashContractBytecode(bytecode); - let parsedBytecode = bytecode.startsWith('0x') ? bytecode.slice(2) : bytecode.slice(); - parsedBytecode = (parsedBytecode.length % 2) ? `0${parsedBytecode}` : parsedBytecode; - const bytecodeLength = parsedBytecode.length / 2; - res = await smt.set(root, keyContractCode, Scalar.fromString(hashByteCode, 16)); - res = await smt.set(res.newRoot, keyContractLength, bytecodeLength); - } + const hashByteCode = await smtUtils.hashContractBytecode(bytecode); + let parsedBytecode = bytecode.startsWith('0x') ? bytecode.slice(2) : bytecode.slice(); + parsedBytecode = (parsedBytecode.length % 2) ? `0${parsedBytecode}` : parsedBytecode; + const bytecodeLength = parsedBytecode.length / 2; + let res = await smt.set(root, keyContractCode, Scalar.fromString(hashByteCode, 16)); + res = await smt.set(res.newRoot, keyContractLength, bytecodeLength); return res.newRoot; } diff --git a/src/zkevm-db.js b/src/zkevm-db.js index f0933041..5c412d18 100644 --- a/src/zkevm-db.js +++ b/src/zkevm-db.js @@ -2,11 +2,11 @@ /* eslint-disable no-restricted-syntax */ const { Scalar } = require('ffjavascript'); const VM = require('@polygon-hermez/vm').default; -const Common = require('@ethereumjs/common').default; +const Common = require('@polygon-hermez/common').default; const { Address, Account, BN, toBuffer, } = require('ethereumjs-util'); -const { Hardfork } = require('@ethereumjs/common'); +const { Hardfork } = require('@polygon-hermez/common'); const ethers = require('ethers'); const clone = require('lodash/clone'); @@ -18,15 +18,17 @@ const { getContractBytecodeLength, } = require('./state-utils'); const { h4toString, stringToH4, hashContractBytecode } = require('./smt-utils'); +const { calculateSnarkInput } = require('./contract-utils'); class ZkEVMDB { - constructor(db, lastBatch, stateRoot, localExitRoot, poseidon, vm, smt, chainID) { + constructor(db, lastBatch, stateRoot, accInputHash, localExitRoot, poseidon, vm, smt, chainID) { this.db = db; this.lastBatch = lastBatch || 0; this.poseidon = poseidon; this.F = poseidon.F; this.stateRoot = stateRoot || [this.F.zero, this.F.zero, this.F.zero, this.F.zero]; + this.accInputHash = accInputHash || [this.F.zero, this.F.zero, this.F.zero, this.F.zero]; this.localExitRoot = localExitRoot || [this.F.zero, this.F.zero, this.F.zero, this.F.zero]; this.chainID = chainID; @@ -40,8 +42,10 @@ class ZkEVMDB { * @param {String} sequencerAddress - ethereum address represented as hex * @param {Array[Field]} globalExitRoot - global exit root * @param {Scalar} maxNTx - Maximum number of transactions (optional) + * @param {Object} options - additional batch options + * @param {Bool} options.skipUpdateSystemStorage - Skips updates on system smrt contract at the end of processable transactions */ - async buildBatch(timestamp, sequencerAddress, globalExitRoot, maxNTx = Constants.DEFAULT_MAX_TX) { + async buildBatch(timestamp, sequencerAddress, globalExitRoot, maxNTx = Constants.DEFAULT_MAX_TX, options = {}) { return new Processor( this.db, this.lastBatch + 1, @@ -49,11 +53,12 @@ class ZkEVMDB { maxNTx, this.stateRoot, sequencerAddress, - this.localExitRoot, + this.accInputHash, globalExitRoot, timestamp, this.chainID, clone(this.vm), + options, ); } @@ -62,7 +67,7 @@ class ZkEVMDB { * @param {Object} processor - Processor object */ async consolidate(processor) { - if (processor.batchNumber !== this.lastBatch + 1) { + if (processor.newNumBatch !== this.lastBatch + 1) { throw new Error('Updating the wrong batch'); } @@ -75,31 +80,44 @@ class ZkEVMDB { // set state root await this.db.setValue( - Scalar.add(Constants.DB_STATE_ROOT, processor.batchNumber), + Scalar.add(Constants.DB_STATE_ROOT, processor.newNumBatch), h4toString(processor.currentStateRoot), ); + // Set accumulate hash input + await this.db.setValue( + Scalar.add(Constants.DB_ACC_INPUT_HASH, processor.newNumBatch), + h4toString(processor.newAccInputHash), + ); + // Set local exit root await this.db.setValue( - Scalar.add(Constants.DB_LOCAL_EXIT_ROOT, processor.batchNumber), + Scalar.add(Constants.DB_LOCAL_EXIT_ROOT, processor.newNumBatch), h4toString(processor.newLocalExitRoot), ); // Set last batch number await this.db.setValue( Constants.DB_LAST_BATCH, - Scalar.toNumber(processor.batchNumber), + Scalar.toNumber(processor.newNumBatch), ); // Set all concatenated touched address await this.db.setValue( - Scalar.add(Constants.DB_TOUCHED_ACCOUNTS, processor.batchNumber), + Scalar.add(Constants.DB_TOUCHED_ACCOUNTS, processor.newNumBatch), processor.getUpdatedAccountsBatch(), ); + // Set stark input + await this.db.setValue( + Scalar.add(Constants.DB_STARK_INPUT, processor.newNumBatch), + processor.starkInput, + ); + // Update ZKEVMDB variables - this.lastBatch = processor.batchNumber; + this.lastBatch = processor.newNumBatch; this.stateRoot = processor.currentStateRoot; + this.accInputHash = processor.newAccInputHash; this.localExitRoot = processor.newLocalExitRoot; this.vm = processor.vm; } @@ -137,6 +155,93 @@ class ZkEVMDB { return this.localExitRoot; } + /** + * Get the current local exit root + * @returns {String} local exit root + */ + getCurrentAccInpuHash() { + return this.accInputHash; + } + + /** + * Get batchL2Data for multiples batches + * @param {Number} initNumBatch - initial num batch + * @param {Number} finalNumBatch - final num batch + */ + async sequenceMultipleBatches(initNumBatch, finalNumBatch) { + const dataBatches = []; + + for (let i = initNumBatch; i <= finalNumBatch; i++) { + const keyInitInput = Scalar.add(Constants.DB_STARK_INPUT, i); + const value = await this.db.getValue(keyInitInput); + if (value === null) { + throw new Error(`Batch ${i} does not exist`); + } + + const dataBatch = { + transactions: value.batchL2Data, + globalExitRoot: value.globalExitRoot, + timestamp: value.timestamp, + forceBatchesTimestamp: [], + }; + + dataBatches.push(dataBatch); + } + + return dataBatches; + } + + /** + * Get batchL2Data for multiples batches + * @param {Number} initNumBatch - initial num batch + * @param {Number} finalNumBatch - final num batch + * @param {String} aggregatorAddress - aggregator Ethereum address + */ + async verifyMultipleBatches(initNumBatch, finalNumBatch, aggregatorAddress) { + const dataVerify = {}; + dataVerify.singleBatchData = []; + + for (let i = initNumBatch; i <= finalNumBatch; i++) { + const keyInitInput = Scalar.add(Constants.DB_STARK_INPUT, i); + const value = await this.db.getValue(keyInitInput); + if (value === null) { + throw new Error(`Batch ${i} does not exist`); + } + + if (i === initNumBatch) { + dataVerify.oldStateRoot = value.oldStateRoot; + dataVerify.oldAccInputHash = value.oldAccInputHash; + dataVerify.oldNumBatch = value.oldNumBatch; + } + + if (i === finalNumBatch) { + dataVerify.newStateRoot = value.newStateRoot; + dataVerify.newAccInputHash = value.newAccInputHash; + dataVerify.newLocalExitRoot = value.newLocalExitRoot; + dataVerify.newNumBatch = value.newNumBatch; + } + + dataVerify.singleBatchData.push(value); + } + + dataVerify.chainID = this.chainID; + dataVerify.aggregatorAddress = aggregatorAddress; + + dataVerify.inputSnark = `0x${Scalar.toString(await calculateSnarkInput( + dataVerify.oldStateRoot, + dataVerify.newStateRoot, + dataVerify.newLocalExitRoot, + dataVerify.oldAccInputHash, + dataVerify.newAccInputHash, + dataVerify.oldNumBatch, + dataVerify.newNumBatch, + dataVerify.chainID, + dataVerify.aggregatorAddress, + ), 16).padStart(64, '0')}`; + + return dataVerify; + } + /** * Get smart contract storage * @param {String} address - smart contract address in hex string @@ -191,16 +296,16 @@ class ZkEVMDB { * @param {Object} db - Mem db object * @param {Object} poseidon - Poseidon object * @param {Array[Fields]} stateRoot - state merkle root - * @param {Array[Fields]} localExitRoot - exit merkle root + * @param {Array[Fields]} accHashInput - accumulate hash input * @param {Object} genesis - genesis block accounts (address, nonce, balance, bytecode, storage) * @param {Object} vm - evm if already instantiated * @param {Object} smt - smt if already instantiated * @param {Number} chainID - L2 chainID * @returns {Object} ZkEVMDB object */ - static async newZkEVM(db, poseidon, stateRoot, localExitRoot, genesis, vm, smt, chainID) { + static async newZkEVM(db, poseidon, stateRoot, accHashInput, genesis, vm, smt, chainID) { const common = Common.custom({ chainId: chainID }, { hardfork: Hardfork.Berlin }); - + common.setEIPs([3607, 3198, 3541]); const lastBatch = await db.getValue(Constants.DB_LAST_BATCH); // If it is null, instantiate a new evm-db if (lastBatch === null) { @@ -265,7 +370,8 @@ class ZkEVMDB { db, 0, newStateRoot, - localExitRoot, + accHashInput, + null, poseidon, newVm, newSmt, @@ -275,12 +381,14 @@ class ZkEVMDB { // Update current zkevm instance const DBStateRoot = await db.getValue(Scalar.add(Constants.DB_STATE_ROOT, lastBatch)); + const DBAccInputHash = await db.getValue(Scalar.add(Constants.DB_ACC_INPUT_HASH, lastBatch)); const DBLocalExitRoot = await db.getValue(Scalar.add(Constants.DB_LOCAL_EXIT_ROOT, lastBatch)); return new ZkEVMDB( db, lastBatch, stringToH4(DBStateRoot), + stringToH4(DBAccInputHash), stringToH4(DBLocalExitRoot), poseidon, vm, diff --git a/test/block-info.test.js b/test/block-info.test.js index 56aee67d..81939072 100644 --- a/test/block-info.test.js +++ b/test/block-info.test.js @@ -22,7 +22,7 @@ const lodash = require('lodash'); const artifactsPath = path.join(__dirname, 'artifacts/contracts'); -const contractsPolygonHermez = require('@0xpolygonhermez/contracts-zkevm'); +const contractsPolygonHermez = require('@0xpolygonhermez/zkevm-contracts'); const { MemDB, ZkEVMDB, getPoseidon, processorUtils, smtUtils, Constants, stateUtils, } = require('../index'); @@ -53,8 +53,8 @@ describe('Block info tests', function () { expectedOldRoot, batches, sequencerAddress, - oldLocalExitRoot, bridgeDeployed, + oldAccInputHash, } = testVectors[i]; const db = new MemDB(F); @@ -63,7 +63,7 @@ describe('Block info tests', function () { db, poseidon, [F.zero, F.zero, F.zero, F.zero], - smtUtils.stringToH4(oldLocalExitRoot), + smtUtils.stringToH4(oldAccInputHash), genesis, null, null, @@ -269,18 +269,23 @@ describe('Block info tests', function () { newLeafs[address].balance = account.balance.toString(); newLeafs[address].nonce = account.nonce.toString(); - if (account.isContract() || address === Constants.ADDRESS_SYSTEM - || address === Constants.ADDRESS_GLOBAL_EXIT_ROOT_MANAGER_L2) { + if (account.isContract() || address.toLowerCase() === Constants.ADDRESS_SYSTEM.toLowerCase() + || address.toLowerCase() === Constants.ADDRESS_GLOBAL_EXIT_ROOT_MANAGER_L2.toLowerCase()) { const storage = await zkEVMDB.dumpStorage(address); newLeafs[address].storage = storage; } } for (const leaf of genesis) { - if (!newLeafs[leaf.address.toLowerCase()]) { - newLeafs[leaf.address] = { ...leaf }; - delete newLeafs[leaf.address].address; - delete newLeafs[leaf.address].bytecode; - delete newLeafs[leaf.address].contractName; + const address = leaf.address.toLowerCase(); + if (!newLeafs[address]) { + newLeafs[address] = { ...leaf }; + const storage = await zkEVMDB.dumpStorage(address); + if (storage !== null) { + newLeafs[address].storage = storage; + } + delete newLeafs[address].address; + delete newLeafs[address].bytecode; + delete newLeafs[address].contractName; } } @@ -317,24 +322,23 @@ describe('Block info tests', function () { } // Check global exit root - const batchNumVm = await zkEVMDB.vm.stateManager.getContractStorage( + const timestampVm = await zkEVMDB.vm.stateManager.getContractStorage( addressInstanceGlobalExitRoot, globalExitRootPosBuffer, ); - const batchNumSmt = (await stateUtils.getContractStorage( + const timestampSmt = (await stateUtils.getContractStorage( Constants.ADDRESS_GLOBAL_EXIT_ROOT_MANAGER_L2, zkEVMDB.smt, zkEVMDB.stateRoot, [globalExitRootPos], ))[Scalar.e(globalExitRootPos)]; - expect(Scalar.fromString(batchNumVm.toString('hex'), 16)).to.equal(batchNumSmt); - expect(batchNumSmt).to.equal(Scalar.e(batch.batchNumber)); + expect(Scalar.fromString(timestampVm.toString('hex'), 16)).to.equal(timestampSmt); // Check through a call in the EVM if (bridgeDeployed) { const interfaceGlobal = new ethers.utils.Interface(['function globalExitRootMap(uint256)']); - const encodedData = interfaceGlobal.encodeFunctionData('globalExitRootMap', [batch.batchNumber]); + const encodedData = interfaceGlobal.encodeFunctionData('globalExitRootMap', [batch.newNumBatch]); const globalExitRootResult = await zkEVMDB.vm.runCall({ to: addressInstanceGlobalExitRoot, caller: Address.zero(), diff --git a/test/contract-utils.test.js b/test/contract-utils.test.js index 680f94b1..2551b190 100644 --- a/test/contract-utils.test.js +++ b/test/contract-utils.test.js @@ -11,10 +11,10 @@ describe('contractUtils', function () { this.timeout(10000); let testVector; - const expectedBatchHashData = '0x9370689d3c20a5a4739f902a31e2ea20c7d7be121a0fc19468a2e1b5d87f4111'; - // input taken from pil-stark - const expectedSnarkInputHash = '10255818422543031151914919891467894274520264482506602925880735498991910195507'; - const expectedStarkHashExecutor = '0x55f4c373d62dd577ef6160a1980130db83f0686dab8afe5e32e641ca6abeab4c'; + const expectedBatchHashData = '0x80cc22bc1a205c21f2b8c87e6185e1215fb60e3d83c609fd3bf3cdc586a6244b'; + // TODO: input taken from pil-stark + const expectedStarkHashExecutor = '0x704d5cfd3e44b82028f7f8cae31168267a7422c5a447b90a65134116da5a8432'; + const expectedSnarkInputHash = '15588448576060468525242870965361192827910782996030023758348255084502752104347'; before(async () => { testVector = JSON.parse(fs.readFileSync(path.join(pathTestVectors, 'inputs-executor/input_executor.json'))); @@ -22,68 +22,60 @@ describe('contractUtils', function () { it('calculateBatchHashData', async () => { const { - batchL2Data, globalExitRoot, sequencerAddr, - + batchL2Data, } = testVector; const computedBatchHashData = await contractUtils.calculateBatchHashData( batchL2Data, - globalExitRoot, - sequencerAddr, ); expect(computedBatchHashData).to.be.equal(expectedBatchHashData); }); - it('calculateSnarkInput', async () => { - const aggregatorAddress = '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'; - + it('calculateStarkInput', async () => { const { - oldLocalExitRoot, - newLocalExitRoot, - oldStateRoot, - newStateRoot, - numBatch, + oldAccInputHash, + globalExitRoot, timestamp, - chainID, + sequencerAddr, } = testVector; - const computedSnark = await contractUtils.calculateSnarkInput( - oldStateRoot, - oldLocalExitRoot, - newStateRoot, - newLocalExitRoot, + const computedGlobalHash = await contractUtils.calculateAccInputHash( + oldAccInputHash, expectedBatchHashData, - numBatch, + globalExitRoot, timestamp, - chainID, - aggregatorAddress, + sequencerAddr, ); - expect(computedSnark.toString()).to.be.equal(expectedSnarkInputHash.toString()); + expect(computedGlobalHash).to.be.equal(expectedStarkHashExecutor); }); - it('calculateStarkInput', async () => { + it('calculateSnarkInput', async () => { + const aggregatorAddress = '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'; + const { - oldLocalExitRoot, - newLocalExitRoot, oldStateRoot, newStateRoot, - numBatch, - timestamp, + newLocalExitRoot, + oldAccInputHash, + newAccInputHash, + oldNumBatch, + newNumBatch, chainID, } = testVector; - const computedGlobalHash = await contractUtils.calculateStarkInput( + const computedSnark = await contractUtils.calculateSnarkInput( oldStateRoot, - oldLocalExitRoot, newStateRoot, newLocalExitRoot, - expectedBatchHashData, - numBatch, - timestamp, + oldAccInputHash, + newAccInputHash, + oldNumBatch, + newNumBatch, chainID, + aggregatorAddress, ); - expect(computedGlobalHash).to.be.equal(expectedStarkHashExecutor); + expect(computedSnark.toString()).to.be.equal(expectedSnarkInputHash.toString()); }); }); diff --git a/test/helpers/test-vectors/block-info/block-info-batches.json b/test/helpers/test-vectors/block-info/block-info-batches.json index 12146b1c..883cfcbd 100644 --- a/test/helpers/test-vectors/block-info/block-info-batches.json +++ b/test/helpers/test-vectors/block-info/block-info-batches.json @@ -39,6 +39,7 @@ ], "expectedOldRoot": "0xf5c30bbb2b8a1bdd2b881cc575b2acbd13578c7cd64250fe8b6770fa95f915b3", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "batches": [ { "txs": [ @@ -157,21 +158,21 @@ "rawTx": "0xf88a06843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880a4e9413d3800000000000000000000000000000000000000000000000000000000000000008207f4a098f56115cad149a409a86e7610863248799a31d80e87d46582d08a3c0933a40aa025455a74fa3ca2ada0bf39dac88a172d032583bfec15061f39184ef9f7012677" } ], - "expectedNewRoot": "0x7ac5e9a0cdc631467c2e2e43d8d668016dbbf5b49d736cbace17cd1422de31ea", + "expectedNewRoot": "0x501d72cea44b1406ab46940f722d3c1293b0f2428f46e1e82a5831398165520d", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { + "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0xf5c30bbb2b8a1bdd2b881cc575b2acbd13578c7cd64250fe8b6770fa95f915b3" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" } }, - "0xae4bb80be56b819606589de61d5ec3b522eeb032": { + "0x0000000000000000000000000000000000000000": { "balance": "0", "nonce": "0" }, "0x617b3a3528f9cdd6630fd3301b9c8911f7bf063d": { - "balance": "100000284192000000000", + "balance": "100000264292000000000", "nonce": "1" }, "0x1275fbb540c8efc58b812ba83b0d0b8b9917ae98": { @@ -180,22 +181,34 @@ "storage": { "0x0000000000000000000000000000000000000000000000000000000000000000": "0x617b3a3528f9cdd6630fd3301b9c8911f7bf063d", "0x0000000000000000000000000000000000000000000000000000000000000002": "0x73e6af6f", - "0x0000000000000000000000000000000000000000000000000000000000000003": "0x01", + "0x0000000000000000000000000000000000000000000000000000000000000003": "0x03", "0x0000000000000000000000000000000000000000000000000000000000000005": "0x01c9c380", - "0x0000000000000000000000000000000000000000000000000000000000000006": "0x03e8", - "0x0000000000000000000000000000000000000000000000000000000000000001": "0xf5c30bbb2b8a1bdd2b881cc575b2acbd13578c7cd64250fe8b6770fa95f915b3" + "0x0000000000000000000000000000000000000000000000000000000000000006": "0x03e8" } }, "0x4d5cf5032b2a844602278b01199ed191a86c93ff": { - "balance": "199999715808000000000", + "balance": "199999735708000000000", "nonce": "7" + }, + "0x000000000000000000000000000000005ca1ab1e": { + "balance": "0", + "nonce": "0", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x07", + "0x7dfe757ecd65cbd7922a9c0161e935dd7fdbcc0e999689c7d31633896b1fc60b": "0xf77f751aaeef4ba7bd7118b2b7c2fdac700cefe91a2e41d2aefc08f12e4644d0", + "0x8f331abe73332f95a25873e8b430885974c0409691f89d643119a11623a7924a": "0x1b60038e083d5ec82468eb90f6f4868a620ad653651db25b959707ded65bf8a4", + "0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0xc18eb9ea7e6dfc3cf833e81797701ec6fcebe074c766c76c10f3c6290b077742", + "0xd9d16d34ffb15ba3a3d852f0d403e2ce1d691fb54de27ac87cd2f993f3ec330f": "0xe184b4858698c58a98011fce9e154529073769c00c90a454ac6b51cbd195a665", + "0xdc686ec4a0ff239c70e7c7c36e8f853eced3bc8618f48d2b816da2a74311237e": "0x8158981ea08e4add7b0b558fa36033ae77fc2557e3635b58251979b3bb4a4d5c", + "0xe2689cd4a84e23ad2f564004f1c9013e9589d260bde6380aba3ca7e09e4df40c": "0x3fa550675342debd80beb0209d66c809e6e34a92a5791ee7422356ba312c7afa", + "0xedc95719e9a3b28dd8e80877cb5880a9be7de1a13fc8b05e7999683b6b567643": "0x247cd6b9c3f9b06df7308f68d72b27f7a6ce5c484d4a8a5dd3fbfbc1e575b4df" + } } }, "batchL2Data": "0xea80843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae988084188ec3568203e880800a62ce9876e027f7a954f96c485c63c9bf043bd1fe1012c5634cf959bf7743190a601eedbcfef58146bdda9845fea5d9356b09d667010d557c73f83353a119a61cea01843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae988084d1a82a9d8203e880803c696d27506eebe00e52cd1c327eefd2ebb8c7a5d5309118ad18381630b2a5d47971958df81d8daa0d393daddb17a250c294452078db34b22d9e5ee85d2482e81bea02843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880846d6516c08203e88080db91fc325e867faa9625a5c7c152dfaf207a992b6eea855fcabe264f489b043a431f20ba77bd0269a6aedb6287118d383305d0dd677478209e60f6d3af3b17201cea03843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae988084b6baffe38203e88080e0c0469634b096c3b190713c8a8faa9c4fccc8b2d83cc8da056a897a28a616277c5bf403ce3a4c77cb0c6ca14cdd24d8fa785b4a0bde1500abba55db7df7483a1bea04843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880841a93d1c38203e8808057c7bfa7288275d862a91776d6d05c2290058a42840f08108b8b157f139120ce565bc8d0b5291e949c1c87e2f829b76d6a5d15e767e61716d1095dcc7cb5b44d1cea05843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880843408e4708203e88080e255f868a61169a2330cb539671e1a66ee846bc06cc888ea8fcd7ae51cdc62940c6dec27e6f756dd84923bcebb1f85db125299c0b622eaa8d5722cb3dace239d1cf84a06843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880a4e9413d3800000000000000000000000000000000000000000000000000000000000000008203e8808098f56115cad149a409a86e7610863248799a31d80e87d46582d08a3c0933a40a25455a74fa3ca2ada0bf39dac88a172d032583bfec15061f39184ef9f70126771c", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0xdacad7e8190fdd636dfcde9182ce3fa76ba8d34a5f799d18411bd3c5d1a45543", - "batchHashData": "0x2fce26f01fde186437d7a97a24f7744fc2c5d0087d5fa9e2157dbe9d2c383efc", + "batchHashData": "0xc8fe9673e241467d9c9a9b44a81c71d1c1bba7cd9fe265ebc37adff1d3d9262b", "timestamp": 1944498031 }, { @@ -315,23 +328,87 @@ "rawTx": "0xf88a0d843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880a4e9413d3800000000000000000000000000000000000000000000000000000000000000018207f3a068ad61295298051fac15519066926aad57ed5af83b351e586a0fbe70006c4829a05695cc59543fd10d4af41a8a266aef5efd2d691abc356fc679c66e2545fd9ef6" } ], - "expectedNewRoot": "0xddae01894acc0b4bed100e783636c83e1ef7c919716e1a44a58b97cdeac75a3c", + "expectedNewRoot": "0x5a62e3d4a89fdae8794ec78ba1fc91db4778bff0286ecb4cee6fbe8f76544ab6", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { + "0x4d5cf5032b2a844602278b01199ed191a86c93ff": { + "balance": "199999548204000000000", + "nonce": "14" + }, + "0x1275fbb540c8efc58b812ba83b0d0b8b9917ae98": { + "balance": "0", + "nonce": "1", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x617b3a3528f9cdd6630fd3301b9c8911f7bf063d", + "0x0000000000000000000000000000000000000000000000000000000000000002": "0x73e6af6f", + "0x0000000000000000000000000000000000000000000000000000000000000003": "0x0a", + "0x0000000000000000000000000000000000000000000000000000000000000005": "0x01c9c380", + "0x0000000000000000000000000000000000000000000000000000000000000006": "0x03e8", + "0x0000000000000000000000000000000000000000000000000000000000000001": "0xc18eb9ea7e6dfc3cf833e81797701ec6fcebe074c766c76c10f3c6290b077742" + } + }, + "0x617b3a3528f9cdd6630fd3301b9c8911f7bf063d": { + "balance": "100000451796000000000", + "nonce": "1" + }, + "0x000000000000000000000000000000005ca1ab1e": { "balance": "0", "nonce": "0", "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0xf5c30bbb2b8a1bdd2b881cc575b2acbd13578c7cd64250fe8b6770fa95f915b3", - "0xada5013122d395ba3c54772283fb069b10426056ef8ca54750cb9bb552a59e7d": "0x7ac5e9a0cdc631467c2e2e43d8d668016dbbf5b49d736cbace17cd1422de31ea" + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x0e", + "0x4db623e5c4870b62d3fc9b4e8f893a1a77627d75ab45d9ff7e56ba19564af99b": "0x68233a704e51770a8bc073b6089ebd51c77585bc2a487c22e67a042d36583469", + "0x57aaafa65c4e563d39fff90096a5fa76d42117f53d87ef870784e64d63a8a16b": "0x51a1d8b135406a44d476ebb9a36cbad1dd8c1ac8b03aa0ab7fbfedac2cc03df4", + "0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0xc18eb9ea7e6dfc3cf833e81797701ec6fcebe074c766c76c10f3c6290b077742", + "0xfc80cd5fe514767bc6e66ec558e68a5429ea70b50fa6caa3b53fc9278e918632": "0x0f7dcf3ccdf59b48a4c4848d3a5e0031648b10be58cf0385e32b90b3a4db9c66", + "0x23bf72df16f8335be9a3eddfb5ef1c739b12847d13a384ec83f578699d38eb89": "0x24a321b1cb8aef1ab5546255b345440c7233add99ccf82e08628e18c613a3ba6", + "0x2a32391a76c35a36352b711f9152c0d0a340cd686850c8ef25fbb11c71b89e7b": "0x80079f96ba5ca87685ef22e1a3eed898546fe8f5c2da057bc70ebf465616eef7", + "0x74a5fbcb419ab7dbacbb2c92a4e163730f0da5c72b911deecf4f05a6b327d0a4": "0x631e222b8765a1e000ec527e0b6eab805fe71a03e774b06b96596fdea2ad9901", + "0x7dfe757ecd65cbd7922a9c0161e935dd7fdbcc0e999689c7d31633896b1fc60b": "0xf77f751aaeef4ba7bd7118b2b7c2fdac700cefe91a2e41d2aefc08f12e4644d0", + "0x86b3fa87ee245373978e0d2d334dbde866c9b8b039036b87c5eb2fd89bcb6bab": "0xbdd44421182ea92d4d53cab97872dc1d11596bd3f03694b9986fff4493e4fe11", + "0x8f331abe73332f95a25873e8b430885974c0409691f89d643119a11623a7924a": "0x1b60038e083d5ec82468eb90f6f4868a620ad653651db25b959707ded65bf8a4", + "0xd9d16d34ffb15ba3a3d852f0d403e2ce1d691fb54de27ac87cd2f993f3ec330f": "0xe184b4858698c58a98011fce9e154529073769c00c90a454ac6b51cbd195a665", + "0xdc686ec4a0ff239c70e7c7c36e8f853eced3bc8618f48d2b816da2a74311237e": "0x8158981ea08e4add7b0b558fa36033ae77fc2557e3635b58251979b3bb4a4d5c", + "0xe2689cd4a84e23ad2f564004f1c9013e9589d260bde6380aba3ca7e09e4df40c": "0x3fa550675342debd80beb0209d66c809e6e34a92a5791ee7422356ba312c7afa", + "0xedc95719e9a3b28dd8e80877cb5880a9be7de1a13fc8b05e7999683b6b567643": "0x247cd6b9c3f9b06df7308f68d72b27f7a6ce5c484d4a8a5dd3fbfbc1e575b4df" } }, + "0x0000000000000000000000000000000000000000": { + "balance": "0", + "nonce": "0" + }, "0xae4bb80be56b819606589de61d5ec3b522eeb032": { + "balance": "0", + "nonce": "0", + "storage": { + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" + } + } + }, + "batchL2Data": "0xea07843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae988084188ec3568203e880800be264304cfc20c400929c82d1435cfbaa18e9a49c34ce65274633820803c415132ab24e00f892d77ad39c87e897772100e3323f31915a3e5eb261e056d99bc31bea08843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae988084d1a82a9d8203e88080775e9a77a45dafb120ec840926129c5db8ad3843722de88f2c7f6df4383c92fe0176dcd120e97ff6a1a1d60150aac3fdbca81bbfd1e2e9349ed9da4fa3bd85a81bea09843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880846d6516c08203e88080f969b5ab22f54db86a57efcfa83f3369047d328d2c56044bd49d7f863e69ed2b5a95c2b1b41801a5b4d7bb548829fe5a51c72dd5e5a08bd2a56f49bc3246a3081cea0a843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae988084b6baffe38203e88080b60beddfce8bf365e93cb4f88f45ed0e5649659de56dbf52332e6c9c16aa10bd576fb90bd967e2495fe8fa09d75d58b82668c54dab54d91f5e4ab0d76d2649ae1bea0b843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880841a93d1c38203e88080416d143b11a02e0c28344feb6af0f90ecb5b0bd5eec26047b25c0f775502be751e40d32fefe94aee39ad9b2605afeb2e86f31b56ac82874f841054c6a01331851bea0c843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880843408e4708203e88080a1ec9b236321a7d3545cfe1a1baedf65d75e589223d732d424576756adb0396e74470d226d5b61895150d96dbd1b1ba8a8ad69a6bf9311a141ece602b6420d961cf84a0d843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880a4e9413d3800000000000000000000000000000000000000000000000000000000000000018203e8808068ad61295298051fac15519066926aad57ed5af83b351e586a0fbe70006c48295695cc59543fd10d4af41a8a266aef5efd2d691abc356fc679c66e2545fd9ef61b", + "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", + "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "batchHashData": "0x8196946b8a211125e92b0bdbce0c9f9b8b8fbebf2cd5e794cbb4cf8208641b3c", + "timestamp": 1944498031 + }, + { + "txs": [], + "expectedNewRoot": "0xbde28b0b2f9284f2d15cc416369528306af5d3cbc53d7e2575a39ad62b30cd6a", + "expectedNewLeafs": { + "0xae4bb80be56b819606589de61d5ec3b522eeb032": { + "balance": "0", + "nonce": "0", + "storage": { + "0x476b1edb8f44f82bc7ef0b7e1c441a7957942d3a0db3d831311e898e665722b5": "0x73e6af71", + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" + } + }, + "0x0000000000000000000000000000000000000000": { "balance": "0", "nonce": "0" }, - "0x4d5cf5032b2a844602278b01199ed191a86c93ff": { - "balance": "199999545404000000000", - "nonce": "14" + "0x617b3a3528f9cdd6630fd3301b9c8911f7bf063d": { + "balance": "100000000000000000000", + "nonce": "1", + "pvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e" }, "0x1275fbb540c8efc58b812ba83b0d0b8b9917ae98": { "balance": "0", @@ -339,23 +416,68 @@ "storage": { "0x0000000000000000000000000000000000000000000000000000000000000000": "0x617b3a3528f9cdd6630fd3301b9c8911f7bf063d", "0x0000000000000000000000000000000000000000000000000000000000000002": "0x73e6af6f", - "0x0000000000000000000000000000000000000000000000000000000000000003": "0x02", + "0x0000000000000000000000000000000000000000000000000000000000000003": "0x0a", "0x0000000000000000000000000000000000000000000000000000000000000005": "0x01c9c380", "0x0000000000000000000000000000000000000000000000000000000000000006": "0x03e8", - "0x0000000000000000000000000000000000000000000000000000000000000001": "0x7ac5e9a0cdc631467c2e2e43d8d668016dbbf5b49d736cbace17cd1422de31ea" + "0x0000000000000000000000000000000000000000000000000000000000000001": "0xc18eb9ea7e6dfc3cf833e81797701ec6fcebe074c766c76c10f3c6290b077742" + } + }, + "0x4d5cf5032b2a844602278b01199ed191a86c93ff": { + "pvtKey": "0x4d27a600dce8c29b7bd080e29a26972377dbb04d7a27d919adbb602bf13cfd23", + "balance": "200000000000000000000", + "nonce": "0" + } + }, + "batchL2Data": "0x", + "globalExitRoot": "0x190bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", + "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "batchHashData": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "timestamp": 1944498033 + }, + { + "txs": [], + "expectedNewRoot": "0xbde28b0b2f9284f2d15cc416369528306af5d3cbc53d7e2575a39ad62b30cd6a", + "expectedNewLeafs": { + "0x0000000000000000000000000000000000000000": { + "balance": "0", + "nonce": "0" + }, + "0xae4bb80be56b819606589de61d5ec3b522eeb032": { + "balance": "0", + "nonce": "0", + "storage": { + "0x476b1edb8f44f82bc7ef0b7e1c441a7957942d3a0db3d831311e898e665722b5": "0x73e6af71", + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" } }, "0x617b3a3528f9cdd6630fd3301b9c8911f7bf063d": { - "balance": "100000454596000000000", - "nonce": "1" + "balance": "100000000000000000000", + "nonce": "1", + "pvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e" + }, + "0x1275fbb540c8efc58b812ba83b0d0b8b9917ae98": { + "balance": "0", + "nonce": "1", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x617b3a3528f9cdd6630fd3301b9c8911f7bf063d", + "0x0000000000000000000000000000000000000000000000000000000000000002": "0x73e6af6f", + "0x0000000000000000000000000000000000000000000000000000000000000003": "0x0a", + "0x0000000000000000000000000000000000000000000000000000000000000005": "0x01c9c380", + "0x0000000000000000000000000000000000000000000000000000000000000006": "0x03e8", + "0x0000000000000000000000000000000000000000000000000000000000000001": "0xc18eb9ea7e6dfc3cf833e81797701ec6fcebe074c766c76c10f3c6290b077742" + } + }, + "0x4d5cf5032b2a844602278b01199ed191a86c93ff": { + "pvtKey": "0x4d27a600dce8c29b7bd080e29a26972377dbb04d7a27d919adbb602bf13cfd23", + "balance": "200000000000000000000", + "nonce": "0" } }, - "batchL2Data": "0xea07843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae988084188ec3568203e880800be264304cfc20c400929c82d1435cfbaa18e9a49c34ce65274633820803c415132ab24e00f892d77ad39c87e897772100e3323f31915a3e5eb261e056d99bc31bea08843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae988084d1a82a9d8203e88080775e9a77a45dafb120ec840926129c5db8ad3843722de88f2c7f6df4383c92fe0176dcd120e97ff6a1a1d60150aac3fdbca81bbfd1e2e9349ed9da4fa3bd85a81bea09843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880846d6516c08203e88080f969b5ab22f54db86a57efcfa83f3369047d328d2c56044bd49d7f863e69ed2b5a95c2b1b41801a5b4d7bb548829fe5a51c72dd5e5a08bd2a56f49bc3246a3081cea0a843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae988084b6baffe38203e88080b60beddfce8bf365e93cb4f88f45ed0e5649659de56dbf52332e6c9c16aa10bd576fb90bd967e2495fe8fa09d75d58b82668c54dab54d91f5e4ab0d76d2649ae1bea0b843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880841a93d1c38203e88080416d143b11a02e0c28344feb6af0f90ecb5b0bd5eec26047b25c0f775502be751e40d32fefe94aee39ad9b2605afeb2e86f31b56ac82874f841054c6a01331851bea0c843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880843408e4708203e88080a1ec9b236321a7d3545cfe1a1baedf65d75e589223d732d424576756adb0396e74470d226d5b61895150d96dbd1b1ba8a8ad69a6bf9311a141ece602b6420d961cf84a0d843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880a4e9413d3800000000000000000000000000000000000000000000000000000000000000018203e8808068ad61295298051fac15519066926aad57ed5af83b351e586a0fbe70006c48295695cc59543fd10d4af41a8a266aef5efd2d691abc356fc679c66e2545fd9ef61b", - "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", + "batchL2Data": "0x", + "globalExitRoot": "0x190bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0x70dbed216757212ab7ba9d4159a1b92c4dc1002a7b69031399789a436f64baab", - "batchHashData": "0x6c8a80b510739fe5f5959dc03d074979d407915f5b4f9b1cb5ba97f469b85b08", - "timestamp": 1944498031 + "batchHashData": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "timestamp": 1944498042 } ] } diff --git a/test/helpers/test-vectors/block-info/block-info.json b/test/helpers/test-vectors/block-info/block-info.json index eefadc17..feeb995f 100644 --- a/test/helpers/test-vectors/block-info/block-info.json +++ b/test/helpers/test-vectors/block-info/block-info.json @@ -136,23 +136,21 @@ "rawTx": "0xf86a05843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880843408e4708207f4a0e255f868a61169a2330cb539671e1a66ee846bc06cc888ea8fcd7ae51cdc6294a00c6dec27e6f756dd84923bcebb1f85db125299c0b622eaa8d5722cb3dace239d" } ], - "expectedNewRoot": "0x214a12bf80a1fe3db5f430b0bbf5d5cf6c05321e78d86aa2647c2c5c9e573bce", + "expectedNewRoot": "0x3c0e9fa45b407ee72bde35b1b36d6ba99b10d6d657075683e7a7259b18838ec7", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { + "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0xf5c30bbb2b8a1bdd2b881cc575b2acbd13578c7cd64250fe8b6770fa95f915b3" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" }, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 }, - "0xae4bb80be56b819606589de61d5ec3b522eeb032": { + "0x0000000000000000000000000000000000000000": { "balance": "0", "nonce": "0", - "storage": { - "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x01" - }, + "storage": null, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 }, @@ -169,7 +167,7 @@ "storage": { "0x0000000000000000000000000000000000000000000000000000000000000000": "0x617b3a3528f9cdd6630fd3301b9c8911f7bf063d", "0x0000000000000000000000000000000000000000000000000000000000000002": "0x73e6af6f", - "0x0000000000000000000000000000000000000000000000000000000000000003": "0x01", + "0x0000000000000000000000000000000000000000000000000000000000000003": "0x03", "0x0000000000000000000000000000000000000000000000000000000000000005": "0x01c9c380", "0x0000000000000000000000000000000000000000000000000000000000000006": "0x03e8" }, @@ -182,14 +180,30 @@ "storage": null, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 + }, + "0x000000000000000000000000000000005ca1ab1e": { + "balance": "0", + "nonce": "0", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x06", + "0x7dfe757ecd65cbd7922a9c0161e935dd7fdbcc0e999689c7d31633896b1fc60b": "0xf77f751aaeef4ba7bd7118b2b7c2fdac700cefe91a2e41d2aefc08f12e4644d0", + "0x8f331abe73332f95a25873e8b430885974c0409691f89d643119a11623a7924a": "0x1b60038e083d5ec82468eb90f6f4868a620ad653651db25b959707ded65bf8a4", + "0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0xc18eb9ea7e6dfc3cf833e81797701ec6fcebe074c766c76c10f3c6290b077742", + "0xd9d16d34ffb15ba3a3d852f0d403e2ce1d691fb54de27ac87cd2f993f3ec330f": "0xe184b4858698c58a98011fce9e154529073769c00c90a454ac6b51cbd195a665", + "0xe2689cd4a84e23ad2f564004f1c9013e9589d260bde6380aba3ca7e09e4df40c": "0x3fa550675342debd80beb0209d66c809e6e34a92a5791ee7422356ba312c7afa", + "0xedc95719e9a3b28dd8e80877cb5880a9be7de1a13fc8b05e7999683b6b567643": "0x247cd6b9c3f9b06df7308f68d72b27f7a6ce5c484d4a8a5dd3fbfbc1e575b4df" + }, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 } }, "batchL2Data": "0xea80843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae988084188ec3568203e880800a62ce9876e027f7a954f96c485c63c9bf043bd1fe1012c5634cf959bf7743190a601eedbcfef58146bdda9845fea5d9356b09d667010d557c73f83353a119a61cea01843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae988084d1a82a9d8203e880803c696d27506eebe00e52cd1c327eefd2ebb8c7a5d5309118ad18381630b2a5d47971958df81d8daa0d393daddb17a250c294452078db34b22d9e5ee85d2482e81bea02843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880846d6516c08203e88080db91fc325e867faa9625a5c7c152dfaf207a992b6eea855fcabe264f489b043a431f20ba77bd0269a6aedb6287118d383305d0dd677478209e60f6d3af3b17201cea03843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae988084b6baffe38203e88080e0c0469634b096c3b190713c8a8faa9c4fccc8b2d83cc8da056a897a28a616277c5bf403ce3a4c77cb0c6ca14cdd24d8fa785b4a0bde1500abba55db7df7483a1bea04843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880841a93d1c38203e8808057c7bfa7288275d862a91776d6d05c2290058a42840f08108b8b157f139120ce565bc8d0b5291e949c1c87e2f829b76d6a5d15e767e61716d1095dcc7cb5b44d1cea05843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880843408e4708203e88080e255f868a61169a2330cb539671e1a66ee846bc06cc888ea8fcd7ae51cdc62940c6dec27e6f756dd84923bcebb1f85db125299c0b622eaa8d5722cb3dace239d1c", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0xab1e6abe832f3ac46d4a098ba2202ac4f8ae851e01ba11e4c3cb8e5f520df20a", - "batchHashData": "0xc14b177061b0fff3a5a1d61a5b1d50319b59a26b864285ef5c4f67cac43a77ee", + "batchHashData": "0xcc387c562528dcc81765f91d3eb572e96815b20d870a3715e0e83c5153a4c696", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0x73bc24d2f3638c7f9fe0b46739e4db2413d50360d5b98cd58e65350c0048ac10" } ] \ No newline at end of file diff --git a/test/helpers/test-vectors/end-to-end/state-transition.json b/test/helpers/test-vectors/end-to-end/state-transition.json index 4dd409d5..9876ea62 100644 --- a/test/helpers/test-vectors/end-to-end/state-transition.json +++ b/test/helpers/test-vectors/end-to-end/state-transition.json @@ -20,13 +20,13 @@ "storage": { "0x0000000000000000000000000000000000000000000000000000000000000002": "0x9d98deabc42dd696deb9e40b4f1cab7ddbf55988" }, - "contractName": "GlobalExitRootManagerL2" + "contractName": "PolygonZkEVMGlobalExitRootL2" }, { "balance": "100000000000000000000000", "nonce": "2", "address": "0x9d98deabc42dd696deb9e40b4f1cab7ddbf55988", - "bytecode": "0x608060405260043610620001075760003560e01c80635d5d326f1162000095578063bab161bf1162000060578063bab161bf1462000414578063d02103ca1462000449578063e73758811462000478578063ed6be5c914620004ac57600080fd5b80635d5d326f146200035e57806381b1c17414620003835780638624c35c14620003ca578063b7e6a7d414620003ef57600080fd5b80633ae0504711620000d65780633ae05047146200023a5780633da816821462000252578063508935f814620002885780635a64a1da14620002a157600080fd5b806322e95f2c146200010c5780632dfdf0b5146200015b5780632f3a3d5d1462000182578063318aee3d14620001b1575b600080fd5b3480156200011957600080fd5b50620001316200012b366004620027b4565b620004c3565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156200016857600080fd5b506200017360415481565b60405190815260200162000152565b3480156200018f57600080fd5b50604754620001319073ffffffffffffffffffffffffffffffffffffffff1681565b348015620001be57600080fd5b5062000208620001d0366004620027f0565b60456020526000908152604090205463ffffffff811690640100000000900473ffffffffffffffffffffffffffffffffffffffff1682565b6040805163ffffffff909316835273ffffffffffffffffffffffffffffffffffffffff90911660208301520162000152565b3480156200024757600080fd5b506200017362000566565b3480156200025f57600080fd5b5062000277620002713660046200290f565b62000640565b604051901515815260200162000152565b6200029f620002993660046200297d565b62000740565b005b348015620002ae57600080fd5b5062000173620002c036600462002a39565b604080517fffffffff0000000000000000000000000000000000000000000000000000000060e098891b81166020808401919091527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000006060998a1b811660248501529790991b1660388201529390951b909316603c830152605082015260708082019290925282518082039092018252609001909152805191012090565b3480156200036b57600080fd5b506200029f6200037d36600462002b51565b62000d2a565b3480156200039057600080fd5b5062000131620003a236600462002c38565b60446020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b348015620003d757600080fd5b506200029f620003e9366004620027b4565b620017d9565b348015620003fc57600080fd5b50620001316200040e366004620027b4565b62001a57565b3480156200042157600080fd5b50604254620004339063ffffffff1681565b60405163ffffffff909116815260200162000152565b3480156200045657600080fd5b50604654620001319073ffffffffffffffffffffffffffffffffffffffff1681565b3480156200048557600080fd5b50620002776200049736600462002c38565b60436020526000908152604090205460ff1681565b348015620004b957600080fd5b5062000433600081565b6040805160e084901b7fffffffff0000000000000000000000000000000000000000000000000000000016602080830191909152606084901b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166024830152825160188184030181526038909201835281519181019190912060009081526044909152205473ffffffffffffffffffffffffffffffffffffffff165b92915050565b6041546000908190815b6020811015620006385781600116600103620005d057600181602081106200059c576200059c62002c52565b0154604080516020810192909252810184905260600160405160208183030381529060405280519060200120925062000614565b8260218260208110620005e757620005e762002c52565b01546040805160208101939093528201526060016040516020818303038152906040528051906020012092505b6200062160028362002cb0565b9150806200062f8162002cec565b91505062000570565b509092915050565b60008467ffffffffffffffff8416825b6020811015620007335781600116600103620006bd578681815181106200067b576200067b62002c52565b6020026020010151836040516020016200069f929190918252602082015260400190565b6040516020818303038152906040528051906020012092506200070f565b82878281518110620006d357620006d362002c52565b6020026020010151604051602001620006f6929190918252602082015260400190565b6040516020818303038152906040528051906020012092505b6200071c60028362002cb0565b9150806200072a8162002cec565b91505062000650565b5050909114949350505050565b60425463ffffffff90811690861603620007e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4272696467653a3a6272696467653a2044455354494e4154494f4e5f43414e5460448201527f5f42455f495453454c460000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600080606073ffffffffffffffffffffffffffffffffffffffff89166200089d5785341462000893576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4272696467653a3a6272696467653a20414d4f554e545f444f45535f4e4f545f60448201527f4d415443485f4d53475f56414c554500000000000000000000000000000000006064820152608401620007d8565b6000915062000bb1565b73ffffffffffffffffffffffffffffffffffffffff808a1660009081526045602090815260409182902082518084019093525463ffffffff81168352640100000000900490921691810182905290156200099e576040517f9dc29fac0000000000000000000000000000000000000000000000000000000081523360048201526024810188905273ffffffffffffffffffffffffffffffffffffffff8b1690639dc29fac906044016020604051808303816000875af115801562000965573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200098b919062002d27565b5060208101518151909450925062000baf565b8415620009b357620009b38a88888862001b20565b620009d773ffffffffffffffffffffffffffffffffffffffff8b1633308a62001f71565b899350604260009054906101000a900463ffffffff1692508973ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000a3b573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405262000a83919081019062002dc6565b8a73ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000acf573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405262000b17919081019062002dc6565b8b73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000b63573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000b89919062002e0f565b60405160200162000b9d9392919062002e7b565b60405160208183030381529060405291505b505b7ff0b963192bdc6349c23af9bd17294b4c7b9b5a73a2a9939610ea18ffd1c5dc2a82848a8a8a8660415460405162000bf0979695949392919062002eb8565b60405180910390a18051602080830191909120604080517fffffffff0000000000000000000000000000000000000000000000000000000060e087811b8216838701527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608a811b82166024860152918f901b90921660388401528c901b16603c820152605081018a9052607080820193909352815180820390930183526090019052805191012062000ca49062002055565b60465473ffffffffffffffffffffffffffffffffffffffff166333d6247d62000ccc62000566565b6040518263ffffffff1660e01b815260040162000ceb91815260200190565b600060405180830381600087803b15801562000d0657600080fd5b505af115801562000d1b573d6000803e3d6000fd5b50505050505050505050505050565b63ffffffff891660009081526043602052604090205460ff161562000dac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4272696467653a3a636c61696d3a20414c52454144595f434c41494d454400006044820152606401620007d8565b6046546040805160208082018c90528183018b9052825180830384018152606083019384905280519101207f257b363200000000000000000000000000000000000000000000000000000000909252606481019190915273ffffffffffffffffffffffffffffffffffffffff9091169063257b3632906084016020604051808303816000875af115801562000e45573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000e6b919062002f25565b60000362000efc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4272696467653a3a636c61696d3a20474c4f42414c5f455849545f524f4f545f60448201527f444f45535f4e4f545f4d415443480000000000000000000000000000000000006064820152608401620007d8565b60425463ffffffff85811691161462000f98576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4272696467653a3a636c61696d3a2044455354494e4154494f4e5f4e4554574f60448201527f524b5f444f45535f4e4f545f4d415443480000000000000000000000000000006064820152608401620007d8565b60425463ffffffff16620010c9578051602080830191909120604080517fffffffff0000000000000000000000000000000000000000000000000000000060e08b811b8216838701527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608c811b82166024860152918b901b909216603884015288901b16603c8201526050810186905260708082019390935281518082039093018352609001905280519101206200105b908b8b63ffffffff168a62000640565b620010c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4272696467653a3a636c61696d3a20534d545f494e56414c49440000000000006044820152606401620007d8565b620011e6565b8051602080830191909120604080517fffffffff0000000000000000000000000000000000000000000000000000000060e08b811b8216838701527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608c811b82166024860152918b901b909216603884015288901b16603c8201526050810186905260708082019390935281518082039093018352609001905280519101206200117e908b8b63ffffffff168b62000640565b620011e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4272696467653a3a636c61696d3a20534d545f494e56414c49440000000000006044820152606401620007d8565b63ffffffff8916600090815260436020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905573ffffffffffffffffffffffffffffffffffffffff851662001357576040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff851690849060405162001279919062002f3f565b60006040518083038185875af1925050503d8060008114620012b8576040519150601f19603f3d011682016040523d82523d6000602084013e620012bd565b606091505b505090508062001350576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f4272696467653a3a636c61696d3a204554485f5452414e534645525f4641494c60448201527f45440000000000000000000000000000000000000000000000000000000000006064820152608401620007d8565b5062001762565b60425463ffffffff9081169087160362001394576200138e73ffffffffffffffffffffffffffffffffffffffff86168484620021ce565b62001762565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b1660208201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b166024820152600090603801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291815281516020928301206000818152604490935291205490915073ffffffffffffffffffffffffffffffffffffffff1680620016c1576047546000906200147f9073ffffffffffffffffffffffffffffffffffffffff168462002226565b90506000806000868060200190518101906200149c919062002f5d565b9250925092508373ffffffffffffffffffffffffffffffffffffffff16636c9452218484848d8d6040518663ffffffff1660e01b8152600401620014e595949392919062002fde565b600060405180830381600087803b1580156200150057600080fd5b505af115801562001515573d6000803e3d6000fd5b50505050836044600088815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060405180604001604052808d63ffffffff1681526020018c73ffffffffffffffffffffffffffffffffffffffff16815250604560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050507fccd7715648d1f2bb13e158f96b5b6c3aeda555d4cb87112e274a6f28bc571d598c8c86604051620016af9392919063ffffffff93909316835273ffffffffffffffffffffffffffffffffffffffff918216602084015216604082015260600190565b60405180910390a1505050506200175f565b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152602482018690528216906340c10f19906044016020604051808303816000875af115801562001737573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200175d919062002d27565b505b50505b6040805163ffffffff8b811682528816602082015273ffffffffffffffffffffffffffffffffffffffff87811682840152851660608201526080810184905290517f25308c93ceeed162da955b3f7ce3e3f93606579e40fb92029faa9efe275459839181900360a00190a150505050505050505050565b600054610100900460ff1615808015620017fa5750600054600160ff909116105b80620018165750303b15801562001816575060005460ff166001145b620018a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401620007d8565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156200190357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b604280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff8516179055604680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905560405162001981906200275c565b604051809103906000f0801580156200199e573d6000803e3d6000fd5b50604780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055620019ee62002306565b801562001a5257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1660208201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606083901b1660248201526000908190603801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012060475490915062001b189073ffffffffffffffffffffffffffffffffffffffff16826200244e565b949350505050565b600062001b6383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250620024d292505050565b90507fffffffff0000000000000000000000000000000000000000000000000000000081167fd505accf000000000000000000000000000000000000000000000000000000001462001c38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f48657a4d617469634d657267653a3a5f7065726d69743a204e4f545f56414c4960448201527f445f43414c4c00000000000000000000000000000000000000000000000000006064820152608401620007d8565b600080808080808062001c4f896004818d6200303e565b81019062001c5e91906200306a565b96509650965096509650965096503373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff161462001d29576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f48657a4d617469634d657267653a3a5f7065726d69743a205045524d49545f4f60448201527f574e45525f4d5553545f42455f5448455f53454e4445520000000000000000006064820152608401620007d8565b73ffffffffffffffffffffffffffffffffffffffff8616301462001dd0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f48657a4d617469634d657267653a3a5f7065726d69743a205350454e4445525f60448201527f4d5553545f42455f5448495300000000000000000000000000000000000000006064820152608401620007d8565b8a851462001e61576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f48657a4d617469634d657267653a3a5f7065726d69743a205045524d49545f4160448201527f4d4f554e545f444f45535f4e4f545f4d415443480000000000000000000000006064820152608401620007d8565b6040805173ffffffffffffffffffffffffffffffffffffffff89811660248301528881166044830152606482018890526084820187905260ff861660a483015260c4820185905260e48083018590528351808403909101815261010490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fd505accf000000000000000000000000000000000000000000000000000000001790529151918e169162001f1c919062002f3f565b6000604051808303816000865af19150503d806000811462001f5b576040519150601f19603f3d011682016040523d82523d6000602084013e62001f60565b606091505b505050505050505050505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526200204f9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152620024d9565b50505050565b80600162002066602060026200321b565b62002072919062003229565b6041541062002104576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4465706f736974436f6e74726163743a5f6465706f7369743a204d45524b4c4560448201527f5f545245455f46554c4c000000000000000000000000000000000000000000006064820152608401620007d8565b60016041600082825462002119919062003243565b909155505060415460005b6020811015620021c357816001166001036200215957826001826020811062002151576200215162002c52565b015550505050565b600181602081106200216f576200216f62002c52565b01546040805160208101929092528101849052606001604051602081830303815290604052805190602001209250600282620021ac919062002cb0565b915080620021ba8162002cec565b91505062002124565b5062001a526200325e565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905262001a529084907fa9059cbb000000000000000000000000000000000000000000000000000000009060640162001fcc565b60006040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528360601b60148201527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006028820152826037826000f591505073ffffffffffffffffffffffffffffffffffffffff811662000560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f455243313136373a2063726561746532206661696c65640000000000000000006044820152606401620007d8565b600054610100900460ff166200239f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401620007d8565b60005b620023b06001602062003229565b8110156200244b5760218160208110620023ce57620023ce62002c52565b015460218260208110620023e657620023e662002c52565b015460408051602081019390935282015260600160405160208183030381529060405280519060200120602182600162002421919062003243565b6020811062002434576200243462002c52565b015580620024428162002cec565b915050620023a2565b50565b6000620024cb8383306040517f3d602d80600a3d3981f3363d3d373d3d3d363d730000000000000000000000008152606093841b60148201527f5af43d82803e903d91602b57fd5bf3ff000000000000000000000000000000006028820152921b6038830152604c8201526037808220606c830152605591012090565b9392505050565b6020015190565b60006200253d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16620025ec9092919063ffffffff16565b80519091501562001a5257808060200190518101906200255e919062002d27565b62001a52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401620007d8565b606062001b1884846000858573ffffffffffffffffffffffffffffffffffffffff85163b62002678576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401620007d8565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051620026a3919062002f3f565b60006040518083038185875af1925050503d8060008114620026e2576040519150601f19603f3d011682016040523d82523d6000602084013e620026e7565b606091505b5091509150620026f982828662002704565b979650505050505050565b6060831562002715575081620024cb565b825115620027265782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620007d891906200328d565b61182980620032a383390190565b803563ffffffff811681146200277f57600080fd5b919050565b73ffffffffffffffffffffffffffffffffffffffff811681146200244b57600080fd5b80356200277f8162002784565b60008060408385031215620027c857600080fd5b620027d3836200276a565b91506020830135620027e58162002784565b809150509250929050565b6000602082840312156200280357600080fd5b8135620024cb8162002784565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171562002889576200288962002810565b604052919050565b600082601f830112620028a357600080fd5b8135602067ffffffffffffffff821115620028c257620028c262002810565b8160051b620028d38282016200283f565b9283528481018201928281019087851115620028ee57600080fd5b83870192505b84831015620026f957823582529183019190830190620028f4565b600080600080608085870312156200292657600080fd5b84359350602085013567ffffffffffffffff808211156200294657600080fd5b620029548883890162002891565b94506040870135915080821682146200296c57600080fd5b509396929550929360600135925050565b60008060008060008060a087890312156200299757600080fd5b8635620029a48162002784565b9550620029b4602088016200276a565b94506040870135620029c68162002784565b935060608701359250608087013567ffffffffffffffff80821115620029eb57600080fd5b818901915089601f83011262002a0057600080fd5b81358181111562002a1057600080fd5b8a602082850101111562002a2357600080fd5b6020830194508093505050509295509295509295565b60008060008060008060c0878903121562002a5357600080fd5b62002a5e876200276a565b9550602087013562002a708162002784565b945062002a80604088016200276a565b9350606087013562002a928162002784565b9598949750929560808101359460a0909101359350915050565b600067ffffffffffffffff82111562002ac95762002ac962002810565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f83011262002b0757600080fd5b813562002b1e62002b188262002aac565b6200283f565b81815284602083860101111562002b3457600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806000806000806000806101408b8d03121562002b7257600080fd5b8a3567ffffffffffffffff8082111562002b8b57600080fd5b62002b998e838f0162002891565b9b5062002ba960208e016200276a565b9a5060408d0135995060608d0135985062002bc760808e016200276a565b975062002bd760a08e01620027a7565b965062002be760c08e016200276a565b955062002bf760e08e01620027a7565b94506101008d013593506101208d013591508082111562002c1757600080fd5b5062002c268d828e0162002af5565b9150509295989b9194979a5092959850565b60006020828403121562002c4b57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008262002ce7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820362002d205762002d2062002c81565b5060010190565b60006020828403121562002d3a57600080fd5b81518015158114620024cb57600080fd5b60005b8381101562002d6857818101518382015260200162002d4e565b838111156200204f5750506000910152565b600082601f83011262002d8c57600080fd5b815162002d9d62002b188262002aac565b81815284602083860101111562002db357600080fd5b62001b1882602083016020870162002d4b565b60006020828403121562002dd957600080fd5b815167ffffffffffffffff81111562002df157600080fd5b62001b188482850162002d7a565b60ff811681146200244b57600080fd5b60006020828403121562002e2257600080fd5b8151620024cb8162002dff565b6000815180845262002e4981602086016020860162002d4b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60608152600062002e90606083018662002e2f565b828103602084015262002ea4818662002e2f565b91505060ff83166040830152949350505050565b600063ffffffff808a16835273ffffffffffffffffffffffffffffffffffffffff808a166020850152818916604085015280881660608501525085608084015260e060a084015262002f0e60e084018662002e2f565b915080841660c08401525098975050505050505050565b60006020828403121562002f3857600080fd5b5051919050565b6000825162002f5381846020870162002d4b565b9190910192915050565b60008060006060848603121562002f7357600080fd5b835167ffffffffffffffff8082111562002f8c57600080fd5b62002f9a8783880162002d7a565b9450602086015191508082111562002fb157600080fd5b5062002fc08682870162002d7a565b925050604084015162002fd38162002dff565b809150509250925092565b60a08152600062002ff360a083018862002e2f565b828103602084015262003007818862002e2f565b60ff969096166040840152505073ffffffffffffffffffffffffffffffffffffffff92909216606083015260809091015292915050565b600080858511156200304f57600080fd5b838611156200305d57600080fd5b5050820193919092039150565b600080600080600080600060e0888a0312156200308657600080fd5b8735620030938162002784565b96506020880135620030a58162002784565b955060408801359450606088013593506080880135620030c58162002dff565b9699959850939692959460a0840135945060c09093013592915050565b600181815b808511156200314157817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111562003125576200312562002c81565b808516156200313357918102915b93841c9390800290620030e7565b509250929050565b6000826200315a5750600162000560565b81620031695750600062000560565b81600181146200318257600281146200318d57620031ad565b600191505062000560565b60ff841115620031a157620031a162002c81565b50506001821b62000560565b5060208310610133831016604e8410600b8410161715620031d2575081810a62000560565b620031de8383620030e2565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111562003213576200321362002c81565b029392505050565b6000620024cb838362003149565b6000828210156200323e576200323e62002c81565b500390565b6000821982111562003259576200325962002c81565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b602081526000620024cb602083018462002e2f56fe60806040523480156200001157600080fd5b50600054610100900460ff1615808015620000335750600054600160ff909116105b8062000063575062000050306200013d60201b6200080a1760201c565b15801562000063575060005460ff166001145b620000cb5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff191660011790558015620000ef576000805461ff0019166101001790555b801562000136576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b506200014c565b6001600160a01b03163b151590565b6116cd806200015c6000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80636c94522111610097578063a3c573eb11610066578063a3c573eb1461021c578063a457c2d714610261578063a9059cbb14610274578063dd62ed3e1461028757600080fd5b80636c945221146101b657806370a08231146101cb57806395d89b41146102015780639dc29fac1461020957600080fd5b806323b872dd116100d357806323b872dd1461014d578063313ce56714610160578063395093511461019057806340c10f19146101a357600080fd5b806306fdde03146100fa578063095ea7b31461011857806318160ddd1461013b575b600080fd5b6101026102cd565b60405161010f91906111c0565b60405180910390f35b61012b61012636600461125c565b61035f565b604051901515815260200161010f565b6035545b60405190815260200161010f565b61012b61015b366004611286565b610377565b60655474010000000000000000000000000000000000000000900460ff1660405160ff909116815260200161010f565b61012b61019e36600461125c565b61039b565b61012b6101b136600461125c565b6103e7565b6101c96101c436600461139c565b610483565b005b61013f6101d9366004611431565b73ffffffffffffffffffffffffffffffffffffffff1660009081526033602052604090205490565b61010261068e565b61012b61021736600461125c565b61069d565b60655461023c9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010f565b61012b61026f36600461125c565b61072b565b61012b61028236600461125c565b6107fc565b61013f610295366004611453565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260346020908152604080832093909416825291909152205490565b6060603680546102dc90611486565b80601f016020809104026020016040519081016040528092919081815260200182805461030890611486565b80156103555780601f1061032a57610100808354040283529160200191610355565b820191906000526020600020905b81548152906001019060200180831161033857829003601f168201915b5050505050905090565b60003361036d818585610826565b5060019392505050565b6000336103858582856109da565b610390858585610ab1565b506001949350505050565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919061036d90829086906103e2908790611508565b610826565b60655460009073ffffffffffffffffffffffffffffffffffffffff163314610470576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f546f6b656e577261707065643a4e4f545f42524944474500000000000000000060448201526064015b60405180910390fd5b61047a8383610d64565b50600192915050565b600054610100900460ff16158080156104a35750600054600160ff909116105b806104bd5750303b1580156104bd575060005460ff166001145b610549576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610467565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156105a757600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6105b18686610e85565b606580547fffffffffffffffffffffff00000000000000000000000000000000000000000016337fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16177401000000000000000000000000000000000000000060ff8716021790556106238383610d64565b801561068657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6060603780546102dc90611486565b60655460009073ffffffffffffffffffffffffffffffffffffffff163314610721576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f546f6b656e577261707065643a4e4f545f4252494447450000000000000000006044820152606401610467565b61047a8383610f26565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190838110156107ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610467565b6103908286868403610826565b60003361036d818585610ab1565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b73ffffffffffffffffffffffffffffffffffffffff83166108c8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff821661096b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152603460209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610aab5781811015610a9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610467565b610aab8484848403610826565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316610b54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff8216610bf7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604090205481811015610cad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260336020526040808220858503905591851681529081208054849290610cf1908490611508565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610d5791815260200190565b60405180910390a3610aab565b73ffffffffffffffffffffffffffffffffffffffff8216610de1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610467565b8060356000828254610df39190611508565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526033602052604081208054839290610e2d908490611508565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35b5050565b600054610100900460ff16610f1c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610467565b610e818282611110565b73ffffffffffffffffffffffffffffffffffffffff8216610fc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff82166000908152603360205260409020548181101561107f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604081208383039055603580548492906110bb908490611520565b909155505060405182815260009073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016109cd565b505050565b600054610100900460ff166111a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610467565b60366111b3838261157d565b50603761110b828261157d565b600060208083528351808285015260005b818110156111ed578581018301518582016040015282016111d1565b818111156111ff576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461125757600080fd5b919050565b6000806040838503121561126f57600080fd5b61127883611233565b946020939093013593505050565b60008060006060848603121561129b57600080fd5b6112a484611233565b92506112b260208501611233565b9150604084013590509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261130257600080fd5b813567ffffffffffffffff8082111561131d5761131d6112c2565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715611363576113636112c2565b8160405283815286602085880101111561137c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080600060a086880312156113b457600080fd5b853567ffffffffffffffff808211156113cc57600080fd5b6113d889838a016112f1565b965060208801359150808211156113ee57600080fd5b506113fb888289016112f1565b945050604086013560ff8116811461141257600080fd5b925061142060608701611233565b949793965091946080013592915050565b60006020828403121561144357600080fd5b61144c82611233565b9392505050565b6000806040838503121561146657600080fd5b61146f83611233565b915061147d60208401611233565b90509250929050565b600181811c9082168061149a57607f821691505b6020821081036114d3577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561151b5761151b6114d9565b500190565b600082821015611532576115326114d9565b500390565b601f82111561110b57600081815260208120601f850160051c8101602086101561155e5750805b601f850160051c820191505b818110156106865782815560010161156a565b815167ffffffffffffffff811115611597576115976112c2565b6115ab816115a58454611486565b84611537565b602080601f8311600181146115fe57600084156115c85750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610686565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561164b5788860151825594840194600190910190840161162c565b508582101561168757878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b0190555056fea264697066735822122015dd8047eba7f7221e0d7792549e5a01ba1b6dfaad0c6a70dc82ef386e0c5cc464736f6c634300080f0033a264697066735822122068cb524538909c05cc5109b7664a019588dc698f1f570976efb4dd6b6aee818364736f6c634300080f0033", + "bytecode": "0x6080604052600436106200017b5760003560e01c806381b1c17411620000cf578063d02103ca116200007d578063e73758811162000060578063e73758811462000589578063ed6be5c914620005bd578063ff634ed714620005d457600080fd5b8063d02103ca1462000543578063d96a15f7146200057257600080fd5b8063a08e8a0811620000b2578063a08e8a0814620004bf578063b7e6a7d414620004e9578063bab161bf146200050e57600080fd5b806381b1c17414620004535780638624c35c146200049a57600080fd5b80633ae05047116200012d5780633e19704311620001105780633e19704314620003155780634638554914620004095780637b6323c1146200042e57600080fd5b80633ae0504714620002c75780633da8168214620002df57600080fd5b80632dfdf0b511620001625780632dfdf0b514620001e85780632f3a3d5d146200020f578063318aee3d146200023e57600080fd5b80630871e971146200018057806322e95f2c1462000199575b600080fd5b6200019762000191366004620032c4565b620005eb565b005b348015620001a657600080fd5b50620001be620001b836600462003380565b62000bdf565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b348015620001f557600080fd5b506200020060415481565b604051908152602001620001df565b3480156200021c57600080fd5b50604754620001be9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156200024b57600080fd5b50620002956200025d366004620033bc565b60456020526000908152604090205463ffffffff811690640100000000900473ffffffffffffffffffffffffffffffffffffffff1682565b6040805163ffffffff909316835273ffffffffffffffffffffffffffffffffffffffff909116602083015201620001df565b348015620002d457600080fd5b506200020062000c82565b348015620002ec57600080fd5b5062000304620002fe366004620034db565b62000d5c565b6040519015158152602001620001df565b3480156200032257600080fd5b50620002006200033436600462003559565b6040517fff0000000000000000000000000000000000000000000000000000000000000060f889901b1660208201527fffffffff0000000000000000000000000000000000000000000000000000000060e088811b821660218401527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606089811b821660258601529188901b909216603984015285901b16603d8201526051810183905260718101829052600090609101604051602081830303815290604052805190602001209050979650505050505050565b3480156200041657600080fd5b50620001976200042836600462003688565b62000e5c565b3480156200043b57600080fd5b50620001976200044d36600462003688565b62001617565b3480156200046057600080fd5b50620001be620004723660046200376f565b60446020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b348015620004a757600080fd5b5062000197620004b936600462003380565b620020c2565b348015620004cc57600080fd5b50620004d6600081565b60405160ff9091168152602001620001df565b348015620004f657600080fd5b50620001be6200050836600462003380565b62002340565b3480156200051b57600080fd5b506042546200052d9063ffffffff1681565b60405163ffffffff9091168152602001620001df565b3480156200055057600080fd5b50604654620001be9073ffffffffffffffffffffffffffffffffffffffff1681565b620001976200058336600462003789565b62002409565b3480156200059657600080fd5b5062000304620005a83660046200376f565b60436020526000908152604090205460ff1681565b348015620005ca57600080fd5b506200052d600081565b348015620005e157600080fd5b50620004d6600181565b60425463ffffffff908116908616036200068c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4272696467653a3a6272696467653a2044455354494e4154494f4e5f43414e5460448201527f5f42455f495453454c460000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600080606073ffffffffffffffffffffffffffffffffffffffff891662000748578534146200073e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4272696467653a3a6272696467653a20414d4f554e545f444f45535f4e4f545f60448201527f4d415443485f4d53475f56414c55450000000000000000000000000000000000606482015260840162000683565b6000915062000a5c565b73ffffffffffffffffffffffffffffffffffffffff808a1660009081526045602090815260409182902082518084019093525463ffffffff811683526401000000009004909216918101829052901562000849576040517f9dc29fac0000000000000000000000000000000000000000000000000000000081523360048201526024810188905273ffffffffffffffffffffffffffffffffffffffff8b1690639dc29fac906044016020604051808303816000875af115801562000810573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620008369190620037f1565b5060208101518151909450925062000a5a565b84156200085e576200085e8a88888862002656565b6200088273ffffffffffffffffffffffffffffffffffffffff8b1633308a62002a81565b899350604260009054906101000a900463ffffffff1692508973ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa158015620008e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526200092e919081019062003890565b8a73ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156200097a573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052620009c2919081019062003890565b8b73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000a0e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a349190620038c9565b60405160200162000a489392919062003935565b60405160208183030381529060405291505b505b7f501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b600083858b8b8b8760415460405162000a9e98979695949392919062003972565b60405180910390a18051602080830191909120604080516000818501527fffffffff0000000000000000000000000000000000000000000000000000000060e087811b821660218401527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608a811b82166025860152918f901b90921660398401528c901b16603d820152605181018a9052607180820193909352815180820390930183526091019052805191012062000b599062002b65565b60465473ffffffffffffffffffffffffffffffffffffffff166333d6247d62000b8162000c82565b6040518263ffffffff1660e01b815260040162000ba091815260200190565b600060405180830381600087803b15801562000bbb57600080fd5b505af115801562000bd0573d6000803e3d6000fd5b50505050505050505050505050565b6040805160e084901b7fffffffff0000000000000000000000000000000000000000000000000000000016602080830191909152606084901b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166024830152825160188184030181526038909201835281519181019190912060009081526044909152205473ffffffffffffffffffffffffffffffffffffffff165b92915050565b6041546000908190815b602081101562000d54578160011660010362000cec576001816020811062000cb85762000cb8620039eb565b0154604080516020810192909252810184905260600160405160208183030381529060405280519060200120925062000d30565b826021826020811062000d035762000d03620039eb565b01546040805160208101939093528201526060016040516020818303038152906040528051906020012092505b62000d3d60028362003a49565b91508062000d4b8162003a85565b91505062000c8c565b509092915050565b60008467ffffffffffffffff8416825b602081101562000e4f578160011660010362000dd95786818151811062000d975762000d97620039eb565b60200260200101518360405160200162000dbb929190918252602082015260400190565b60405160208183030381529060405280519060200120925062000e2b565b8287828151811062000def5762000def620039eb565b602002602001015160405160200162000e12929190918252602082015260400190565b6040516020818303038152906040528051906020012092505b62000e3860028362003a49565b91508062000e468162003a85565b91505062000d6c565b5050909114949350505050565b63ffffffff891660009081526043602052604090205460ff161562000f04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4272696467653a3a636c61696d4d6573736167653a20414c52454144595f434c60448201527f41494d4544000000000000000000000000000000000000000000000000000000606482015260840162000683565b6046546040805160208082018c90528183018b9052825180830384018152606083019384905280519101207f257b363200000000000000000000000000000000000000000000000000000000909252606481019190915273ffffffffffffffffffffffffffffffffffffffff9091169063257b3632906084016020604051808303816000875af115801562000f9d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000fc3919062003ac0565b60000362001054576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4272696467653a3a636c61696d4d6573736167653a20474c4f42414c5f45584960448201527f545f524f4f545f444f45535f4e4f545f4d415443480000000000000000000000606482015260840162000683565b60425463ffffffff858116911614620010f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4272696467653a3a636c61696d4d6573736167653a2044455354494e4154494f60448201527f4e5f4e4554574f524b5f444f45535f4e4f545f4d415443480000000000000000606482015260840162000683565b60425463ffffffff166200126e578051602080830191909120604080517f0100000000000000000000000000000000000000000000000000000000000000818501527fffffffff0000000000000000000000000000000000000000000000000000000060e08b811b821660218401527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608c811b82166025860152918b901b909216603984015288901b16603d820152605181018690526071808201939093528151808203909301835260910190528051910120620011da905b8b8b63ffffffff168a62000d5c565b62001268576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4272696467653a3a636c61696d4d6573736167653a20534d545f494e56414c4960448201527f4400000000000000000000000000000000000000000000000000000000000000606482015260840162000683565b620013d8565b8051602080830191909120604080517f0100000000000000000000000000000000000000000000000000000000000000818501527fffffffff0000000000000000000000000000000000000000000000000000000060e08b811b821660218401527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608c811b82166025860152918b901b909216603984015288901b16603d8201526051810186905260718082019390935281518082039093018352609101905280519101206200134a905b8b8b63ffffffff168b62000d5c565b620013d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4272696467653a3a636c61696d4d6573736167653a20534d545f494e56414c4960448201527f4400000000000000000000000000000000000000000000000000000000000000606482015260840162000683565b63ffffffff891660009081526043602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555173ffffffffffffffffffffffffffffffffffffffff8516908490620014469089908b90879060240162003ada565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f1806b5f20000000000000000000000000000000000000000000000000000000017905251620014c9919062003b20565b60006040518083038185875af1925050503d806000811462001508576040519150601f19603f3d011682016040523d82523d6000602084013e6200150d565b606091505b50509050806200159f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4272696467653a3a636c61696d4d6573736167653a204d4553534147455f464160448201527f494c454400000000000000000000000000000000000000000000000000000000606482015260840162000683565b6040805163ffffffff8c811682528916602082015273ffffffffffffffffffffffffffffffffffffffff88811682840152861660608201526080810185905290517f25308c93ceeed162da955b3f7ce3e3f93606579e40fb92029faa9efe275459839181900360a00190a15050505050505050505050565b63ffffffff891660009081526043602052604090205460ff161562001699576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4272696467653a3a636c61696d3a20414c52454144595f434c41494d45440000604482015260640162000683565b6046546040805160208082018c90528183018b9052825180830384018152606083019384905280519101207f257b363200000000000000000000000000000000000000000000000000000000909252606481019190915273ffffffffffffffffffffffffffffffffffffffff9091169063257b3632906084016020604051808303816000875af115801562001732573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001758919062003ac0565b600003620017e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4272696467653a3a636c61696d3a20474c4f42414c5f455849545f524f4f545f60448201527f444f45535f4e4f545f4d41544348000000000000000000000000000000000000606482015260840162000683565b60425463ffffffff85811691161462001885576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4272696467653a3a636c61696d3a2044455354494e4154494f4e5f4e4554574f60448201527f524b5f444f45535f4e4f545f4d41544348000000000000000000000000000000606482015260840162000683565b60425463ffffffff16620019b4578051602080830191909120604080516000818501527fffffffff0000000000000000000000000000000000000000000000000000000060e08b811b821660218401527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608c811b82166025860152918b901b909216603984015288901b16603d8201526051810186905260718082019390935281518082039093018352609101905280519101206200194690620011cb565b620019ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4272696467653a3a636c61696d3a20534d545f494e56414c4944000000000000604482015260640162000683565b62001acf565b8051602080830191909120604080516000818501527fffffffff0000000000000000000000000000000000000000000000000000000060e08b811b821660218401527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608c811b82166025860152918b901b909216603984015288901b16603d82015260518101869052607180820193909352815180820390930183526091019052805191012062001a67906200133b565b62001acf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4272696467653a3a636c61696d3a20534d545f494e56414c4944000000000000604482015260640162000683565b63ffffffff8916600090815260436020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905573ffffffffffffffffffffffffffffffffffffffff851662001c40576040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff851690849060405162001b62919062003b20565b60006040518083038185875af1925050503d806000811462001ba1576040519150601f19603f3d011682016040523d82523d6000602084013e62001ba6565b606091505b505090508062001c39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f4272696467653a3a636c61696d3a204554485f5452414e534645525f4641494c60448201527f4544000000000000000000000000000000000000000000000000000000000000606482015260840162000683565b506200204b565b60425463ffffffff9081169087160362001c7d5762001c7773ffffffffffffffffffffffffffffffffffffffff8616848462002cde565b6200204b565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b1660208201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b166024820152600090603801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291815281516020928301206000818152604490935291205490915073ffffffffffffffffffffffffffffffffffffffff168062001faa5760475460009062001d689073ffffffffffffffffffffffffffffffffffffffff168462002d36565b905060008060008680602001905181019062001d85919062003b3e565b9250925092508373ffffffffffffffffffffffffffffffffffffffff16636c9452218484848d8d6040518663ffffffff1660e01b815260040162001dce95949392919062003bbf565b600060405180830381600087803b15801562001de957600080fd5b505af115801562001dfe573d6000803e3d6000fd5b50505050836044600088815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060405180604001604052808d63ffffffff1681526020018c73ffffffffffffffffffffffffffffffffffffffff16815250604560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050507fccd7715648d1f2bb13e158f96b5b6c3aeda555d4cb87112e274a6f28bc571d598c8c8660405162001f989392919063ffffffff93909316835273ffffffffffffffffffffffffffffffffffffffff918216602084015216604082015260600190565b60405180910390a15050505062002048565b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152602482018690528216906340c10f19906044016020604051808303816000875af115801562002020573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620020469190620037f1565b505b50505b6040805163ffffffff8b811682528816602082015273ffffffffffffffffffffffffffffffffffffffff87811682840152851660608201526080810184905290517f25308c93ceeed162da955b3f7ce3e3f93606579e40fb92029faa9efe275459839181900360a00190a150505050505050505050565b600054610100900460ff1615808015620020e35750600054600160ff909116105b80620020ff5750303b158015620020ff575060005460ff166001145b6200218d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840162000683565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015620021ec57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b604280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff8516179055604680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84161790556040516200226a906200326c565b604051809103906000f08015801562002287573d6000803e3d6000fd5b50604780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055620022d762002e16565b80156200233b57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1660208201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606083901b1660248201526000908190603801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190528051602090910120604754909150620024019073ffffffffffffffffffffffffffffffffffffffff168262002f5e565b949350505050565b60425463ffffffff90811690841603620024a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4272696467653a3a6272696467653a2044455354494e4154494f4e5f43414e5460448201527f5f42455f495453454c4600000000000000000000000000000000000000000000606482015260840162000683565b6042546041546040517f501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b92620024f39260019263ffffffff9092169133918991899134918a919062003972565b60405180910390a16042548151602080840191909120604080517f0100000000000000000000000000000000000000000000000000000000000000818501527fffffffff0000000000000000000000000000000000000000000000000000000060e095861b811660218301527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000033606090811b82166025850152968a901b90911660398301529487901b909416603d8501523460518501526071808501929092528051808503909201825260919093019092528151910120620025d69062002b65565b60465473ffffffffffffffffffffffffffffffffffffffff166333d6247d620025fe62000c82565b6040518263ffffffff1660e01b81526004016200261d91815260200190565b600060405180830381600087803b1580156200263857600080fd5b505af11580156200264d573d6000803e3d6000fd5b50505050505050565b60006200269983838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525062002fe292505050565b90507fffffffff0000000000000000000000000000000000000000000000000000000081167fd505accf000000000000000000000000000000000000000000000000000000001462002748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4272696467653a3a5f7065726d69743a204e4f545f56414c49445f43414c4c00604482015260640162000683565b60008080808080806200275f896004818d62003c1f565b8101906200276e919062003c4b565b96509650965096509650965096503373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff161462002839576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4272696467653a3a5f7065726d69743a205045524d49545f4f574e45525f4d5560448201527f53545f42455f5448455f53454e44455200000000000000000000000000000000606482015260840162000683565b73ffffffffffffffffffffffffffffffffffffffff86163014620028e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4272696467653a3a5f7065726d69743a205350454e4445525f4d5553545f424560448201527f5f54484953000000000000000000000000000000000000000000000000000000606482015260840162000683565b8a851462002971576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4272696467653a3a5f7065726d69743a205045524d49545f414d4f554e545f4460448201527f4f45535f4e4f545f4d4154434800000000000000000000000000000000000000606482015260840162000683565b6040805173ffffffffffffffffffffffffffffffffffffffff89811660248301528881166044830152606482018890526084820187905260ff861660a483015260c4820185905260e48083018590528351808403909101815261010490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fd505accf000000000000000000000000000000000000000000000000000000001790529151918e169162002a2c919062003b20565b6000604051808303816000865af19150503d806000811462002a6b576040519150601f19603f3d011682016040523d82523d6000602084013e62002a70565b606091505b505050505050505050505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff8085166024830152831660448201526064810182905262002b5f9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915262002fe9565b50505050565b80600162002b766020600262003ddf565b62002b82919062003ded565b6041541062002c14576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4465706f736974436f6e74726163743a5f6465706f7369743a204d45524b4c4560448201527f5f545245455f46554c4c00000000000000000000000000000000000000000000606482015260840162000683565b60016041600082825462002c29919062003e07565b909155505060415460005b602081101562002cd3578160011660010362002c6957826001826020811062002c615762002c61620039eb565b015550505050565b6001816020811062002c7f5762002c7f620039eb565b0154604080516020810192909252810184905260600160405160208183030381529060405280519060200120925060028262002cbc919062003a49565b91508062002cca8162003a85565b91505062002c34565b506200233b62003e22565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526200233b9084907fa9059cbb000000000000000000000000000000000000000000000000000000009060640162002adc565b60006040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528360601b60148201527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006028820152826037826000f591505073ffffffffffffffffffffffffffffffffffffffff811662000c7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f455243313136373a2063726561746532206661696c6564000000000000000000604482015260640162000683565b600054610100900460ff1662002eaf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840162000683565b60005b62002ec06001602062003ded565b81101562002f5b576021816020811062002ede5762002ede620039eb565b01546021826020811062002ef65762002ef6620039eb565b015460408051602081019390935282015260600160405160208183030381529060405280519060200120602182600162002f31919062003e07565b6020811062002f445762002f44620039eb565b01558062002f528162003a85565b91505062002eb2565b50565b600062002fdb8383306040517f3d602d80600a3d3981f3363d3d373d3d3d363d730000000000000000000000008152606093841b60148201527f5af43d82803e903d91602b57fd5bf3ff000000000000000000000000000000006028820152921b6038830152604c8201526037808220606c830152605591012090565b9392505050565b6020015190565b60006200304d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16620030fc9092919063ffffffff16565b8051909150156200233b57808060200190518101906200306e9190620037f1565b6200233b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840162000683565b60606200240184846000858573ffffffffffffffffffffffffffffffffffffffff85163b62003188576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000683565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051620031b3919062003b20565b60006040518083038185875af1925050503d8060008114620031f2576040519150601f19603f3d011682016040523d82523d6000602084013e620031f7565b606091505b50915091506200320982828662003214565b979650505050505050565b606083156200322557508162002fdb565b825115620032365782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000683919062003e51565b6118298062003e6783390190565b73ffffffffffffffffffffffffffffffffffffffff8116811462002f5b57600080fd5b8035620032aa816200327a565b919050565b803563ffffffff81168114620032aa57600080fd5b60008060008060008060a08789031215620032de57600080fd5b8635620032eb816200327a565b9550620032fb60208801620032af565b945060408701356200330d816200327a565b935060608701359250608087013567ffffffffffffffff808211156200333257600080fd5b818901915089601f8301126200334757600080fd5b8135818111156200335757600080fd5b8a60208285010111156200336a57600080fd5b6020830194508093505050509295509295509295565b600080604083850312156200339457600080fd5b6200339f83620032af565b91506020830135620033b1816200327a565b809150509250929050565b600060208284031215620033cf57600080fd5b813562002fdb816200327a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715620034555762003455620033dc565b604052919050565b600082601f8301126200346f57600080fd5b8135602067ffffffffffffffff8211156200348e576200348e620033dc565b8160051b6200349f8282016200340b565b9283528481018201928281019087851115620034ba57600080fd5b83870192505b848310156200320957823582529183019190830190620034c0565b60008060008060808587031215620034f257600080fd5b84359350602085013567ffffffffffffffff808211156200351257600080fd5b62003520888389016200345d565b94506040870135915080821682146200353857600080fd5b509396929550929360600135925050565b60ff8116811462002f5b57600080fd5b600080600080600080600060e0888a0312156200357557600080fd5b8735620035828162003549565b96506200359260208901620032af565b95506040880135620035a4816200327a565b9450620035b460608901620032af565b93506080880135620035c6816200327a565b9699959850939692959460a0840135945060c09093013592915050565b600067ffffffffffffffff821115620036005762003600620033dc565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f8301126200363e57600080fd5b8135620036556200364f82620035e3565b6200340b565b8181528460208386010111156200366b57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806000806000806000806101408b8d031215620036a957600080fd5b8a3567ffffffffffffffff80821115620036c257600080fd5b620036d08e838f016200345d565b9b50620036e060208e01620032af565b9a5060408d0135995060608d01359850620036fe60808e01620032af565b97506200370e60a08e016200329d565b96506200371e60c08e01620032af565b95506200372e60e08e016200329d565b94506101008d013593506101208d01359150808211156200374e57600080fd5b506200375d8d828e016200362c565b9150509295989b9194979a5092959850565b6000602082840312156200378257600080fd5b5035919050565b6000806000606084860312156200379f57600080fd5b620037aa84620032af565b92506020840135620037bc816200327a565b9150604084013567ffffffffffffffff811115620037d957600080fd5b620037e7868287016200362c565b9150509250925092565b6000602082840312156200380457600080fd5b8151801515811462002fdb57600080fd5b60005b838110156200383257818101518382015260200162003818565b8381111562002b5f5750506000910152565b600082601f8301126200385657600080fd5b8151620038676200364f82620035e3565b8181528460208386010111156200387d57600080fd5b6200240182602083016020870162003815565b600060208284031215620038a357600080fd5b815167ffffffffffffffff811115620038bb57600080fd5b620024018482850162003844565b600060208284031215620038dc57600080fd5b815162002fdb8162003549565b600081518084526200390381602086016020860162003815565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6060815260006200394a6060830186620038e9565b82810360208401526200395e8186620038e9565b91505060ff83166040830152949350505050565b600061010060ff8b16835263ffffffff808b16602085015273ffffffffffffffffffffffffffffffffffffffff808b166040860152818a1660608601528089166080860152508660a08501528160c0850152620039d282850187620038e9565b925080851660e085015250509998505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008262003a80577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820362003ab95762003ab962003a1a565b5060010190565b60006020828403121562003ad357600080fd5b5051919050565b73ffffffffffffffffffffffffffffffffffffffff8416815263ffffffff8316602082015260606040820152600062003b176060830184620038e9565b95945050505050565b6000825162003b3481846020870162003815565b9190910192915050565b60008060006060848603121562003b5457600080fd5b835167ffffffffffffffff8082111562003b6d57600080fd5b62003b7b8783880162003844565b9450602086015191508082111562003b9257600080fd5b5062003ba18682870162003844565b925050604084015162003bb48162003549565b809150509250925092565b60a08152600062003bd460a0830188620038e9565b828103602084015262003be88188620038e9565b60ff969096166040840152505073ffffffffffffffffffffffffffffffffffffffff92909216606083015260809091015292915050565b6000808585111562003c3057600080fd5b8386111562003c3e57600080fd5b5050820193919092039150565b600080600080600080600060e0888a03121562003c6757600080fd5b873562003c74816200327a565b9650602088013562003c86816200327a565b955060408801359450606088013593506080880135620035c68162003549565b600181815b8085111562003d0557817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111562003ce95762003ce962003a1a565b8085161562003cf757918102915b93841c939080029062003cab565b509250929050565b60008262003d1e5750600162000c7c565b8162003d2d5750600062000c7c565b816001811462003d46576002811462003d515762003d71565b600191505062000c7c565b60ff84111562003d655762003d6562003a1a565b50506001821b62000c7c565b5060208310610133831016604e8410600b841016171562003d96575081810a62000c7c565b62003da2838362003ca6565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111562003dd75762003dd762003a1a565b029392505050565b600062002fdb838362003d0d565b60008282101562003e025762003e0262003a1a565b500390565b6000821982111562003e1d5762003e1d62003a1a565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60208152600062002fdb6020830184620038e956fe60806040523480156200001157600080fd5b50600054610100900460ff1615808015620000335750600054600160ff909116105b8062000063575062000050306200013d60201b6200080a1760201c565b15801562000063575060005460ff166001145b620000cb5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff191660011790558015620000ef576000805461ff0019166101001790555b801562000136576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b506200014c565b6001600160a01b03163b151590565b6116cd806200015c6000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80636c94522111610097578063a3c573eb11610066578063a3c573eb1461021c578063a457c2d714610261578063a9059cbb14610274578063dd62ed3e1461028757600080fd5b80636c945221146101b657806370a08231146101cb57806395d89b41146102015780639dc29fac1461020957600080fd5b806323b872dd116100d357806323b872dd1461014d578063313ce56714610160578063395093511461019057806340c10f19146101a357600080fd5b806306fdde03146100fa578063095ea7b31461011857806318160ddd1461013b575b600080fd5b6101026102cd565b60405161010f91906111c0565b60405180910390f35b61012b61012636600461125c565b61035f565b604051901515815260200161010f565b6035545b60405190815260200161010f565b61012b61015b366004611286565b610377565b60655474010000000000000000000000000000000000000000900460ff1660405160ff909116815260200161010f565b61012b61019e36600461125c565b61039b565b61012b6101b136600461125c565b6103e7565b6101c96101c436600461139c565b610483565b005b61013f6101d9366004611431565b73ffffffffffffffffffffffffffffffffffffffff1660009081526033602052604090205490565b61010261068e565b61012b61021736600461125c565b61069d565b60655461023c9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010f565b61012b61026f36600461125c565b61072b565b61012b61028236600461125c565b6107fc565b61013f610295366004611453565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260346020908152604080832093909416825291909152205490565b6060603680546102dc90611486565b80601f016020809104026020016040519081016040528092919081815260200182805461030890611486565b80156103555780601f1061032a57610100808354040283529160200191610355565b820191906000526020600020905b81548152906001019060200180831161033857829003601f168201915b5050505050905090565b60003361036d818585610826565b5060019392505050565b6000336103858582856109da565b610390858585610ab1565b506001949350505050565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919061036d90829086906103e2908790611508565b610826565b60655460009073ffffffffffffffffffffffffffffffffffffffff163314610470576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f546f6b656e577261707065643a4e4f545f42524944474500000000000000000060448201526064015b60405180910390fd5b61047a8383610d64565b50600192915050565b600054610100900460ff16158080156104a35750600054600160ff909116105b806104bd5750303b1580156104bd575060005460ff166001145b610549576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610467565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156105a757600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6105b18686610e85565b606580547fffffffffffffffffffffff00000000000000000000000000000000000000000016337fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16177401000000000000000000000000000000000000000060ff8716021790556106238383610d64565b801561068657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6060603780546102dc90611486565b60655460009073ffffffffffffffffffffffffffffffffffffffff163314610721576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f546f6b656e577261707065643a4e4f545f4252494447450000000000000000006044820152606401610467565b61047a8383610f26565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190838110156107ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610467565b6103908286868403610826565b60003361036d818585610ab1565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b73ffffffffffffffffffffffffffffffffffffffff83166108c8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff821661096b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152603460209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610aab5781811015610a9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610467565b610aab8484848403610826565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316610b54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff8216610bf7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604090205481811015610cad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260336020526040808220858503905591851681529081208054849290610cf1908490611508565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610d5791815260200190565b60405180910390a3610aab565b73ffffffffffffffffffffffffffffffffffffffff8216610de1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610467565b8060356000828254610df39190611508565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526033602052604081208054839290610e2d908490611508565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35b5050565b600054610100900460ff16610f1c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610467565b610e818282611110565b73ffffffffffffffffffffffffffffffffffffffff8216610fc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff82166000908152603360205260409020548181101561107f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604081208383039055603580548492906110bb908490611520565b909155505060405182815260009073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016109cd565b505050565b600054610100900460ff166111a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610467565b60366111b3838261157d565b50603761110b828261157d565b600060208083528351808285015260005b818110156111ed578581018301518582016040015282016111d1565b818111156111ff576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461125757600080fd5b919050565b6000806040838503121561126f57600080fd5b61127883611233565b946020939093013593505050565b60008060006060848603121561129b57600080fd5b6112a484611233565b92506112b260208501611233565b9150604084013590509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261130257600080fd5b813567ffffffffffffffff8082111561131d5761131d6112c2565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715611363576113636112c2565b8160405283815286602085880101111561137c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080600060a086880312156113b457600080fd5b853567ffffffffffffffff808211156113cc57600080fd5b6113d889838a016112f1565b965060208801359150808211156113ee57600080fd5b506113fb888289016112f1565b945050604086013560ff8116811461141257600080fd5b925061142060608701611233565b949793965091946080013592915050565b60006020828403121561144357600080fd5b61144c82611233565b9392505050565b6000806040838503121561146657600080fd5b61146f83611233565b915061147d60208401611233565b90509250929050565b600181811c9082168061149a57607f821691505b6020821081036114d3577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561151b5761151b6114d9565b500190565b600082821015611532576115326114d9565b500390565b601f82111561110b57600081815260208120601f850160051c8101602086101561155e5750805b601f850160051c820191505b818110156106865782815560010161156a565b815167ffffffffffffffff811115611597576115976112c2565b6115ab816115a58454611486565b84611537565b602080601f8311600181146115fe57600084156115c85750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610686565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561164b5788860151825594840194600190910190840161162c565b508582101561168757878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b0190555056fea264697066735822122015dd8047eba7f7221e0d7792549e5a01ba1b6dfaad0c6a70dc82ef386e0c5cc464736f6c634300080f0033a26469706673582212200f33d24b40d1e879f02496512d8e703a09704c5edf7d149259a9c3cf2b64250664736f6c634300080f0033", "storage": { "0x0000000000000000000000000000000000000000000000000000000000000000": "0x01", "0x0000000000000000000000000000000000000000000000000000000000000042": "0x01", @@ -64,7 +64,7 @@ "0x000000000000000000000000000000000000000000000000000000000000003f": "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", "0x0000000000000000000000000000000000000000000000000000000000000040": "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" }, - "contractName": "Bridge" + "contractName": "PolygonZkEVMBridge" }, { "balance": "0", @@ -88,15 +88,15 @@ } } ], - "expectedOldRoot": "0xb33635210b9f5d07769cf70bf5a3cbf241ecbaf79a9b66ef79b28d920da1f776", + "expectedOldRoot": "0x52a940938311f513017f0d9b1da06123c00603bb494763bcdbc536aebefa900c", "txs": [ { "from": "0xc949254d682d8c9ad5682521675b8f43b102aec4", "to": "0x9d98deabc42dd696deb9e40b4f1cab7ddbf55988", "nonce": 3, "value": "0", - "contractName": "Bridge", - "function": "claim", + "contractName": "PolygonZkEVMBridge", + "function": "claimAsset", "params": [ [ "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -133,7 +133,7 @@ "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" ], 0, - "0x573768af52d1354a7b83fb784ecbacecf8fead6ad49f25af8909a35b0a7bba05", + "0x5ba002329b53c11a2f1dfe90b11e031771842056cf2125b43da8103c199dcd7f", "0x0000000000000000000000000000000000000000000000000000000000000000", 0, "0x0000000000000000000000000000000000000000", @@ -144,19 +144,19 @@ ], "gasLimit": 2000000, "gasPrice": "0", - "data": "0x5d5d326f00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000573768af52d1354a7b83fb784ecbacecf8fead6ad49f25af8909a35b0a7bba050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c949254d682d8c9ad5682521675b8f43b102aec40000000000000000000000000000000000000000000000008ac7230489e80000000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000ad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5b4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d3021ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85e58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a193440eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968ffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f839867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756afcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0f9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5f8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf8923490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99cc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8beccda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d22733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981fe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0b46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0c65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2f4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd95a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e3774df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652cdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618db8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea32293237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d7358448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a90000000000000000000000000000000000000000000000000000000000000000", + "data": "0x7b6323c1000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000005ba002329b53c11a2f1dfe90b11e031771842056cf2125b43da8103c199dcd7f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c949254d682d8c9ad5682521675b8f43b102aec40000000000000000000000000000000000000000000000008ac7230489e80000000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000ad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5b4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d3021ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85e58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a193440eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968ffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f839867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756afcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0f9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5f8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf8923490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99cc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8beccda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d22733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981fe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0b46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0c65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2f4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd95a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e3774df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652cdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618db8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea32293237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d7358448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a90000000000000000000000000000000000000000000000000000000000000000", "chainId": 1000, "reason": "", - "customRawTx": "0xf905a80380831e8480949d98deabc42dd696deb9e40b4f1cab7ddbf5598880b905845d5d326f00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000573768af52d1354a7b83fb784ecbacecf8fead6ad49f25af8909a35b0a7bba050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c949254d682d8c9ad5682521675b8f43b102aec40000000000000000000000000000000000000000000000008ac7230489e80000000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000ad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5b4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d3021ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85e58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a193440eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968ffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f839867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756afcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0f9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5f8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf8923490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99cc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8beccda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d22733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981fe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0b46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0c65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2f4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd95a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e3774df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652cdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618db8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea32293237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d7358448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a900000000000000000000000000000000000000000000000000000000000000008203e8808048480a57632d9de622b3b3fbfb56471b4b31e0b810dc753a794dfeb87c032bee7edbdf61ad83e3ed2bd98cb242c8924bb6983d823f485776895efd6dc76f16a61c", - "rawTx": "0xf905e80380831e8480949d98deabc42dd696deb9e40b4f1cab7ddbf5598880b905845d5d326f00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000573768af52d1354a7b83fb784ecbacecf8fead6ad49f25af8909a35b0a7bba050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c949254d682d8c9ad5682521675b8f43b102aec40000000000000000000000000000000000000000000000008ac7230489e80000000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000ad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5b4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d3021ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85e58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a193440eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968ffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f839867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756afcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0f9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5f8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf8923490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99cc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8beccda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d22733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981fe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0b46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0c65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2f4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd95a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e3774df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652cdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618db8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea32293237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d7358448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a900000000000000000000000000000000000000000000000000000000000000008207f4a048480a57632d9de622b3b3fbfb56471b4b31e0b810dc753a794dfeb87c032beea07edbdf61ad83e3ed2bd98cb242c8924bb6983d823f485776895efd6dc76f16a6" + "customRawTx": "0xf905a80380831e8480949d98deabc42dd696deb9e40b4f1cab7ddbf5598880b905847b6323c1000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000005ba002329b53c11a2f1dfe90b11e031771842056cf2125b43da8103c199dcd7f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c949254d682d8c9ad5682521675b8f43b102aec40000000000000000000000000000000000000000000000008ac7230489e80000000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000ad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5b4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d3021ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85e58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a193440eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968ffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f839867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756afcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0f9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5f8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf8923490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99cc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8beccda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d22733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981fe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0b46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0c65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2f4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd95a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e3774df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652cdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618db8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea32293237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d7358448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a900000000000000000000000000000000000000000000000000000000000000008203e88080acc0f3f1c62c08b14771c6708632db779c4b9ab167793dd6e311a4bfe72d82183f054c5631e299c7f84ccf2b6244bd07c7f2a4fd7ebe4fc6daf46a0371831cdd1b", + "rawTx": "0xf905e80380831e8480949d98deabc42dd696deb9e40b4f1cab7ddbf5598880b905847b6323c1000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000005ba002329b53c11a2f1dfe90b11e031771842056cf2125b43da8103c199dcd7f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c949254d682d8c9ad5682521675b8f43b102aec40000000000000000000000000000000000000000000000008ac7230489e80000000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000ad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5b4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d3021ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85e58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a193440eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968ffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f839867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756afcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0f9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5f8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf8923490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99cc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8beccda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d22733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981fe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0b46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0c65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2f4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd95a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e3774df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652cdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618db8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea32293237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d7358448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a900000000000000000000000000000000000000000000000000000000000000008207f3a0acc0f3f1c62c08b14771c6708632db779c4b9ab167793dd6e311a4bfe72d8218a03f054c5631e299c7f84ccf2b6244bd07c7f2a4fd7ebe4fc6daf46a0371831cdd" }, { "from": "0xc949254d682d8c9ad5682521675b8f43b102aec4", "to": "0x9d98deabc42dd696deb9e40b4f1cab7ddbf55988", "nonce": 4, "value": "1000000000000000000", - "contractName": "Bridge", - "function": "bridge", + "contractName": "PolygonZkEVMBridge", + "function": "bridgeAsset", "params": [ "0x0000000000000000000000000000000000000000", 0, @@ -166,35 +166,33 @@ ], "gasLimit": 2000000, "gasPrice": "0", - "data": "0x508935f800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c949254d682d8c9ad5682521675b8f43b102aec40000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000", + "data": "0x0871e97100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c949254d682d8c9ad5682521675b8f43b102aec40000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000", "chainId": 1000, "reason": "", - "customRawTx": "0xf8ef0480831e8480949d98deabc42dd696deb9e40b4f1cab7ddbf55988880de0b6b3a7640000b8c4508935f800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c949254d682d8c9ad5682521675b8f43b102aec40000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000008203e88080cb1a319474de4dbee7c198144a6a4767d8aad6649d83b2fd76c8793a74fdad824d536fdded69a0ea3909ff40c9242cc12c2f1efe95581647252861333e84bfed1b", - "rawTx": "0xf9012f0480831e8480949d98deabc42dd696deb9e40b4f1cab7ddbf55988880de0b6b3a7640000b8c4508935f800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c949254d682d8c9ad5682521675b8f43b102aec40000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000008207f3a0cb1a319474de4dbee7c198144a6a4767d8aad6649d83b2fd76c8793a74fdad82a04d536fdded69a0ea3909ff40c9242cc12c2f1efe95581647252861333e84bfed" + "customRawTx": "0xf8ef0480831e8480949d98deabc42dd696deb9e40b4f1cab7ddbf55988880de0b6b3a7640000b8c40871e97100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c949254d682d8c9ad5682521675b8f43b102aec40000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000008203e88080f212cb649f835d4f9c788d3a6733911b8aa02c6b63751f3b931fb062bd1942e452e73d8704862f4eb55646e7440dcf65f6e7ca424e38340ed8bcf24597c6865d1c", + "rawTx": "0xf9012f0480831e8480949d98deabc42dd696deb9e40b4f1cab7ddbf55988880de0b6b3a7640000b8c40871e97100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c949254d682d8c9ad5682521675b8f43b102aec40000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000008207f4a0f212cb649f835d4f9c788d3a6733911b8aa02c6b63751f3b931fb062bd1942e4a052e73d8704862f4eb55646e7440dcf65f6e7ca424e38340ed8bcf24597c6865d" } ], - "expectedNewRoot": "0xfbfd4ed8618af74ccccfaefe6f9afa6ce24055bc215200bb365f85cb879c6817", + "expectedNewRoot": "0xe6df887aa885bec60e0f87b88b792ffa22702f18a725f43a9427d727601b4113", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { - "balance": "0", - "nonce": "0", - "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0xb33635210b9f5d07769cf70bf5a3cbf241ecbaf79a9b66ef79b28d920da1f776" - }, - "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", - "bytecodeLength": 0 - }, "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "1", "storage": { - "0x664cfcf7194b8e36c5de9768bca5f921966785e8528dec268b14fd13e1e97922": "0x01", + "0xb7b9bfbed410c773a6625940b8d940fbc10059beab3c33131a2bd6f11a2b106c": "0x73e6af6f", "0x0000000000000000000000000000000000000000000000000000000000000002": "0x9d98deabc42dd696deb9e40b4f1cab7ddbf55988", - "0x0000000000000000000000000000000000000000000000000000000000000001": "0x284215bd63e6ebdb90fd60b51c2da82dcc0dfe6c53ea6ef6995920da706a5897" + "0x0000000000000000000000000000000000000000000000000000000000000001": "0x97c7c68e5f6062b69b69b7395dd8ca484a2266fb86d782bc0f094eb1b73f17ba" }, "hashBytecode": "0xef2427249f0f776e1fb03a22fa9dc30b18372734b0742c63a0acb4a55c82e1a3", "bytecodeLength": 486 }, + "0x0000000000000000000000000000000000000000": { + "balance": "0", + "nonce": "0", + "storage": null, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 + }, "0x9d98deabc42dd696deb9e40b4f1cab7ddbf55988": { "balance": "99991000000000000000000", "nonce": "2", @@ -205,7 +203,7 @@ "0x0000000000000000000000000000000000000000000000000000000000000042": "0x01", "0x0000000000000000000000000000000000000000000000000000000000000046": "0xae4bb80be56b819606589de61d5ec3b522eeb032", "0x0000000000000000000000000000000000000000000000000000000000000047": "0x61ba0248b0986c2480181c6e76b6adeeaa962483", - "0x0000000000000000000000000000000000000000000000000000000000000001": "0x7ac47f029324d95af252563d003bdb7c483c73c80c6c4b0931c34c05478e293a", + "0x0000000000000000000000000000000000000000000000000000000000000001": "0xe0101b02f9f6ca22f4e9518033d4b1b033af8254b9285d93015c233140474852", "0x0000000000000000000000000000000000000000000000000000000000000022": "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5", "0x0000000000000000000000000000000000000000000000000000000000000023": "0xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30", "0x0000000000000000000000000000000000000000000000000000000000000024": "0x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85", @@ -238,8 +236,8 @@ "0x000000000000000000000000000000000000000000000000000000000000003f": "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", "0x0000000000000000000000000000000000000000000000000000000000000040": "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" }, - "hashBytecode": "0x0b50651f5202dfb99d0cf2d32ad3bad933ee4b67332325f8a303827f0c002e8c", - "bytecodeLength": 19201 + "hashBytecode": "0x5352aabf1bf5ffc33e0f37cd2d5decbd67a78b9f4a9b05986d09f150e3f65714", + "bytecodeLength": 22213 }, "0xc949254d682d8c9ad5682521675b8f43b102aec4": { "balance": "9000000000000000000", @@ -270,14 +268,26 @@ "storage": null, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 + }, + "0x000000000000000000000000000000005ca1ab1e": { + "balance": "0", + "nonce": "0", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x02", + "0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0x8c2127702da72a56961189c5f8b1097116d1a963c05fb98719394dda1ead2cf0", + "0xd9d16d34ffb15ba3a3d852f0d403e2ce1d691fb54de27ac87cd2f993f3ec330f": "0x4e2090a3d95b2235a2e549d7439f3c6d216507982fa641d0b5ba8d5e1e81bec0" + }, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 } }, - "batchL2Data": "0xf905a80380831e8480949d98deabc42dd696deb9e40b4f1cab7ddbf5598880b905845d5d326f00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000573768af52d1354a7b83fb784ecbacecf8fead6ad49f25af8909a35b0a7bba050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c949254d682d8c9ad5682521675b8f43b102aec40000000000000000000000000000000000000000000000008ac7230489e80000000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000ad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5b4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d3021ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85e58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a193440eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968ffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f839867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756afcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0f9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5f8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf8923490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99cc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8beccda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d22733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981fe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0b46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0c65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2f4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd95a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e3774df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652cdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618db8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea32293237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d7358448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a900000000000000000000000000000000000000000000000000000000000000008203e8808048480a57632d9de622b3b3fbfb56471b4b31e0b810dc753a794dfeb87c032bee7edbdf61ad83e3ed2bd98cb242c8924bb6983d823f485776895efd6dc76f16a61cf8ef0480831e8480949d98deabc42dd696deb9e40b4f1cab7ddbf55988880de0b6b3a7640000b8c4508935f800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c949254d682d8c9ad5682521675b8f43b102aec40000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000008203e88080cb1a319474de4dbee7c198144a6a4767d8aad6649d83b2fd76c8793a74fdad824d536fdded69a0ea3909ff40c9242cc12c2f1efe95581647252861333e84bfed1b", - "globalExitRoot": "0x5bf5ecd501710dc31809a1a9ffa9f832e5dc729361da93abd333b6611d123add", - "newLocalExitRoot": "0x284215bd63e6ebdb90fd60b51c2da82dcc0dfe6c53ea6ef6995920da706a5897", - "inputHash": "0x4e7213de255cb776177fea7d427b5cfa2dcacbc73e5b9e0f170786619ea3d4eb", - "batchHashData": "0xd8604505cb2959d10bd0a1a19fe863a05fd280271ce19cf9f26738b1f7c33587", + "batchL2Data": "0xf905a80380831e8480949d98deabc42dd696deb9e40b4f1cab7ddbf5598880b905847b6323c1000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000005ba002329b53c11a2f1dfe90b11e031771842056cf2125b43da8103c199dcd7f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c949254d682d8c9ad5682521675b8f43b102aec40000000000000000000000000000000000000000000000008ac7230489e80000000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000ad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5b4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d3021ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85e58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a193440eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968ffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f839867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756afcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0f9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5f8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf8923490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99cc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8beccda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d22733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981fe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0b46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0c65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2f4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd95a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e3774df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652cdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618db8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea32293237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d7358448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a900000000000000000000000000000000000000000000000000000000000000008203e88080acc0f3f1c62c08b14771c6708632db779c4b9ab167793dd6e311a4bfe72d82183f054c5631e299c7f84ccf2b6244bd07c7f2a4fd7ebe4fc6daf46a0371831cdd1bf8ef0480831e8480949d98deabc42dd696deb9e40b4f1cab7ddbf55988880de0b6b3a7640000b8c40871e97100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c949254d682d8c9ad5682521675b8f43b102aec40000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000008203e88080f212cb649f835d4f9c788d3a6733911b8aa02c6b63751f3b931fb062bd1942e452e73d8704862f4eb55646e7440dcf65f6e7ca424e38340ed8bcf24597c6865d1c", + "globalExitRoot": "0x772a7e7f901e350a1943a7204f9bcc5da04bcb804d3b37c4debda567b05b13c4", + "newLocalExitRoot": "0x97c7c68e5f6062b69b69b7395dd8ca484a2266fb86d782bc0f094eb1b73f17ba", + "batchHashData": "0xf8be4fda0fa34bf8b56f96439c31c682ecf16c435b283b468aa42daec1d91c58", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0x114c46cf96ffc260e7f621e001ae0231ec98767c2595f45c459ea94ef3312635" } ] \ No newline at end of file diff --git a/test/helpers/test-vectors/inputs-executor/input_executor.json b/test/helpers/test-vectors/inputs-executor/input_executor.json index dd4a2681..d7da94de 100644 --- a/test/helpers/test-vectors/inputs-executor/input_executor.json +++ b/test/helpers/test-vectors/inputs-executor/input_executor.json @@ -1,5 +1,17 @@ { "oldStateRoot": "0x2dc4db4293af236cb329700be43f08ace740a05088f8c7654736871709687e90", + "newStateRoot": "0xbff23fc2c168c033aaac77503ce18f958e9689d5cdaebb88c5524ce5c0319de3", + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "newAccInputHash": "0x2c9d2c1b2ed8e4be0719f443235c3483f8d6288c6d057859e7210fe39acce682", + "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "oldNumBatch": 0, + "newNumBatch": 1, + "chainID": 1000, + "batchL2Data": "0xee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731b", + "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", + "timestamp": 1944498031, + "sequencerAddr": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", + "contractsBytecode": {}, "db": { "0x2dc4db4293af236cb329700be43f08ace740a05088f8c7654736871709687e90": [ "0000000000000000", @@ -67,15 +79,5 @@ "0000000000000000", "0000000000000000" ] - }, - "sequencerAddr": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", - "batchL2Data": "0xee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731b", - "newStateRoot": "0xbff23fc2c168c033aaac77503ce18f958e9689d5cdaebb88c5524ce5c0319de3", - "oldLocalExitRoot": "0x17c04c3760510b48c6012742c540a81aba4bca2f78b9d14bfd2f123e2e53ea3e", - "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", - "numBatch": 1, - "timestamp": 1944498031, - "chainID": 1000, - "contractsBytecode": {} + } } \ No newline at end of file diff --git a/test/helpers/test-vectors/processor/state-transition.json b/test/helpers/test-vectors/processor/state-transition.json index 7d7f0bfb..e9a5ecc5 100644 --- a/test/helpers/test-vectors/processor/state-transition.json +++ b/test/helpers/test-vectors/processor/state-transition.json @@ -34,22 +34,13 @@ "customRawTx": "0xee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731b" } ], - "expectedNewRoot": "0x5a52a0ee8577a03e831f627fead1921da142f3820f5880118e98ae6362626b3c", + "expectedNewRoot": "0xea2eb6fb48966077643e7a7dbde44df32d65ca64476c4f9ecb1dc99ba4bc0d72", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { - "balance": "0", - "nonce": "0", - "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0x4a9bfcb163ec91c5beb22e6aca41592433092c8c7821b01d37fd0de483f9265d" - }, - "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", - "bytecodeLength": 0 - }, "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x01" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" }, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 @@ -67,15 +58,26 @@ "storage": null, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 + }, + "0x000000000000000000000000000000005ca1ab1e": { + "balance": "0", + "nonce": "0", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x01", + "0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0xff820a2828206984cb9c56603f585beaa62ff9892598c269c3c38d7b53b081bb" + }, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 } }, "batchL2Data": "0xee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731b", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0x6dcef8046ea49c2ffc910e13524b18727c1ef1520d3d7d477f9cd84cd7ac7dfb", - "batchHashData": "0x9370689d3c20a5a4739f902a31e2ea20c7d7be121a0fc19468a2e1b5d87f4111", + "batchHashData": "0x80cc22bc1a205c21f2b8c87e6185e1215fb60e3d83c609fd3bf3cdc586a6244b", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0x704d5cfd3e44b82028f7f8cae31168267a7422c5a447b90a65134116da5a8432" }, { "id": 1, @@ -182,22 +184,13 @@ "rawTx": "0xf86c80843b9aca00830186a094abcced19d7f290b84608fec510bee872cc8f5112880de0b6b3a7640000801ba02c92035bc11227e9e94ba066a6d77a65c43d29dfb4a855c9464e1b60fabd6334a07171c6dc84816ffcf025040cd6193ecef3928a0c4e4964ddba320826b76c725d" } ], - "expectedNewRoot": "0x8e5389c78d997fb5116a6d6a7a374aa61836fe4b0ab68b3c842d3b16c782ba97", + "expectedNewRoot": "0xe87e03b34db1bb7f0154f27cd035e73f210078272a5975c0082ce64aeaa304bd", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { - "balance": "0", - "nonce": "0", - "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0x76b362a9afd679ea13a456ab103786492c65946be653589c1fd627841d0c6fdd" - }, - "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", - "bytecodeLength": 0 - }, "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x01" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" }, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 @@ -236,15 +229,27 @@ "storage": null, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 + }, + "0x000000000000000000000000000000005ca1ab1e": { + "balance": "0", + "nonce": "0", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x02", + "0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0x4b77bae453a140e036aa3b62fe334e22597f44d3b1d0c61357b86a997938eb7b", + "0xd9d16d34ffb15ba3a3d852f0d403e2ce1d691fb54de27ac87cd2f993f3ec330f": "0x525cd380df0da47482e212d1a14eb8b668853d71b55ba173c08ad0224cafd913" + }, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 } }, "batchL2Data": "0xee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731bef80843b9aca00830186a094187bd40226a7073b49163b1f6c2b73d8f2aa8478893635c9adc5dea00000808203e880806199f98970ea3e0e9a59e32184ea11ae9158b9b93d70906e11f60eb6ce0096023c1bbbb437e58ea5f7bebd344d61cccd161c6b8accff11b50ea44300d3ab58bd1bee80843b9aca00830186a094187bd40226a7073b49163b1f6c2b73d8f2aa8478880de0b6b3a7640000808203e8808074ecb6abb3d84c322a4905c60199b8f422b79b940e8a853d580869268009ae3123fb6caa5b3afc410b79d9b68bf851df1fd46fd6923cc481b3e273aeb92ce67d1cee80843b9aca00830186a094abcced19d7f290b84608fec510bee872cc8f5112880de0b6b3a7640000808203e88080432b1bc18d96dea596edfe17b249a68e42117f738ecfaea4e9f92aa77935fb4d5b9a983a5ba73c27cbaa4de62b1d8ab8b908a941926387927dcd2319d8b4dfb21cec80843b9aca00830186a094abcced19d7f290b84608fec510bee872cc8f5112880de0b6b3a764000080808080c58f68d4c65a9a131d17a426ab83da163a43e21f8811a70cd4ca79eb5d26f25d169e8e50ee8483669b2aef296e6dc68464e5af0dc582a54751ef50c2c9207b6b1c", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0xd18171b48d0e6be1f17ade61317f56803544897111acb8fd356a12a1820e12bf", - "batchHashData": "0xb42e4971194ef84093a6db689ab04ef94ee29868c2b618408708285272f10aca", + "batchHashData": "0x7c029310f044ec61946375d00c12cec221f35d42dc6829a9ff1489cf6bb5624d", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0x8bc7f90ad21282dd4676c19e7ce8f6b73beb7304fed1f8cae2dc7b53026d359c" }, { "id": 2, @@ -281,22 +286,13 @@ "customRawTx": "0xf080843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff8a021e19e0c9bab2400000808203e8808069d48cb9ade9de851379987aa0f7f677cdaee1152ec785a3d3009f094c889be9368c3d198cdfe5b1e0100fe110ea60e77b1eb65e9363d96f7fb9c2b84a37c9b01c" } ], - "expectedNewRoot": "0x7c29e07c803e993311b3d1633e5e9dd9f6db8cf813b7b60117599c7d1d7b66bb", + "expectedNewRoot": "0x0143c4ffec267aba2b44f9c5253c41042af8388b7ac2535c566e70937242a2db", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { - "balance": "0", - "nonce": "0", - "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0x4a9bfcb163ec91c5beb22e6aca41592433092c8c7821b01d37fd0de483f9265d" - }, - "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", - "bytecodeLength": 0 - }, "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x01" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" }, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 @@ -315,10 +311,11 @@ "batchL2Data": "0xf080843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff8a021e19e0c9bab2400000808203e8808069d48cb9ade9de851379987aa0f7f677cdaee1152ec785a3d3009f094c889be9368c3d198cdfe5b1e0100fe110ea60e77b1eb65e9363d96f7fb9c2b84a37c9b01c", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0x974acb61a8c42a1633a51abd4850d34f99d6592b32728aaef008bfbdc934b771", - "batchHashData": "0xf1a712e0d7cb35046bea1b8b977ef07232b7d006bf8f5f8c748a9478c5ca0f85", + "batchHashData": "0x9e2a4414f78bef13670164fb0eac6d43e50b5f305c8c9e9495e8f204d880b88d", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0xb10056e7bcaf293d31fff9155619f5bb7f8e22d4116e0870db02b1e85c62254f" }, { "id": 3, @@ -390,22 +387,13 @@ "customRawTx": "0xef80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff89056bc75e2d63100000808203e880806fac51f437890686cea7fc4d478e01f4650284d8b0c447d3a049ad799a938e855d76085acbdd3af82e205f070fd3f333d3f069ab3936323ac347003f07d9418a1b" } ], - "expectedNewRoot": "0x7c29e07c803e993311b3d1633e5e9dd9f6db8cf813b7b60117599c7d1d7b66bb", + "expectedNewRoot": "0x0143c4ffec267aba2b44f9c5253c41042af8388b7ac2535c566e70937242a2db", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { - "balance": "0", - "nonce": "0", - "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0x4a9bfcb163ec91c5beb22e6aca41592433092c8c7821b01d37fd0de483f9265d" - }, - "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", - "bytecodeLength": 0 - }, "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x01" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" }, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 @@ -424,10 +412,11 @@ "batchL2Data": "0xee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a00008082019180806e209c61ca92c2b980d6197e7ac9ccc3f547bf13be6455dfe682aa5dda9655ef16819a7edcc3fefec81ca97c7a6f3d10ec774440e409adbba693ce8b698d41f11cef80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff89056bc75e2d63100000808203e880806fac51f437890686cea7fc4d478e01f4650284d8b0c447d3a049ad799a938e855d76085acbdd3af82e205f070fd3f333d3f069ab3936323ac347003f07d9418a1b", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0x04c784104247158012050b7496228a76791906f7c0552e4b3ae0fae90ca1e74d", - "batchHashData": "0xe5f8356f91d4d5e6316257cb36687c2b678d5ad75f11580a4aa0e411d3f72fa9", + "batchHashData": "0x63a2f1c975b3481a834dc19e47d51bbebfa95d36a5cd5ef7e1cd8f77dba9f92f", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0x5096be84d9ffe4b90dadb9e14adf0560d3b026f6c70a657ff8db1d8013912dee" }, { "id": 4, @@ -465,22 +454,13 @@ "customRawTx": "0xee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731b" } ], - "expectedNewRoot": "0x7c29e07c803e993311b3d1633e5e9dd9f6db8cf813b7b60117599c7d1d7b66bb", + "expectedNewRoot": "0x0143c4ffec267aba2b44f9c5253c41042af8388b7ac2535c566e70937242a2db", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { - "balance": "0", - "nonce": "0", - "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0x4a9bfcb163ec91c5beb22e6aca41592433092c8c7821b01d37fd0de483f9265d" - }, - "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", - "bytecodeLength": 0 - }, "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x01" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" }, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 @@ -499,10 +479,11 @@ "batchL2Data": "0xee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0x8b7632b1847ce651bbc61bd5fd1dc5e09f88e7435b7e7e2495149575966d7056", - "batchHashData": "0xd519b9786fa59e931526ccb9ea45d03affac1cef13f1e6a087fc7ea5e0f973bb", + "batchHashData": "0x990477d9fa852647f7f31a984aa915af0ff3a813ca717728c510b48feaacac66", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0x65e3db0bc8243f62d1064c526cc067caaeea18611bd9f64bb9076574915255c9" }, { "id": 5, @@ -539,22 +520,13 @@ "customRawTx": "0xee80843b9aca00830186a094617b3a3528f9cdd6630fd3301b9c8911f7bf063d88016345785d8a0000808203e88080cca9bd00c0a9af18cdc17e693951b88b293bae8ed236ff7dcf2684c478bc0b6a19cc9ed09ee5e1e2750abbea7ec8d2ed31df90c7d364d4e2f36c31eb410c10451b" } ], - "expectedNewRoot": "0x5e00165e52fe5d9554cc452422efaeaa00ba9637e933d915b0345535363ae825", + "expectedNewRoot": "0x49d9e431034c9e29e2bdcb73ce388ac1d973e9001388371539ddaed0c8aece34", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { - "balance": "0", - "nonce": "0", - "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0x4a9bfcb163ec91c5beb22e6aca41592433092c8c7821b01d37fd0de483f9265d" - }, - "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", - "bytecodeLength": 0 - }, "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x01" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" }, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 @@ -572,15 +544,26 @@ "storage": null, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 + }, + "0x000000000000000000000000000000005ca1ab1e": { + "balance": "0", + "nonce": "0", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x01", + "0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0x72f06d3422e79efefd698d2c12dd4c667cdfecd27378af2215c578c44f826f60" + }, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 } }, "batchL2Data": "0xee80843b9aca00830186a094617b3a3528f9cdd6630fd3301b9c8911f7bf063d88016345785d8a0000808203e88080cca9bd00c0a9af18cdc17e693951b88b293bae8ed236ff7dcf2684c478bc0b6a19cc9ed09ee5e1e2750abbea7ec8d2ed31df90c7d364d4e2f36c31eb410c10451b", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0x14af73b726ad9a576041c06ec14462a6b3361affb0299a74879a35d265a8266d", - "batchHashData": "0x76fa73a1392da97795dd5bd13828e60fc39e470a828e5b50724f455626cae832", + "batchHashData": "0x36e75bc24a19a4f5c6057500ed3d9d0567606eaf31f870f0fe3d2b71de951700", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0xaee9fbede25418352d0912d6920684cb4a624d91491a4c1080b096b10ac0c61e" }, { "id": 6, @@ -656,22 +639,13 @@ "rawTx": "0xf86c80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff880de0b6b3a7640000801ba077f76b76aca6161db28545aa742536370e4f57f9a71651688631a423abcbe04aa0131474e130abe8bcc9ef39a44a877eb64b2d43132cb0907abe547aa605b641b8" } ], - "expectedNewRoot": "0x6547ef7c0a28d237e87bb463ffb09804c87afbc5e13efdc192c0ca54e983de97", + "expectedNewRoot": "0x8fae87d4148f1e3f0646b8218d6768a7e52d494d8a2c81301ebaa873384b2022", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { - "balance": "0", - "nonce": "0", - "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0x4a9bfcb163ec91c5beb22e6aca41592433092c8c7821b01d37fd0de483f9265d" - }, - "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", - "bytecodeLength": 0 - }, "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x01" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" }, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 @@ -689,15 +663,26 @@ "storage": null, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 + }, + "0x000000000000000000000000000000005ca1ab1e": { + "balance": "0", + "nonce": "0", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x01", + "0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0x2399767cba4867599d0c5403a0c6f2d29e5256e259e95afa693b7b9e18524a63" + }, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 } }, "batchL2Data": "0xef80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff89056bc75e2d63100000808203e880806fac51f437890686cea7fc4d478e01f4650284d8b0c447d3a049ad799a938e855d76085acbdd3af82e205f070fd3f333d3f069ab3936323ac347003f07d9418a1bee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731bee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff880de0b6b3a7640000808203e880803317280d96c3ed303a42d9da2638805301351c96cad135380ffa544d3c2bc96a6a55cef2d3827323f134976dd99a33bebef27b5e99c454fb1f8d4a4861ac4e0f1cec80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff880de0b6b3a764000080808080f7e1e6f3cd95d27522592e8796afa8f419a066b7172e0ac3e7826705ad608c672731e14da1b190dab8c14e79e050e31da53fdb4a0e55ca48ee4faff859606d5a1b", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0x8eaa9abf8c4406ea28af18fee74ef82c23fdc54db703dc52db16bfc4c560e913", - "batchHashData": "0x07bc943150ed8ec52700dad23fa01022c90d0093541463a8bf3b247f0afc29b9", + "batchHashData": "0xcf2f7e2aa1ba6181e15e1fcd15948b92a5dbe807a46b15726eb6688949b7df26", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0x46608e2fa1db11c26d2cccfad6bd6f7f3150ad41818808507b08080a14e19ead" }, { "id": 7, @@ -734,22 +719,13 @@ "customRawTx": "0xee80843b9aca00830186a094617b3a3528f9cdd6630fd3301b9c8911f7bf063d88016345785d8a0000808203e88080cca9bd00c0a9af18cdc17e693951b88b293bae8ed236ff7dcf2684c478bc0b6a19cc9ed09ee5e1e2750abbea7ec8d2ed31df90c7d364d4e2f36c31eb410c10451b" } ], - "expectedNewRoot": "0xcbcec05248845b79355514270b0713a5e268c85c061dedb8a59bf3282758a1ae", + "expectedNewRoot": "0xd906285a08c96927daf29c52d1e3c273d43e3cf82df53763c5d5e0f0c2132361", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { - "balance": "0", - "nonce": "0", - "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0x4a9bfcb163ec91c5beb22e6aca41592433092c8c7821b01d37fd0de483f9265d" - }, - "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", - "bytecodeLength": 0 - }, "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x01" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" }, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 @@ -767,15 +743,26 @@ "storage": null, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 + }, + "0x000000000000000000000000000000005ca1ab1e": { + "balance": "0", + "nonce": "0", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x01", + "0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0x890c798b995ef75e7ab19292d67c1a4701ba124e84b9732f75400c0479023f45" + }, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 } }, "batchL2Data": "0xee80843b9aca00830186a094617b3a3528f9cdd6630fd3301b9c8911f7bf063d88016345785d8a0000808203e88080cca9bd00c0a9af18cdc17e693951b88b293bae8ed236ff7dcf2684c478bc0b6a19cc9ed09ee5e1e2750abbea7ec8d2ed31df90c7d364d4e2f36c31eb410c10451b", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0xe1a98171d7abdc1017d8ac3e1ab62e72fdb468c368b1951f8c3a150019380cb0", - "batchHashData": "0x6f70724ce6f47451d23b55925247248d9425b1e36e759ed8108535bfb58fa2b9", + "batchHashData": "0x36e75bc24a19a4f5c6057500ed3d9d0567606eaf31f870f0fe3d2b71de951700", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0xa93e53fa4ad349a9ca7d3c10cbf300bcd27dd8b0edd3237ab3b4ae1186f66669" }, { "id": 8, @@ -825,22 +812,13 @@ "customRawTx": "0xee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff8806f05b59d3b20000808203e880809990717b4c80d955cacf4a765d3bfefd707511d66e0a482510906d119fa285c7232ccd442c5b618558b62175f01d9f45ff655d480f36394ea50a0b7dc52bc3331c" } ], - "expectedNewRoot": "0x819b4c3a481bec09372972b2d5cc3f9b7e455a2d63247bb962d6f412838cd914", + "expectedNewRoot": "0x31ea9f5bd5a19fb3c66da5626bf2451e02beaf9449ede180f7392028f37a759b", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { - "balance": "0", - "nonce": "0", - "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0x8397a02db0909df274170a8a1a4e45f6d7f24e66606976cd00960d8c6c850c97" - }, - "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", - "bytecodeLength": 0 - }, "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x01" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" }, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 @@ -858,15 +836,27 @@ "storage": null, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 + }, + "0x000000000000000000000000000000005ca1ab1e": { + "balance": "0", + "nonce": "0", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x02", + "0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0x706491c67b9e5be9d5cbd6e0f5d415e616ad0ea04082c0c4d40206acdb8ddffe", + "0xd9d16d34ffb15ba3a3d852f0d403e2ce1d691fb54de27ac87cd2f993f3ec330f": "0x7a6952c64e2a91949d53b13da8e219d6695665ba8229689d5f9ff873cf7ef3e2" + }, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 } }, "batchL2Data": "0xf080862b4f29945e00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880802338447c58501088b071192ec4b44c696f2f1cdf4ff8182ecb8d0cd4ea83c428034c91620ac27f2870e1568e30e1db2ce9c0a05f2b03b20d017b3a0410edc6571cee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff8806f05b59d3b20000808203e880809990717b4c80d955cacf4a765d3bfefd707511d66e0a482510906d119fa285c7232ccd442c5b618558b62175f01d9f45ff655d480f36394ea50a0b7dc52bc3331c", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0x06af46765475a04bdbddc08f136d47c942d42eb45c76eca9b381ce721846e766", - "batchHashData": "0x22a6bee1dba88693c69e4f7e941a4ec4434b1c455c732e0cb0e4704c3a8112fb", + "batchHashData": "0x165cea5fa8d1f2c85665d22bfff8a45b2b7183e9627840dd04f618c1aec2464f", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0x34dd638b5422dba4ea61dac77930bcede32dd758fa9d16e2ca7df7b9fecfd406" }, { "id": 9, @@ -942,22 +932,13 @@ "rawTx": "0xf86e03843b9aca00830186a094617b3a3528f9cdd6630fd3301b9c8911f7bf063d8806f05b59d3b20000808207f3a047b4f7d735dfadefc585bf24d9bd2267438f9bc92d1ab4f65fa9a6d90cc33858a00720a7da26cad22c05bf1358011c95caec969b8b9177af91c0e90dac3d02f6b3" } ], - "expectedNewRoot": "0x2ff312edcaed6207129c4480b68156f7beb9811728038e4d4903be606bff2b9a", + "expectedNewRoot": "0xfe94fc7c1fbeacb3a973bfc31287a69834dab9cd1330ff0412fd15065a5d6c03", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { - "balance": "0", - "nonce": "0", - "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0x4a9bfcb163ec91c5beb22e6aca41592433092c8c7821b01d37fd0de483f9265d" - }, - "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", - "bytecodeLength": 0 - }, "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x01" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" }, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 @@ -975,15 +956,29 @@ "storage": null, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 + }, + "0x000000000000000000000000000000005ca1ab1e": { + "balance": "0", + "nonce": "0", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x04", + "0x7dfe757ecd65cbd7922a9c0161e935dd7fdbcc0e999689c7d31633896b1fc60b": "0xa199ba48e4f4850f485c629e71e190db1ef963c46587b1dd8e09cd71a9bd7ee4", + "0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0x2399767cba4867599d0c5403a0c6f2d29e5256e259e95afa693b7b9e18524a63", + "0xd9d16d34ffb15ba3a3d852f0d403e2ce1d691fb54de27ac87cd2f993f3ec330f": "0x160bd2809e5d7d7ce556ac2c98a6d577a3270fa9d7bb5e625a1b05427e54daaa", + "0xedc95719e9a3b28dd8e80877cb5880a9be7de1a13fc8b05e7999683b6b567643": "0xe10fd7c39745bb4a66b053270387a303e007e313f31d0fba83c9b9b2513a9b02" + }, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 } }, "batchL2Data": "0xee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731bee01843b9aca00830186a094617b3a3528f9cdd6630fd3301b9c8911f7bf063d8806f05b59d3b20000808203e88080c15e7f0afea365929bff2dea9b1c219ce7d656e9829c30c5736bfa499fee328132ee39a354417f726d717e68b6b019214721808753aba88a68eea6c57ca136521cee02843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e88080bff0e780ba7db409339fd3f71969fa2cbf1b8535f6c725a1499d3318d3ef9c2b6340ddfab84add2c188f9efddb99771db1fe621c981846394ea4f035c85bcdd51bee03843b9aca00830186a094617b3a3528f9cdd6630fd3301b9c8911f7bf063d8806f05b59d3b20000808203e8808047b4f7d735dfadefc585bf24d9bd2267438f9bc92d1ab4f65fa9a6d90cc338580720a7da26cad22c05bf1358011c95caec969b8b9177af91c0e90dac3d02f6b31b", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0xe97f3a43133e9823c6677adf2ee6a73bcb4c362d5ec2d72845c3595d3ef95ab4", - "batchHashData": "0x424ca9c22f473aa8474b37975ce1a94ffba84dec4a1b2b2dfaa1bf767152719e", + "batchHashData": "0x797d3bbd5aafb65b31647e20b5b0ca3371702fd5166b16c0f1512cad7dc88f8e", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0x244fb1f80db37280624da30acf8647a65a68ef3acecb7ca0fd31692bb87e096f" }, { "id": 10, @@ -1051,22 +1046,13 @@ "rawTx": "0xf86e80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808207f3a01cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e7a05d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad73" } ], - "expectedNewRoot": "0x2fca4b67b066c1be0240768cc749cd343796d2f7696de5179e0b9ff0a79442c4", + "expectedNewRoot": "0x43b64765591d74099404c3327d3d38beb4731ba1feb8f7a88e935c57973672b2", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { - "balance": "0", - "nonce": "0", - "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0x7281dd8612498e474632eabb78a60346362053c5313a496edd646ca6db4f62ad" - }, - "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", - "bytecodeLength": 0 - }, "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x01" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" }, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 @@ -1094,15 +1080,27 @@ }, "hashBytecode": "0x062131fa38229aa99857628dfce11250ce3012071d0ec4c670667952350df87c", "bytecodeLength": 643 + }, + "0x000000000000000000000000000000005ca1ab1e": { + "balance": "0", + "nonce": "0", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x02", + "0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0x2125790de337401559f4200e8b3d29f512a806c1ad182127c36661449683b1d5", + "0xd9d16d34ffb15ba3a3d852f0d403e2ce1d691fb54de27ac87cd2f993f3ec330f": "0xde76464d1d098470fe4439e8ea7261d6bd7bb9396f035026c3e086993b1c535f" + }, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 } }, "batchL2Data": "0xf84a80843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880a45ef3d3dd00000000000000000000000000000000000000000000000000000000000000078203e880803943e5a952e27d85c91f61610159fd8caf0dd68db76a1df7fb52934156d9ec935ceec6b0f908e36ee8b2c70350b3813d72558572ff95deac79069168e68726571cee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731b", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0x1ae2ca703708b94165c47c3befbe1021c8e424934244141fc83230505d61c2ab", - "batchHashData": "0x74cd37dc6dde2c5d2b9f6eba15e7cb1c059df44cfbd9654c55b1557ca7aca031", + "batchHashData": "0x34277e04e6bb366e19b85abe556937435e579d1c2fe2973587b730c73415b94d", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0xd9cd7be40516bdb7b3afe0a764f088e1e3c0f574f70769703aa884a11a6026c5" }, { "id": 11, @@ -1168,22 +1166,13 @@ "rawTx": "0xf8ab01843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880b844494e4bc30000000000000000000000004d5cf5032b2a844602278b01199ed191a86c93ff00000000000000000000000000000000000000000000000000038d7ea4c680008207f3a0c83069009c51e411569ca78a660bbcb64e4e6709909eb99c28395fb4c787da4ca02b846bf51fcf891fb293e36a0cf5f4efd1fe7c19b2c8a1220b8308b195e80156" } ], - "expectedNewRoot": "0xc18d837127224d10a414fa4b7e57d3ce19c5d566415630526e0ead7341f26677", + "expectedNewRoot": "0x3f5011bc061f6e25c52494442ae4cc8795d720dc9d309469d2bb7c5f37253be7", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { - "balance": "0", - "nonce": "0", - "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0x144bac90dd26abcbd923370ec5155b2416fac64f542d21ad0d5a50dc15598c78" - }, - "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", - "bytecodeLength": 0 - }, "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x01" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" }, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 @@ -1208,15 +1197,27 @@ "storage": {}, "hashBytecode": "0x4816a88058a9b03290d643c0c50e7117b563074c41579b38526e7fded1b3ad23", "bytecodeLength": 534 + }, + "0x000000000000000000000000000000005ca1ab1e": { + "balance": "0", + "nonce": "0", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x02", + "0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0xb77669f8c01951ce4caabcf2cdeb5e6a2c87b798e9c19be85c3469e71b32556f", + "0xd9d16d34ffb15ba3a3d852f0d403e2ce1d691fb54de27ac87cd2f993f3ec330f": "0x579c39e12b0e78d846c660af1c82bd6a26050423ac4da94bc61a9209f34af1f8" + }, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 } }, "batchL2Data": "0xee80843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9888016345785d8a0000808203e880800aec3714591ea85d38943922d16f5f592f10abd2834c43b06253314a8591107f00e81823e7864ba979b28a6ee5eb660dfce7aa857303691ba6759d9edc5378901cf86b01843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880b844494e4bc30000000000000000000000004d5cf5032b2a844602278b01199ed191a86c93ff00000000000000000000000000000000000000000000000000038d7ea4c680008203e88080c83069009c51e411569ca78a660bbcb64e4e6709909eb99c28395fb4c787da4c2b846bf51fcf891fb293e36a0cf5f4efd1fe7c19b2c8a1220b8308b195e801561b", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0x2cba864519a36cafe9b85103bef38d9b3ad0cb84765be691b8567cd960e36aa5", - "batchHashData": "0xedcefed860f6d77c3446ef42f9456cb73d69064223588fc44f17b5eb9b1aca69", + "batchHashData": "0x405293b4b4015b2e08493a85d2028419422c2a42b173396552bb4db165f24dbc", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0x3b0a2351ed7ce472ffd4b62f8ad7e93aa1243201624d51f653f5efca29555089" }, { "id": 12, @@ -1291,22 +1292,13 @@ "rawTx": "0xf88a01843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880a4027e5d610000000000000000000000004d5cf5032b2a844602278b01199ed191a86c93ff8207f3a0a04c0969f64f440a2c91e29bf9ea0b1cc8db9f33bda47c2c6899840ae46d36d7a00212c0a9f1bb015890ed0830c7fea6c52adaf85b0bf3d64448d3300c12c1bb16" } ], - "expectedNewRoot": "0xc0dcf04e5e2adb3ddeb3431855fa61fcd94b121c9b426f9374cae4a38f7ca746", + "expectedNewRoot": "0xd6f87d22b32fd72d65a6317286eb7a201c05c5b28e98ad75febe3cdcf57a0af1", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { - "balance": "0", - "nonce": "0", - "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0x2535fbb1a1509a05832eb23bd775b7bb726f6a24183283935b5fb1096ff88c28" - }, - "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", - "bytecodeLength": 0 - }, "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x01" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" }, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 @@ -1333,15 +1325,27 @@ }, "hashBytecode": "0xbfbd82130765fb7f1f8d2329c86aa82d679e04c896878ed0dbc8a151b4e696b8", "bytecodeLength": 574 + }, + "0x000000000000000000000000000000005ca1ab1e": { + "balance": "0", + "nonce": "0", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x02", + "0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0xab9891d273a3b578625bd00b98718879cd4a8c1f20e8700f5b8c6de9a2dc2894", + "0xd9d16d34ffb15ba3a3d852f0d403e2ce1d691fb54de27ac87cd2f993f3ec330f": "0x7bea96e161326922da00236594cf6458c425aa581dbef5a63881a95dca02036d" + }, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 } }, "batchL2Data": "0xee80843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9888016345785d8a0000808203e880800aec3714591ea85d38943922d16f5f592f10abd2834c43b06253314a8591107f00e81823e7864ba979b28a6ee5eb660dfce7aa857303691ba6759d9edc5378901cf84a01843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880a4027e5d610000000000000000000000004d5cf5032b2a844602278b01199ed191a86c93ff8203e88080a04c0969f64f440a2c91e29bf9ea0b1cc8db9f33bda47c2c6899840ae46d36d70212c0a9f1bb015890ed0830c7fea6c52adaf85b0bf3d64448d3300c12c1bb161b", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0x4e4b628228f6c5aff26a72c5c9415b0133966f3e533771c637da019b9a0eff63", - "batchHashData": "0xf28d5240092614f023fa7e231235b71ccce80515fb785f00469e6a0367c10a48", + "batchHashData": "0x0648c342d6d0c7dfdbc8ebb8ec2273793705faeead957dc4a6b6cd69c5fa4f71", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0xf93a82af6e9f96942ba005f3362379ab21ba868cd7cf555e4be05a97723219eb" }, { "id": 13, @@ -1416,22 +1420,13 @@ "rawTx": "0xf88a02843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880a4027e5d610000000000000000000000004d5cf5032b2a844602278b01199ed191a86c93ff8207f3a028e62eb40661fd098322a7211dca25a6b56f60eefb24ede9607d2603a09e4c65a03be289b7a729a18336e2f9f4a4f52c4fadc4274d1fd42dd8965deeb8634ddddc" } ], - "expectedNewRoot": "0xf02f68cf7b3dafb765e9dde78b91a40e7798a8d48edcd821ddbf9d4c3e289838", + "expectedNewRoot": "0xa7c4b5953163cabe65894a06213f4757e1c7dd5554d0b4db5a21997f3cf120da", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { - "balance": "0", - "nonce": "0", - "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0x5321e97596347ed38932cf308e5346af6208deaaf459b5ecc18ca2b23d97d15c" - }, - "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", - "bytecodeLength": 0 - }, "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x01" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" }, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 @@ -1458,14 +1453,27 @@ }, "hashBytecode": "0x53ab04d3e34c23abaf57efc4acd9e54df7c39f82521e3928bebf6ce95ca6d6ca", "bytecodeLength": 574 + }, + "0x000000000000000000000000000000005ca1ab1e": { + "balance": "0", + "nonce": "0", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x03", + "0x7dfe757ecd65cbd7922a9c0161e935dd7fdbcc0e999689c7d31633896b1fc60b": "0x21edb6b1fc6a75e923bec4ec01ba91b0044e4b040a8ebebdeeb43f7a3b784cbc", + "0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0x614b5f1e8e8cb0bd1986b8b1a548a9c5acda0b6bd866b9cb152f3434345fc61d", + "0xd9d16d34ffb15ba3a3d852f0d403e2ce1d691fb54de27ac87cd2f993f3ec330f": "0xe0baf1661b7d491a08ef7231710de76e28720cc135b7a95a9e0a1556719b914d" + }, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 } }, "batchL2Data": "0xf9032880843b9aca00830f42408080b90314608060405234801561001057600080fd5b506040516102f43803806102f483398181016040528101906100329190610054565b80600081905550506100a7565b60008151905061004e81610090565b92915050565b60006020828403121561006a5761006961008b565b5b60006100788482850161003f565b91505092915050565b6000819050919050565b600080fd5b61009981610081565b81146100a457600080fd5b50565b61023e806100b66000396000f3fe6080604052600436106100385760003560e01c8063027e5d6114610041578063aa8c217c1461006a578063d997ccb3146100955761003f565b3661003f57005b005b34801561004d57600080fd5b5061006860048036038101906100639190610123565b6100b3565b005b34801561007657600080fd5b5061007f6100ff565b60405161008c9190610189565b60405180910390f35b61009d610105565b6040516100aa919061016e565b60405180910390f35b8073ffffffffffffffffffffffffffffffffffffffff166108fc6000549081150290604051600060405180830381858888f193505050501580156100fb573d6000803e3d6000fd5b5050565b60005481565b60006001905090565b60008135905061011d816101f1565b92915050565b600060208284031215610139576101386101ec565b5b60006101478482850161010e565b91505092915050565b610159816101b6565b82525050565b610168816101e2565b82525050565b60006020820190506101836000830184610150565b92915050565b600060208201905061019e600083018461015f565b92915050565b60006101af826101c2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600080fd5b6101fa816101a4565b811461020557600080fd5b5056fea26469706673582212208cb33f54873dbf0b74ff9c230fc2e7522ca18ea82fcce1f4a1904abe1c1043fe64736f6c6343000807003300000000000000000000000000000000000000000000000000000000000000018203e88080579b8010f25b1f95158686736e9930d4ebd2a3c0ef4e604d0e76684e491f735d30eb46fe9a689148f3559c23bd5566fcaed97f61be389c4fb96f735b464ec5031cee01843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9888016345785d8a0000808203e88080da8130f8fd64ed97277e306b9aca4f42ece0e2352d74823b0d31172fe0d8be686bbb35fb63de10207ea586da635ff92c0097acf501aef7940b733317ba4e0d751bf84a02843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880a4027e5d610000000000000000000000004d5cf5032b2a844602278b01199ed191a86c93ff8203e8808028e62eb40661fd098322a7211dca25a6b56f60eefb24ede9607d2603a09e4c653be289b7a729a18336e2f9f4a4f52c4fadc4274d1fd42dd8965deeb8634ddddc1b", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0xc5a6c303491abf0ee5b349ec58c28d357b3b27798820803c0831206b7d98bbc8", - "batchHashData": "0x6f9e2eecfdf9fc19be6be2b17fe3d9f498639ebdf225808adbe0a6fb55308d5d", + "batchHashData": "0x97e4163ef51abe91b6acd1b35ba01f89753de21a725a9c0566b55c17a6e7237a", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0xcaf5359437893ef0b54f14c2b52e6aeb6ee01d56f53cbce37162a9a60f2246fa" } ] \ No newline at end of file diff --git a/test/helpers/test-vectors/selfdestruct/selfdestruct.json b/test/helpers/test-vectors/selfdestruct/selfdestruct.json index 48881ec9..0733790a 100644 --- a/test/helpers/test-vectors/selfdestruct/selfdestruct.json +++ b/test/helpers/test-vectors/selfdestruct/selfdestruct.json @@ -90,28 +90,26 @@ "rawTx": "0xf86a02843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880842b68b9c68207f4a0f5b684b995dd9549bb5fd2ed23d3b388f75f559b14110277b4ae7de5bd7775efa01be51078330d1ef03f0e4fe0271e8e2502b6e98c1f7664a5e2aeae3ab04156d4" } ], - "expectedNewRoot": "0x7715d21009b1b81e0f19b90c2490c05e4b15f6054d88741f8caf80cad9c50be2", + "expectedNewRoot": "0x96ddba4a047cb0002f6fcc966c0685040d289946f730b38f7ead4a466d01785a", "expectedNewLeafs": { - "0x0000000000000000000000000000000000000000": { + "0xae4bb80be56b819606589de61d5ec3b522eeb032": { "balance": "0", "nonce": "0", "storage": { - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5": "0x2761798d338f390fa233a5ff12c7fd6a50ab8a82e559c25e2895516c3e4213c6" + "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x73e6af6f" }, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 }, - "0xae4bb80be56b819606589de61d5ec3b522eeb032": { + "0x0000000000000000000000000000000000000000": { "balance": "0", "nonce": "0", - "storage": { - "0x53d3f126103a7f7d6245751d2392e0245bf71479d10a3c27a5b501ace6dde1b7": "0x01" - }, + "storage": null, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 }, "0x617b3a3528f9cdd6630fd3301b9c8911f7bf063d": { - "balance": "100000116508000000000", + "balance": "100000140508000000000", "nonce": "1", "storage": null, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -124,16 +122,28 @@ "0x0000000000000000000000000000000000000000000000000000000000000000": "0x01", "0x0000000000000000000000000000000000000000000000000000000000000001": "0x075bcd15" }, - "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", - "bytecodeLength": 0 + "hashBytecode": "0xbbebd914926f549bcc798e9081a339e3745b9831b3c3906fb8bb2bcf2e05a160", + "bytecodeLength": 574 }, "0x4d5cf5032b2a844602278b01199ed191a86c93ff": { - "balance": "199999883491876543211", + "balance": "199999859491876543211", "nonce": "3", "storage": null, "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", "bytecodeLength": 0 }, + "0x000000000000000000000000000000005ca1ab1e": { + "balance": "0", + "nonce": "0", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x03", + "0x7dfe757ecd65cbd7922a9c0161e935dd7fdbcc0e999689c7d31633896b1fc60b": "0x874bb1c54bd84db12cfeae234fde18e6eb9fc78fdc740544954665a60194609b", + "0xcc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f": "0xf13d27f15e082ec0d7cd70e9dfe1c3dff946c0a7ef39a0667d1410e13eecf72d", + "0xd9d16d34ffb15ba3a3d852f0d403e2ce1d691fb54de27ac87cd2f993f3ec330f": "0xb189c75e3c56fdca62d57db79a99001a4fc0ee797d46f5f6f9beafa8896d80d4" + }, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 + }, "0x0000000000000000000000000000000000000001": { "balance": "123456789", "nonce": "0", @@ -145,9 +155,10 @@ "batchL2Data": "0xf84a80843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880a4718da7ee00000000000000000000000000000000000000000000000000000000000000018203e880800f169b9405991a5f4a96f9d1d726e43ab9d42e1d0b4daac7ec9b4797dd39e9b724cf48c46cbc1924dd25adc6536ef259bedcd822979734ae347e01d715303ad01cee01843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9884075bcd15845cfb28e78203e88080b22ac440612ebcd45672cfc7dcbbbe7cde784294e5076827b1812f9ea9eee2736c3c774150514808053972653f74bbeb33918dc74aa9182cee7993283b1faa541bea02843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880842b68b9c68203e88080f5b684b995dd9549bb5fd2ed23d3b388f75f559b14110277b4ae7de5bd7775ef1be51078330d1ef03f0e4fe0271e8e2502b6e98c1f7664a5e2aeae3ab04156d41c", "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "inputHash": "0x13ebec4ee2eb93d3431ecbfeb16399f4e6d26d17bf134148f3ed4b827ca46b82", - "batchHashData": "0x1f9553beb9fe9b03b2e19a00c41dfd2d9b711afbc9c05d29ab00d430542d7d12", + "batchHashData": "0x8861a42093839bba053d104b4fd359fab4bbb4806eb4214401104ace03b3bca9", "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", - "timestamp": 1944498031 + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "expectedNewAccInputHash": "0x3eecc493740cb9dae79ff74a75f407c81e042883c5fba4a78290e16735929972" } ] \ No newline at end of file diff --git a/test/helpers/test-vectors/zkevm-db/recursive.json b/test/helpers/test-vectors/zkevm-db/recursive.json new file mode 100644 index 00000000..00fd5836 --- /dev/null +++ b/test/helpers/test-vectors/zkevm-db/recursive.json @@ -0,0 +1,90 @@ +[ + { + "id": 0, + "description": "2 accounts and 1 valid transaction.", + "chainID": 1000, + "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", + "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "timestamp": 1944498031, + "aggregatorAddress": "0x0123456789012345678901234567890123456789", + "genesis": [ + { + "address": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", + "pvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", + "balance": "100000000000000000000", + "nonce": "0" + }, + { + "address": "0x4d5Cf5032B2a844602278b01199ED191A86c93ff", + "pvtKey": "0x4d27a600dce8c29b7bd080e29a26972377dbb04d7a27d919adbb602bf13cfd23", + "balance": "200000000000000000000", + "nonce": "0" + } + ], + "expectedOldRoot": "0x4a9bfcb163ec91c5beb22e6aca41592433092c8c7821b01d37fd0de483f9265d", + "batches": [ + { + "txs": [ + { + "id": 0, + "from": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", + "to": "0x4d5Cf5032B2a844602278b01199ED191A86c93ff", + "nonce": 0, + "value": "100000000000000000", + "gasLimit": 100000, + "gasPrice": "1000000000", + "chainId": 1000, + "rawTx": "0xf86d80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808207f5a01186622d03b6b8da7cf111d1ccba5bb185c56deae6a322cebc6dda0556f3cb979f910c26408b64b51c5da36ba2f38ef55ba1cee719d5a6c01225968799907432", + "reason": "", + "customRawTx": "0xee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731b" + } + ], + "expectedNewRoot": "0xea2eb6fb48966077643e7a7dbde44df32d65ca64476c4f9ecb1dc99ba4bc0d72", + "expectedNewAccInputHash": "0x704d5cfd3e44b82028f7f8cae31168267a7422c5a447b90a65134116da5a8432", + "expoectNewLocalExitRoot": "", + "expectedNewLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "expectedNewNumBatch": 1, + "expectedBatchL2Data": "0xee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731b" + }, + { + "txs": [ + { + "id": 0, + "from": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", + "to": "0x4d5Cf5032B2a844602278b01199ED191A86c93ff", + "nonce": 1, + "value": "200000000000000000", + "gasLimit": 100000, + "gasPrice": "1000000000", + "chainId": 1000, + "rawTx": "0xf86d80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808207f5a01186622d03b6b8da7cf111d1ccba5bb185c56deae6a322cebc6dda0556f3cb979f910c26408b64b51c5da36ba2f38ef55ba1cee719d5a6c01225968799907432", + "reason": "", + "customRawTx": "0xee01843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff8802c68af0bb140000808203e88080225fd92907efb068a8bee3f95a26f2c5d67db2750bb9993083e0df217ff3a2666f412c311280066d1717f309c248fdbd853ce738363db08775999b2f2d2a8d5e1c" + } + ], + "expectedNewRoot": "0x834d6f18362daabea8b103a9a2952d63176b81efbfac20970159a0b36871bac4", + "expectedNewAccInputHash": "0x87f958227c38bcf883025f5fda2dee19460cff48ca3c4d48d3a48f55c1258e60", + "expoectNewLocalExitRoot": "", + "expectedNewLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "expectedNewNumBatch": 2, + "expectedBatchL2Data": "0xee01843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff8802c68af0bb140000808203e88080225fd92907efb068a8bee3f95a26f2c5d67db2750bb9993083e0df217ff3a2666f412c311280066d1717f309c248fdbd853ce738363db08775999b2f2d2a8d5e1c" + } + ], + "finalNewLeafs": { + "0x617b3a3528f9cdd6630fd3301b9c8911f7bf063d": { + "balance": "99900000000000000000", + "nonce": "1" + }, + "0x4d5cf5032b2a844602278b01199ed191a86c93ff": { + "balance": "200100000000000000000", + "nonce": "0" + } + }, + "finalStateRoot": "0x834d6f18362daabea8b103a9a2952d63176b81efbfac20970159a0b36871bac4", + "finalLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "finalAccInputHash": "0x87f958227c38bcf883025f5fda2dee19460cff48ca3c4d48d3a48f55c1258e60", + "finalNumBatch": 2, + "inputSnark": "0x0aef7431c3060a724238693fea11a846f2d71827f5f64fa24b1dd72b27f8681d" + } +] \ No newline at end of file diff --git a/test/helpers/test-vectors/zkevm-db/state-transition.json b/test/helpers/test-vectors/zkevm-db/state-transition.json index 13b64bb6..8487b3d1 100644 --- a/test/helpers/test-vectors/zkevm-db/state-transition.json +++ b/test/helpers/test-vectors/zkevm-db/state-transition.json @@ -34,7 +34,7 @@ "customRawTx": "0xee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731b" } ], - "expectedNewRoot": "0x5a52a0ee8577a03e831f627fead1921da142f3820f5880118e98ae6362626b3c", + "expectedNewRoot": "0xea2eb6fb48966077643e7a7dbde44df32d65ca64476c4f9ecb1dc99ba4bc0d72", "expectedNewLeafs": { "0x617b3a3528f9cdd6630fd3301b9c8911f7bf063d": { "balance": "99900000000000000000", @@ -50,7 +50,8 @@ "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "inputHash": "0x58dc76197a13d9a9f0894e3d5984098339944ad4fa2cff01945b053d39cd1c9e", "batchHashData": "0x3d53e7e5be04b00f66af647512af6d17e4e767a5e41fa1293010b885c9fe06db", - "oldLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "expectedNewAccInputHash": "0x704d5cfd3e44b82028f7f8cae31168267a7422c5a447b90a65134116da5a8432", "timestamp": 1944498031 } ] \ No newline at end of file diff --git a/test/processor.test.js b/test/processor.test.js index 08e18f03..0bf2e23a 100644 --- a/test/processor.test.js +++ b/test/processor.test.js @@ -1,3 +1,4 @@ +/* eslint-disable prefer-const */ /* eslint-disable global-require */ /* eslint-disable import/no-dynamic-require */ /* eslint-disable no-unused-expressions */ @@ -22,7 +23,7 @@ const lodash = require('lodash'); const artifactsPath = path.join(__dirname, 'artifacts/contracts'); -const contractsPolygonHermez = require('@0xpolygonhermez/contracts-zkevm'); +const contractsPolygonHermez = require('@0xpolygonhermez/zkevm-contracts'); const { MemDB, ZkEVMDB, getPoseidon, processorUtils, smtUtils, Constants, stateUtils, } = require('../index'); @@ -59,16 +60,17 @@ describe('Processor', async function () { it('Check test vectors', async () => { for (let i = 0; i < testVectors.length; i++) { - const { + let { id, genesis, expectedOldRoot, txs, expectedNewRoot, + expectedNewAccInputHash, sequencerAddress, expectedNewLeafs, batchL2Data, - oldLocalExitRoot, + oldAccInputHash, newLocalExitRoot, globalExitRoot, batchHashData, @@ -84,7 +86,7 @@ describe('Processor', async function () { db, poseidon, [F.zero, F.zero, F.zero, F.zero], - smtUtils.stringToH4(oldLocalExitRoot), + smtUtils.stringToH4(oldAccInputHash), genesis, null, null, @@ -244,8 +246,10 @@ describe('Processor', async function () { const newRoot = batch.currentStateRoot; if (!update) { expect(smtUtils.h4toString(newRoot)).to.be.equal(expectedNewRoot); + expect(smtUtils.h4toString(batch.newAccInputHash)).to.be.equal(expectedNewAccInputHash); } else { testVectors[i].expectedNewRoot = smtUtils.h4toString(newRoot); + testVectors[i].expectedNewAccInputHash = smtUtils.h4toString(batch.newAccInputHash); } // Check errors on decode transactions @@ -322,26 +326,32 @@ describe('Processor', async function () { if (Scalar.eq(localExitRootSmt, Scalar.e(0))) { expect(localExitRootVm.toString('hex')).to.equal(''); + if (update) { + newLocalExitRoot = ethers.constants.HashZero; + } expect(newLocalExitRoot).to.equal(ethers.constants.HashZero); } else { expect(localExitRootVm.toString('hex')).to.equal(localExitRootSmt.toString(16).padStart(64, '0')); + if (update) { + newLocalExitRoot = `0x${localExitRootVm.toString('hex')}`; + } expect(localExitRootVm.toString('hex')).to.equal(newLocalExitRoot.slice(2)); } // Check global exit root - const batchNumVm = await zkEVMDB.vm.stateManager.getContractStorage( + const timestampVm = await zkEVMDB.vm.stateManager.getContractStorage( addressInstanceGlobalExitRoot, globalExitRootPosBuffer, ); - const batchNumSmt = (await stateUtils.getContractStorage( + const timestampSmt = (await stateUtils.getContractStorage( Constants.ADDRESS_GLOBAL_EXIT_ROOT_MANAGER_L2, zkEVMDB.smt, zkEVMDB.stateRoot, [globalExitRootPos], ))[Scalar.e(globalExitRootPos)]; - expect(Scalar.fromString(batchNumVm.toString('hex'), 16)).to.equal(batchNumSmt); - expect(batchNumSmt).to.equal(Scalar.e(batch.batchNumber)); + expect(Scalar.fromString(timestampVm.toString('hex'), 16)).to.equal(timestampSmt); + expect(timestampSmt).to.equal(Scalar.e(batch.timestamp)); // Check through a call in the EVM if (bridgeDeployed) { @@ -352,7 +362,7 @@ describe('Processor', async function () { caller: Address.zero(), data: Buffer.from(encodedData.slice(2), 'hex'), }); - expect(globalExitRootResult.execResult.returnValue.toString('hex')).to.be.equal(ethers.utils.hexZeroPad(batch.batchNumber, 32).slice(2)); + expect(globalExitRootResult.execResult.returnValue.toString('hex')).to.be.equal(ethers.utils.hexZeroPad(batch.timestamp, 32).slice(2)); } // Check the circuit input diff --git a/test/zkevm-db.test.js b/test/zkevm-db.test.js index cdc66d6e..f9e34ed6 100644 --- a/test/zkevm-db.test.js +++ b/test/zkevm-db.test.js @@ -16,17 +16,20 @@ const { pathTestVectors } = require('./helpers/test-utils'); describe('ZkEVMDB', function () { this.timeout(5000); const pathZkevmDbTest = path.join(pathTestVectors, 'zkevm-db/state-transition.json'); + const pathZkevmDbTestRecursive = path.join(pathTestVectors, 'zkevm-db/recursive.json'); let update; let poseidon; let F; let testVectors; + let testVectorsRecursive; before(async () => { poseidon = await getPoseidon(); F = poseidon.F; testVectors = JSON.parse(fs.readFileSync(pathZkevmDbTest)); + testVectorsRecursive = JSON.parse(fs.readFileSync(pathZkevmDbTestRecursive)); update = argv.update === true; }); @@ -34,7 +37,7 @@ describe('ZkEVMDB', function () { it('Check zkEVMDB basic functions', async () => { const sequencerAddress = '0x0000000000000000000000000000000000000000'; const genesisRoot = [F.zero, F.zero, F.zero, F.zero]; - const localExitRoot = [F.zero, F.zero, F.zero, F.zero]; + const accHashInput = [F.zero, F.zero, F.zero, F.zero]; const globalExitRoot = [F.zero, F.zero, F.zero, F.zero]; const timestamp = 1; const genesis = []; @@ -46,7 +49,7 @@ describe('ZkEVMDB', function () { db, poseidon, genesisRoot, - localExitRoot, + accHashInput, genesis, null, null, @@ -57,12 +60,6 @@ describe('ZkEVMDB', function () { const batch = await zkEVMDB.buildBatch(timestamp, sequencerAddress, globalExitRoot); await batch.executeTxs(); - /* - * New root should be different because the will add in the mapping on globalExitRoot - * const newRoot = batch.currentStateRoot; - * expect(newRoot).to.be.equal(genesisRoot); - */ - // checks DB state previous consolidate zkEVMDB const lastBatch = await db.getValue(Constants.DB_LAST_BATCH); expect(lastBatch).to.be.equal(null); @@ -107,10 +104,11 @@ describe('ZkEVMDB', function () { txs, expectedNewRoot, sequencerAddress, - oldLocalExitRoot, globalExitRoot, timestamp, newLocalExitRoot, + oldAccInputHash, + expectedNewAccInputHash, chainID, } = testVectors[0]; @@ -218,7 +216,7 @@ describe('ZkEVMDB', function () { db, poseidon, genesisRoot, - smtUtils.stringToH4(oldLocalExitRoot), + smtUtils.stringToH4(oldAccInputHash), genesis, null, null, @@ -234,11 +232,14 @@ describe('ZkEVMDB', function () { await batch.executeTxs(); const newRoot = batch.currentStateRoot; + const { newAccInputHash } = batch; if (update) { testVectors[0].expectedNewRoot = smtUtils.h4toString(newRoot); + testVectors[0].expectedNewAccInputHash = smtUtils.h4toString(newAccInputHash); } else { expect(smtUtils.h4toString(newRoot)).to.be.equal(expectedNewRoot); + expect(smtUtils.h4toString(newAccInputHash)).to.be.equal(expectedNewAccInputHash); } // checks previous consolidate zkEVMDB @@ -260,6 +261,7 @@ describe('ZkEVMDB', function () { if (!update) { expect(smtUtils.h4toString(zkEVMDB.getCurrentStateRoot())).to.be.equal(expectedNewRoot); expect(smtUtils.h4toString(zkEVMDB.getCurrentLocalExitRoot())).to.be.equal(newLocalExitRoot); + expect(smtUtils.h4toString(zkEVMDB.getCurrentAccInpuHash())).to.be.equal(expectedNewAccInputHash); } const lastBatchDB = await db.getValue(Constants.DB_LAST_BATCH); @@ -271,8 +273,218 @@ describe('ZkEVMDB', function () { const localExitRootDB = await db.getValue(Scalar.add(Constants.DB_LOCAL_EXIT_ROOT, lastBatchDB)); expect(localExitRootDB).to.be.deep.equal(smtUtils.h4toString(zkEVMDB.getCurrentLocalExitRoot())); + const accHashInputDB = await db.getValue(Scalar.add(Constants.DB_ACC_INPUT_HASH, lastBatchDB)); + expect(accHashInputDB).to.be.deep.equal(smtUtils.h4toString(zkEVMDB.getCurrentAccInpuHash())); + if (update) { await fs.writeFileSync(pathZkevmDbTest, JSON.stringify(testVectors, null, 2)); } }); + + it('Check zkEVMDB recursive functions', async () => { + const { + genesis, + expectedOldRoot, + batches, + sequencerAddress, + globalExitRoot, + timestamp, + oldAccInputHash, + chainID, + finalStateRoot, + finalLocalExitRoot, + finalAccInputHash, + finalNumBatch, + aggregatorAddress, + inputSnark, + } = testVectorsRecursive[0]; + + const db = new MemDB(F); + const smt = new SMT(db, poseidon, poseidon.F); + + const walletMap = {}; + const addressArray = []; + const amountArray = []; + const nonceArray = []; + + // create genesis block + for (let j = 0; j < genesis.length; j++) { + const { + address, pvtKey, balance, nonce, + } = genesis[j]; + + const newWallet = new ethers.Wallet(pvtKey); + expect(address).to.be.equal(newWallet.address); + + walletMap[address] = newWallet; + addressArray.push(address); + amountArray.push(Scalar.e(balance)); + nonceArray.push(Scalar.e(nonce)); + } + + // set genesis block + const genesisRoot = await stateUtils.setGenesisBlock(addressArray, amountArray, nonceArray, smt); + for (let j = 0; j < addressArray.length; j++) { + const currentState = await stateUtils.getState(addressArray[j], smt, genesisRoot); + + expect(currentState.balance).to.be.equal(amountArray[j]); + expect(currentState.nonce).to.be.equal(nonceArray[j]); + } + + if (update) { + testVectorsRecursive[0].expectedOldRoot = smtUtils.h4toString(genesisRoot); + } else { + expect(smtUtils.h4toString(genesisRoot)).to.be.equal(expectedOldRoot); + } + + /* + * build, sign transaction and generate rawTxs + * rawTxs would be the calldata inserted in the contract + */ + const rawBatches = []; + + for (let m = 0; m < batches.length; m++) { + const { txs } = batches[m]; + const rawTxs = []; + + for (let j = 0; j < txs.length; j++) { + const txData = txs[j]; + + const tx = { + to: txData.to, + nonce: txData.nonce, + value: ethers.utils.parseUnits(txData.value, 'wei'), + gasLimit: txData.gasLimit, + gasPrice: ethers.utils.parseUnits(txData.gasPrice, 'wei'), + chainId: txData.chainId, + data: txData.data || '0x', + }; + if (!ethers.utils.isAddress(tx.to) || !ethers.utils.isAddress(txData.from)) { + expect(txData.customRawTx).to.equal(undefined); + // eslint-disable-next-line no-continue + continue; + } + + try { + let customRawTx; + + if (tx.chainId === 0) { + const signData = ethers.utils.RLP.encode([ + processorUtils.toHexStringRlp(Scalar.e(tx.nonce)), + processorUtils.toHexStringRlp(tx.gasPrice), + processorUtils.toHexStringRlp(tx.gasLimit), + processorUtils.toHexStringRlp(tx.to), + processorUtils.toHexStringRlp(tx.value), + processorUtils.toHexStringRlp(tx.data), + processorUtils.toHexStringRlp(tx.chainId), + '0x', + '0x', + ]); + const digest = ethers.utils.keccak256(signData); + const signingKey = new ethers.utils.SigningKey(walletMap[txData.from].privateKey); + const signature = signingKey.signDigest(digest); + const r = signature.r.slice(2).padStart(64, '0'); // 32 bytes + const s = signature.s.slice(2).padStart(64, '0'); // 32 bytes + const v = (signature.v).toString(16).padStart(2, '0'); // 1 bytes + customRawTx = signData.concat(r).concat(s).concat(v); + } else { + const rawTxEthers = await walletMap[txData.from].signTransaction(tx); + customRawTx = processorUtils.rawTxToCustomRawTx(rawTxEthers); + } + + if (update) { + testVectorsRecursive[0].batches[m].txs[j].customRawTx = customRawTx; + } else { + expect(customRawTx).to.equal(txData.customRawTx); + } + + if (txData.encodeInvalidData) { + customRawTx = customRawTx.slice(0, -6); + } + rawTxs.push(customRawTx); + } catch (error) { + expect(txData.customRawTx).to.equal(undefined); + } + } + rawBatches.push(rawTxs); + } + + // create a zkEVMDB and build a batch + const zkEVMDB = await ZkEVMDB.newZkEVM( + db, + poseidon, + genesisRoot, + smtUtils.stringToH4(oldAccInputHash), + genesis, + null, + null, + chainID, + ); + + // create batches + for (let m = 0; m < rawBatches.length; m++) { + const rawTxs = rawBatches[m]; + const batch = await zkEVMDB.buildBatch(timestamp, sequencerAddress, smtUtils.stringToH4(globalExitRoot)); + for (let j = 0; j < rawTxs.length; j++) { + batch.addRawTx(rawTxs[j]); + } + await batch.executeTxs(); + await zkEVMDB.consolidate(batch); + + const newRoot = batch.currentStateRoot; + const { newAccInputHash, newNumBatch, newLocalExitRoot } = batch; + const batchL2Data = await batch.getBatchL2Data(); + + if (update) { + testVectorsRecursive[0].batches[m].expectedNewRoot = smtUtils.h4toString(newRoot); + testVectorsRecursive[0].batches[m].expectedNewAccInputHash = smtUtils.h4toString(newAccInputHash); + testVectorsRecursive[0].batches[m].expectedNewNumBatch = batch.newNumBatch; + testVectorsRecursive[0].batches[m].expectedNewLocalExitRoot = smtUtils.h4toString(newLocalExitRoot); + testVectorsRecursive[0].batches[m].expectedBatchL2Data = batchL2Data; + } else { + expect(smtUtils.h4toString(newRoot)).to.be.equal(batches[m].expectedNewRoot); + expect(smtUtils.h4toString(newAccInputHash)).to.be.equal(batches[m].expectedNewAccInputHash); + expect(newNumBatch).to.be.equal(batches[m].expectedNewNumBatch); + expect(smtUtils.h4toString(newLocalExitRoot)).to.be.equal(batches[m].expectedNewLocalExitRoot); + expect(batchL2Data).to.be.equal(batches[m].expectedBatchL2Data); + } + } + + // checks after consolidate zkEVMDB + if (!update) { + expect(smtUtils.h4toString(zkEVMDB.getCurrentStateRoot())).to.be.equal(finalStateRoot); + expect(smtUtils.h4toString(zkEVMDB.getCurrentLocalExitRoot())).to.be.equal(finalLocalExitRoot); + expect(smtUtils.h4toString(zkEVMDB.getCurrentAccInpuHash())).to.be.equal(finalAccInputHash); + expect(zkEVMDB.getCurrentNumBatch()).to.be.equal(finalNumBatch); + } else { + testVectorsRecursive[0].finalStateRoot = smtUtils.h4toString(zkEVMDB.getCurrentStateRoot()); + testVectorsRecursive[0].finalLocalExitRoot = smtUtils.h4toString(zkEVMDB.getCurrentLocalExitRoot()); + testVectorsRecursive[0].finalAccInputHash = smtUtils.h4toString(zkEVMDB.getCurrentAccInpuHash()); + testVectorsRecursive[0].finalNumBatch = zkEVMDB.getCurrentNumBatch(); + } + + // checks sequence multiple batches + const initBatch = 1; + const finalBatch = 2; + const seqBatches = await zkEVMDB.sequenceMultipleBatches(initBatch, finalBatch); + + for (let i = 0; i < (finalBatch - initBatch); i++) { + expect(seqBatches[i].timestamp).to.equal(timestamp); + expect(seqBatches[i].globalExitRoot).to.equal(globalExitRoot); + expect(seqBatches[i].transactions).to.equal(batches[i].expectedBatchL2Data); + } + + // checks snark input for multiple batches + const verifyBatches = await zkEVMDB.verifyMultipleBatches(initBatch, finalBatch, aggregatorAddress); + + if (update) { + testVectorsRecursive[0].inputSnark = verifyBatches.inputSnark; + } else { + expect(inputSnark).to.be.equal(verifyBatches.inputSnark); + } + + if (update) { + await fs.writeFileSync(pathZkevmDbTestRecursive, JSON.stringify(testVectorsRecursive, null, 2)); + } + }); }); diff --git a/tools/fill-genesis/create-genesis.js b/tools/fill-genesis/create-genesis.js deleted file mode 100644 index 834401dc..00000000 --- a/tools/fill-genesis/create-genesis.js +++ /dev/null @@ -1,241 +0,0 @@ -/* eslint-disable global-require */ -/* eslint-disable import/no-dynamic-require */ -/* eslint-disable no-unused-expressions */ -/* eslint-disable no-console */ -/* eslint-disable multiline-comment-style */ -/* eslint-disable no-restricted-syntax */ -/* eslint-disable no-await-in-loop */ -/* eslint-disable guard-for-in */ -/* eslint-disable import/no-extraneous-dependencies */ - -const { Scalar } = require('ffjavascript'); -const fs = require('fs'); - -const ethers = require('ethers'); -const { - Address, -} = require('ethereumjs-util'); -const { defaultAbiCoder } = require('@ethersproject/abi'); -const path = require('path'); - -const artifactsPath = path.join(__dirname, '../../test/artifacts/contracts'); - -const { argv } = require('yargs'); -const contractsPolygonHermez = require('@0xpolygonhermez/contracts-zkevm'); -const { - MemDB, ZkEVMDB, getPoseidon, processorUtils, smtUtils, Constants, stateUtils, -} = require('../../index'); - -// Example of use: node create-genesis.js --gen genesis-gen.json --out genesis.json - -async function main() { - // load generator - const inputPath = (typeof argv.gen === 'undefined') ? undefined : argv.gen; - if (inputPath === undefined) { throw Error('Input genesis must be provided'); } - - // load output file - const outPath = (typeof argv.out === 'undefined') ? undefined : argv.out; - if (outPath === undefined) { throw Error('Output file must be specified'); } - - const genesisGenerator = require(path.join(__dirname, inputPath)); - - const genesisOutput = {}; - - const globalExitRoot = ethers.constants.HashZero; - const localExitRoot = ethers.constants.HashZero; - - const poseidon = await getPoseidon(); - const { F } = poseidon; - const { - genesis, - txs, - sequencerAddress, - timestamp, - } = genesisGenerator; - - const db = new MemDB(F); - - // create a zkEVMDB to compile the sc - const zkEVMDB = await ZkEVMDB.newZkEVM( - db, - poseidon, - [F.zero, F.zero, F.zero, F.zero], - smtUtils.stringToH4(localExitRoot), - genesis, - ); - - /* - * build, sign transaction and generate rawTxs - * rawTxs would be the calldata inserted in the contract - */ - const addressToContractName = {}; - const rawTxs = []; - for (let j = 0; j < txs.length; j++) { - const currentTx = txs[j]; - - const tx = { - to: currentTx.to || '0x', - nonce: currentTx.nonce, - value: processorUtils.toHexStringRlp(ethers.utils.parseUnits(currentTx.value, 'wei')), - gasLimit: currentTx.gasLimit, - gasPrice: processorUtils.toHexStringRlp(ethers.utils.parseUnits(currentTx.gasPrice, 'wei')), - chainId: currentTx.chainId, - data: currentTx.data || '0x', - }; - - // Contract deployment from tx - let bytecode; let - abi; - if (contractsPolygonHermez[currentTx.contractName]) { - ({ bytecode, abi } = contractsPolygonHermez[currentTx.contractName]); - } else { - ({ bytecode, abi } = require(`${artifactsPath}/${currentTx.contractName}.sol/${currentTx.contractName}.json`)); - } - - if (currentTx.function) { - const interfaceContract = new ethers.utils.Interface(abi); - tx.data = interfaceContract.encodeFunctionData(currentTx.function, currentTx.paramsFunction); - } else { - if (currentTx.paramsDeploy) { - const params = defaultAbiCoder.encode(currentTx.paramsDeploy.types, currentTx.paramsDeploy.values); - tx.data = bytecode + params.slice(2); - } else { - tx.data = bytecode; - } - const addressContract = await ethers.utils.getContractAddress( - { from: currentTx.from, nonce: currentTx.nonce }, - ); - addressToContractName[addressContract.toLowerCase()] = currentTx.contractName; - } - - let customRawTx; - const address = genesis.find((o) => o.address === currentTx.from); - const wallet = new ethers.Wallet(address.pvtKey); - if (tx.chainId === 0) { - const signData = ethers.utils.RLP.encode([ - processorUtils.toHexStringRlp(Scalar.e(tx.nonce)), - processorUtils.toHexStringRlp(tx.gasPrice), - processorUtils.toHexStringRlp(tx.gasLimit), - processorUtils.toHexStringRlp(tx.to), - processorUtils.toHexStringRlp(tx.value), - processorUtils.toHexStringRlp(tx.data), - processorUtils.toHexStringRlp(tx.chainId), - '0x', - '0x', - ]); - const digest = ethers.utils.keccak256(signData); - const signingKey = new ethers.utils.SigningKey(address.pvtKey); - const signature = signingKey.signDigest(digest); - const r = signature.r.slice(2).padStart(64, '0'); // 32 bytes - const s = signature.s.slice(2).padStart(64, '0'); // 32 bytes - const v = (signature.v).toString(16).padStart(2, '0'); // 1 bytes - customRawTx = signData.concat(r).concat(s).concat(v); - } else { - const rawTxEthers = await wallet.signTransaction(tx); - customRawTx = processorUtils.rawTxToCustomRawTx(rawTxEthers); - } - rawTxs.push(customRawTx); - } - const batch = await zkEVMDB.buildBatch(timestamp, sequencerAddress, smtUtils.stringToH4(globalExitRoot)); - for (let j = 0; j < rawTxs.length; j++) { - batch.addRawTx(rawTxs[j]); - } - - // execute the transactions added to the batch - await batch.executeTxs(); - // consolidate state - await zkEVMDB.consolidate(batch); - - // clean address 0 batch, clean globalExitRoot - let newRoot = batch.currentStateRoot; - - // clean address 0 state root - const batchNumber = 0; - const stateRootPos = ethers.utils.solidityKeccak256(['uint256', 'uint256'], [batchNumber, Constants.STATE_ROOT_STORAGE_POS]); - let newStorageEntry = {}; - newStorageEntry[stateRootPos] = '0x00'; - - newRoot = await stateUtils.setContractStorage( - Constants.ADDRESS_SYSTEM, - batch.smt, - newRoot, - newStorageEntry, - ); - // cleanglobal exit root - newStorageEntry = {}; - const globalExitRootPos = ethers.utils.solidityKeccak256(['uint256', 'uint256'], [ethers.constants.HashZero, Constants.GLOBAL_EXIT_ROOT_STORAGE_POS]); - newStorageEntry[globalExitRootPos] = 0; - newRoot = await stateUtils.setContractStorage( - Constants.ADDRESS_GLOBAL_EXIT_ROOT_MANAGER_L2, - batch.smt, - newRoot, - newStorageEntry, - ); - - const updatedAccounts = batch.getUpdatedAccountsBatch(); - const currentVM = batch.vm; - const accountsOutput = []; - - for (const item in updatedAccounts) { - const address = item; - const account = updatedAccounts[address]; - const currentAccountOutput = {}; - currentAccountOutput.balance = account.balance.toString(); - currentAccountOutput.nonce = account.nonce.toString(); - currentAccountOutput.address = address; - - // If account is a contract, update storage and bytecode - if (account.isContract()) { - const addressInstance = Address.fromString(address); - const smCode = await currentVM.stateManager.getContractCode(addressInstance); - const sto = await currentVM.stateManager.dumpStorage(addressInstance); - const storage = {}; - const keys = Object.keys(sto).map((v) => `0x${v}`); - const values = Object.values(sto).map((v) => `0x${v}`); - for (let k = 0; k < keys.length; k++) { - storage[keys[k]] = ethers.utils.RLP.decode(values[k]); - } - - currentAccountOutput.bytecode = `0x${smCode.toString('hex')}`; - currentAccountOutput.storage = storage; - currentAccountOutput.contractName = addressToContractName[address]; - } else if (address !== Constants.ADDRESS_SYSTEM && address !== Constants.ADDRESS_GLOBAL_EXIT_ROOT_MANAGER_L2) { - currentAccountOutput.pvtKey = (genesis.find((o) => o.address.toLowerCase() === address.toLowerCase())).pvtKey; - } - accountsOutput.push(currentAccountOutput); - } - - // add accounts that has not been used - for (let i = 0; i < genesis.length; i++) { - const item = genesis[i]; - if (typeof updatedAccounts[item.address.toLowerCase()] === 'undefined') { - accountsOutput.push(item); - } - } - - genesisOutput.root = smtUtils.h4toString(newRoot); - genesisOutput.genesis = accountsOutput; - const genesisOutputPath = path.join(__dirname, outPath); - await fs.writeFileSync(genesisOutputPath, JSON.stringify(genesisOutput, null, 2)); - - if (argv.update) { - const updatePath = (typeof argv.update === 'undefined') ? undefined : argv.update; - - if (!fs.existsSync(updatePath)) { - throw new Error('Update file does not exist'); - } - - const testVectors = JSON.parse(fs.readFileSync(updatePath)); - testVectors[0].genesis = genesisOutput.genesis; - testVectors[0].expectedOldRoot = genesisOutput.root; - await fs.writeFileSync(updatePath, JSON.stringify(testVectors, null, 2)); - } -} -// We recommend this pattern to be able to use async/await everywhere -// and properly handle errors. -main() - .then(() => process.exit(0)) - .catch((error) => { - console.error(error); - process.exit(1); - }); diff --git a/tools/fill-genesis/genesis-gen.json b/tools/fill-genesis/genesis-gen.json deleted file mode 100644 index ca2520db..00000000 --- a/tools/fill-genesis/genesis-gen.json +++ /dev/null @@ -1,70 +0,0 @@ - -{ - "defaultChainId": 1000, - "sequencerAddress": "0xC949254d682D8c9ad5682521675b8F43b102aec4", - "genesis": [ - { - "address": "0x9D98DeAbC42dd696Deb9e40b4f1CAB7dDBF55988", - "pvtKey": "0x00", - "balance": "100000000000000000000000", - "nonce": "0" - }, - { - "address": "0xC949254d682D8c9ad5682521675b8F43b102aec4", - "pvtKey": "0xdfd01798f92667dbf91df722434e8fbe96af0211d4d1b82bbbbc8f1def7a814f", - "balance": "0", - "nonce": "0" - }, - { - "address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - "pvtKey": "0x00", - "balance": "100000000000000000000000", - "nonce": "0" - } - ], - "txs": [ - { - "from": "0xC949254d682D8c9ad5682521675b8F43b102aec4", - "nonce": 0, - "value": "0", - "gasLimit": 10000000, - "gasPrice": "0", - "chainId": 1000, - "paramsDeploy": { - "types": [ - "address" - ], - "values": [ - "0x9D98DeAbC42dd696Deb9e40b4f1CAB7dDBF55988" - ] - }, - "contractName": "GlobalExitRootManagerL2", - "reason": "" - }, - { - "from": "0xC949254d682D8c9ad5682521675b8F43b102aec4", - "nonce": 1, - "value": "0", - "gasLimit": 10000000, - "gasPrice": "0", - "chainId": 1000, - "contractName": "Bridge" - }, - { - "from": "0xC949254d682D8c9ad5682521675b8F43b102aec4", - "to": "0x9D98DeAbC42dd696Deb9e40b4f1CAB7dDBF55988", - "nonce": 2, - "value": "0", - "gasLimit": 10000000, - "gasPrice": "0", - "chainId": 1000, - "function": "initialize", - "paramsFunction": [ - 1, - "0xAE4bB80bE56B819606589DE61d5ec3b522EEB032" - ], - "contractName": "Bridge" - } - ], - "timestamp": 1944498031 -} diff --git a/tools/fill-genesis/genesis.json b/tools/fill-genesis/genesis.json deleted file mode 100644 index e14c0e2e..00000000 --- a/tools/fill-genesis/genesis.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "root": "0xb33635210b9f5d07769cf70bf5a3cbf241ecbaf79a9b66ef79b28d920da1f776", - "genesis": [ - { - "balance": "0", - "nonce": "0", - "address": "0x0000000000000000000000000000000000000000" - }, - { - "balance": "0", - "nonce": "1", - "address": "0xae4bb80be56b819606589de61d5ec3b522eeb032", - "bytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806301fd904414610051578063257b36321461006d57806333d6247d1461008d578063a3c573eb146100a2575b600080fd5b61005a60015481565b6040519081526020015b60405180910390f35b61005a61007b366004610197565b60006020819052908152604090205481565b6100a061009b366004610197565b6100e7565b005b6002546100c29073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610064565b60025473ffffffffffffffffffffffffffffffffffffffff163314610192576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f476c6f62616c45786974526f6f744d616e616765724c323a3a7570646174654560448201527f786974526f6f743a204f4e4c595f425249444745000000000000000000000000606482015260840160405180910390fd5b600155565b6000602082840312156101a957600080fd5b503591905056fea2646970667358221220b6ba072419f510d5d5b9a55d9605786898f58415125e7e2ac3f699371fda0cbc64736f6c634300080f0033", - "storage": { - "0x0000000000000000000000000000000000000000000000000000000000000002": "0x9d98deabc42dd696deb9e40b4f1cab7ddbf55988" - }, - "contractName": "GlobalExitRootManagerL2" - }, - { - "balance": "100000000000000000000000", - "nonce": "2", - "address": "0x9d98deabc42dd696deb9e40b4f1cab7ddbf55988", - "bytecode": "0x608060405260043610620001075760003560e01c80635d5d326f1162000095578063bab161bf1162000060578063bab161bf1462000414578063d02103ca1462000449578063e73758811462000478578063ed6be5c914620004ac57600080fd5b80635d5d326f146200035e57806381b1c17414620003835780638624c35c14620003ca578063b7e6a7d414620003ef57600080fd5b80633ae0504711620000d65780633ae05047146200023a5780633da816821462000252578063508935f814620002885780635a64a1da14620002a157600080fd5b806322e95f2c146200010c5780632dfdf0b5146200015b5780632f3a3d5d1462000182578063318aee3d14620001b1575b600080fd5b3480156200011957600080fd5b50620001316200012b366004620027b4565b620004c3565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156200016857600080fd5b506200017360415481565b60405190815260200162000152565b3480156200018f57600080fd5b50604754620001319073ffffffffffffffffffffffffffffffffffffffff1681565b348015620001be57600080fd5b5062000208620001d0366004620027f0565b60456020526000908152604090205463ffffffff811690640100000000900473ffffffffffffffffffffffffffffffffffffffff1682565b6040805163ffffffff909316835273ffffffffffffffffffffffffffffffffffffffff90911660208301520162000152565b3480156200024757600080fd5b506200017362000566565b3480156200025f57600080fd5b5062000277620002713660046200290f565b62000640565b604051901515815260200162000152565b6200029f620002993660046200297d565b62000740565b005b348015620002ae57600080fd5b5062000173620002c036600462002a39565b604080517fffffffff0000000000000000000000000000000000000000000000000000000060e098891b81166020808401919091527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000006060998a1b811660248501529790991b1660388201529390951b909316603c830152605082015260708082019290925282518082039092018252609001909152805191012090565b3480156200036b57600080fd5b506200029f6200037d36600462002b51565b62000d2a565b3480156200039057600080fd5b5062000131620003a236600462002c38565b60446020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b348015620003d757600080fd5b506200029f620003e9366004620027b4565b620017d9565b348015620003fc57600080fd5b50620001316200040e366004620027b4565b62001a57565b3480156200042157600080fd5b50604254620004339063ffffffff1681565b60405163ffffffff909116815260200162000152565b3480156200045657600080fd5b50604654620001319073ffffffffffffffffffffffffffffffffffffffff1681565b3480156200048557600080fd5b50620002776200049736600462002c38565b60436020526000908152604090205460ff1681565b348015620004b957600080fd5b5062000433600081565b6040805160e084901b7fffffffff0000000000000000000000000000000000000000000000000000000016602080830191909152606084901b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166024830152825160188184030181526038909201835281519181019190912060009081526044909152205473ffffffffffffffffffffffffffffffffffffffff165b92915050565b6041546000908190815b6020811015620006385781600116600103620005d057600181602081106200059c576200059c62002c52565b0154604080516020810192909252810184905260600160405160208183030381529060405280519060200120925062000614565b8260218260208110620005e757620005e762002c52565b01546040805160208101939093528201526060016040516020818303038152906040528051906020012092505b6200062160028362002cb0565b9150806200062f8162002cec565b91505062000570565b509092915050565b60008467ffffffffffffffff8416825b6020811015620007335781600116600103620006bd578681815181106200067b576200067b62002c52565b6020026020010151836040516020016200069f929190918252602082015260400190565b6040516020818303038152906040528051906020012092506200070f565b82878281518110620006d357620006d362002c52565b6020026020010151604051602001620006f6929190918252602082015260400190565b6040516020818303038152906040528051906020012092505b6200071c60028362002cb0565b9150806200072a8162002cec565b91505062000650565b5050909114949350505050565b60425463ffffffff90811690861603620007e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4272696467653a3a6272696467653a2044455354494e4154494f4e5f43414e5460448201527f5f42455f495453454c460000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600080606073ffffffffffffffffffffffffffffffffffffffff89166200089d5785341462000893576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4272696467653a3a6272696467653a20414d4f554e545f444f45535f4e4f545f60448201527f4d415443485f4d53475f56414c554500000000000000000000000000000000006064820152608401620007d8565b6000915062000bb1565b73ffffffffffffffffffffffffffffffffffffffff808a1660009081526045602090815260409182902082518084019093525463ffffffff81168352640100000000900490921691810182905290156200099e576040517f9dc29fac0000000000000000000000000000000000000000000000000000000081523360048201526024810188905273ffffffffffffffffffffffffffffffffffffffff8b1690639dc29fac906044016020604051808303816000875af115801562000965573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200098b919062002d27565b5060208101518151909450925062000baf565b8415620009b357620009b38a88888862001b20565b620009d773ffffffffffffffffffffffffffffffffffffffff8b1633308a62001f71565b899350604260009054906101000a900463ffffffff1692508973ffffffffffffffffffffffffffffffffffffffff166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000a3b573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405262000a83919081019062002dc6565b8a73ffffffffffffffffffffffffffffffffffffffff166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000acf573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405262000b17919081019062002dc6565b8b73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000b63573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000b89919062002e0f565b60405160200162000b9d9392919062002e7b565b60405160208183030381529060405291505b505b7ff0b963192bdc6349c23af9bd17294b4c7b9b5a73a2a9939610ea18ffd1c5dc2a82848a8a8a8660415460405162000bf0979695949392919062002eb8565b60405180910390a18051602080830191909120604080517fffffffff0000000000000000000000000000000000000000000000000000000060e087811b8216838701527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608a811b82166024860152918f901b90921660388401528c901b16603c820152605081018a9052607080820193909352815180820390930183526090019052805191012062000ca49062002055565b60465473ffffffffffffffffffffffffffffffffffffffff166333d6247d62000ccc62000566565b6040518263ffffffff1660e01b815260040162000ceb91815260200190565b600060405180830381600087803b15801562000d0657600080fd5b505af115801562000d1b573d6000803e3d6000fd5b50505050505050505050505050565b63ffffffff891660009081526043602052604090205460ff161562000dac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4272696467653a3a636c61696d3a20414c52454144595f434c41494d454400006044820152606401620007d8565b6046546040805160208082018c90528183018b9052825180830384018152606083019384905280519101207f257b363200000000000000000000000000000000000000000000000000000000909252606481019190915273ffffffffffffffffffffffffffffffffffffffff9091169063257b3632906084016020604051808303816000875af115801562000e45573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000e6b919062002f25565b60000362000efc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4272696467653a3a636c61696d3a20474c4f42414c5f455849545f524f4f545f60448201527f444f45535f4e4f545f4d415443480000000000000000000000000000000000006064820152608401620007d8565b60425463ffffffff85811691161462000f98576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4272696467653a3a636c61696d3a2044455354494e4154494f4e5f4e4554574f60448201527f524b5f444f45535f4e4f545f4d415443480000000000000000000000000000006064820152608401620007d8565b60425463ffffffff16620010c9578051602080830191909120604080517fffffffff0000000000000000000000000000000000000000000000000000000060e08b811b8216838701527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608c811b82166024860152918b901b909216603884015288901b16603c8201526050810186905260708082019390935281518082039093018352609001905280519101206200105b908b8b63ffffffff168a62000640565b620010c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4272696467653a3a636c61696d3a20534d545f494e56414c49440000000000006044820152606401620007d8565b620011e6565b8051602080830191909120604080517fffffffff0000000000000000000000000000000000000000000000000000000060e08b811b8216838701527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000060608c811b82166024860152918b901b909216603884015288901b16603c8201526050810186905260708082019390935281518082039093018352609001905280519101206200117e908b8b63ffffffff168b62000640565b620011e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4272696467653a3a636c61696d3a20534d545f494e56414c49440000000000006044820152606401620007d8565b63ffffffff8916600090815260436020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905573ffffffffffffffffffffffffffffffffffffffff851662001357576040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff851690849060405162001279919062002f3f565b60006040518083038185875af1925050503d8060008114620012b8576040519150601f19603f3d011682016040523d82523d6000602084013e620012bd565b606091505b505090508062001350576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f4272696467653a3a636c61696d3a204554485f5452414e534645525f4641494c60448201527f45440000000000000000000000000000000000000000000000000000000000006064820152608401620007d8565b5062001762565b60425463ffffffff9081169087160362001394576200138e73ffffffffffffffffffffffffffffffffffffffff86168484620021ce565b62001762565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b1660208201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b166024820152600090603801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291815281516020928301206000818152604490935291205490915073ffffffffffffffffffffffffffffffffffffffff1680620016c1576047546000906200147f9073ffffffffffffffffffffffffffffffffffffffff168462002226565b90506000806000868060200190518101906200149c919062002f5d565b9250925092508373ffffffffffffffffffffffffffffffffffffffff16636c9452218484848d8d6040518663ffffffff1660e01b8152600401620014e595949392919062002fde565b600060405180830381600087803b1580156200150057600080fd5b505af115801562001515573d6000803e3d6000fd5b50505050836044600088815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060405180604001604052808d63ffffffff1681526020018c73ffffffffffffffffffffffffffffffffffffffff16815250604560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050507fccd7715648d1f2bb13e158f96b5b6c3aeda555d4cb87112e274a6f28bc571d598c8c86604051620016af9392919063ffffffff93909316835273ffffffffffffffffffffffffffffffffffffffff918216602084015216604082015260600190565b60405180910390a1505050506200175f565b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152602482018690528216906340c10f19906044016020604051808303816000875af115801562001737573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200175d919062002d27565b505b50505b6040805163ffffffff8b811682528816602082015273ffffffffffffffffffffffffffffffffffffffff87811682840152851660608201526080810184905290517f25308c93ceeed162da955b3f7ce3e3f93606579e40fb92029faa9efe275459839181900360a00190a150505050505050505050565b600054610100900460ff1615808015620017fa5750600054600160ff909116105b80620018165750303b15801562001816575060005460ff166001145b620018a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401620007d8565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156200190357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b604280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff8516179055604680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905560405162001981906200275c565b604051809103906000f0801580156200199e573d6000803e3d6000fd5b50604780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055620019ee62002306565b801562001a5257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1660208201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606083901b1660248201526000908190603801604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152919052805160209091012060475490915062001b189073ffffffffffffffffffffffffffffffffffffffff16826200244e565b949350505050565b600062001b6383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250620024d292505050565b90507fffffffff0000000000000000000000000000000000000000000000000000000081167fd505accf000000000000000000000000000000000000000000000000000000001462001c38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f48657a4d617469634d657267653a3a5f7065726d69743a204e4f545f56414c4960448201527f445f43414c4c00000000000000000000000000000000000000000000000000006064820152608401620007d8565b600080808080808062001c4f896004818d6200303e565b81019062001c5e91906200306a565b96509650965096509650965096503373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff161462001d29576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f48657a4d617469634d657267653a3a5f7065726d69743a205045524d49545f4f60448201527f574e45525f4d5553545f42455f5448455f53454e4445520000000000000000006064820152608401620007d8565b73ffffffffffffffffffffffffffffffffffffffff8616301462001dd0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f48657a4d617469634d657267653a3a5f7065726d69743a205350454e4445525f60448201527f4d5553545f42455f5448495300000000000000000000000000000000000000006064820152608401620007d8565b8a851462001e61576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f48657a4d617469634d657267653a3a5f7065726d69743a205045524d49545f4160448201527f4d4f554e545f444f45535f4e4f545f4d415443480000000000000000000000006064820152608401620007d8565b6040805173ffffffffffffffffffffffffffffffffffffffff89811660248301528881166044830152606482018890526084820187905260ff861660a483015260c4820185905260e48083018590528351808403909101815261010490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fd505accf000000000000000000000000000000000000000000000000000000001790529151918e169162001f1c919062002f3f565b6000604051808303816000865af19150503d806000811462001f5b576040519150601f19603f3d011682016040523d82523d6000602084013e62001f60565b606091505b505050505050505050505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526200204f9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152620024d9565b50505050565b80600162002066602060026200321b565b62002072919062003229565b6041541062002104576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4465706f736974436f6e74726163743a5f6465706f7369743a204d45524b4c4560448201527f5f545245455f46554c4c000000000000000000000000000000000000000000006064820152608401620007d8565b60016041600082825462002119919062003243565b909155505060415460005b6020811015620021c357816001166001036200215957826001826020811062002151576200215162002c52565b015550505050565b600181602081106200216f576200216f62002c52565b01546040805160208101929092528101849052606001604051602081830303815290604052805190602001209250600282620021ac919062002cb0565b915080620021ba8162002cec565b91505062002124565b5062001a526200325e565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905262001a529084907fa9059cbb000000000000000000000000000000000000000000000000000000009060640162001fcc565b60006040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528360601b60148201527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006028820152826037826000f591505073ffffffffffffffffffffffffffffffffffffffff811662000560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f455243313136373a2063726561746532206661696c65640000000000000000006044820152606401620007d8565b600054610100900460ff166200239f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401620007d8565b60005b620023b06001602062003229565b8110156200244b5760218160208110620023ce57620023ce62002c52565b015460218260208110620023e657620023e662002c52565b015460408051602081019390935282015260600160405160208183030381529060405280519060200120602182600162002421919062003243565b6020811062002434576200243462002c52565b015580620024428162002cec565b915050620023a2565b50565b6000620024cb8383306040517f3d602d80600a3d3981f3363d3d373d3d3d363d730000000000000000000000008152606093841b60148201527f5af43d82803e903d91602b57fd5bf3ff000000000000000000000000000000006028820152921b6038830152604c8201526037808220606c830152605591012090565b9392505050565b6020015190565b60006200253d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16620025ec9092919063ffffffff16565b80519091501562001a5257808060200190518101906200255e919062002d27565b62001a52576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401620007d8565b606062001b1884846000858573ffffffffffffffffffffffffffffffffffffffff85163b62002678576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401620007d8565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051620026a3919062002f3f565b60006040518083038185875af1925050503d8060008114620026e2576040519150601f19603f3d011682016040523d82523d6000602084013e620026e7565b606091505b5091509150620026f982828662002704565b979650505050505050565b6060831562002715575081620024cb565b825115620027265782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620007d891906200328d565b61182980620032a383390190565b803563ffffffff811681146200277f57600080fd5b919050565b73ffffffffffffffffffffffffffffffffffffffff811681146200244b57600080fd5b80356200277f8162002784565b60008060408385031215620027c857600080fd5b620027d3836200276a565b91506020830135620027e58162002784565b809150509250929050565b6000602082840312156200280357600080fd5b8135620024cb8162002784565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171562002889576200288962002810565b604052919050565b600082601f830112620028a357600080fd5b8135602067ffffffffffffffff821115620028c257620028c262002810565b8160051b620028d38282016200283f565b9283528481018201928281019087851115620028ee57600080fd5b83870192505b84831015620026f957823582529183019190830190620028f4565b600080600080608085870312156200292657600080fd5b84359350602085013567ffffffffffffffff808211156200294657600080fd5b620029548883890162002891565b94506040870135915080821682146200296c57600080fd5b509396929550929360600135925050565b60008060008060008060a087890312156200299757600080fd5b8635620029a48162002784565b9550620029b4602088016200276a565b94506040870135620029c68162002784565b935060608701359250608087013567ffffffffffffffff80821115620029eb57600080fd5b818901915089601f83011262002a0057600080fd5b81358181111562002a1057600080fd5b8a602082850101111562002a2357600080fd5b6020830194508093505050509295509295509295565b60008060008060008060c0878903121562002a5357600080fd5b62002a5e876200276a565b9550602087013562002a708162002784565b945062002a80604088016200276a565b9350606087013562002a928162002784565b9598949750929560808101359460a0909101359350915050565b600067ffffffffffffffff82111562002ac95762002ac962002810565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f83011262002b0757600080fd5b813562002b1e62002b188262002aac565b6200283f565b81815284602083860101111562002b3457600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806000806000806000806101408b8d03121562002b7257600080fd5b8a3567ffffffffffffffff8082111562002b8b57600080fd5b62002b998e838f0162002891565b9b5062002ba960208e016200276a565b9a5060408d0135995060608d0135985062002bc760808e016200276a565b975062002bd760a08e01620027a7565b965062002be760c08e016200276a565b955062002bf760e08e01620027a7565b94506101008d013593506101208d013591508082111562002c1757600080fd5b5062002c268d828e0162002af5565b9150509295989b9194979a5092959850565b60006020828403121562002c4b57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008262002ce7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820362002d205762002d2062002c81565b5060010190565b60006020828403121562002d3a57600080fd5b81518015158114620024cb57600080fd5b60005b8381101562002d6857818101518382015260200162002d4e565b838111156200204f5750506000910152565b600082601f83011262002d8c57600080fd5b815162002d9d62002b188262002aac565b81815284602083860101111562002db357600080fd5b62001b1882602083016020870162002d4b565b60006020828403121562002dd957600080fd5b815167ffffffffffffffff81111562002df157600080fd5b62001b188482850162002d7a565b60ff811681146200244b57600080fd5b60006020828403121562002e2257600080fd5b8151620024cb8162002dff565b6000815180845262002e4981602086016020860162002d4b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60608152600062002e90606083018662002e2f565b828103602084015262002ea4818662002e2f565b91505060ff83166040830152949350505050565b600063ffffffff808a16835273ffffffffffffffffffffffffffffffffffffffff808a166020850152818916604085015280881660608501525085608084015260e060a084015262002f0e60e084018662002e2f565b915080841660c08401525098975050505050505050565b60006020828403121562002f3857600080fd5b5051919050565b6000825162002f5381846020870162002d4b565b9190910192915050565b60008060006060848603121562002f7357600080fd5b835167ffffffffffffffff8082111562002f8c57600080fd5b62002f9a8783880162002d7a565b9450602086015191508082111562002fb157600080fd5b5062002fc08682870162002d7a565b925050604084015162002fd38162002dff565b809150509250925092565b60a08152600062002ff360a083018862002e2f565b828103602084015262003007818862002e2f565b60ff969096166040840152505073ffffffffffffffffffffffffffffffffffffffff92909216606083015260809091015292915050565b600080858511156200304f57600080fd5b838611156200305d57600080fd5b5050820193919092039150565b600080600080600080600060e0888a0312156200308657600080fd5b8735620030938162002784565b96506020880135620030a58162002784565b955060408801359450606088013593506080880135620030c58162002dff565b9699959850939692959460a0840135945060c09093013592915050565b600181815b808511156200314157817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111562003125576200312562002c81565b808516156200313357918102915b93841c9390800290620030e7565b509250929050565b6000826200315a5750600162000560565b81620031695750600062000560565b81600181146200318257600281146200318d57620031ad565b600191505062000560565b60ff841115620031a157620031a162002c81565b50506001821b62000560565b5060208310610133831016604e8410600b8410161715620031d2575081810a62000560565b620031de8383620030e2565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111562003213576200321362002c81565b029392505050565b6000620024cb838362003149565b6000828210156200323e576200323e62002c81565b500390565b6000821982111562003259576200325962002c81565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b602081526000620024cb602083018462002e2f56fe60806040523480156200001157600080fd5b50600054610100900460ff1615808015620000335750600054600160ff909116105b8062000063575062000050306200013d60201b6200080a1760201c565b15801562000063575060005460ff166001145b620000cb5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff191660011790558015620000ef576000805461ff0019166101001790555b801562000136576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b506200014c565b6001600160a01b03163b151590565b6116cd806200015c6000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80636c94522111610097578063a3c573eb11610066578063a3c573eb1461021c578063a457c2d714610261578063a9059cbb14610274578063dd62ed3e1461028757600080fd5b80636c945221146101b657806370a08231146101cb57806395d89b41146102015780639dc29fac1461020957600080fd5b806323b872dd116100d357806323b872dd1461014d578063313ce56714610160578063395093511461019057806340c10f19146101a357600080fd5b806306fdde03146100fa578063095ea7b31461011857806318160ddd1461013b575b600080fd5b6101026102cd565b60405161010f91906111c0565b60405180910390f35b61012b61012636600461125c565b61035f565b604051901515815260200161010f565b6035545b60405190815260200161010f565b61012b61015b366004611286565b610377565b60655474010000000000000000000000000000000000000000900460ff1660405160ff909116815260200161010f565b61012b61019e36600461125c565b61039b565b61012b6101b136600461125c565b6103e7565b6101c96101c436600461139c565b610483565b005b61013f6101d9366004611431565b73ffffffffffffffffffffffffffffffffffffffff1660009081526033602052604090205490565b61010261068e565b61012b61021736600461125c565b61069d565b60655461023c9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010f565b61012b61026f36600461125c565b61072b565b61012b61028236600461125c565b6107fc565b61013f610295366004611453565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260346020908152604080832093909416825291909152205490565b6060603680546102dc90611486565b80601f016020809104026020016040519081016040528092919081815260200182805461030890611486565b80156103555780601f1061032a57610100808354040283529160200191610355565b820191906000526020600020905b81548152906001019060200180831161033857829003601f168201915b5050505050905090565b60003361036d818585610826565b5060019392505050565b6000336103858582856109da565b610390858585610ab1565b506001949350505050565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919061036d90829086906103e2908790611508565b610826565b60655460009073ffffffffffffffffffffffffffffffffffffffff163314610470576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f546f6b656e577261707065643a4e4f545f42524944474500000000000000000060448201526064015b60405180910390fd5b61047a8383610d64565b50600192915050565b600054610100900460ff16158080156104a35750600054600160ff909116105b806104bd5750303b1580156104bd575060005460ff166001145b610549576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610467565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156105a757600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6105b18686610e85565b606580547fffffffffffffffffffffff00000000000000000000000000000000000000000016337fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16177401000000000000000000000000000000000000000060ff8716021790556106238383610d64565b801561068657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6060603780546102dc90611486565b60655460009073ffffffffffffffffffffffffffffffffffffffff163314610721576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f546f6b656e577261707065643a4e4f545f4252494447450000000000000000006044820152606401610467565b61047a8383610f26565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190838110156107ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610467565b6103908286868403610826565b60003361036d818585610ab1565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b73ffffffffffffffffffffffffffffffffffffffff83166108c8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff821661096b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152603460209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610aab5781811015610a9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610467565b610aab8484848403610826565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316610b54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff8216610bf7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604090205481811015610cad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260336020526040808220858503905591851681529081208054849290610cf1908490611508565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610d5791815260200190565b60405180910390a3610aab565b73ffffffffffffffffffffffffffffffffffffffff8216610de1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610467565b8060356000828254610df39190611508565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526033602052604081208054839290610e2d908490611508565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35b5050565b600054610100900460ff16610f1c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610467565b610e818282611110565b73ffffffffffffffffffffffffffffffffffffffff8216610fc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff82166000908152603360205260409020548181101561107f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604081208383039055603580548492906110bb908490611520565b909155505060405182815260009073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016109cd565b505050565b600054610100900460ff166111a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610467565b60366111b3838261157d565b50603761110b828261157d565b600060208083528351808285015260005b818110156111ed578581018301518582016040015282016111d1565b818111156111ff576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461125757600080fd5b919050565b6000806040838503121561126f57600080fd5b61127883611233565b946020939093013593505050565b60008060006060848603121561129b57600080fd5b6112a484611233565b92506112b260208501611233565b9150604084013590509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261130257600080fd5b813567ffffffffffffffff8082111561131d5761131d6112c2565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715611363576113636112c2565b8160405283815286602085880101111561137c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080600060a086880312156113b457600080fd5b853567ffffffffffffffff808211156113cc57600080fd5b6113d889838a016112f1565b965060208801359150808211156113ee57600080fd5b506113fb888289016112f1565b945050604086013560ff8116811461141257600080fd5b925061142060608701611233565b949793965091946080013592915050565b60006020828403121561144357600080fd5b61144c82611233565b9392505050565b6000806040838503121561146657600080fd5b61146f83611233565b915061147d60208401611233565b90509250929050565b600181811c9082168061149a57607f821691505b6020821081036114d3577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561151b5761151b6114d9565b500190565b600082821015611532576115326114d9565b500390565b601f82111561110b57600081815260208120601f850160051c8101602086101561155e5750805b601f850160051c820191505b818110156106865782815560010161156a565b815167ffffffffffffffff811115611597576115976112c2565b6115ab816115a58454611486565b84611537565b602080601f8311600181146115fe57600084156115c85750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610686565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561164b5788860151825594840194600190910190840161162c565b508582101561168757878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b0190555056fea264697066735822122015dd8047eba7f7221e0d7792549e5a01ba1b6dfaad0c6a70dc82ef386e0c5cc464736f6c634300080f0033a264697066735822122068cb524538909c05cc5109b7664a019588dc698f1f570976efb4dd6b6aee818364736f6c634300080f0033", - "storage": { - "0x0000000000000000000000000000000000000000000000000000000000000000": "0x01", - "0x0000000000000000000000000000000000000000000000000000000000000042": "0x01", - "0x0000000000000000000000000000000000000000000000000000000000000046": "0xae4bb80be56b819606589de61d5ec3b522eeb032", - "0x0000000000000000000000000000000000000000000000000000000000000047": "0x61ba0248b0986c2480181c6e76b6adeeaa962483", - "0x0000000000000000000000000000000000000000000000000000000000000022": "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5", - "0x0000000000000000000000000000000000000000000000000000000000000023": "0xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30", - "0x0000000000000000000000000000000000000000000000000000000000000024": "0x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85", - "0x0000000000000000000000000000000000000000000000000000000000000025": "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0x0000000000000000000000000000000000000000000000000000000000000026": "0x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d", - "0x0000000000000000000000000000000000000000000000000000000000000027": "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0x0000000000000000000000000000000000000000000000000000000000000028": "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x0000000000000000000000000000000000000000000000000000000000000029": "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0x000000000000000000000000000000000000000000000000000000000000002a": "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0x000000000000000000000000000000000000000000000000000000000000002b": "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0x000000000000000000000000000000000000000000000000000000000000002c": "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x000000000000000000000000000000000000000000000000000000000000002d": "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0x000000000000000000000000000000000000000000000000000000000000002e": "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x000000000000000000000000000000000000000000000000000000000000002f": "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0x0000000000000000000000000000000000000000000000000000000000000030": "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x0000000000000000000000000000000000000000000000000000000000000031": "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0x0000000000000000000000000000000000000000000000000000000000000032": "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x0000000000000000000000000000000000000000000000000000000000000033": "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0x0000000000000000000000000000000000000000000000000000000000000034": "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0x0000000000000000000000000000000000000000000000000000000000000035": "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0x0000000000000000000000000000000000000000000000000000000000000036": "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x0000000000000000000000000000000000000000000000000000000000000037": "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x0000000000000000000000000000000000000000000000000000000000000038": "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0x0000000000000000000000000000000000000000000000000000000000000039": "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x000000000000000000000000000000000000000000000000000000000000003a": "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0x000000000000000000000000000000000000000000000000000000000000003b": "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x000000000000000000000000000000000000000000000000000000000000003c": "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x000000000000000000000000000000000000000000000000000000000000003d": "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x000000000000000000000000000000000000000000000000000000000000003e": "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x000000000000000000000000000000000000000000000000000000000000003f": "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x0000000000000000000000000000000000000000000000000000000000000040": "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - }, - "contractName": "Bridge" - }, - { - "balance": "0", - "nonce": "3", - "address": "0xc949254d682d8c9ad5682521675b8f43b102aec4", - "pvtKey": "0xdfd01798f92667dbf91df722434e8fbe96af0211d4d1b82bbbbc8f1def7a814f" - }, - { - "balance": "100000000000000000000000", - "nonce": "0", - "address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", - "pvtKey": "0x00" - }, - { - "balance": "0", - "nonce": "1", - "address": "0x61ba0248b0986c2480181c6e76b6adeeaa962483", - "bytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636c94522111610097578063a3c573eb11610066578063a3c573eb1461021c578063a457c2d714610261578063a9059cbb14610274578063dd62ed3e1461028757600080fd5b80636c945221146101b657806370a08231146101cb57806395d89b41146102015780639dc29fac1461020957600080fd5b806323b872dd116100d357806323b872dd1461014d578063313ce56714610160578063395093511461019057806340c10f19146101a357600080fd5b806306fdde03146100fa578063095ea7b31461011857806318160ddd1461013b575b600080fd5b6101026102cd565b60405161010f91906111c0565b60405180910390f35b61012b61012636600461125c565b61035f565b604051901515815260200161010f565b6035545b60405190815260200161010f565b61012b61015b366004611286565b610377565b60655474010000000000000000000000000000000000000000900460ff1660405160ff909116815260200161010f565b61012b61019e36600461125c565b61039b565b61012b6101b136600461125c565b6103e7565b6101c96101c436600461139c565b610483565b005b61013f6101d9366004611431565b73ffffffffffffffffffffffffffffffffffffffff1660009081526033602052604090205490565b61010261068e565b61012b61021736600461125c565b61069d565b60655461023c9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161010f565b61012b61026f36600461125c565b61072b565b61012b61028236600461125c565b6107fc565b61013f610295366004611453565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260346020908152604080832093909416825291909152205490565b6060603680546102dc90611486565b80601f016020809104026020016040519081016040528092919081815260200182805461030890611486565b80156103555780601f1061032a57610100808354040283529160200191610355565b820191906000526020600020905b81548152906001019060200180831161033857829003601f168201915b5050505050905090565b60003361036d818585610826565b5060019392505050565b6000336103858582856109da565b610390858585610ab1565b506001949350505050565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919061036d90829086906103e2908790611508565b610826565b60655460009073ffffffffffffffffffffffffffffffffffffffff163314610470576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f546f6b656e577261707065643a4e4f545f42524944474500000000000000000060448201526064015b60405180910390fd5b61047a8383610d64565b50600192915050565b600054610100900460ff16158080156104a35750600054600160ff909116105b806104bd5750303b1580156104bd575060005460ff166001145b610549576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610467565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156105a757600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6105b18686610e85565b606580547fffffffffffffffffffffff00000000000000000000000000000000000000000016337fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16177401000000000000000000000000000000000000000060ff8716021790556106238383610d64565b801561068657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6060603780546102dc90611486565b60655460009073ffffffffffffffffffffffffffffffffffffffff163314610721576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f546f6b656e577261707065643a4e4f545f4252494447450000000000000000006044820152606401610467565b61047a8383610f26565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190838110156107ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610467565b6103908286868403610826565b60003361036d818585610ab1565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b73ffffffffffffffffffffffffffffffffffffffff83166108c8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff821661096b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152603460209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610aab5781811015610a9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610467565b610aab8484848403610826565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316610b54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff8216610bf7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604090205481811015610cad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260336020526040808220858503905591851681529081208054849290610cf1908490611508565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610d5791815260200190565b60405180910390a3610aab565b73ffffffffffffffffffffffffffffffffffffffff8216610de1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610467565b8060356000828254610df39190611508565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526033602052604081208054839290610e2d908490611508565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35b5050565b600054610100900460ff16610f1c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610467565b610e818282611110565b73ffffffffffffffffffffffffffffffffffffffff8216610fc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff82166000908152603360205260409020548181101561107f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610467565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604081208383039055603580548492906110bb908490611520565b909155505060405182815260009073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016109cd565b505050565b600054610100900460ff166111a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610467565b60366111b3838261157d565b50603761110b828261157d565b600060208083528351808285015260005b818110156111ed578581018301518582016040015282016111d1565b818111156111ff576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461125757600080fd5b919050565b6000806040838503121561126f57600080fd5b61127883611233565b946020939093013593505050565b60008060006060848603121561129b57600080fd5b6112a484611233565b92506112b260208501611233565b9150604084013590509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261130257600080fd5b813567ffffffffffffffff8082111561131d5761131d6112c2565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715611363576113636112c2565b8160405283815286602085880101111561137c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600080600060a086880312156113b457600080fd5b853567ffffffffffffffff808211156113cc57600080fd5b6113d889838a016112f1565b965060208801359150808211156113ee57600080fd5b506113fb888289016112f1565b945050604086013560ff8116811461141257600080fd5b925061142060608701611233565b949793965091946080013592915050565b60006020828403121561144357600080fd5b61144c82611233565b9392505050565b6000806040838503121561146657600080fd5b61146f83611233565b915061147d60208401611233565b90509250929050565b600181811c9082168061149a57607f821691505b6020821081036114d3577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561151b5761151b6114d9565b500190565b600082821015611532576115326114d9565b500390565b601f82111561110b57600081815260208120601f850160051c8101602086101561155e5750805b601f850160051c820191505b818110156106865782815560010161156a565b815167ffffffffffffffff811115611597576115976112c2565b6115ab816115a58454611486565b84611537565b602080601f8311600181146115fe57600084156115c85750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610686565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561164b5788860151825594840194600190910190840161162c565b508582101561168757878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b0190555056fea264697066735822122015dd8047eba7f7221e0d7792549e5a01ba1b6dfaad0c6a70dc82ef386e0c5cc464736f6c634300080f0033", - "storage": { - "0x0000000000000000000000000000000000000000000000000000000000000000": "0x01" - } - } - ] -} \ No newline at end of file diff --git a/tools/fill-genesis/generate-claim-exit-root.js b/tools/generate-claim/generate-claim-exit-root.js similarity index 88% rename from tools/fill-genesis/generate-claim-exit-root.js rename to tools/generate-claim/generate-claim-exit-root.js index f1f3db89..3a7c1107 100644 --- a/tools/fill-genesis/generate-claim-exit-root.js +++ b/tools/generate-claim/generate-claim-exit-root.js @@ -8,6 +8,8 @@ const { getLeafValue, } = require('../../index').mtBridgeUtils; +const { Constants } = require('../../index'); + function calculateGlobalExitRoot(mainnetExitRoot, rollupExitRoot) { return ethers.utils.solidityKeccak256(['bytes32', 'bytes32'], [mainnetExitRoot, rollupExitRoot]); } @@ -31,7 +33,15 @@ async function main() { // pre compute root merkle tree in Js const height = 32; const merkleTree = new MerkleTreeBridge(height); - const leafValue = getLeafValue(originNetwork, tokenAddress, destinationNetwork, destinationAddress, amount, metadataHash); + const leafValue = getLeafValue( + Constants.BRIDGE_LEAF_TYPE_ASSET, + originNetwork, + tokenAddress, + destinationNetwork, + destinationAddress, + amount, + metadataHash, + ); merkleTree.add(leafValue); const rootJSMainnet = merkleTree.getRoot();