From 390d6ff860eb12d89d040cbe076e616d668a83d3 Mon Sep 17 00:00:00 2001 From: "Andrei A." Date: Thu, 31 Oct 2024 19:03:53 +0200 Subject: [PATCH] Feat/122 Add TokenBridge e2e tests (#210) * fix: add mutex in account manager to avoid nonce issue * fix: optimize global setup * Limiting number of concurrent traces API requests for the local stack to avoid occasional OOM-s * Limiting number of verticles for Traces API node * Add E2E TokenBridge tests * fixing test and adding concurency * fixing test and adding concurency * fixing test and adding concurency * fixing test and adding concurency * fixing nonce management * deploying l2token for the L2 -> L1 test * adjusting accounts for L2->L1 test * adjusting l2TestContractAddress * use nonce management for L1->L2 test * adjusting the TestERC20 contract and tests * rebasing with fix/133-improve-e2e-tests-performance * fix: update jest config to exit even if there are open handles * Trying out Besu untuned and raising limit per endpoint to 2 for traces * Trying out Besu untuned and raising limit per endpoint to 2 for traces and Shomei node * Using besu untuned for arithmetization as well * Compile once and parallelise setRemoteTokenBridge * feat: deploy smart contracts from artifacts + change e2e tests setup * fix: update pnpm * fix: remove compile contracts gradle task * fix: remove compileContracts gradle task * fix: refactor genesis generator dockerfile + downgrade l1-el-node besu version * fix: move abi from e2e folder to contract folder + refactor contracts deployments scripts * feat: add deployment script from artifacts for LineaRollupV6 * update pnpm version in get-started.md * fix: update console log in deployment scripts * fix: update besu version + fix deployment scripts * correct addresses * fix import * use abi and bytecode for deployments * use upgradable beacon for BridgedToken ABI deploys * use saved abi and bytecode for TestERC20 deploy * correct deployBridgedTokenAndTokenBridge casing * optimize token bridge e2e calls * use explicit message event data * use precomputed nonces for e2e stack --------- Co-authored-by: VGau Co-authored-by: Victorien Gauch <85494462+VGau@users.noreply.github.com> Co-authored-by: Roman <4833306+Filter94@users.noreply.github.com> Co-authored-by: thedarkjester Co-authored-by: The Dark Jester --- Makefile | 53 +- contracts/common/helpers/storeAddress.ts | 2 +- .../contracts/tokenBridge/mocks/TestERC20.sol | 40 + contracts/deploy/05_deploy_BridgedToken.ts | 6 +- contracts/deploy/06_deploy_TokenBridge.ts | 7 +- contracts/deploy/11_deploy_TestERC20.ts | 48 + .../deployBridgedTokenAndTokenBridge.ts | 141 ++ .../deployL2MessageService.ts | 8 +- .../deployPlonkVerifierAndLineaRollupV5.ts | 10 +- .../deployPlonkVerifierAndLineaRollupV6.ts | 11 +- .../deployTestERC20.ts | 61 + .../dynamic-artifacts/BridgedToken.json | 519 ++++++ .../dynamic-artifacts/TokenBridge.json | 1474 +++++++++++++++++ .../get-wallet-nonce.ts | 33 + .../static-artifacts/TestERC20.json | 385 +++++ .../static-artifacts/UpgradeableBeacon.json | 113 ++ .../config/linea-local-dev-genesis-PoA.json | 2 +- e2e/src/bridge-tokens.spec.ts | 211 +++ e2e/src/common/utils.ts | 9 +- e2e/src/config/jest/global-setup.ts | 12 +- .../config/tests-config/environments/dev.ts | 4 + .../config/tests-config/environments/local.ts | 10 +- .../tests-config/environments/sepolia.ts | 4 + e2e/src/config/tests-config/setup.ts | 71 + e2e/src/config/tests-config/types.ts | 11 +- e2e/src/l2.spec.ts | 10 +- 26 files changed, 3237 insertions(+), 18 deletions(-) create mode 100644 contracts/contracts/tokenBridge/mocks/TestERC20.sol create mode 100644 contracts/deploy/11_deploy_TestERC20.ts create mode 100644 contracts/local-deployments-artifacts/deployBridgedTokenAndTokenBridge.ts create mode 100644 contracts/local-deployments-artifacts/deployTestERC20.ts create mode 100644 contracts/local-deployments-artifacts/dynamic-artifacts/BridgedToken.json create mode 100644 contracts/local-deployments-artifacts/dynamic-artifacts/TokenBridge.json create mode 100644 contracts/local-deployments-artifacts/get-wallet-nonce.ts create mode 100644 contracts/local-deployments-artifacts/static-artifacts/TestERC20.json create mode 100644 contracts/local-deployments-artifacts/static-artifacts/UpgradeableBeacon.json create mode 100644 e2e/src/bridge-tokens.spec.ts diff --git a/Makefile b/Makefile index da10f154..146bc5a5 100644 --- a/Makefile +++ b/Makefile @@ -108,6 +108,53 @@ deploy-l2messageservice: L2MSGSERVICE_RATE_LIMIT_AMOUNT=1000000000000000000000 \ npx ts-node local-deployments-artifacts/deployL2MessageService.ts +deploy-token-bridge-l1: + # WARNING: FOR LOCAL DEV ONLY - DO NOT REUSE THESE KEYS ELSEWHERE + cd contracts/; \ + PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ + RPC_URL=http:\\localhost:8445/ \ + REMOTE_CHAIN_ID=1337 \ + TOKEN_BRIDGE_L1=true \ + TOKEN_BRIDGE_SECURITY_COUNCIL=0x90F79bf6EB2c4f870365E785982E1f101E93b906 \ + L2_MESSAGE_SERVICE_ADDRESS=0xe537D669CA013d86EBeF1D64e40fC74CADC91987 \ + LINEA_ROLLUP_ADDRESS=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 \ + npx ts-node local-deployments-artifacts/deployBridgedTokenAndTokenBridge.ts + +deploy-token-bridge-l2: + # WARNING: FOR LOCAL DEV ONLY - DO NOT REUSE THESE KEYS ELSEWHERE + cd contracts/; \ + SAVE_ADDRESS=true \ + PRIVATE_KEY=0x1dd171cec7e2995408b5513004e8207fe88d6820aeff0d82463b3e41df251aae \ + RPC_URL=http:\\localhost:8545/ \ + REMOTE_CHAIN_ID=31648428 \ + TOKEN_BRIDGE_L1=false \ + TOKEN_BRIDGE_SECURITY_COUNCIL=0xf17f52151EbEF6C7334FAD080c5704D77216b732 \ + L2_MESSAGE_SERVICE_ADDRESS=0xe537D669CA013d86EBeF1D64e40fC74CADC91987 \ + LINEA_ROLLUP_ADDRESS=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 \ + npx ts-node local-deployments-artifacts/deployBridgedTokenAndTokenBridge.ts + +deploy-l1-test-erc20: + # WARNING: FOR LOCAL DEV ONLY - DO NOT REUSE THESE KEYS ELSEWHERE + cd contracts/; \ + PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ + RPC_URL=http:\\localhost:8445/ \ + TEST_ERC20_L1=true \ + TEST_ERC20_NAME=TestERC20 \ + TEST_ERC20_SYMBOL=TERC20 \ + TEST_ERC20_INITIAL_SUPPLY=100000 \ + npx ts-node local-deployments-artifacts/deployTestERC20.ts + +deploy-l2-test-erc20: + # WARNING: FOR LOCAL DEV ONLY - DO NOT REUSE THESE KEYS ELSEWHERE + cd contracts/; \ + PRIVATE_KEY=0x1dd171cec7e2995408b5513004e8207fe88d6820aeff0d82463b3e41df251aae \ + RPC_URL=http:\\localhost:8545/ \ + TEST_ERC20_L1=false \ + TEST_ERC20_NAME=TestERC20 \ + TEST_ERC20_SYMBOL=TERC20 \ + TEST_ERC20_INITIAL_SUPPLY=100000 \ + npx ts-node local-deployments-artifacts/deployTestERC20.ts + upgrade-linea-rollup-on-uat: cd contracts/; \ rm -f .openzeppelin/goerli.json; \ @@ -153,7 +200,11 @@ deploy-contracts-v4: $(MAKE) -j2 deploy-linea-rollup-v4 deploy-l2messageservice deploy-contracts: - $(MAKE) -j2 deploy-linea-rollup-v5 deploy-l2messageservice + cd contracts/; \ + export L1_NONCE=$$(npx ts-node local-deployments-artifacts/get-wallet-nonce.ts --wallet-priv-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --rpc-url http://localhost:8445) && \ + export L2_NONCE=$$(npx ts-node local-deployments-artifacts/get-wallet-nonce.ts --wallet-priv-key 0x1dd171cec7e2995408b5513004e8207fe88d6820aeff0d82463b3e41df251aae --rpc-url http://localhost:8545) && \ + cd .. && \ + $(MAKE) -j6 deploy-linea-rollup-v5 deploy-token-bridge-l1 deploy-l1-test-erc20 deploy-l2messageservice deploy-token-bridge-l2 deploy-l2-test-erc20 testnet-start-l2: docker compose -f docker/compose.yml -f docker/compose-testnet-sync.overrides.yml --profile l2 up -d diff --git a/contracts/common/helpers/storeAddress.ts b/contracts/common/helpers/storeAddress.ts index 0c5d3bd8..f8218bf5 100644 --- a/contracts/common/helpers/storeAddress.ts +++ b/contracts/common/helpers/storeAddress.ts @@ -15,7 +15,7 @@ export const tryStoreAddress = async ( const network = await ethers.provider.getNetwork(); const ContractFactory = await ethers.getContractFactory(contractName); - const dirPath = path.join(__dirname, "..", "deployments", `${networkName}`); + const dirPath = path.join(__dirname, "..", "..", "deployments", `${networkName}`); if (!fs.existsSync(dirPath)) { fs.mkdirSync(dirPath, { recursive: true }); diff --git a/contracts/contracts/tokenBridge/mocks/TestERC20.sol b/contracts/contracts/tokenBridge/mocks/TestERC20.sol new file mode 100644 index 00000000..5e764284 --- /dev/null +++ b/contracts/contracts/tokenBridge/mocks/TestERC20.sol @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: MIT + +pragma solidity 0.8.19; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "@openzeppelin/contracts/access/Ownable.sol"; + +/** + * @title TestERC20 + * @dev Simple ERC20 Token example. + */ + +contract TestERC20 is ERC20, Ownable { + /** + * @dev Constructor that gives msg.sender all of existing tokens. + */ + + constructor(string memory _name, string memory _symbol, uint256 _initialSupply) ERC20(_name, _symbol) { + _mint(msg.sender, _initialSupply); + } + + /** + * @dev Function to mint tokens + * @param _to The address that will receive the minted tokens. + * @param _amount The amount of tokens to mint. + */ + + function mint(address _to, uint256 _amount) public { + _mint(_to, _amount); + } + + /** + * @dev Function to burn tokens + * @param _amount The amount of tokens to burn. + */ + + function burn(uint256 _amount) public { + _burn(msg.sender, _amount); + } +} diff --git a/contracts/deploy/05_deploy_BridgedToken.ts b/contracts/deploy/05_deploy_BridgedToken.ts index 9d3588d5..7b376228 100644 --- a/contracts/deploy/05_deploy_BridgedToken.ts +++ b/contracts/deploy/05_deploy_BridgedToken.ts @@ -43,7 +43,11 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { await tryStoreAddress(network.name, contractName, bridgedTokenAddress, deployTx.hash); - console.log(`BridgedToken beacon deployed on ${network.name}, at address:`, bridgedTokenAddress); + if (process.env.TOKEN_BRIDGE_L1 === "true") { + console.log(`L1 BridgedToken beacon deployed on ${network.name}, at address:`, bridgedTokenAddress); + } else { + console.log(`L2 BridgedToken beacon deployed on ${network.name}, at address:`, bridgedTokenAddress); + } await tryVerifyContract(bridgedTokenAddress); }; diff --git a/contracts/deploy/06_deploy_TokenBridge.ts b/contracts/deploy/06_deploy_TokenBridge.ts index 469c431e..90eafa73 100644 --- a/contracts/deploy/06_deploy_TokenBridge.ts +++ b/contracts/deploy/06_deploy_TokenBridge.ts @@ -113,8 +113,11 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { await tryStoreProxyAdminAddress(network.name, contractName, proxyAdminAddress); - console.log(`TokenBridge deployed on ${network.name}, at address: ${tokenBridgeAddress}`); - + if (process.env.TOKEN_BRIDGE_L1 === "true") { + console.log(`L1 TokenBridge deployed on ${network.name}, at address: ${tokenBridgeAddress}`); + } else { + console.log(`L2 TokenBridge deployed on ${network.name}, at address: ${tokenBridgeAddress}`); + } await tryVerifyContract(tokenBridgeAddress); }; export default func; diff --git a/contracts/deploy/11_deploy_TestERC20.ts b/contracts/deploy/11_deploy_TestERC20.ts new file mode 100644 index 00000000..2ffd7031 --- /dev/null +++ b/contracts/deploy/11_deploy_TestERC20.ts @@ -0,0 +1,48 @@ +import { ethers, network } from "hardhat"; +import { DeployFunction } from "hardhat-deploy/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { + getRequiredEnvVar, + tryVerifyContract, + tryStoreAddress, + validateDeployBranchAndTags, + getDeployedContractAddress, +} from "../common/helpers"; + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployments } = hre; + validateDeployBranchAndTags(hre.network.name); + + const contractName = "TestERC20"; + const existingContractAddress = await getDeployedContractAddress(contractName, deployments); + + const tokenName = getRequiredEnvVar("TEST_ERC20_NAME"); + const tokenSymbol = getRequiredEnvVar("TEST_ERC20_SYMBOL"); + const initialSupply = getRequiredEnvVar("TEST_ERC20_INITIAL_SUPPLY"); + + if (!existingContractAddress) { + console.log(`Deploying initial version, NB: the address will be saved if env SAVE_ADDRESS=true.`); + } else { + console.log(`Deploying new version, NB: ${existingContractAddress} will be overwritten if env SAVE_ADDRESS=true.`); + } + + const TestERC20Factory = await ethers.getContractFactory(contractName); + const contract = await TestERC20Factory.deploy(tokenName, tokenSymbol, ethers.parseEther(initialSupply)); + + await contract.waitForDeployment(); + const contractAddress = await contract.getAddress(); + + const deployTx = contract.deploymentTransaction(); + if (!deployTx) { + throw "Deployment transaction not found."; + } + + await tryStoreAddress(network.name, contractName, contractAddress, deployTx.hash); + + const chainId = (await ethers.provider.getNetwork()).chainId; + console.log(`${contractName} deployed on ${network.name}, chainId=${chainId}, at address: ${contractAddress}`); + await tryVerifyContract(contractAddress); +}; + +export default func; +func.tags = ["TestERC20"]; diff --git a/contracts/local-deployments-artifacts/deployBridgedTokenAndTokenBridge.ts b/contracts/local-deployments-artifacts/deployBridgedTokenAndTokenBridge.ts new file mode 100644 index 00000000..d7ecaf9d --- /dev/null +++ b/contracts/local-deployments-artifacts/deployBridgedTokenAndTokenBridge.ts @@ -0,0 +1,141 @@ +import { abi as ProxyAdminAbi, bytecode as ProxyAdminBytecode } from "./static-artifacts/ProxyAdmin.json"; +import { abi as BridgedTokenAbi, bytecode as BridgedTokenBytecode } from "./dynamic-artifacts/BridgedToken.json"; +import { abi as TokenBridgeAbi, bytecode as TokenBridgeBytecode } from "./dynamic-artifacts/TokenBridge.json"; +import { + abi as UpgradeableBeaconAbi, + bytecode as UpgradeableBeaconBytecode, +} from "./static-artifacts/UpgradeableBeacon.json"; + +import { + abi as TransparentUpgradeableProxyAbi, + bytecode as TransparentUpgradeableProxyBytecode, +} from "./static-artifacts/TransparentUpgradeableProxy.json"; +import { getEnvVarOrDefault, getRequiredEnvVar } from "../common/helpers/environment"; +import { generateRoleAssignments } from "../common/helpers/roles"; +import { + TOKEN_BRIDGE_PAUSE_TYPES_ROLES, + TOKEN_BRIDGE_ROLES, + TOKEN_BRIDGE_UNPAUSE_TYPES_ROLES, +} from "contracts/common/constants"; +import { ethers } from "ethers"; +import { deployContractFromArtifacts, getInitializerData } from "../common/helpers/deployments"; + +async function main() { + const ORDERED_NONCE_POST_L2MESSAGESERVICE = 3; + const ORDERED_NONCE_POST_LINEAROLLUP = 4; + const bridgedTokenName = "BridgedToken"; + const tokenBridgeName = "TokenBridge"; + + const l2MessageServiceAddress = process.env.L2_MESSAGE_SERVICE_ADDRESS; + const lineaRollupAddress = process.env.LINEA_ROLLUP_ADDRESS; + + const remoteChainId = getRequiredEnvVar("REMOTE_CHAIN_ID"); + const tokenBridgeSecurityCouncil = getRequiredEnvVar("TOKEN_BRIDGE_SECURITY_COUNCIL"); + + const pauseTypeRoles = getEnvVarOrDefault("TOKEN_BRIDGE_PAUSE_TYPES_ROLES", TOKEN_BRIDGE_PAUSE_TYPES_ROLES); + const unpauseTypeRoles = getEnvVarOrDefault("TOKEN_BRIDGE_UNPAUSE_TYPES_ROLES", TOKEN_BRIDGE_UNPAUSE_TYPES_ROLES); + const defaultRoleAddresses = generateRoleAssignments(TOKEN_BRIDGE_ROLES, tokenBridgeSecurityCouncil, []); + const roleAddresses = getEnvVarOrDefault("TOKEN_BRIDGE_ROLE_ADDRESSES", defaultRoleAddresses); + const provider = new ethers.JsonRpcProvider(process.env.RPC_URL); + const wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, provider); + + let walletNonce; + + if (process.env.TOKEN_BRIDGE_L1 === "true") { + if (process.env.L1_NONCE === undefined) { + walletNonce = await wallet.getNonce(); + } else { + walletNonce = parseInt(process.env.L1_NONCE) + ORDERED_NONCE_POST_LINEAROLLUP; + } + } else { + if (process.env.L2_NONCE === undefined) { + walletNonce = await wallet.getNonce(); + } else { + walletNonce = parseInt(process.env.L2_NONCE) + ORDERED_NONCE_POST_L2MESSAGESERVICE; + } + } + + const [bridgedToken, tokenBridgeImplementation, proxyAdmin] = await Promise.all([ + deployContractFromArtifacts(BridgedTokenAbi, BridgedTokenBytecode, wallet, { nonce: walletNonce }), + deployContractFromArtifacts(TokenBridgeAbi, TokenBridgeBytecode, wallet, { nonce: walletNonce + 1 }), + deployContractFromArtifacts(ProxyAdminAbi, ProxyAdminBytecode, wallet, { nonce: walletNonce + 2 }), + ]); + + const bridgedTokenAddress = await bridgedToken.getAddress(); + const tokenBridgeImplementationAddress = await tokenBridgeImplementation.getAddress(); + const proxyAdminAddress = await proxyAdmin.getAddress(); + + const chainId = (await provider.getNetwork()).chainId; + + console.log(`${bridgedTokenName} contract deployed at ${bridgedTokenAddress}`); + console.log(`${tokenBridgeName} Implementation contract deployed at ${tokenBridgeImplementationAddress}`); + console.log(`L1 ProxyAdmin deployed: address=${proxyAdminAddress}`); + console.log(`Deploying UpgradeableBeacon: chainId=${chainId} bridgedTokenAddress=${bridgedTokenAddress}`); + + const beaconProxy = await deployContractFromArtifacts( + UpgradeableBeaconAbi, + UpgradeableBeaconBytecode, + wallet, + bridgedTokenAddress, + ); + + const beaconProxyAddress = await beaconProxy.getAddress(); + + let deployingChainMessageService = l2MessageServiceAddress; + let reservedAddresses = process.env.L2_RESERVED_TOKEN_ADDRESSES + ? process.env.L2_RESERVED_TOKEN_ADDRESSES.split(",") + : []; + + if (process.env.TOKEN_BRIDGE_L1 === "true") { + console.log( + `TOKEN_BRIDGE_L1=${process.env.TOKEN_BRIDGE_L1}. Deploying TokenBridge on L1, using L1_RESERVED_TOKEN_ADDRESSES environment variable`, + ); + deployingChainMessageService = lineaRollupAddress; + reservedAddresses = process.env.L1_RESERVED_TOKEN_ADDRESSES + ? process.env.L1_RESERVED_TOKEN_ADDRESSES.split(",") + : []; + } else { + console.log( + `TOKEN_BRIDGE_L1=${process.env.TOKEN_BRIDGE_L1}. Deploying TokenBridge on L2, using L2_RESERVED_TOKEN_ADDRESSES environment variable`, + ); + } + + const initializer = getInitializerData(TokenBridgeAbi, "initialize", [ + { + defaultAdmin: tokenBridgeSecurityCouncil, + messageService: deployingChainMessageService, + tokenBeacon: beaconProxyAddress, + sourceChainId: chainId, + targetChainId: remoteChainId, + reservedTokens: reservedAddresses, + roleAddresses, + pauseTypeRoles, + unpauseTypeRoles, + }, + ]); + + const proxyContract = await deployContractFromArtifacts( + TransparentUpgradeableProxyAbi, + TransparentUpgradeableProxyBytecode, + wallet, + tokenBridgeImplementationAddress, + proxyAdminAddress, + initializer, + ); + + const proxyContractAddress = await proxyContract.getAddress(); + const txReceipt = await proxyContract.deploymentTransaction()?.wait(); + + if (!txReceipt) { + throw "Contract deployment transaction receipt not found."; + } + + console.log( + `${tokenBridgeName} deployed: chainId=${chainId} address=${proxyContractAddress} blockNumber=${txReceipt.blockNumber}`, + ); +} + +main().catch((error) => { + console.error(error); + process.exitCode = 1; +}); diff --git a/contracts/local-deployments-artifacts/deployL2MessageService.ts b/contracts/local-deployments-artifacts/deployL2MessageService.ts index 7e3ca100..6fc5289f 100644 --- a/contracts/local-deployments-artifacts/deployL2MessageService.ts +++ b/contracts/local-deployments-artifacts/deployL2MessageService.ts @@ -30,7 +30,13 @@ async function main() { const provider = new ethers.JsonRpcProvider(process.env.RPC_URL); const wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, provider); - const walletNonce = await wallet.getNonce(); + let walletNonce; + + if (!process.env.L2_NONCE) { + walletNonce = await wallet.getNonce(); + } else { + walletNonce = parseInt(process.env.L2_NONCE); + } const [l2MessageServiceImplementation, proxyAdmin] = await Promise.all([ deployContractFromArtifacts(L2MessageServiceAbi, L2MessageServiceBytecode, wallet, { nonce: walletNonce }), diff --git a/contracts/local-deployments-artifacts/deployPlonkVerifierAndLineaRollupV5.ts b/contracts/local-deployments-artifacts/deployPlonkVerifierAndLineaRollupV5.ts index 04b529bc..8ff0d6a7 100644 --- a/contracts/local-deployments-artifacts/deployPlonkVerifierAndLineaRollupV5.ts +++ b/contracts/local-deployments-artifacts/deployPlonkVerifierAndLineaRollupV5.ts @@ -52,7 +52,15 @@ async function main() { const provider = new ethers.JsonRpcProvider(process.env.RPC_URL); const wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, provider); - const [walletNonce, { gasPrice }] = await Promise.all([wallet.getNonce(), get1559Fees(provider)]); + const { gasPrice } = await get1559Fees(provider); + + let walletNonce; + + if (!process.env.L1_NONCE) { + walletNonce = await wallet.getNonce(); + } else { + walletNonce = parseInt(process.env.L1_NONCE); + } const [verifier, lineaRollupImplementation, proxyAdmin] = await Promise.all([ deployContractFromArtifacts(verifierArtifacts.abi, verifierArtifacts.bytecode, wallet, { diff --git a/contracts/local-deployments-artifacts/deployPlonkVerifierAndLineaRollupV6.ts b/contracts/local-deployments-artifacts/deployPlonkVerifierAndLineaRollupV6.ts index 7b44bca7..de02b5ef 100644 --- a/contracts/local-deployments-artifacts/deployPlonkVerifierAndLineaRollupV6.ts +++ b/contracts/local-deployments-artifacts/deployPlonkVerifierAndLineaRollupV6.ts @@ -65,9 +65,18 @@ async function main() { const verifierArtifacts = findContractArtifacts(path.join(__dirname, "./dynamic-artifacts"), verifierName); const provider = new ethers.JsonRpcProvider(process.env.RPC_URL); + const wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, provider); - const [walletNonce, { gasPrice }] = await Promise.all([wallet.getNonce(), get1559Fees(provider)]); + const { gasPrice } = await get1559Fees(provider); + + let walletNonce; + + if (!process.env.L1_NONCE) { + walletNonce = await wallet.getNonce(); + } else { + walletNonce = parseInt(process.env.L1_NONCE); + } const [verifier, lineaRollupImplementation, proxyAdmin] = await Promise.all([ deployContractFromArtifacts(verifierArtifacts.abi, verifierArtifacts.bytecode, wallet, { diff --git a/contracts/local-deployments-artifacts/deployTestERC20.ts b/contracts/local-deployments-artifacts/deployTestERC20.ts new file mode 100644 index 00000000..051e9683 --- /dev/null +++ b/contracts/local-deployments-artifacts/deployTestERC20.ts @@ -0,0 +1,61 @@ +import { ethers } from "ethers"; +import { abi as TestERC20Abi, bytecode as TestERC20Bytecode } from "./static-artifacts/TestERC20.json"; +import { deployContractFromArtifacts } from "../common/helpers/deployments"; +import { get1559Fees } from "../scripts/utils"; +import { getRequiredEnvVar } from "../common/helpers/environment"; + +async function main() { + const ORDERED_NONCE_POST_LINEAROLLUP = 4; + const ORDERED_NONCE_POST_TOKENBRIDGE = 5; + const ORDERED_NONCE_POST_L2MESSAGESERVICE = 3; + + const provider = new ethers.JsonRpcProvider(process.env.RPC_URL); + const wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, provider); + + const erc20Name = getRequiredEnvVar("TEST_ERC20_NAME"); + const erc20Symbol = getRequiredEnvVar("TEST_ERC20_SYMBOL"); + const erc20Supply = getRequiredEnvVar("TEST_ERC20_INITIAL_SUPPLY"); + + const { gasPrice } = await get1559Fees(provider); + + let walletNonce; + + if (process.env.TEST_ERC20_L1 === "true") { + if (!process.env.L1_NONCE) { + walletNonce = await wallet.getNonce(); + } else { + walletNonce = parseInt(process.env.L1_NONCE) + ORDERED_NONCE_POST_LINEAROLLUP + ORDERED_NONCE_POST_TOKENBRIDGE; + } + } else { + if (!process.env.L2_NONCE) { + walletNonce = await wallet.getNonce(); + } else { + walletNonce = + parseInt(process.env.L2_NONCE) + ORDERED_NONCE_POST_L2MESSAGESERVICE + ORDERED_NONCE_POST_TOKENBRIDGE; + } + } + + const testERC20 = await deployContractFromArtifacts( + TestERC20Abi, + TestERC20Bytecode, + wallet, + erc20Name, + erc20Symbol, + erc20Supply, + { + nonce: walletNonce, + gasPrice, + }, + ); + + const testERC20Address = await testERC20.getAddress(); + + const chainId = (await provider.getNetwork()).chainId; + + console.log(`testERC20 deployed: address=${testERC20Address} chainId=${chainId}`); +} + +main().catch((error) => { + console.error(error); + process.exit(1); +}); diff --git a/contracts/local-deployments-artifacts/dynamic-artifacts/BridgedToken.json b/contracts/local-deployments-artifacts/dynamic-artifacts/BridgedToken.json new file mode 100644 index 00000000..19fb297c --- /dev/null +++ b/contracts/local-deployments-artifacts/dynamic-artifacts/BridgedToken.json @@ -0,0 +1,519 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "BridgedToken", + "sourceName": "contracts/tokenBridge/BridgedToken.sol", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "bridgeAddress", + "type": "address" + } + ], + "name": "OnlyBridge", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "_decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "bridge", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_tokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "_tokenSymbol", + "type": "string" + }, + { + "internalType": "uint8", + "name": "_tokenDecimals", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b5061001961001e565b6100dd565b600054610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116146100db576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6120dc80620000ed6000396000f3fe608060405234801561001057600080fd5b506004361061016c5760003560e01c806370a08231116100cd578063a457c2d711610081578063d505accf11610066578063d505accf14610315578063dd62ed3e14610328578063e78cea921461036e57600080fd5b8063a457c2d7146102ef578063a9059cbb1461030257600080fd5b806384b0196e116100b257806384b0196e146102b957806395d89b41146102d45780639dc29fac146102dc57600080fd5b806370a08231146102705780637ecebe00146102a657600080fd5b8063313ce567116101245780633644e515116101095780633644e51514610242578063395093511461024a57806340c10f191461025d57600080fd5b8063313ce567146101ec57806332424aa31461021d57600080fd5b80631624f6c6116101555780631624f6c6146101b257806318160ddd146101c757806323b872dd146101d957600080fd5b806306fdde0314610171578063095ea7b31461018f575b600080fd5b6101796103b3565b6040516101869190611b09565b60405180910390f35b6101a261019d366004611b4c565b610445565b6040519015158152602001610186565b6101c56101c0366004611c61565b61045f565b005b6035545b604051908152602001610186565b6101a26101e7366004611cd5565b61066c565b60cc5474010000000000000000000000000000000000000000900460ff165b60405160ff9091168152602001610186565b60cc5461020b9074010000000000000000000000000000000000000000900460ff1681565b6101cb610690565b6101a2610258366004611b4c565b61069f565b6101c561026b366004611b4c565b6106eb565b6101cb61027e366004611d11565b73ffffffffffffffffffffffffffffffffffffffff1660009081526033602052604090205490565b6101cb6102b4366004611d11565b610766565b6102c1610791565b6040516101869796959493929190611d2c565b61017961086d565b6101c56102ea366004611b4c565b61087c565b6101a26102fd366004611b4c565b6108fe565b6101a2610310366004611b4c565b6109cf565b6101c5610323366004611deb565b6109dd565b6101cb610336366004611e55565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260346020908152604080832093909416825291909152205490565b60cc5461038e9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610186565b6060603680546103c290611e88565b80601f01602080910402602001604051908101604052809291908181526020018280546103ee90611e88565b801561043b5780601f106104105761010080835404028352916020019161043b565b820191906000526020600020905b81548152906001019060200180831161041e57829003601f168201915b5050505050905090565b600033610453818585610b9c565b60019150505b92915050565b600054610100900460ff161580801561047f5750600054600160ff909116105b806104995750303b158015610499575060005460ff166001145b61052a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561058857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6105928484610d50565b61059b84610df1565b60cc80547fffffffffffffffffffffff00000000000000000000000000000000000000000016337fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16177401000000000000000000000000000000000000000060ff851602179055801561066657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60003361067a858285610eca565b610685858585610f9b565b506001949350505050565b600061069a611211565b905090565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919061045390829086906106e6908790611ed5565b610b9c565b60cc5473ffffffffffffffffffffffffffffffffffffffff1633146107585760cc546040517fd8ee8db000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610521565b610762828261121b565b5050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260996020526040812054610459565b6000606080600080600060606065546000801b1480156107b15750606654155b610817576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4549503731323a20556e696e697469616c697a656400000000000000000000006044820152606401610521565b61081f611310565b61082761131f565b604080516000808252602082019092527f0f000000000000000000000000000000000000000000000000000000000000009b939a50919850469750309650945092509050565b6060603780546103c290611e88565b60cc5473ffffffffffffffffffffffffffffffffffffffff1633146108e95760cc546040517fd8ee8db000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610521565b6108f4823383610eca565b610762828261132e565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190838110156109c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610521565b6106858286868403610b9c565b600033610453818585610f9b565b83421115610a47576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610521565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610a768c6114f1565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610ade82611526565b90506000610aee8287878761156e565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610b85576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610521565b610b908a8a8a610b9c565b50505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8316610c3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610521565b73ffffffffffffffffffffffffffffffffffffffff8216610ce1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610521565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b600054610100900460ff16610de7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610521565b6107628282611596565b600054610100900460ff16610e88576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610521565b610ec7816040518060400160405280600181526020017f3100000000000000000000000000000000000000000000000000000000000000815250611646565b50565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152603460209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146106665781811015610f8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610521565b6106668484848403610b9c565b73ffffffffffffffffffffffffffffffffffffffff831661103e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610521565b73ffffffffffffffffffffffffffffffffffffffff82166110e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610521565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604090205481811015611197576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610521565b73ffffffffffffffffffffffffffffffffffffffff80851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906112049086815260200190565b60405180910390a3610666565b600061069a611705565b73ffffffffffffffffffffffffffffffffffffffff8216611298576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610521565b80603560008282546112aa9190611ed5565b909155505073ffffffffffffffffffffffffffffffffffffffff82166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6060606780546103c290611e88565b6060606880546103c290611e88565b73ffffffffffffffffffffffffffffffffffffffff82166113d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610521565b73ffffffffffffffffffffffffffffffffffffffff821660009081526033602052604090205481811015611487576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610521565b73ffffffffffffffffffffffffffffffffffffffff831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610d43565b505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526099602052604090208054600181018255905b50919050565b6000610459611533611211565b836040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b600080600061157f87878787611779565b9150915061158c81611868565b5095945050505050565b600054610100900460ff1661162d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610521565b60366116398382611f5d565b5060376114ec8282611f5d565b600054610100900460ff166116dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610521565b60676116e98382611f5d565b5060686116f68282611f5d565b50506000606581905560665550565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611730611a1b565b611738611a74565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156117b0575060009050600361185f565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611804573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166118585760006001925092505061185f565b9150600090505b94509492505050565b600081600481111561187c5761187c612077565b036118845750565b600181600481111561189857611898612077565b036118ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610521565b600281600481111561191357611913612077565b0361197a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610521565b600381600481111561198e5761198e612077565b03610ec7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610521565b600080611a26611310565b805190915015611a3d578051602090910120919050565b6065548015611a4c5792915050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709250505090565b600080611a7f61131f565b805190915015611a96578051602090910120919050565b6066548015611a4c5792915050565b6000815180845260005b81811015611acb57602081850181015186830182015201611aaf565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000611b1c6020830184611aa5565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611b4757600080fd5b919050565b60008060408385031215611b5f57600080fd5b611b6883611b23565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112611bb657600080fd5b813567ffffffffffffffff80821115611bd157611bd1611b76565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715611c1757611c17611b76565b81604052838152866020858801011115611c3057600080fd5b836020870160208301376000602085830101528094505050505092915050565b803560ff81168114611b4757600080fd5b600080600060608486031215611c7657600080fd5b833567ffffffffffffffff80821115611c8e57600080fd5b611c9a87838801611ba5565b94506020860135915080821115611cb057600080fd5b50611cbd86828701611ba5565b925050611ccc60408501611c50565b90509250925092565b600080600060608486031215611cea57600080fd5b611cf384611b23565b9250611d0160208501611b23565b9150604084013590509250925092565b600060208284031215611d2357600080fd5b611b1c82611b23565b7fff00000000000000000000000000000000000000000000000000000000000000881681526000602060e081840152611d6860e084018a611aa5565b8381036040850152611d7a818a611aa5565b6060850189905273ffffffffffffffffffffffffffffffffffffffff8816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015611dd957835183529284019291840191600101611dbd565b50909c9b505050505050505050505050565b600080600080600080600060e0888a031215611e0657600080fd5b611e0f88611b23565b9650611e1d60208901611b23565b95506040880135945060608801359350611e3960808901611c50565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215611e6857600080fd5b611e7183611b23565b9150611e7f60208401611b23565b90509250929050565b600181811c90821680611e9c57607f821691505b602082108103611520577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b80820180821115610459577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b601f8211156114ec57600081815260208120601f850160051c81016020861015611f365750805b601f850160051c820191505b81811015611f5557828155600101611f42565b505050505050565b815167ffffffffffffffff811115611f7757611f77611b76565b611f8b81611f858454611e88565b84611f0f565b602080601f831160018114611fde5760008415611fa85750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555611f55565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561202b5788860151825594840194600190910190840161200c565b508582101561206757878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea2646970667358221220994e21ba7ae01426ca4f6c7c2f75d35c06c4eb5b620e8cb3f7f7065a0946c82564736f6c63430008130033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061016c5760003560e01c806370a08231116100cd578063a457c2d711610081578063d505accf11610066578063d505accf14610315578063dd62ed3e14610328578063e78cea921461036e57600080fd5b8063a457c2d7146102ef578063a9059cbb1461030257600080fd5b806384b0196e116100b257806384b0196e146102b957806395d89b41146102d45780639dc29fac146102dc57600080fd5b806370a08231146102705780637ecebe00146102a657600080fd5b8063313ce567116101245780633644e515116101095780633644e51514610242578063395093511461024a57806340c10f191461025d57600080fd5b8063313ce567146101ec57806332424aa31461021d57600080fd5b80631624f6c6116101555780631624f6c6146101b257806318160ddd146101c757806323b872dd146101d957600080fd5b806306fdde0314610171578063095ea7b31461018f575b600080fd5b6101796103b3565b6040516101869190611b09565b60405180910390f35b6101a261019d366004611b4c565b610445565b6040519015158152602001610186565b6101c56101c0366004611c61565b61045f565b005b6035545b604051908152602001610186565b6101a26101e7366004611cd5565b61066c565b60cc5474010000000000000000000000000000000000000000900460ff165b60405160ff9091168152602001610186565b60cc5461020b9074010000000000000000000000000000000000000000900460ff1681565b6101cb610690565b6101a2610258366004611b4c565b61069f565b6101c561026b366004611b4c565b6106eb565b6101cb61027e366004611d11565b73ffffffffffffffffffffffffffffffffffffffff1660009081526033602052604090205490565b6101cb6102b4366004611d11565b610766565b6102c1610791565b6040516101869796959493929190611d2c565b61017961086d565b6101c56102ea366004611b4c565b61087c565b6101a26102fd366004611b4c565b6108fe565b6101a2610310366004611b4c565b6109cf565b6101c5610323366004611deb565b6109dd565b6101cb610336366004611e55565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260346020908152604080832093909416825291909152205490565b60cc5461038e9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610186565b6060603680546103c290611e88565b80601f01602080910402602001604051908101604052809291908181526020018280546103ee90611e88565b801561043b5780601f106104105761010080835404028352916020019161043b565b820191906000526020600020905b81548152906001019060200180831161041e57829003601f168201915b5050505050905090565b600033610453818585610b9c565b60019150505b92915050565b600054610100900460ff161580801561047f5750600054600160ff909116105b806104995750303b158015610499575060005460ff166001145b61052a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561058857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6105928484610d50565b61059b84610df1565b60cc80547fffffffffffffffffffffff00000000000000000000000000000000000000000016337fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16177401000000000000000000000000000000000000000060ff851602179055801561066657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60003361067a858285610eca565b610685858585610f9b565b506001949350505050565b600061069a611211565b905090565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919061045390829086906106e6908790611ed5565b610b9c565b60cc5473ffffffffffffffffffffffffffffffffffffffff1633146107585760cc546040517fd8ee8db000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610521565b610762828261121b565b5050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260996020526040812054610459565b6000606080600080600060606065546000801b1480156107b15750606654155b610817576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4549503731323a20556e696e697469616c697a656400000000000000000000006044820152606401610521565b61081f611310565b61082761131f565b604080516000808252602082019092527f0f000000000000000000000000000000000000000000000000000000000000009b939a50919850469750309650945092509050565b6060603780546103c290611e88565b60cc5473ffffffffffffffffffffffffffffffffffffffff1633146108e95760cc546040517fd8ee8db000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610521565b6108f4823383610eca565b610762828261132e565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190838110156109c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610521565b6106858286868403610b9c565b600033610453818585610f9b565b83421115610a47576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610521565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610a768c6114f1565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610ade82611526565b90506000610aee8287878761156e565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610b85576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610521565b610b908a8a8a610b9c565b50505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8316610c3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610521565b73ffffffffffffffffffffffffffffffffffffffff8216610ce1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610521565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b600054610100900460ff16610de7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610521565b6107628282611596565b600054610100900460ff16610e88576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610521565b610ec7816040518060400160405280600181526020017f3100000000000000000000000000000000000000000000000000000000000000815250611646565b50565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152603460209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146106665781811015610f8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610521565b6106668484848403610b9c565b73ffffffffffffffffffffffffffffffffffffffff831661103e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610521565b73ffffffffffffffffffffffffffffffffffffffff82166110e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610521565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604090205481811015611197576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610521565b73ffffffffffffffffffffffffffffffffffffffff80851660008181526033602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906112049086815260200190565b60405180910390a3610666565b600061069a611705565b73ffffffffffffffffffffffffffffffffffffffff8216611298576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610521565b80603560008282546112aa9190611ed5565b909155505073ffffffffffffffffffffffffffffffffffffffff82166000818152603360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6060606780546103c290611e88565b6060606880546103c290611e88565b73ffffffffffffffffffffffffffffffffffffffff82166113d1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610521565b73ffffffffffffffffffffffffffffffffffffffff821660009081526033602052604090205481811015611487576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610521565b73ffffffffffffffffffffffffffffffffffffffff831660008181526033602090815260408083208686039055603580548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610d43565b505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526099602052604090208054600181018255905b50919050565b6000610459611533611211565b836040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b600080600061157f87878787611779565b9150915061158c81611868565b5095945050505050565b600054610100900460ff1661162d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610521565b60366116398382611f5d565b5060376114ec8282611f5d565b600054610100900460ff166116dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610521565b60676116e98382611f5d565b5060686116f68282611f5d565b50506000606581905560665550565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611730611a1b565b611738611a74565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156117b0575060009050600361185f565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611804573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166118585760006001925092505061185f565b9150600090505b94509492505050565b600081600481111561187c5761187c612077565b036118845750565b600181600481111561189857611898612077565b036118ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610521565b600281600481111561191357611913612077565b0361197a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610521565b600381600481111561198e5761198e612077565b03610ec7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610521565b600080611a26611310565b805190915015611a3d578051602090910120919050565b6065548015611a4c5792915050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709250505090565b600080611a7f61131f565b805190915015611a96578051602090910120919050565b6066548015611a4c5792915050565b6000815180845260005b81811015611acb57602081850181015186830182015201611aaf565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b602081526000611b1c6020830184611aa5565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114611b4757600080fd5b919050565b60008060408385031215611b5f57600080fd5b611b6883611b23565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112611bb657600080fd5b813567ffffffffffffffff80821115611bd157611bd1611b76565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715611c1757611c17611b76565b81604052838152866020858801011115611c3057600080fd5b836020870160208301376000602085830101528094505050505092915050565b803560ff81168114611b4757600080fd5b600080600060608486031215611c7657600080fd5b833567ffffffffffffffff80821115611c8e57600080fd5b611c9a87838801611ba5565b94506020860135915080821115611cb057600080fd5b50611cbd86828701611ba5565b925050611ccc60408501611c50565b90509250925092565b600080600060608486031215611cea57600080fd5b611cf384611b23565b9250611d0160208501611b23565b9150604084013590509250925092565b600060208284031215611d2357600080fd5b611b1c82611b23565b7fff00000000000000000000000000000000000000000000000000000000000000881681526000602060e081840152611d6860e084018a611aa5565b8381036040850152611d7a818a611aa5565b6060850189905273ffffffffffffffffffffffffffffffffffffffff8816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015611dd957835183529284019291840191600101611dbd565b50909c9b505050505050505050505050565b600080600080600080600060e0888a031215611e0657600080fd5b611e0f88611b23565b9650611e1d60208901611b23565b95506040880135945060608801359350611e3960808901611c50565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215611e6857600080fd5b611e7183611b23565b9150611e7f60208401611b23565b90509250929050565b600181811c90821680611e9c57607f821691505b602082108103611520577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b80820180821115610459577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b601f8211156114ec57600081815260208120601f850160051c81016020861015611f365750805b601f850160051c820191505b81811015611f5557828155600101611f42565b505050505050565b815167ffffffffffffffff811115611f7757611f77611b76565b611f8b81611f858454611e88565b84611f0f565b602080601f831160018114611fde5760008415611fa85750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555611f55565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561202b5788860151825594840194600190910190840161200c565b508582101561206757878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea2646970667358221220994e21ba7ae01426ca4f6c7c2f75d35c06c4eb5b620e8cb3f7f7065a0946c82564736f6c63430008130033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/contracts/local-deployments-artifacts/dynamic-artifacts/TokenBridge.json b/contracts/local-deployments-artifacts/dynamic-artifacts/TokenBridge.json new file mode 100644 index 00000000..e9558439 --- /dev/null +++ b/contracts/local-deployments-artifacts/dynamic-artifacts/TokenBridge.json @@ -0,0 +1,1474 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "TokenBridge", + "sourceName": "contracts/tokenBridge/TokenBridge.sol", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "AlreadyBridgedToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "AlreadyBrigedToNativeTokenSet", + "type": "error" + }, + { + "inputs": [], + "name": "ArrayLengthsDoNotMatch", + "type": "error" + }, + { + "inputs": [], + "name": "CallerIsNotMessageService", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "DecimalsAreUnknown", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "permitData", + "type": "bytes4" + }, + { + "internalType": "bytes4", + "name": "permitSelector", + "type": "bytes4" + } + ], + "name": "InvalidPermitData", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + } + ], + "name": "IsNotPaused", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + } + ], + "name": "IsPaused", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "NativeToBridgedTokenAlreadySet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "NotReserved", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "PermitNotAllowingBridge", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "PermitNotFromSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "remoteTokenBridge", + "type": "address" + } + ], + "name": "RemoteTokenBridgeAlreadySet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "ReservedToken", + "type": "error" + }, + { + "inputs": [], + "name": "SenderNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "StatusAddressNotAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "TokenNotDeployed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ZeroAmountNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroHashNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "nativeToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "bridgedToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "BridgingFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "nativeToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "bridgedToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "BridgingFinalizedV2", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BridgingInitiated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BridgingInitiatedV2", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "nativeToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "customContract", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "setBy", + "type": "address" + } + ], + "name": "CustomContractSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "indexed": true, + "internalType": "address", + "name": "confirmedBy", + "type": "address" + } + ], + "name": "DeploymentConfirmed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newMessageService", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldMessageService", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "setBy", + "type": "address" + } + ], + "name": "MessageServiceUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "NewToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "bridgedToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "nativeToken", + "type": "address" + } + ], + "name": "NewTokenDeployed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "PauseTypeRoleSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "messageSender", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "remoteSender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "setter", + "type": "address" + } + ], + "name": "RemoteSenderSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "remoteTokenBridge", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "setBy", + "type": "address" + } + ], + "name": "RemoteTokenBridgeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "ReservationRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "TokenDeployed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "TokenReserved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "enum IPauseManager.PauseType", + "name": "unPauseType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "UnPauseTypeRoleSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "messageSender", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + } + ], + "name": "UnPaused", + "type": "event" + }, + { + "inputs": [], + "name": "CONTRACT_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PAUSE_ALL_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PAUSE_COMPLETE_TOKEN_BRIDGING_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PAUSE_INITIATE_TOKEN_BRIDGING_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "REMOVE_RESERVED_TOKEN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "SET_CUSTOM_CONTRACT_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "SET_MESSAGE_SERVICE_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "SET_REMOTE_TOKENBRIDGE_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "SET_RESERVED_TOKEN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNPAUSE_ALL_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNPAUSE_COMPLETE_TOKEN_BRIDGING_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNPAUSE_INITIATE_TOKEN_BRIDGING_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_recipient", + "type": "address" + } + ], + "name": "bridgeToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_permitData", + "type": "bytes" + } + ], + "name": "bridgeTokenWithPermit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "bridgedToNativeToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_nativeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_tokenMetadata", + "type": "bytes" + } + ], + "name": "completeBridging", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + } + ], + "name": "confirmDeployment", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "defaultAdmin", + "type": "address" + }, + { + "internalType": "address", + "name": "messageService", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenBeacon", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sourceChainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "targetChainId", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "reservedTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "addressWithRole", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPermissionsManager.RoleAddress[]", + "name": "roleAddresses", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPauseManager.PauseTypeRole[]", + "name": "pauseTypeRoles", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPauseManager.PauseTypeRole[]", + "name": "unpauseTypeRoles", + "type": "tuple[]" + } + ], + "internalType": "struct ITokenBridge.InitializationData", + "name": "_initializationData", + "type": "tuple" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "_pauseType", + "type": "uint8" + } + ], + "name": "isPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "messageService", + "outputs": [ + { + "internalType": "contract IMessageService", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nativeToBridgedToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "_pauseType", + "type": "uint8" + } + ], + "name": "pauseByType", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "pauseType", + "type": "bytes32" + } + ], + "name": "pauseTypeStatuses", + "outputs": [ + { + "internalType": "bool", + "name": "pauseStatus", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_defaultAdmin", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "addressWithRole", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPermissionsManager.RoleAddress[]", + "name": "_roleAddresses", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPauseManager.PauseTypeRole[]", + "name": "_pauseTypeRoles", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "pauseType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "internalType": "struct IPauseManager.PauseTypeRole[]", + "name": "_unpauseTypeRoles", + "type": "tuple[]" + } + ], + "name": "reinitializePauseTypesAndPermissions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "remoteSender", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "removeReserved", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_nativeToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_targetContract", + "type": "address" + } + ], + "name": "setCustomContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_nativeTokens", + "type": "address[]" + } + ], + "name": "setDeployed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_messageService", + "type": "address" + } + ], + "name": "setMessageService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_remoteTokenBridge", + "type": "address" + } + ], + "name": "setRemoteTokenBridge", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "setReserved", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sourceChainId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "targetChainId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tokenBeacon", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IPauseManager.PauseType", + "name": "_pauseType", + "type": "uint8" + } + ], + "name": "unPauseByType", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e3565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000e1576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b615f4880620000f36000396000f3fe6080604052600436106200030b5760003560e01c806391d148541162000197578063ca41a24711620000e7578063d547741f1162000095578063e4d27451116200006c578063e4d274511462000a4e578063edc42a221462000a73578063fe3c50a01462000a9857600080fd5b8063d547741f14620009ed578063dfa96efb1462000a12578063e196fb5d1462000a2957600080fd5b8063ccf5a77c11620000ca578063ccf5a77c1462000962578063cdd914c51462000992578063cf4a720814620009b757600080fd5b8063ca41a24714620008e6578063cc5782f6146200092e57600080fd5b8063b3232bdf1162000145578063be46096f1162000128578063be46096f1462000855578063c483d838146200087a578063c986752a14620008b057600080fd5b8063b3232bdf146200080b578063bc61e733146200083057600080fd5b8063a217fddf116200017a578063a217fddf14620007a0578063a676e8ab14620007b7578063a6ef995f14620007dc57600080fd5b806391d1485414620007135780639ac25d08146200076a57600080fd5b80632f2ff15d116200025f578063522ea81a116200020d5780636a906b8011620001e45780636a906b80146200067857806380efb43a14620006ae5780638dae45dd14620006e457600080fd5b8063522ea81a14620005f55780635626fc25146200060c5780635a06a42a146200064257600080fd5b806336568abe116200024257806336568abe146200055f57806338b9033314620005845780634bf98dce14620005de57600080fd5b80632f2ff15d14620005045780633551237b146200052957600080fd5b80631544298e11620002bd578063248a9ca311620002a0578063248a9ca314620004755780632a564f3414620004a95780632e4c3fff14620004ce57600080fd5b80631544298e14620004375780631754f301146200045057600080fd5b80630f6f86ec11620002f25780630f6f86ec14620003715780631065a39914620003ea578063146ffb26146200040f57600080fd5b806301941d39146200031057806301ffc9a71462000337575b600080fd5b3480156200031d57600080fd5b50620003356200032f36600462004aff565b62000ace565b005b3480156200034457600080fd5b506200035c6200035636600462004bb8565b62000ca5565b60405190151581526020015b60405180910390f35b3480156200037e57600080fd5b50620003c46200039036600462004bfc565b61010860209081526000928352604080842090915290825290205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200162000368565b348015620003f757600080fd5b50620003356200040936600462004c2f565b62000d3f565b3480156200041c57600080fd5b506200042861010b5481565b60405190815260200162000368565b3480156200044457600080fd5b506200042861010a5481565b3480156200045d57600080fd5b50620003356200046f36600462004c52565b62000e54565b3480156200048257600080fd5b50620004286200049436600462004c85565b60009081526097602052604090206001015490565b348015620004b657600080fd5b5062000335620004c836600462004c9f565b62001237565b348015620004db57600080fd5b50620004287f8a7b208fd13ab36d18025be4f62b53d46aeb2cbe8958d2e13de74c040dddcddd81565b3480156200051157600080fd5b50620003356200052336600462004bfc565b62001496565b3480156200053657600080fd5b50620004287f19bf281d118073c159a713666aba52e0d403520cd01e03f42e0f62a0b3bd4a3581565b3480156200056c57600080fd5b50620003356200057e36600462004bfc565b620014bf565b3480156200059157600080fd5b50620005cf6040518060400160405280600381526020017f312e30000000000000000000000000000000000000000000000000000000000081525081565b60405162000368919062004d8b565b62000335620005ef36600462004e21565b62001576565b620003356200060636600462004ee0565b62001812565b3480156200061957600080fd5b50620004287f46e34517dc946faf87aabe65eb5b4fa06b974e5c8d72c5df73b9fb6ff7b6d80281565b3480156200064f57600080fd5b50620004287f50962b2d10066f5051f78d5ea04a3ab09b9c87dd1002962f0b1e30e66eeb80a581565b3480156200068557600080fd5b50620004287fd8b4c34c2ec1f3194471108c64ad2beda340c0337ee4ca35592f9ef270f4228b81565b348015620006bb57600080fd5b50620004287fbf094fe3c005c553ff0d33c7dff9d1273add12fb3f258b992f8d36224dd35b2481565b348015620006f157600080fd5b5060c954620003c49073ffffffffffffffffffffffffffffffffffffffff1681565b3480156200072057600080fd5b506200035c6200073236600462004bfc565b600091825260976020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b3480156200077757600080fd5b50620004287f56bdc3c9ec86cb7db110a7699b2ade72f0b8819727d9f7d906b012641505fa7781565b348015620007ad57600080fd5b5062000428600081565b348015620007c457600080fd5b5062000335620007d636600462004f27565b62001f2e565b348015620007e957600080fd5b5060ca54620003c49073ffffffffffffffffffffffffffffffffffffffff1681565b3480156200081857600080fd5b50620003356200082a36600462004f47565b6200201a565b3480156200083d57600080fd5b506200035c6200084f36600462004c2f565b6200252b565b3480156200086257600080fd5b50620003356200087436600462004f27565b62002553565b3480156200088757600080fd5b50620004287feaf25fcc6b7d45bda16c56628df3f435e20319ef53b065c11ee4510083f0ae2d81565b348015620008bd57600080fd5b50620004287f550554a677c8e7b73b62db78b0ef06c5f237da4ef30b88196a899ccf591041fe81565b348015620008f357600080fd5b50620003c46200090536600462004f27565b6101096020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b3480156200093b57600080fd5b506200035c6200094d36600462004c85565b60d56020526000908152604090205460ff1681565b3480156200096f57600080fd5b5061010754620003c49073ffffffffffffffffffffffffffffffffffffffff1681565b3480156200099f57600080fd5b5062000335620009b136600462004f27565b62002649565b348015620009c457600080fd5b50620004287f3900d9d72d5177a154375317154fdc0e08377e3134a8a5d21cadccf831cc231c81565b348015620009fa57600080fd5b506200033562000a0c36600462004bfc565b6200280e565b6200033562000a2336600462004fcb565b62002837565b34801562000a3657600080fd5b506200033562000a4836600462004c2f565b6200285f565b34801562000a5b57600080fd5b506200033562000a6d36600462005046565b6200294d565b34801562000a8057600080fd5b506200033562000a9236600462004f27565b62002d87565b34801562000aa557600080fd5b50620004287f77974cc9cb5bafc9bb265be792d93fa46355c05701895b82f6d3b4b448c8ce0081565b600054600290610100900460ff1615801562000af1575060005460ff8083169116105b62000b83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001660ff83161761010017905573ffffffffffffffffffffffffffffffffffffffff881662000c02576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62000c0f60008962002f10565b6000606555600060d55562000c2362003006565b62000c3185858585620030ab565b62000c3d8787620033a7565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148062000d3957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60d8600082600881111562000d585762000d58620050ca565b600881111562000d6c5762000d6c620050ca565b81526020019081526020016000205462000d86816200358a565b62000d91826200252b565b62000dcc57816040517f1865965400000000000000000000000000000000000000000000000000000000815260040162000b7a919062005135565b81600881111562000de15762000de1620050ca565b60d68054600190921b19909116905581600881111562000e055762000e05620050ca565b7fd071d2b85dec4489435b541d2f0e2570db09b09db9efd8703948d44a433df65a335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a25050565b8173ffffffffffffffffffffffffffffffffffffffff811662000ea3576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff811662000ef2576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f550554a677c8e7b73b62db78b0ef06c5f237da4ef30b88196a899ccf591041fe62000f1e816200358a565b73ffffffffffffffffffffffffffffffffffffffff8086166000908152610109602052604090205486911615158062000f8c575061010a5460009081526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff85811685529252909120541615155b1562000fdd576040517f12f3df0900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240162000b7a565b73ffffffffffffffffffffffffffffffffffffffff85811660009081526101096020526040902054161562001057576040517ff8fb7c2700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8616600482015260240162000b7a565b73ffffffffffffffffffffffffffffffffffffffff8516610222148062001095575073ffffffffffffffffffffffffffffffffffffffff8516610333145b80620010b8575073ffffffffffffffffffffffffffffffffffffffff8516610111145b1562001109576040517fd8ce8acb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8616600482015260240162000b7a565b61010b5460008181526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff8b81168552925290912054161562001191576040517f022bc84100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8816600482015260240162000b7a565b60008181526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff808c168086529184528285208054918c167fffffffffffffffffffffffff00000000000000000000000000000000000000009283168117909155808652610109909452828520805490911682179055905133937f844cb5c635052898ad92bea4ece14519111765d835105e76aa1f77ad0d0aa81f91a450505050505050565b60c95473ffffffffffffffffffffffffffffffffffffffff16331462001289576040517f8c56efb100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ca5460c954604080517f67e404ce000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff93841693909216916367e404ce916004808201926020929091908290030181865afa15801562001301573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001327919062005145565b73ffffffffffffffffffffffffffffffffffffffff161462001375576040517f79d1e58f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015620014915761010a5460009081526101086020526040812061033391858585818110620013ad57620013ad62005165565b9050602002016020810190620013c4919062004f27565b73ffffffffffffffffffffffffffffffffffffffff9081168252602082019290925260400160002080547fffffffffffffffffffffffff000000000000000000000000000000000000000016929091169190911790558282828181106200142f576200142f62005165565b905060200201602081019062001446919062004f27565b73ffffffffffffffffffffffffffffffffffffffff167f91d24864a084ab70b268a1f865e757ca12006cf298d763b6be697302ef86498c60405160405180910390a260010162001378565b505050565b600082815260976020526040902060010154620014b3816200358a565b62001491838362002f10565b73ffffffffffffffffffffffffffffffffffffffff8116331462001566576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840162000b7a565b62001572828262003599565b5050565b60005b81518110156200169a57600061010960008484815181106200159f576200159f62005165565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff90811683529082019290925260400160002054169050806200164957828281518110620015f157620015f162005165565b60200260200101516040517fa5ea89da00000000000000000000000000000000000000000000000000000000815260040162000b7a919073ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b808383815181106200165f576200165f62005165565b73ffffffffffffffffffffffffffffffffffffffff9092166020928302919091019091015250806200169181620051c3565b91505062001579565b5060c95460ca5460405173ffffffffffffffffffffffffffffffffffffffff92831692639f3ce55a9234929116908290620016da908790602401620051fe565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f2a564f3400000000000000000000000000000000000000000000000000000000179052517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b1681526200178b939291906004016200525a565b6000604051808303818588803b158015620017a557600080fd5b505af1158015620017ba573d6000803e3d6000fd5b50505050503373ffffffffffffffffffffffffffffffffffffffff167f59eab5b5f813ac9e0c10035dfb55b5e3419eff53c0f7a869fb3c22400ea036d682604051620018079190620051fe565b60405180910390a250565b8273ffffffffffffffffffffffffffffffffffffffff811662001861576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff8116620018b0576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8380600003620018f0576040517f4618044a0000000000000000000000000000000000000000000000000000000081526004810182905260240162000b7a565b620018fa62003655565b620019066007620036ca565b61010a5460008181526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff808c168552925290912054167ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeef8101620019b0576040517f6dad9c7800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8916600482015260240162000b7a565b73ffffffffffffffffffffffffffffffffffffffff80891660009081526101096020526040812054909116906060821562001a79576040517f9dc29fac000000000000000000000000000000000000000000000000000000008152336004820152602481018b905273ffffffffffffffffffffffffffffffffffffffff8c1690639dc29fac90604401600060405180830381600087803b15801562001a5457600080fd5b505af115801562001a69573d6000803e3d6000fd5b5050505061010b54915062001d35565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8d16906370a0823190602401602060405180830381865afa15801562001ae7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001b0d91906200529a565b905062001b3373ffffffffffffffffffffffffffffffffffffffff8d1633308e62003765565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152819073ffffffffffffffffffffffffffffffffffffffff8e16906370a0823190602401602060405180830381865afa15801562001ba0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001bc691906200529a565b62001bd29190620052b4565b9a508b935073ffffffffffffffffffffffffffffffffffffffff851662001cc957610222610108600088815260200190815260200160002060008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508b73ffffffffffffffffffffffffffffffffffffffff167f0f53e2a811b6fd2d6cd965fd6c27b44fb924ca39f7a7f321115705c22366d62360405160405180910390a25b73ffffffffffffffffffffffffffffffffffffffff85166103331462001d305762001cf48c62003843565b62001cff8d62003963565b62001d0a8e62003a70565b60405160200162001d1e93929190620052ca565b60405160208183030381529060405291505b859250505b60c960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639f3ce55a3460ca60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1634878f8f898960405160240162001db395949392919062005307565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fe4d2745100000000000000000000000000000000000000000000000000000000179052517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b16815262001e64939291906004016200525a565b6000604051808303818588803b15801562001e7e57600080fd5b505af115801562001e93573d6000803e3d6000fd5b50505050508a73ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8780a94875b70464f8ac6c28851501d32e7fd4ee574e4b94beb28923a3c42d9c8d60405162001f0f91815260200190565b60405180910390a4505050505062001f2660018055565b505050505050565b7fbf094fe3c005c553ff0d33c7dff9d1273add12fb3f258b992f8d36224dd35b2462001f5a816200358a565b60ca5473ffffffffffffffffffffffffffffffffffffffff161562001fc85760ca546040517f94fbfd2e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116600482015260240162000b7a565b62001fd38262003bb6565b604051339073ffffffffffffffffffffffffffffffffffffffff8416907fb044c1a1a05a729c402def784b4e4cb01612ff03eee6f0beb3eba0f0606260a190600090a35050565b6200202c604082016020830162004f27565b73ffffffffffffffffffffffffffffffffffffffff81166200207a576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6200208c606083016040840162004f27565b73ffffffffffffffffffffffffffffffffffffffff8116620020da576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600054610100900460ff1615808015620020fb5750600054600160ff909116105b80620021175750303b15801562002117575060005460ff166001145b620021a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840162000b7a565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156200220457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6200222d6200221760e08601866200534e565b620022276101008801886200534e565b620030ab565b6200224962002243604086016020870162004f27565b62003c76565b6200225362003006565b6200226e600062002268602087018762004f27565b62002f10565b620022876200228160c08601866200534e565b620033a7565b62002299606085016040860162004f27565b61010780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055606084013561010a55608084013561010b5560005b6200230360a0860186620053b9565b9050811015620024c05760006200231e60a0870187620053b9565b8381811062002331576200233162005165565b905060200201602081019062002348919062004f27565b73ffffffffffffffffffffffffffffffffffffffff160362002396576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61010a5460009081526101086020526040812061011191620023bc60a0890189620053b9565b85818110620023cf57620023cf62005165565b9050602002016020810190620023e6919062004f27565b73ffffffffffffffffffffffffffffffffffffffff9081168252602082019290925260400160002080547fffffffffffffffffffffffff000000000000000000000000000000000000000016929091169190911790556200244b60a0860186620053b9565b828181106200245e576200245e62005165565b905060200201602081019062002475919062004f27565b73ffffffffffffffffffffffffffffffffffffffff167f5e023c7a09fa0534ce3199f65fc3e635a5e851c5adc88ebda3b9d332ae07cbe960405160405180910390a2600101620022f4565b5080156200252557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6000816008811115620025425762002542620050ca565b60d654600190911b16151592915050565b8073ffffffffffffffffffffffffffffffffffffffff8116620025a2576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f77974cc9cb5bafc9bb265be792d93fa46355c05701895b82f6d3b4b448c8ce00620025ce816200358a565b60c9805473ffffffffffffffffffffffffffffffffffffffff8581167fffffffffffffffffffffffff00000000000000000000000000000000000000008316811790935560405191169133918391907fc96d462e42a71473da49a1d58c1754b9b2d319786692d621dc7f921331c517e990600090a450505050565b8073ffffffffffffffffffffffffffffffffffffffff811662002698576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8083166000908152610109602052604090205483911615158062002706575061010a5460009081526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff85811685529252909120541615155b1562002757576040517f12f3df0900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240162000b7a565b7feaf25fcc6b7d45bda16c56628df3f435e20319ef53b065c11ee4510083f0ae2d62002783816200358a565b61010a5460009081526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff8816808552925280832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166101111790555190917f5e023c7a09fa0534ce3199f65fc3e635a5e851c5adc88ebda3b9d332ae07cbe991a250505050565b6000828152609760205260409020600101546200282b816200358a565b62001491838362003599565b80156200284b576200284b85838362003da4565b6200285885858562001812565b5050505050565b60d76000826008811115620028785762002878620050ca565b60088111156200288c576200288c620050ca565b815260200190815260200160002054620028a6816200358a565b620028b1826200252b565b15620028ed57816040517fc0a71b5800000000000000000000000000000000000000000000000000000000815260040162000b7a919062005135565b816008811115620029025762002902620050ca565b60d68054600190921b9091179055816008811115620029255762002925620050ca565b7f534f879afd40abb4e39f8e1b77a316be4c8e3521d9cf5a3a3db8959d574d45593362000e28565b6200295762003655565b60c95473ffffffffffffffffffffffffffffffffffffffff163314620029a9576040517f8c56efb100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ca5460c954604080517f67e404ce000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff93841693909216916367e404ce916004808201926020929091908290030181865afa15801562002a21573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062002a47919062005145565b73ffffffffffffffffffffffffffffffffffffffff161462002a95576040517f79d1e58f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600862002aa281620036ca565b60008481526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff808c1685529252822054169061022282148062002afd575073ffffffffffffffffffffffffffffffffffffffff8216610333145b1562002b2c5762002b2673ffffffffffffffffffffffffffffffffffffffff8a16888a62004075565b62002cfb565b508073ffffffffffffffffffffffffffffffffffffffff811662002c705762002b5b89868661010a54620040cd565b90508861010960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080610108600061010b54815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152602482018a90528216906340c10f1990604401600060405180830381600087803b15801562002ce157600080fd5b505af115801562002cf6573d6000803e3d6000fd5b505050505b8673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167f6ed06519caca659cdefa71015c79a561928d3cf8cc4a3e9739fde9fb5fb38d648b60405162002d7291815260200190565b60405180910390a450505062001f2660018055565b8073ffffffffffffffffffffffffffffffffffffffff811662002dd6576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f19bf281d118073c159a713666aba52e0d403520cd01e03f42e0f62a0b3bd4a3562002e02816200358a565b61010a5460008181526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff8881168552925290912054166101111462002e8d576040517f82f5d0a500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240162000b7a565b60008181526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff8816808552925280832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555190917f0145163d8d460d1ab21463758d147fdfe79d4b57c81ca3d1439996104ae6895991a250505050565b600082815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166200157257600082815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905562002fa83390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600054610100900460ff166200309f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840162000b7a565b620030a962004231565b565b600054610100900460ff1662003144576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840162000b7a565b8260005b81811015620032745785858281811062003166576200316662005165565b9050604002016020013560d7600088888581811062003189576200318962005165565b620031a1926020604090920201908101915062004c2f565b6008811115620031b557620031b5620050ca565b6008811115620031c957620031c9620050ca565b81526020810191909152604001600020557f33aa8fd1ce49e1761bc8d27fd53414bfefc45d690feed0ce55019d7d3aec609186868381811062003210576200321062005165565b62003228926020604090920201908101915062004c2f565b8787848181106200323d576200323d62005165565b905060400201602001356040516200325792919062005424565b60405180910390a1806200326b81620051c3565b91505062003148565b5081905060005b8181101562001f265783838281811062003299576200329962005165565b9050604002016020013560d86000868685818110620032bc57620032bc62005165565b620032d4926020604090920201908101915062004c2f565b6008811115620032e857620032e8620050ca565b6008811115620032fc57620032fc620050ca565b81526020810191909152604001600020557fe7bf4b8dc0c17a52dc9e52323a3ab61cb2079db35f969125b1f8a3d984c6f6c284848381811062003343576200334362005165565b6200335b926020604090920201908101915062004c2f565b85858481811062003370576200337062005165565b905060400201602001356040516200338a92919062005424565b60405180910390a1806200339e81620051c3565b9150506200327b565b600054610100900460ff1662003440576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840162000b7a565b8060005b818110156200252557600084848381811062003464576200346462005165565b6200347c926020604090920201908101915062004f27565b73ffffffffffffffffffffffffffffffffffffffff1603620034ca576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b838382818110620034df57620034df62005165565b905060400201602001356000801b0362003525576040517f0742d05300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b620035758484838181106200353e576200353e62005165565b905060400201602001358585848181106200355d576200355d62005165565b62002268926020604090920201908101915062004f27565b806200358181620051c3565b91505062003444565b620035968133620042ca565b50565b600082815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16156200157257600082815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600260015403620036c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640162000b7a565b6002600155565b60d654816008811115620036e257620036e2620050ca565b6001901b8116156200372457816040517fc0a71b5800000000000000000000000000000000000000000000000000000000815260040162000b7a919062005135565b6002811615620015725760016040517fc0a71b5800000000000000000000000000000000000000000000000000000000815260040162000b7a919062005135565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052620025259085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526200438d565b60408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f06fdde03000000000000000000000000000000000000000000000000000000001790529051606091600091829173ffffffffffffffffffffffffffffffffffffffff861691620038c7919062005441565b600060405180830381855afa9150503d806000811462003904576040519150601f19603f3d011682016040523d82523d6000602084013e62003909565b606091505b50915091508162003950576040518060400160405280600781526020017f4e4f5f4e414d45000000000000000000000000000000000000000000000000008152506200395b565b6200395b81620044a3565b949350505050565b60408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f95d89b41000000000000000000000000000000000000000000000000000000001790529051606091600091829173ffffffffffffffffffffffffffffffffffffffff861691620039e7919062005441565b600060405180830381855afa9150503d806000811462003a24576040519150601f19603f3d011682016040523d82523d6000602084013e62003a29565b606091505b50915091508162003950576040518060400160405280600981526020017f4e4f5f53594d424f4c00000000000000000000000000000000000000000000008152506200395b565b60408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f313ce5670000000000000000000000000000000000000000000000000000000017905290516000918291829173ffffffffffffffffffffffffffffffffffffffff86169162003af3919062005441565b600060405180830381855afa9150503d806000811462003b30576040519150601f19603f3d011682016040523d82523d6000602084013e62003b35565b606091505b509150915081801562003b49575080516020145b1562003b6557808060200190518101906200395b91906200546f565b6040517fb5a2f1c600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240162000b7a565b60018055565b73ffffffffffffffffffffffffffffffffffffffff811662003c04576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ca80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040513391907fe68b208814fdb633b222cd15e73d5a27fb4ef9eef4cae78c623bc27702141d2890600090a350565b600054610100900460ff1662003d0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840162000b7a565b73ffffffffffffffffffffffffffffffffffffffff811662003d5d576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60c980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b7fd505accf0000000000000000000000000000000000000000000000000000000062003dd56004600084866200548f565b62003de091620054bb565b7fffffffff00000000000000000000000000000000000000000000000000000000161462003ea15762003e186004600083856200548f565b62003e2391620054bb565b6040517fcf9e29460000000000000000000000000000000000000000000000000000000081527fffffffff0000000000000000000000000000000000000000000000000000000090911660048201527fd505accf00000000000000000000000000000000000000000000000000000000602482015260440162000b7a565b600080808080808062003eb8886004818c6200548f565b81019062003ec7919062005504565b96509650965096509650965096503373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff161462003f54576040517f200688cc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8816600482015260240162000b7a565b73ffffffffffffffffffffffffffffffffffffffff8616301462003fbd576040517f2911594800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8716600482015260240162000b7a565b6040517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690526064810185905260ff8416608482015260a4810183905260c4810182905273ffffffffffffffffffffffffffffffffffffffff8b169063d505accf9060e401600060405180830381600087803b1580156200405057600080fd5b505af115801562004065573d6000803e3d6000fd5b5050505050505050505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052620014919084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401620037c0565b60008181526020859052604081206101075460405173ffffffffffffffffffffffffffffffffffffffff90911690620041069062004a7f565b73ffffffffffffffffffffffffffffffffffffffff90911681526040602082018190526000908201526060018190604051809103906000f590508015801562004153573d6000803e3d6000fd5b50905060008080620041688688018862005621565b9250925092508373ffffffffffffffffffffffffffffffffffffffff16631624f6c68484846040518463ffffffff1660e01b8152600401620041ad93929190620052ca565b600060405180830381600087803b158015620041c857600080fd5b505af1158015620041dd573d6000803e3d6000fd5b505060405173ffffffffffffffffffffffffffffffffffffffff808c169350871691507fd5d4920bb61e6141c8499d50a7bd617dae2b1818c9d6b995d3f2ba4975e32ea490600090a3505050949350505050565b600054610100900460ff1662003bb0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840162000b7a565b600082815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1662001572576200430d8162004676565b6200431a83602062004696565b6040516020016200432d92919062005697565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a000000000000000000000000000000000000000000000000000000000825262000b7a9160040162004d8b565b6000620043f1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16620048fe9092919063ffffffff16565b9050805160001480620044155750808060200190518101906200441591906200571c565b62001491576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840162000b7a565b60606040825110620044c5578180602001905181019062000d39919062005740565b81516020146200450857505060408051808201909152601281527f4e4f545f56414c49445f454e434f44494e470000000000000000000000000000602082015290565b60005b6020811080156200455657508281815181106200452c576200452c62005165565b01602001517fff000000000000000000000000000000000000000000000000000000000000001615155b1562004565576001016200450b565b80600003620045a957505060408051808201909152601281527f4e4f545f56414c49445f454e434f44494e4700000000000000000000000000006020820152919050565b60008167ffffffffffffffff811115620045c757620045c762004da0565b6040519080825280601f01601f191660200182016040528015620045f2576020820181803683370190505b50905060005b828110156200466e5784818151811062004616576200461662005165565b602001015160f81c60f81b82828151811062004636576200463662005165565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101620045f8565b509392505050565b606062000d3973ffffffffffffffffffffffffffffffffffffffff831660145b60606000620046a7836002620057b7565b620046b4906002620057d1565b67ffffffffffffffff811115620046cf57620046cf62004da0565b6040519080825280601f01601f191660200182016040528015620046fa576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811062004734576200473462005165565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106200479a576200479a62005165565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000620047d8846002620057b7565b620047e5906001620057d1565b90505b60018111156200488c577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106200482a576200482a62005165565b1a60f81b82828151811062004843576200484362005165565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936200488481620057e7565b9050620047e8565b508315620048f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640162000b7a565b9392505050565b60606200395b8484600085856000808673ffffffffffffffffffffffffffffffffffffffff16858760405162004935919062005441565b60006040518083038185875af1925050503d806000811462004974576040519150601f19603f3d011682016040523d82523d6000602084013e62004979565b606091505b50915091506200498c8783838762004997565b979650505050505050565b6060831562004a3257825160000362004a2a5773ffffffffffffffffffffffffffffffffffffffff85163b62004a2a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000b7a565b50816200395b565b6200395b838381511562004a495781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000b7a919062004d8b565b6106f3806200582083390190565b73ffffffffffffffffffffffffffffffffffffffff811681146200359657600080fd5b60008083601f84011262004ac357600080fd5b50813567ffffffffffffffff81111562004adc57600080fd5b6020830191508360208260061b850101111562004af857600080fd5b9250929050565b60008060008060008060006080888a03121562004b1b57600080fd5b873562004b288162004a8d565b9650602088013567ffffffffffffffff8082111562004b4657600080fd5b62004b548b838c0162004ab0565b909850965060408a013591508082111562004b6e57600080fd5b62004b7c8b838c0162004ab0565b909650945060608a013591508082111562004b9657600080fd5b5062004ba58a828b0162004ab0565b989b979a50959850939692959293505050565b60006020828403121562004bcb57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114620048f757600080fd5b6000806040838503121562004c1057600080fd5b82359150602083013562004c248162004a8d565b809150509250929050565b60006020828403121562004c4257600080fd5b813560098110620048f757600080fd5b6000806040838503121562004c6657600080fd5b823562004c738162004a8d565b9150602083013562004c248162004a8d565b60006020828403121562004c9857600080fd5b5035919050565b6000806020838503121562004cb357600080fd5b823567ffffffffffffffff8082111562004ccc57600080fd5b818501915085601f83011262004ce157600080fd5b81358181111562004cf157600080fd5b8660208260051b850101111562004d0757600080fd5b60209290920196919550909350505050565b60005b8381101562004d3657818101518382015260200162004d1c565b50506000910152565b6000815180845262004d5981602086016020860162004d19565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000620048f7602083018462004d3f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171562004e195762004e1962004da0565b604052919050565b6000602080838503121562004e3557600080fd5b823567ffffffffffffffff8082111562004e4e57600080fd5b818501915085601f83011262004e6357600080fd5b81358181111562004e785762004e7862004da0565b8060051b915062004e8b84830162004dcf565b818152918301840191848101908884111562004ea657600080fd5b938501935b8385101562004ed4578435925062004ec38362004a8d565b828252938501939085019062004eab565b98975050505050505050565b60008060006060848603121562004ef657600080fd5b833562004f038162004a8d565b925060208401359150604084013562004f1c8162004a8d565b809150509250925092565b60006020828403121562004f3a57600080fd5b8135620048f78162004a8d565b60006020828403121562004f5a57600080fd5b813567ffffffffffffffff81111562004f7257600080fd5b82016101208185031215620048f757600080fd5b60008083601f84011262004f9957600080fd5b50813567ffffffffffffffff81111562004fb257600080fd5b60208301915083602082850101111562004af857600080fd5b60008060008060006080868803121562004fe457600080fd5b853562004ff18162004a8d565b94506020860135935060408601356200500a8162004a8d565b9250606086013567ffffffffffffffff8111156200502757600080fd5b620050358882890162004f86565b969995985093965092949392505050565b60008060008060008060a087890312156200506057600080fd5b86356200506d8162004a8d565b9550602087013594506040870135620050868162004a8d565b935060608701359250608087013567ffffffffffffffff811115620050aa57600080fd5b620050b889828a0162004f86565b979a9699509497509295939492505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6009811062005131577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b6020810162000d398284620050f9565b6000602082840312156200515857600080fd5b8151620048f78162004a8d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203620051f757620051f762005194565b5060010190565b6020808252825182820181905260009190848201906040850190845b818110156200524e57835173ffffffffffffffffffffffffffffffffffffffff16835292840192918401916001016200521a565b50909695505050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815282602082015260606040820152600062005291606083018462004d3f565b95945050505050565b600060208284031215620052ad57600080fd5b5051919050565b8181038181111562000d395762000d3962005194565b606081526000620052df606083018662004d3f565b8281036020840152620052f3818662004d3f565b91505060ff83166040830152949350505050565b600073ffffffffffffffffffffffffffffffffffffffff808816835286602084015280861660408401525083606083015260a060808301526200498c60a083018462004d3f565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126200538457600080fd5b83018035915067ffffffffffffffff821115620053a057600080fd5b6020019150600681901b360382131562004af857600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112620053ef57600080fd5b83018035915067ffffffffffffffff8211156200540b57600080fd5b6020019150600581901b360382131562004af857600080fd5b60408101620054348285620050f9565b8260208301529392505050565b600082516200545581846020870162004d19565b9190910192915050565b60ff811681146200359657600080fd5b6000602082840312156200548257600080fd5b8151620048f7816200545f565b60008085851115620054a057600080fd5b83861115620054ae57600080fd5b5050820193919092039150565b7fffffffff000000000000000000000000000000000000000000000000000000008135818116916004851015620054fc5780818660040360031b1b83161692505b505092915050565b600080600080600080600060e0888a0312156200552057600080fd5b87356200552d8162004a8d565b965060208801356200553f8162004a8d565b9550604088013594506060880135935060808801356200555f816200545f565b9699959850939692959460a0840135945060c09093013592915050565b600067ffffffffffffffff82111562005599576200559962004da0565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f830112620055d757600080fd5b8135620055ee620055e8826200557c565b62004dcf565b8181528460208386010111156200560457600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000606084860312156200563757600080fd5b833567ffffffffffffffff808211156200565057600080fd5b6200565e87838801620055c5565b945060208601359150808211156200567557600080fd5b506200568486828701620055c5565b925050604084013562004f1c816200545f565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351620056d181601785016020880162004d19565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516200571081602884016020880162004d19565b01602801949350505050565b6000602082840312156200572f57600080fd5b81518015158114620048f757600080fd5b6000602082840312156200575357600080fd5b815167ffffffffffffffff8111156200576b57600080fd5b8201601f810184136200577d57600080fd5b80516200578e620055e8826200557c565b818152856020838501011115620057a457600080fd5b6200529182602083016020860162004d19565b808202811582820484141762000d395762000d3962005194565b8082018082111562000d395762000d3962005194565b600081620057f957620057f962005194565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fe60806040526040516106f33803806106f383398101604081905261002291610420565b61002e82826000610035565b505061054a565b61003e836100f6565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100f1576100ef836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e991906104e0565b8361027a565b505b505050565b6001600160a01b0381163b6101605760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101d4816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906104e0565b6001600160a01b03163b151590565b6102395760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610157565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392909216919091179055565b606061029f83836040518060600160405280602781526020016106cc602791396102a6565b9392505050565b6060600080856001600160a01b0316856040516102c391906104fb565b600060405180830381855af49150503d80600081146102fe576040519150601f19603f3d011682016040523d82523d6000602084013e610303565b606091505b5090925090506103158683838761031f565b9695505050505050565b6060831561038e578251600003610387576001600160a01b0385163b6103875760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610157565b5081610398565b61039883836103a0565b949350505050565b8151156103b05781518083602001fd5b8060405162461bcd60e51b81526004016101579190610517565b80516001600160a01b03811681146103e157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156104175781810151838201526020016103ff565b50506000910152565b6000806040838503121561043357600080fd5b61043c836103ca565b60208401519092506001600160401b038082111561045957600080fd5b818501915085601f83011261046d57600080fd5b81518181111561047f5761047f6103e6565b604051601f8201601f19908116603f011681019083821181831017156104a7576104a76103e6565b816040528281528860208487010111156104c057600080fd5b6104d18360208301602088016103fc565b80955050505050509250929050565b6000602082840312156104f257600080fd5b61029f826103ca565b6000825161050d8184602087016103fc565b9190910192915050565b60208152600082518060208401526105368160408501602087016103fc565b601f01601f19169190910160400192915050565b610173806105596000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea2646970667358221220487f6f370ed71b7026944bbfbeff4c6a8abfbc1f686dbaab6010959808b5814564736f6c63430008130033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220de9804b67318a6cdb529d18b92fd51bf5512166da05a44c81a9aaec12a7bc66b64736f6c63430008130033", + "deployedBytecode": "0x6080604052600436106200030b5760003560e01c806391d148541162000197578063ca41a24711620000e7578063d547741f1162000095578063e4d27451116200006c578063e4d274511462000a4e578063edc42a221462000a73578063fe3c50a01462000a9857600080fd5b8063d547741f14620009ed578063dfa96efb1462000a12578063e196fb5d1462000a2957600080fd5b8063ccf5a77c11620000ca578063ccf5a77c1462000962578063cdd914c51462000992578063cf4a720814620009b757600080fd5b8063ca41a24714620008e6578063cc5782f6146200092e57600080fd5b8063b3232bdf1162000145578063be46096f1162000128578063be46096f1462000855578063c483d838146200087a578063c986752a14620008b057600080fd5b8063b3232bdf146200080b578063bc61e733146200083057600080fd5b8063a217fddf116200017a578063a217fddf14620007a0578063a676e8ab14620007b7578063a6ef995f14620007dc57600080fd5b806391d1485414620007135780639ac25d08146200076a57600080fd5b80632f2ff15d116200025f578063522ea81a116200020d5780636a906b8011620001e45780636a906b80146200067857806380efb43a14620006ae5780638dae45dd14620006e457600080fd5b8063522ea81a14620005f55780635626fc25146200060c5780635a06a42a146200064257600080fd5b806336568abe116200024257806336568abe146200055f57806338b9033314620005845780634bf98dce14620005de57600080fd5b80632f2ff15d14620005045780633551237b146200052957600080fd5b80631544298e11620002bd578063248a9ca311620002a0578063248a9ca314620004755780632a564f3414620004a95780632e4c3fff14620004ce57600080fd5b80631544298e14620004375780631754f301146200045057600080fd5b80630f6f86ec11620002f25780630f6f86ec14620003715780631065a39914620003ea578063146ffb26146200040f57600080fd5b806301941d39146200031057806301ffc9a71462000337575b600080fd5b3480156200031d57600080fd5b50620003356200032f36600462004aff565b62000ace565b005b3480156200034457600080fd5b506200035c6200035636600462004bb8565b62000ca5565b60405190151581526020015b60405180910390f35b3480156200037e57600080fd5b50620003c46200039036600462004bfc565b61010860209081526000928352604080842090915290825290205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200162000368565b348015620003f757600080fd5b50620003356200040936600462004c2f565b62000d3f565b3480156200041c57600080fd5b506200042861010b5481565b60405190815260200162000368565b3480156200044457600080fd5b506200042861010a5481565b3480156200045d57600080fd5b50620003356200046f36600462004c52565b62000e54565b3480156200048257600080fd5b50620004286200049436600462004c85565b60009081526097602052604090206001015490565b348015620004b657600080fd5b5062000335620004c836600462004c9f565b62001237565b348015620004db57600080fd5b50620004287f8a7b208fd13ab36d18025be4f62b53d46aeb2cbe8958d2e13de74c040dddcddd81565b3480156200051157600080fd5b50620003356200052336600462004bfc565b62001496565b3480156200053657600080fd5b50620004287f19bf281d118073c159a713666aba52e0d403520cd01e03f42e0f62a0b3bd4a3581565b3480156200056c57600080fd5b50620003356200057e36600462004bfc565b620014bf565b3480156200059157600080fd5b50620005cf6040518060400160405280600381526020017f312e30000000000000000000000000000000000000000000000000000000000081525081565b60405162000368919062004d8b565b62000335620005ef36600462004e21565b62001576565b620003356200060636600462004ee0565b62001812565b3480156200061957600080fd5b50620004287f46e34517dc946faf87aabe65eb5b4fa06b974e5c8d72c5df73b9fb6ff7b6d80281565b3480156200064f57600080fd5b50620004287f50962b2d10066f5051f78d5ea04a3ab09b9c87dd1002962f0b1e30e66eeb80a581565b3480156200068557600080fd5b50620004287fd8b4c34c2ec1f3194471108c64ad2beda340c0337ee4ca35592f9ef270f4228b81565b348015620006bb57600080fd5b50620004287fbf094fe3c005c553ff0d33c7dff9d1273add12fb3f258b992f8d36224dd35b2481565b348015620006f157600080fd5b5060c954620003c49073ffffffffffffffffffffffffffffffffffffffff1681565b3480156200072057600080fd5b506200035c6200073236600462004bfc565b600091825260976020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b3480156200077757600080fd5b50620004287f56bdc3c9ec86cb7db110a7699b2ade72f0b8819727d9f7d906b012641505fa7781565b348015620007ad57600080fd5b5062000428600081565b348015620007c457600080fd5b5062000335620007d636600462004f27565b62001f2e565b348015620007e957600080fd5b5060ca54620003c49073ffffffffffffffffffffffffffffffffffffffff1681565b3480156200081857600080fd5b50620003356200082a36600462004f47565b6200201a565b3480156200083d57600080fd5b506200035c6200084f36600462004c2f565b6200252b565b3480156200086257600080fd5b50620003356200087436600462004f27565b62002553565b3480156200088757600080fd5b50620004287feaf25fcc6b7d45bda16c56628df3f435e20319ef53b065c11ee4510083f0ae2d81565b348015620008bd57600080fd5b50620004287f550554a677c8e7b73b62db78b0ef06c5f237da4ef30b88196a899ccf591041fe81565b348015620008f357600080fd5b50620003c46200090536600462004f27565b6101096020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b3480156200093b57600080fd5b506200035c6200094d36600462004c85565b60d56020526000908152604090205460ff1681565b3480156200096f57600080fd5b5061010754620003c49073ffffffffffffffffffffffffffffffffffffffff1681565b3480156200099f57600080fd5b5062000335620009b136600462004f27565b62002649565b348015620009c457600080fd5b50620004287f3900d9d72d5177a154375317154fdc0e08377e3134a8a5d21cadccf831cc231c81565b348015620009fa57600080fd5b506200033562000a0c36600462004bfc565b6200280e565b6200033562000a2336600462004fcb565b62002837565b34801562000a3657600080fd5b506200033562000a4836600462004c2f565b6200285f565b34801562000a5b57600080fd5b506200033562000a6d36600462005046565b6200294d565b34801562000a8057600080fd5b506200033562000a9236600462004f27565b62002d87565b34801562000aa557600080fd5b50620004287f77974cc9cb5bafc9bb265be792d93fa46355c05701895b82f6d3b4b448c8ce0081565b600054600290610100900460ff1615801562000af1575060005460ff8083169116105b62000b83576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001660ff83161761010017905573ffffffffffffffffffffffffffffffffffffffff881662000c02576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62000c0f60008962002f10565b6000606555600060d55562000c2362003006565b62000c3185858585620030ab565b62000c3d8787620033a7565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148062000d3957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b60d8600082600881111562000d585762000d58620050ca565b600881111562000d6c5762000d6c620050ca565b81526020019081526020016000205462000d86816200358a565b62000d91826200252b565b62000dcc57816040517f1865965400000000000000000000000000000000000000000000000000000000815260040162000b7a919062005135565b81600881111562000de15762000de1620050ca565b60d68054600190921b19909116905581600881111562000e055762000e05620050ca565b7fd071d2b85dec4489435b541d2f0e2570db09b09db9efd8703948d44a433df65a335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a25050565b8173ffffffffffffffffffffffffffffffffffffffff811662000ea3576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff811662000ef2576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f550554a677c8e7b73b62db78b0ef06c5f237da4ef30b88196a899ccf591041fe62000f1e816200358a565b73ffffffffffffffffffffffffffffffffffffffff8086166000908152610109602052604090205486911615158062000f8c575061010a5460009081526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff85811685529252909120541615155b1562000fdd576040517f12f3df0900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240162000b7a565b73ffffffffffffffffffffffffffffffffffffffff85811660009081526101096020526040902054161562001057576040517ff8fb7c2700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8616600482015260240162000b7a565b73ffffffffffffffffffffffffffffffffffffffff8516610222148062001095575073ffffffffffffffffffffffffffffffffffffffff8516610333145b80620010b8575073ffffffffffffffffffffffffffffffffffffffff8516610111145b1562001109576040517fd8ce8acb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8616600482015260240162000b7a565b61010b5460008181526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff8b81168552925290912054161562001191576040517f022bc84100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8816600482015260240162000b7a565b60008181526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff808c168086529184528285208054918c167fffffffffffffffffffffffff00000000000000000000000000000000000000009283168117909155808652610109909452828520805490911682179055905133937f844cb5c635052898ad92bea4ece14519111765d835105e76aa1f77ad0d0aa81f91a450505050505050565b60c95473ffffffffffffffffffffffffffffffffffffffff16331462001289576040517f8c56efb100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ca5460c954604080517f67e404ce000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff93841693909216916367e404ce916004808201926020929091908290030181865afa15801562001301573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001327919062005145565b73ffffffffffffffffffffffffffffffffffffffff161462001375576040517f79d1e58f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015620014915761010a5460009081526101086020526040812061033391858585818110620013ad57620013ad62005165565b9050602002016020810190620013c4919062004f27565b73ffffffffffffffffffffffffffffffffffffffff9081168252602082019290925260400160002080547fffffffffffffffffffffffff000000000000000000000000000000000000000016929091169190911790558282828181106200142f576200142f62005165565b905060200201602081019062001446919062004f27565b73ffffffffffffffffffffffffffffffffffffffff167f91d24864a084ab70b268a1f865e757ca12006cf298d763b6be697302ef86498c60405160405180910390a260010162001378565b505050565b600082815260976020526040902060010154620014b3816200358a565b62001491838362002f10565b73ffffffffffffffffffffffffffffffffffffffff8116331462001566576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840162000b7a565b62001572828262003599565b5050565b60005b81518110156200169a57600061010960008484815181106200159f576200159f62005165565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff90811683529082019290925260400160002054169050806200164957828281518110620015f157620015f162005165565b60200260200101516040517fa5ea89da00000000000000000000000000000000000000000000000000000000815260040162000b7a919073ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b808383815181106200165f576200165f62005165565b73ffffffffffffffffffffffffffffffffffffffff9092166020928302919091019091015250806200169181620051c3565b91505062001579565b5060c95460ca5460405173ffffffffffffffffffffffffffffffffffffffff92831692639f3ce55a9234929116908290620016da908790602401620051fe565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f2a564f3400000000000000000000000000000000000000000000000000000000179052517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b1681526200178b939291906004016200525a565b6000604051808303818588803b158015620017a557600080fd5b505af1158015620017ba573d6000803e3d6000fd5b50505050503373ffffffffffffffffffffffffffffffffffffffff167f59eab5b5f813ac9e0c10035dfb55b5e3419eff53c0f7a869fb3c22400ea036d682604051620018079190620051fe565b60405180910390a250565b8273ffffffffffffffffffffffffffffffffffffffff811662001861576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff8116620018b0576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8380600003620018f0576040517f4618044a0000000000000000000000000000000000000000000000000000000081526004810182905260240162000b7a565b620018fa62003655565b620019066007620036ca565b61010a5460008181526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff808c168552925290912054167ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeef8101620019b0576040517f6dad9c7800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8916600482015260240162000b7a565b73ffffffffffffffffffffffffffffffffffffffff80891660009081526101096020526040812054909116906060821562001a79576040517f9dc29fac000000000000000000000000000000000000000000000000000000008152336004820152602481018b905273ffffffffffffffffffffffffffffffffffffffff8c1690639dc29fac90604401600060405180830381600087803b15801562001a5457600080fd5b505af115801562001a69573d6000803e3d6000fd5b5050505061010b54915062001d35565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8d16906370a0823190602401602060405180830381865afa15801562001ae7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001b0d91906200529a565b905062001b3373ffffffffffffffffffffffffffffffffffffffff8d1633308e62003765565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152819073ffffffffffffffffffffffffffffffffffffffff8e16906370a0823190602401602060405180830381865afa15801562001ba0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001bc691906200529a565b62001bd29190620052b4565b9a508b935073ffffffffffffffffffffffffffffffffffffffff851662001cc957610222610108600088815260200190815260200160002060008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508b73ffffffffffffffffffffffffffffffffffffffff167f0f53e2a811b6fd2d6cd965fd6c27b44fb924ca39f7a7f321115705c22366d62360405160405180910390a25b73ffffffffffffffffffffffffffffffffffffffff85166103331462001d305762001cf48c62003843565b62001cff8d62003963565b62001d0a8e62003a70565b60405160200162001d1e93929190620052ca565b60405160208183030381529060405291505b859250505b60c960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639f3ce55a3460ca60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1634878f8f898960405160240162001db395949392919062005307565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fe4d2745100000000000000000000000000000000000000000000000000000000179052517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b16815262001e64939291906004016200525a565b6000604051808303818588803b15801562001e7e57600080fd5b505af115801562001e93573d6000803e3d6000fd5b50505050508a73ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8780a94875b70464f8ac6c28851501d32e7fd4ee574e4b94beb28923a3c42d9c8d60405162001f0f91815260200190565b60405180910390a4505050505062001f2660018055565b505050505050565b7fbf094fe3c005c553ff0d33c7dff9d1273add12fb3f258b992f8d36224dd35b2462001f5a816200358a565b60ca5473ffffffffffffffffffffffffffffffffffffffff161562001fc85760ca546040517f94fbfd2e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116600482015260240162000b7a565b62001fd38262003bb6565b604051339073ffffffffffffffffffffffffffffffffffffffff8416907fb044c1a1a05a729c402def784b4e4cb01612ff03eee6f0beb3eba0f0606260a190600090a35050565b6200202c604082016020830162004f27565b73ffffffffffffffffffffffffffffffffffffffff81166200207a576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6200208c606083016040840162004f27565b73ffffffffffffffffffffffffffffffffffffffff8116620020da576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600054610100900460ff1615808015620020fb5750600054600160ff909116105b80620021175750303b15801562002117575060005460ff166001145b620021a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840162000b7a565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156200220457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6200222d6200221760e08601866200534e565b620022276101008801886200534e565b620030ab565b6200224962002243604086016020870162004f27565b62003c76565b6200225362003006565b6200226e600062002268602087018762004f27565b62002f10565b620022876200228160c08601866200534e565b620033a7565b62002299606085016040860162004f27565b61010780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055606084013561010a55608084013561010b5560005b6200230360a0860186620053b9565b9050811015620024c05760006200231e60a0870187620053b9565b8381811062002331576200233162005165565b905060200201602081019062002348919062004f27565b73ffffffffffffffffffffffffffffffffffffffff160362002396576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61010a5460009081526101086020526040812061011191620023bc60a0890189620053b9565b85818110620023cf57620023cf62005165565b9050602002016020810190620023e6919062004f27565b73ffffffffffffffffffffffffffffffffffffffff9081168252602082019290925260400160002080547fffffffffffffffffffffffff000000000000000000000000000000000000000016929091169190911790556200244b60a0860186620053b9565b828181106200245e576200245e62005165565b905060200201602081019062002475919062004f27565b73ffffffffffffffffffffffffffffffffffffffff167f5e023c7a09fa0534ce3199f65fc3e635a5e851c5adc88ebda3b9d332ae07cbe960405160405180910390a2600101620022f4565b5080156200252557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6000816008811115620025425762002542620050ca565b60d654600190911b16151592915050565b8073ffffffffffffffffffffffffffffffffffffffff8116620025a2576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f77974cc9cb5bafc9bb265be792d93fa46355c05701895b82f6d3b4b448c8ce00620025ce816200358a565b60c9805473ffffffffffffffffffffffffffffffffffffffff8581167fffffffffffffffffffffffff00000000000000000000000000000000000000008316811790935560405191169133918391907fc96d462e42a71473da49a1d58c1754b9b2d319786692d621dc7f921331c517e990600090a450505050565b8073ffffffffffffffffffffffffffffffffffffffff811662002698576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8083166000908152610109602052604090205483911615158062002706575061010a5460009081526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff85811685529252909120541615155b1562002757576040517f12f3df0900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260240162000b7a565b7feaf25fcc6b7d45bda16c56628df3f435e20319ef53b065c11ee4510083f0ae2d62002783816200358a565b61010a5460009081526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff8816808552925280832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166101111790555190917f5e023c7a09fa0534ce3199f65fc3e635a5e851c5adc88ebda3b9d332ae07cbe991a250505050565b6000828152609760205260409020600101546200282b816200358a565b62001491838362003599565b80156200284b576200284b85838362003da4565b6200285885858562001812565b5050505050565b60d76000826008811115620028785762002878620050ca565b60088111156200288c576200288c620050ca565b815260200190815260200160002054620028a6816200358a565b620028b1826200252b565b15620028ed57816040517fc0a71b5800000000000000000000000000000000000000000000000000000000815260040162000b7a919062005135565b816008811115620029025762002902620050ca565b60d68054600190921b9091179055816008811115620029255762002925620050ca565b7f534f879afd40abb4e39f8e1b77a316be4c8e3521d9cf5a3a3db8959d574d45593362000e28565b6200295762003655565b60c95473ffffffffffffffffffffffffffffffffffffffff163314620029a9576040517f8c56efb100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ca5460c954604080517f67e404ce000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff93841693909216916367e404ce916004808201926020929091908290030181865afa15801562002a21573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062002a47919062005145565b73ffffffffffffffffffffffffffffffffffffffff161462002a95576040517f79d1e58f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600862002aa281620036ca565b60008481526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff808c1685529252822054169061022282148062002afd575073ffffffffffffffffffffffffffffffffffffffff8216610333145b1562002b2c5762002b2673ffffffffffffffffffffffffffffffffffffffff8a16888a62004075565b62002cfb565b508073ffffffffffffffffffffffffffffffffffffffff811662002c705762002b5b89868661010a54620040cd565b90508861010960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080610108600061010b54815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152602482018a90528216906340c10f1990604401600060405180830381600087803b15801562002ce157600080fd5b505af115801562002cf6573d6000803e3d6000fd5b505050505b8673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167f6ed06519caca659cdefa71015c79a561928d3cf8cc4a3e9739fde9fb5fb38d648b60405162002d7291815260200190565b60405180910390a450505062001f2660018055565b8073ffffffffffffffffffffffffffffffffffffffff811662002dd6576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f19bf281d118073c159a713666aba52e0d403520cd01e03f42e0f62a0b3bd4a3562002e02816200358a565b61010a5460008181526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff8881168552925290912054166101111462002e8d576040517f82f5d0a500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240162000b7a565b60008181526101086020908152604080832073ffffffffffffffffffffffffffffffffffffffff8816808552925280832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555190917f0145163d8d460d1ab21463758d147fdfe79d4b57c81ca3d1439996104ae6895991a250505050565b600082815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166200157257600082815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905562002fa83390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600054610100900460ff166200309f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840162000b7a565b620030a962004231565b565b600054610100900460ff1662003144576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840162000b7a565b8260005b81811015620032745785858281811062003166576200316662005165565b9050604002016020013560d7600088888581811062003189576200318962005165565b620031a1926020604090920201908101915062004c2f565b6008811115620031b557620031b5620050ca565b6008811115620031c957620031c9620050ca565b81526020810191909152604001600020557f33aa8fd1ce49e1761bc8d27fd53414bfefc45d690feed0ce55019d7d3aec609186868381811062003210576200321062005165565b62003228926020604090920201908101915062004c2f565b8787848181106200323d576200323d62005165565b905060400201602001356040516200325792919062005424565b60405180910390a1806200326b81620051c3565b91505062003148565b5081905060005b8181101562001f265783838281811062003299576200329962005165565b9050604002016020013560d86000868685818110620032bc57620032bc62005165565b620032d4926020604090920201908101915062004c2f565b6008811115620032e857620032e8620050ca565b6008811115620032fc57620032fc620050ca565b81526020810191909152604001600020557fe7bf4b8dc0c17a52dc9e52323a3ab61cb2079db35f969125b1f8a3d984c6f6c284848381811062003343576200334362005165565b6200335b926020604090920201908101915062004c2f565b85858481811062003370576200337062005165565b905060400201602001356040516200338a92919062005424565b60405180910390a1806200339e81620051c3565b9150506200327b565b600054610100900460ff1662003440576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840162000b7a565b8060005b818110156200252557600084848381811062003464576200346462005165565b6200347c926020604090920201908101915062004f27565b73ffffffffffffffffffffffffffffffffffffffff1603620034ca576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b838382818110620034df57620034df62005165565b905060400201602001356000801b0362003525576040517f0742d05300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b620035758484838181106200353e576200353e62005165565b905060400201602001358585848181106200355d576200355d62005165565b62002268926020604090920201908101915062004f27565b806200358181620051c3565b91505062003444565b620035968133620042ca565b50565b600082815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16156200157257600082815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600260015403620036c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640162000b7a565b6002600155565b60d654816008811115620036e257620036e2620050ca565b6001901b8116156200372457816040517fc0a71b5800000000000000000000000000000000000000000000000000000000815260040162000b7a919062005135565b6002811615620015725760016040517fc0a71b5800000000000000000000000000000000000000000000000000000000815260040162000b7a919062005135565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052620025259085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526200438d565b60408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f06fdde03000000000000000000000000000000000000000000000000000000001790529051606091600091829173ffffffffffffffffffffffffffffffffffffffff861691620038c7919062005441565b600060405180830381855afa9150503d806000811462003904576040519150601f19603f3d011682016040523d82523d6000602084013e62003909565b606091505b50915091508162003950576040518060400160405280600781526020017f4e4f5f4e414d45000000000000000000000000000000000000000000000000008152506200395b565b6200395b81620044a3565b949350505050565b60408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f95d89b41000000000000000000000000000000000000000000000000000000001790529051606091600091829173ffffffffffffffffffffffffffffffffffffffff861691620039e7919062005441565b600060405180830381855afa9150503d806000811462003a24576040519150601f19603f3d011682016040523d82523d6000602084013e62003a29565b606091505b50915091508162003950576040518060400160405280600981526020017f4e4f5f53594d424f4c00000000000000000000000000000000000000000000008152506200395b565b60408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f313ce5670000000000000000000000000000000000000000000000000000000017905290516000918291829173ffffffffffffffffffffffffffffffffffffffff86169162003af3919062005441565b600060405180830381855afa9150503d806000811462003b30576040519150601f19603f3d011682016040523d82523d6000602084013e62003b35565b606091505b509150915081801562003b49575080516020145b1562003b6557808060200190518101906200395b91906200546f565b6040517fb5a2f1c600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240162000b7a565b60018055565b73ffffffffffffffffffffffffffffffffffffffff811662003c04576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ca80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040513391907fe68b208814fdb633b222cd15e73d5a27fb4ef9eef4cae78c623bc27702141d2890600090a350565b600054610100900460ff1662003d0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840162000b7a565b73ffffffffffffffffffffffffffffffffffffffff811662003d5d576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60c980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b7fd505accf0000000000000000000000000000000000000000000000000000000062003dd56004600084866200548f565b62003de091620054bb565b7fffffffff00000000000000000000000000000000000000000000000000000000161462003ea15762003e186004600083856200548f565b62003e2391620054bb565b6040517fcf9e29460000000000000000000000000000000000000000000000000000000081527fffffffff0000000000000000000000000000000000000000000000000000000090911660048201527fd505accf00000000000000000000000000000000000000000000000000000000602482015260440162000b7a565b600080808080808062003eb8886004818c6200548f565b81019062003ec7919062005504565b96509650965096509650965096503373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff161462003f54576040517f200688cc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8816600482015260240162000b7a565b73ffffffffffffffffffffffffffffffffffffffff8616301462003fbd576040517f2911594800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8716600482015260240162000b7a565b6040517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690526064810185905260ff8416608482015260a4810183905260c4810182905273ffffffffffffffffffffffffffffffffffffffff8b169063d505accf9060e401600060405180830381600087803b1580156200405057600080fd5b505af115801562004065573d6000803e3d6000fd5b5050505050505050505050505050565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052620014919084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401620037c0565b60008181526020859052604081206101075460405173ffffffffffffffffffffffffffffffffffffffff90911690620041069062004a7f565b73ffffffffffffffffffffffffffffffffffffffff90911681526040602082018190526000908201526060018190604051809103906000f590508015801562004153573d6000803e3d6000fd5b50905060008080620041688688018862005621565b9250925092508373ffffffffffffffffffffffffffffffffffffffff16631624f6c68484846040518463ffffffff1660e01b8152600401620041ad93929190620052ca565b600060405180830381600087803b158015620041c857600080fd5b505af1158015620041dd573d6000803e3d6000fd5b505060405173ffffffffffffffffffffffffffffffffffffffff808c169350871691507fd5d4920bb61e6141c8499d50a7bd617dae2b1818c9d6b995d3f2ba4975e32ea490600090a3505050949350505050565b600054610100900460ff1662003bb0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840162000b7a565b600082815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1662001572576200430d8162004676565b6200431a83602062004696565b6040516020016200432d92919062005697565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a000000000000000000000000000000000000000000000000000000000825262000b7a9160040162004d8b565b6000620043f1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16620048fe9092919063ffffffff16565b9050805160001480620044155750808060200190518101906200441591906200571c565b62001491576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840162000b7a565b60606040825110620044c5578180602001905181019062000d39919062005740565b81516020146200450857505060408051808201909152601281527f4e4f545f56414c49445f454e434f44494e470000000000000000000000000000602082015290565b60005b6020811080156200455657508281815181106200452c576200452c62005165565b01602001517fff000000000000000000000000000000000000000000000000000000000000001615155b1562004565576001016200450b565b80600003620045a957505060408051808201909152601281527f4e4f545f56414c49445f454e434f44494e4700000000000000000000000000006020820152919050565b60008167ffffffffffffffff811115620045c757620045c762004da0565b6040519080825280601f01601f191660200182016040528015620045f2576020820181803683370190505b50905060005b828110156200466e5784818151811062004616576200461662005165565b602001015160f81c60f81b82828151811062004636576200463662005165565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101620045f8565b509392505050565b606062000d3973ffffffffffffffffffffffffffffffffffffffff831660145b60606000620046a7836002620057b7565b620046b4906002620057d1565b67ffffffffffffffff811115620046cf57620046cf62004da0565b6040519080825280601f01601f191660200182016040528015620046fa576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811062004734576200473462005165565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106200479a576200479a62005165565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000620047d8846002620057b7565b620047e5906001620057d1565b90505b60018111156200488c577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106200482a576200482a62005165565b1a60f81b82828151811062004843576200484362005165565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936200488481620057e7565b9050620047e8565b508315620048f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640162000b7a565b9392505050565b60606200395b8484600085856000808673ffffffffffffffffffffffffffffffffffffffff16858760405162004935919062005441565b60006040518083038185875af1925050503d806000811462004974576040519150601f19603f3d011682016040523d82523d6000602084013e62004979565b606091505b50915091506200498c8783838762004997565b979650505050505050565b6060831562004a3257825160000362004a2a5773ffffffffffffffffffffffffffffffffffffffff85163b62004a2a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640162000b7a565b50816200395b565b6200395b838381511562004a495781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040162000b7a919062004d8b565b6106f3806200582083390190565b73ffffffffffffffffffffffffffffffffffffffff811681146200359657600080fd5b60008083601f84011262004ac357600080fd5b50813567ffffffffffffffff81111562004adc57600080fd5b6020830191508360208260061b850101111562004af857600080fd5b9250929050565b60008060008060008060006080888a03121562004b1b57600080fd5b873562004b288162004a8d565b9650602088013567ffffffffffffffff8082111562004b4657600080fd5b62004b548b838c0162004ab0565b909850965060408a013591508082111562004b6e57600080fd5b62004b7c8b838c0162004ab0565b909650945060608a013591508082111562004b9657600080fd5b5062004ba58a828b0162004ab0565b989b979a50959850939692959293505050565b60006020828403121562004bcb57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114620048f757600080fd5b6000806040838503121562004c1057600080fd5b82359150602083013562004c248162004a8d565b809150509250929050565b60006020828403121562004c4257600080fd5b813560098110620048f757600080fd5b6000806040838503121562004c6657600080fd5b823562004c738162004a8d565b9150602083013562004c248162004a8d565b60006020828403121562004c9857600080fd5b5035919050565b6000806020838503121562004cb357600080fd5b823567ffffffffffffffff8082111562004ccc57600080fd5b818501915085601f83011262004ce157600080fd5b81358181111562004cf157600080fd5b8660208260051b850101111562004d0757600080fd5b60209290920196919550909350505050565b60005b8381101562004d3657818101518382015260200162004d1c565b50506000910152565b6000815180845262004d5981602086016020860162004d19565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000620048f7602083018462004d3f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171562004e195762004e1962004da0565b604052919050565b6000602080838503121562004e3557600080fd5b823567ffffffffffffffff8082111562004e4e57600080fd5b818501915085601f83011262004e6357600080fd5b81358181111562004e785762004e7862004da0565b8060051b915062004e8b84830162004dcf565b818152918301840191848101908884111562004ea657600080fd5b938501935b8385101562004ed4578435925062004ec38362004a8d565b828252938501939085019062004eab565b98975050505050505050565b60008060006060848603121562004ef657600080fd5b833562004f038162004a8d565b925060208401359150604084013562004f1c8162004a8d565b809150509250925092565b60006020828403121562004f3a57600080fd5b8135620048f78162004a8d565b60006020828403121562004f5a57600080fd5b813567ffffffffffffffff81111562004f7257600080fd5b82016101208185031215620048f757600080fd5b60008083601f84011262004f9957600080fd5b50813567ffffffffffffffff81111562004fb257600080fd5b60208301915083602082850101111562004af857600080fd5b60008060008060006080868803121562004fe457600080fd5b853562004ff18162004a8d565b94506020860135935060408601356200500a8162004a8d565b9250606086013567ffffffffffffffff8111156200502757600080fd5b620050358882890162004f86565b969995985093965092949392505050565b60008060008060008060a087890312156200506057600080fd5b86356200506d8162004a8d565b9550602087013594506040870135620050868162004a8d565b935060608701359250608087013567ffffffffffffffff811115620050aa57600080fd5b620050b889828a0162004f86565b979a9699509497509295939492505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6009811062005131577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b6020810162000d398284620050f9565b6000602082840312156200515857600080fd5b8151620048f78162004a8d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203620051f757620051f762005194565b5060010190565b6020808252825182820181905260009190848201906040850190845b818110156200524e57835173ffffffffffffffffffffffffffffffffffffffff16835292840192918401916001016200521a565b50909695505050505050565b73ffffffffffffffffffffffffffffffffffffffff8416815282602082015260606040820152600062005291606083018462004d3f565b95945050505050565b600060208284031215620052ad57600080fd5b5051919050565b8181038181111562000d395762000d3962005194565b606081526000620052df606083018662004d3f565b8281036020840152620052f3818662004d3f565b91505060ff83166040830152949350505050565b600073ffffffffffffffffffffffffffffffffffffffff808816835286602084015280861660408401525083606083015260a060808301526200498c60a083018462004d3f565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126200538457600080fd5b83018035915067ffffffffffffffff821115620053a057600080fd5b6020019150600681901b360382131562004af857600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112620053ef57600080fd5b83018035915067ffffffffffffffff8211156200540b57600080fd5b6020019150600581901b360382131562004af857600080fd5b60408101620054348285620050f9565b8260208301529392505050565b600082516200545581846020870162004d19565b9190910192915050565b60ff811681146200359657600080fd5b6000602082840312156200548257600080fd5b8151620048f7816200545f565b60008085851115620054a057600080fd5b83861115620054ae57600080fd5b5050820193919092039150565b7fffffffff000000000000000000000000000000000000000000000000000000008135818116916004851015620054fc5780818660040360031b1b83161692505b505092915050565b600080600080600080600060e0888a0312156200552057600080fd5b87356200552d8162004a8d565b965060208801356200553f8162004a8d565b9550604088013594506060880135935060808801356200555f816200545f565b9699959850939692959460a0840135945060c09093013592915050565b600067ffffffffffffffff82111562005599576200559962004da0565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f830112620055d757600080fd5b8135620055ee620055e8826200557c565b62004dcf565b8181528460208386010111156200560457600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000606084860312156200563757600080fd5b833567ffffffffffffffff808211156200565057600080fd5b6200565e87838801620055c5565b945060208601359150808211156200567557600080fd5b506200568486828701620055c5565b925050604084013562004f1c816200545f565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351620056d181601785016020880162004d19565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516200571081602884016020880162004d19565b01602801949350505050565b6000602082840312156200572f57600080fd5b81518015158114620048f757600080fd5b6000602082840312156200575357600080fd5b815167ffffffffffffffff8111156200576b57600080fd5b8201601f810184136200577d57600080fd5b80516200578e620055e8826200557c565b818152856020838501011115620057a457600080fd5b6200529182602083016020860162004d19565b808202811582820484141762000d395762000d3962005194565b8082018082111562000d395762000d3962005194565b600081620057f957620057f962005194565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fe60806040526040516106f33803806106f383398101604081905261002291610420565b61002e82826000610035565b505061054a565b61003e836100f6565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100f1576100ef836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e991906104e0565b8361027a565b505b505050565b6001600160a01b0381163b6101605760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101d4816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906104e0565b6001600160a01b03163b151590565b6102395760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610157565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392909216919091179055565b606061029f83836040518060600160405280602781526020016106cc602791396102a6565b9392505050565b6060600080856001600160a01b0316856040516102c391906104fb565b600060405180830381855af49150503d80600081146102fe576040519150601f19603f3d011682016040523d82523d6000602084013e610303565b606091505b5090925090506103158683838761031f565b9695505050505050565b6060831561038e578251600003610387576001600160a01b0385163b6103875760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610157565b5081610398565b61039883836103a0565b949350505050565b8151156103b05781518083602001fd5b8060405162461bcd60e51b81526004016101579190610517565b80516001600160a01b03811681146103e157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156104175781810151838201526020016103ff565b50506000910152565b6000806040838503121561043357600080fd5b61043c836103ca565b60208401519092506001600160401b038082111561045957600080fd5b818501915085601f83011261046d57600080fd5b81518181111561047f5761047f6103e6565b604051601f8201601f19908116603f011681019083821181831017156104a7576104a76103e6565b816040528281528860208487010111156104c057600080fd5b6104d18360208301602088016103fc565b80955050505050509250929050565b6000602082840312156104f257600080fd5b61029f826103ca565b6000825161050d8184602087016103fc565b9190910192915050565b60208152600082518060208401526105368160408501602087016103fc565b601f01601f19169190910160400192915050565b610173806105596000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea2646970667358221220487f6f370ed71b7026944bbfbeff4c6a8abfbc1f686dbaab6010959808b5814564736f6c63430008130033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220de9804b67318a6cdb529d18b92fd51bf5512166da05a44c81a9aaec12a7bc66b64736f6c63430008130033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/contracts/local-deployments-artifacts/get-wallet-nonce.ts b/contracts/local-deployments-artifacts/get-wallet-nonce.ts new file mode 100644 index 00000000..3fe33055 --- /dev/null +++ b/contracts/local-deployments-artifacts/get-wallet-nonce.ts @@ -0,0 +1,33 @@ +import { JsonRpcProvider, Wallet } from "ethers"; +import yargs from "yargs"; +import { hideBin } from "yargs/helpers"; +import { sanitizePrivKey } from "../scripts/cli"; + +const argv = yargs(hideBin(process.argv)) + .option("rpc-url", { + describe: "RPC url", + type: "string", + demandOption: true, + }) + .option("wallet-priv-key", { + describe: "deployer private key", + type: "string", + demandOption: true, + coerce: sanitizePrivKey("priv-key"), + }) + .parseSync(); + +async function main(args: typeof argv) { + const provider = new JsonRpcProvider(args.rpcUrl); + const wallet = new Wallet(args.walletPrivKey, provider); + + const nonce = await wallet.getNonce(); + + process.env.L1_NONCE = nonce.toString(); + process.stdout.write(process.env.L1_NONCE); +} + +main(argv).catch((error) => { + console.error(error); + process.exit(1); +}); diff --git a/contracts/local-deployments-artifacts/static-artifacts/TestERC20.json b/contracts/local-deployments-artifacts/static-artifacts/TestERC20.json new file mode 100644 index 00000000..3b919619 --- /dev/null +++ b/contracts/local-deployments-artifacts/static-artifacts/TestERC20.json @@ -0,0 +1,385 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "TestERC20", + "sourceName": "contracts/tokenBridge/mocks/TestERC20.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_initialSupply", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x60806040523480156200001157600080fd5b50604051620014d1380380620014d183398101604081905262000034916200026b565b828260036200004483826200036c565b5060046200005382826200036c565b505050620000706200006a6200008560201b60201c565b62000089565b6200007c3382620000db565b50505062000460565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216620001365760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b80600260008282546200014a919062000438565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b505050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620001ce57600080fd5b81516001600160401b0380821115620001eb57620001eb620001a6565b604051601f8301601f19908116603f01168101908282118183101715620002165762000216620001a6565b816040528381526020925086838588010111156200023357600080fd5b600091505b8382101562000257578582018301518183018401529082019062000238565b600093810190920192909252949350505050565b6000806000606084860312156200028157600080fd5b83516001600160401b03808211156200029957600080fd5b620002a787838801620001bc565b94506020860151915080821115620002be57600080fd5b50620002cd86828701620001bc565b925050604084015190509250925092565b600181811c90821680620002f357607f821691505b6020821081036200031457634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001a157600081815260208120601f850160051c81016020861015620003435750805b601f850160051c820191505b8181101562000364578281556001016200034f565b505050505050565b81516001600160401b03811115620003885762000388620001a6565b620003a081620003998454620002de565b846200031a565b602080601f831160018114620003d85760008415620003bf5750858301515b600019600386901b1c1916600185901b17855562000364565b600085815260208120601f198616915b828110156200040957888601518255948401946001909101908401620003e8565b5085821015620004285787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b808201808211156200045a57634e487b7160e01b600052601160045260246000fd5b92915050565b61106180620004706000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d714610223578063a9059cbb14610236578063dd62ed3e14610249578063f2fde38b1461028f57600080fd5b806370a08231146101b5578063715018a6146101eb5780638da5cb5b146101f357806395d89b411461021b57600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461017a57806340c10f191461018d57806342966c68146101a257600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d6102a2565b60405161011a9190610e35565b60405180910390f35b610136610131366004610eca565b610334565b604051901515815260200161011a565b6002545b60405190815260200161011a565b610136610166366004610ef4565b61034e565b6040516012815260200161011a565b610136610188366004610eca565b610372565b6101a061019b366004610eca565b6103be565b005b6101a06101b0366004610f30565b6103cc565b61014a6101c3366004610f49565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6101a06103d9565b60055460405173ffffffffffffffffffffffffffffffffffffffff909116815260200161011a565b61010d6103ed565b610136610231366004610eca565b6103fc565b610136610244366004610eca565b6104d2565b61014a610257366004610f6b565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6101a061029d366004610f49565b6104e0565b6060600380546102b190610f9e565b80601f01602080910402602001604051908101604052809291908181526020018280546102dd90610f9e565b801561032a5780601f106102ff5761010080835404028352916020019161032a565b820191906000526020600020905b81548152906001019060200180831161030d57829003601f168201915b5050505050905090565b600033610342818585610594565b60019150505b92915050565b60003361035c858285610748565b61036785858561081f565b506001949350505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919061034290829086906103b9908790610ff1565b610594565b6103c88282610a8e565b5050565b6103d63382610b81565b50565b6103e1610d3d565b6103eb6000610dbe565b565b6060600480546102b190610f9e565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190838110156104c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6103678286868403610594565b60003361034281858561081f565b6104e8610d3d565b73ffffffffffffffffffffffffffffffffffffffff811661058b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016104bc565b6103d681610dbe565b73ffffffffffffffffffffffffffffffffffffffff8316610636576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016104bc565b73ffffffffffffffffffffffffffffffffffffffff82166106d9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016104bc565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610819578181101561080c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016104bc565b6108198484848403610594565b50505050565b73ffffffffffffffffffffffffffffffffffffffff83166108c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016104bc565b73ffffffffffffffffffffffffffffffffffffffff8216610965576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016104bc565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610a1b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016104bc565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610819565b73ffffffffffffffffffffffffffffffffffffffff8216610b0b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016104bc565b8060026000828254610b1d9190610ff1565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff8216610c24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016104bc565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205481811015610cda576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f636500000000000000000000000000000000000000000000000000000000000060648201526084016104bc565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910161073b565b60055473ffffffffffffffffffffffffffffffffffffffff1633146103eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104bc565b6005805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600060208083528351808285015260005b81811015610e6257858101830151858201604001528201610e46565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610ec557600080fd5b919050565b60008060408385031215610edd57600080fd5b610ee683610ea1565b946020939093013593505050565b600080600060608486031215610f0957600080fd5b610f1284610ea1565b9250610f2060208501610ea1565b9150604084013590509250925092565b600060208284031215610f4257600080fd5b5035919050565b600060208284031215610f5b57600080fd5b610f6482610ea1565b9392505050565b60008060408385031215610f7e57600080fd5b610f8783610ea1565b9150610f9560208401610ea1565b90509250929050565b600181811c90821680610fb257607f821691505b602082108103610feb577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b80820180821115610348577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea26469706673582212204492a857249c95f2aaf7020dbd1bd99ac26cde6c4bc5ec1a51caa0e6462b02e864736f6c63430008130033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d714610223578063a9059cbb14610236578063dd62ed3e14610249578063f2fde38b1461028f57600080fd5b806370a08231146101b5578063715018a6146101eb5780638da5cb5b146101f357806395d89b411461021b57600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461017a57806340c10f191461018d57806342966c68146101a257600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d6102a2565b60405161011a9190610e35565b60405180910390f35b610136610131366004610eca565b610334565b604051901515815260200161011a565b6002545b60405190815260200161011a565b610136610166366004610ef4565b61034e565b6040516012815260200161011a565b610136610188366004610eca565b610372565b6101a061019b366004610eca565b6103be565b005b6101a06101b0366004610f30565b6103cc565b61014a6101c3366004610f49565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6101a06103d9565b60055460405173ffffffffffffffffffffffffffffffffffffffff909116815260200161011a565b61010d6103ed565b610136610231366004610eca565b6103fc565b610136610244366004610eca565b6104d2565b61014a610257366004610f6b565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6101a061029d366004610f49565b6104e0565b6060600380546102b190610f9e565b80601f01602080910402602001604051908101604052809291908181526020018280546102dd90610f9e565b801561032a5780601f106102ff5761010080835404028352916020019161032a565b820191906000526020600020905b81548152906001019060200180831161030d57829003601f168201915b5050505050905090565b600033610342818585610594565b60019150505b92915050565b60003361035c858285610748565b61036785858561081f565b506001949350505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919061034290829086906103b9908790610ff1565b610594565b6103c88282610a8e565b5050565b6103d63382610b81565b50565b6103e1610d3d565b6103eb6000610dbe565b565b6060600480546102b190610f9e565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190838110156104c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6103678286868403610594565b60003361034281858561081f565b6104e8610d3d565b73ffffffffffffffffffffffffffffffffffffffff811661058b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016104bc565b6103d681610dbe565b73ffffffffffffffffffffffffffffffffffffffff8316610636576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016104bc565b73ffffffffffffffffffffffffffffffffffffffff82166106d9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016104bc565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610819578181101561080c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016104bc565b6108198484848403610594565b50505050565b73ffffffffffffffffffffffffffffffffffffffff83166108c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016104bc565b73ffffffffffffffffffffffffffffffffffffffff8216610965576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016104bc565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610a1b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016104bc565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610819565b73ffffffffffffffffffffffffffffffffffffffff8216610b0b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016104bc565b8060026000828254610b1d9190610ff1565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff8216610c24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016104bc565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090205481811015610cda576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f636500000000000000000000000000000000000000000000000000000000000060648201526084016104bc565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910161073b565b60055473ffffffffffffffffffffffffffffffffffffffff1633146103eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104bc565b6005805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600060208083528351808285015260005b81811015610e6257858101830151858201604001528201610e46565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610ec557600080fd5b919050565b60008060408385031215610edd57600080fd5b610ee683610ea1565b946020939093013593505050565b600080600060608486031215610f0957600080fd5b610f1284610ea1565b9250610f2060208501610ea1565b9150604084013590509250925092565b600060208284031215610f4257600080fd5b5035919050565b600060208284031215610f5b57600080fd5b610f6482610ea1565b9392505050565b60008060408385031215610f7e57600080fd5b610f8783610ea1565b9150610f9560208401610ea1565b90509250929050565b600181811c90821680610fb257607f821691505b602082108103610feb577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b80820180821115610348577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea26469706673582212204492a857249c95f2aaf7020dbd1bd99ac26cde6c4bc5ec1a51caa0e6462b02e864736f6c63430008130033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/contracts/local-deployments-artifacts/static-artifacts/UpgradeableBeacon.json b/contracts/local-deployments-artifacts/static-artifacts/UpgradeableBeacon.json new file mode 100644 index 00000000..c4d19879 --- /dev/null +++ b/contracts/local-deployments-artifacts/static-artifacts/UpgradeableBeacon.json @@ -0,0 +1,113 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "UpgradeableBeacon", + "sourceName": "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b506040516104e43803806104e483398101604081905261002f91610151565b61003833610047565b61004181610097565b50610181565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6100aa8161014260201b6101a01760201c565b6101205760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03163b151590565b60006020828403121561016357600080fd5b81516001600160a01b038116811461017a57600080fd5b9392505050565b610354806101906000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80633659cfe61461005c5780635c60da1b14610071578063715018a61461009a5780638da5cb5b146100a2578063f2fde38b146100b3575b600080fd5b61006f61006a3660046102ee565b6100c6565b005b6001546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b61006f61010e565b6000546001600160a01b031661007e565b61006f6100c13660046102ee565b610122565b6100ce6101af565b6100d781610209565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6101166101af565b610120600061029e565b565b61012a6101af565b6001600160a01b0381166101945760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61019d8161029e565b50565b6001600160a01b03163b151590565b6000546001600160a01b031633146101205760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161018b565b6001600160a01b0381163b61027c5760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f6044820152721b881a5cc81b9bdd08184818dbdb9d1c9858dd606a1b606482015260840161018b565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561030057600080fd5b81356001600160a01b038116811461031757600080fd5b939250505056fea264697066735822122037f5e761a584b5cfedfedcacdd35de142872479851fbaecf66f55a175ffa1d1d64736f6c63430008090033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c80633659cfe61461005c5780635c60da1b14610071578063715018a61461009a5780638da5cb5b146100a2578063f2fde38b146100b3575b600080fd5b61006f61006a3660046102ee565b6100c6565b005b6001546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b61006f61010e565b6000546001600160a01b031661007e565b61006f6100c13660046102ee565b610122565b6100ce6101af565b6100d781610209565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6101166101af565b610120600061029e565b565b61012a6101af565b6001600160a01b0381166101945760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61019d8161029e565b50565b6001600160a01b03163b151590565b6000546001600160a01b031633146101205760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161018b565b6001600160a01b0381163b61027c5760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f6044820152721b881a5cc81b9bdd08184818dbdb9d1c9858dd606a1b606482015260840161018b565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561030057600080fd5b81356001600160a01b038116811461031757600080fd5b939250505056fea264697066735822122037f5e761a584b5cfedfedcacdd35de142872479851fbaecf66f55a175ffa1d1d64736f6c63430008090033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/docker/config/linea-local-dev-genesis-PoA.json b/docker/config/linea-local-dev-genesis-PoA.json index 26deaccb..45ff305f 100644 --- a/docker/config/linea-local-dev-genesis-PoA.json +++ b/docker/config/linea-local-dev-genesis-PoA.json @@ -48,7 +48,7 @@ "f17f52151EbEF6C7334FAD080c5704D77216b732": { "@WARNING": "FOR LOCAL DEV ONLY - DO NOT REUSE THESE KEYS ELSEWHERE", "privateKey": "ae6ae8e5ccbfb04590405997ee2d52d2b330726137b875053c36d94e974d162f", - "comment": "account 3, can be used as end user", + "comment": "L2 Security Council", "balance": "90000000000000000000003" }, "6d26dcc30a1693043aefa35ed9171c16da53f275": { diff --git a/e2e/src/bridge-tokens.spec.ts b/e2e/src/bridge-tokens.spec.ts new file mode 100644 index 00000000..8b00894b --- /dev/null +++ b/e2e/src/bridge-tokens.spec.ts @@ -0,0 +1,211 @@ +import { ethers } from "ethers"; +import { describe, expect, it } from "@jest/globals"; +import { config } from "./config/tests-config"; +import { waitForEvents, etherToWei } from "./common/utils"; +import { MESSAGE_SENT_EVENT_SIGNATURE } from "./common/constants"; + +const l1AccountManager = config.getL1AccountManager(); +const l2AccountManager = config.getL2AccountManager(); +const bridgeAmount = ethers.parseEther("100"); +const messageSentEventMessageNumberIndex = 4; +const messageSentEventMessageHashIndex = 6; + +describe("Bridge ERC20 Tokens L1 -> L2 and L2 -> L1", () => { + it.concurrent("Bridge a token from L1 to L2", async () => { + const [l1Account, l2Account] = await Promise.all([ + l1AccountManager.generateAccount(), + l2AccountManager.generateAccount(), + ]); + + const lineaRollup = config.getLineaRollupContract(); + const l2MessageService = config.getL2MessageServiceContract(); + const l1TokenBridge = config.getL1TokenBridgeContract(); + const l2TokenBridge = config.getL2TokenBridgeContract(); + const l1Token = config.getL1TokenContract(); + const l1Provider = config.getL1Provider(); + + console.log("Minting ERC20 tokens to L1 Account"); + + let { maxPriorityFeePerGas: l1MaxPriorityFeePerGas, maxFeePerGas: l1MaxFeePerGas } = await l1Provider.getFeeData(); + let nonce = await l1Provider.getTransactionCount(l1Account.address, "pending"); + + console.log("Minting and approving tokens to L1 TokenBridge"); + + await Promise.all([ + ( + await l1Token.connect(l1Account).mint(l1Account.address, bridgeAmount, { + nonce: nonce, + maxPriorityFeePerGas: l1MaxPriorityFeePerGas, + maxFeePerGas: l1MaxFeePerGas, + }) + ).wait(), + ( + await l1Token.connect(l1Account).approve(l1TokenBridge.getAddress(), bridgeAmount, { + maxPriorityFeePerGas: l1MaxPriorityFeePerGas, + maxFeePerGas: l1MaxFeePerGas, + nonce: nonce + 1, + }) + ).wait(), + ]); + + const l1TokenBridgeAddress = await l1TokenBridge.getAddress(); + const l1TokenAddress = await l1Token.getAddress(); + + const allowanceL1Account = await l1Token.allowance(l1Account.address, l1TokenBridgeAddress); + console.log("Current allowance of L1 account to L1 TokenBridge is :", allowanceL1Account.toString()); + + console.log("Calling the bridgeToken function on the L1 TokenBridge contract"); + + ({ maxPriorityFeePerGas: l1MaxPriorityFeePerGas, maxFeePerGas: l1MaxFeePerGas } = await l1Provider.getFeeData()); + nonce = await l1Provider.getTransactionCount(l1Account.address, "pending"); + + const bridgeTokenTx = await l1TokenBridge + .connect(l1Account) + .bridgeToken(l1TokenAddress, bridgeAmount, l2Account.address, { + value: etherToWei("0.01"), + maxPriorityFeePerGas: l1MaxPriorityFeePerGas, + maxFeePerGas: l1MaxFeePerGas, + nonce: nonce, + }); + + const bridgedTxReceipt = await bridgeTokenTx.wait(); + + const sentEventLog = bridgedTxReceipt?.logs.find((log) => log.topics[0] == MESSAGE_SENT_EVENT_SIGNATURE); + + const messageSentEvent = lineaRollup.interface.decodeEventLog( + "MessageSent", + sentEventLog!.data, + sentEventLog!.topics, + ); + + const l1TokenBalance = await l1Token.balanceOf(l1Account.address); + console.log("Token balance of L1 account :", l1TokenBalance.toString()); + + expect(l1TokenBalance).toEqual(0n); + + console.log("Waiting for MessageSent event on L1."); + + const messageNumber = messageSentEvent[messageSentEventMessageNumberIndex]; + const messageHash = messageSentEvent[messageSentEventMessageHashIndex]; + + console.log(`Message sent on L1 : messageHash=${messageHash}`); + + console.log("Waiting for anchoring..."); + + const [rollingHashUpdatedEvent] = await waitForEvents( + l2MessageService, + l2MessageService.filters.RollingHashUpdated(), + 1_000, + 0, + "latest", + async (events) => events.filter((event) => event.args.messageNumber >= messageNumber), + ); + expect(rollingHashUpdatedEvent).not.toBeNull(); + + const anchoredStatus = await l2MessageService.inboxL1L2MessageStatus(messageHash); + + expect(anchoredStatus).toBeGreaterThan(0); + + console.log(`Message anchored : ${JSON.stringify(rollingHashUpdatedEvent)}`); + + console.log("Waiting for MessageClaimed event on L2..."); + + const [claimedEvent] = await waitForEvents(l2MessageService, l2MessageService.filters.MessageClaimed(messageHash)); + expect(claimedEvent).not.toBeNull(); + + const [newTokenDeployed] = await waitForEvents(l2TokenBridge, l2TokenBridge.filters.NewTokenDeployed()); + expect(newTokenDeployed).not.toBeNull(); + + console.log(`Message claimed on L2 : ${JSON.stringify(claimedEvent)}.`); + + const l2Token = config.getL2BridgedTokenContract(newTokenDeployed.args.bridgedToken); + + console.log("Verify the token balance on L2"); + + const l2TokenBalance = await l2Token.balanceOf(l2Account.address); + console.log("Token balance of L2 account :", l2TokenBalance.toString()); + + expect(l2TokenBalance).toEqual(bridgeAmount); + }); + + it.concurrent("Bridge a token from L2 to L1", async () => { + const [l1Account, l2Account] = await Promise.all([ + l1AccountManager.generateAccount(), + l2AccountManager.generateAccount(), + ]); + + const lineaRollup = config.getLineaRollupContract(); + const l2MessageService = config.getL2MessageServiceContract(); + const l1TokenBridge = config.getL1TokenBridgeContract(); + const l2TokenBridge = config.getL2TokenBridgeContract(); + const l2Token = config.getL2TokenContract(); + const l2Provider = config.getL2Provider(); + + const { maxPriorityFeePerGas: l2MaxPriorityFeePerGas, maxFeePerGas: l2MaxFeePerGas } = + await l2Provider.getFeeData(); + let nonce = await l2Provider.getTransactionCount(l2Account.address, "pending"); + + await Promise.all([ + ( + await l2Token.connect(l2Account).mint(l2Account.address, bridgeAmount, { + nonce: nonce, + maxPriorityFeePerGas: l2MaxPriorityFeePerGas, + maxFeePerGas: l2MaxFeePerGas, + }) + ).wait(), + ( + await l2Token.connect(l2Account).approve(l2TokenBridge.getAddress(), ethers.parseEther("100"), { + maxPriorityFeePerGas: l2MaxPriorityFeePerGas, + maxFeePerGas: l2MaxFeePerGas, + nonce: nonce + 1, + }) + ).wait(), + ]); + + const allowanceL2Account = await l2Token.allowance(l2Account.address, l2TokenBridge.getAddress()); + console.log("Current allowance of L2 account to L2 TokenBridge is :", allowanceL2Account.toString()); + console.log("Current balance of L2 account is :", await l2Token.balanceOf(l2Account)); + + console.log("Calling the bridgeToken function on the L2 TokenBridge contract"); + + nonce = await l2Provider.getTransactionCount(l2Account.address, "pending"); + + const bridgeTokenTx = await l2TokenBridge + .connect(l2Account) + .bridgeToken(await l2Token.getAddress(), bridgeAmount, l1Account.address, { + value: etherToWei("0.01"), + maxPriorityFeePerGas: l2MaxPriorityFeePerGas, + maxFeePerGas: l2MaxFeePerGas, + nonce: nonce, + }); + + const receipt = await bridgeTokenTx.wait(); + const sentEventLog = receipt?.logs.find((log) => log.topics[0] == MESSAGE_SENT_EVENT_SIGNATURE); + + const messageSentEvent = l2MessageService.interface.decodeEventLog( + "MessageSent", + sentEventLog!.data, + sentEventLog!.topics, + ); + const messageHash = messageSentEvent[messageSentEventMessageHashIndex]; + + console.log("Waiting for L1 MessageClaimed event."); + + const [claimedEvent] = await waitForEvents(lineaRollup, lineaRollup.filters.MessageClaimed(messageHash)); + expect(claimedEvent).not.toBeNull(); + + console.log(`Message claimed on L1 : ${JSON.stringify(claimedEvent)}`); + + const [newTokenDeployed] = await waitForEvents(l1TokenBridge, l1TokenBridge.filters.NewTokenDeployed()); + expect(newTokenDeployed).not.toBeNull(); + + const l1BridgedToken = config.getL1BridgedTokenContract(newTokenDeployed.args.bridgedToken); + + console.log("Verify the token balance on L1"); + + const l1BridgedTokenBalance = await l1BridgedToken.balanceOf(l1Account.address); + console.log("Token balance of L1 account :", l1BridgedTokenBalance.toString()); + + expect(l1BridgedTokenBalance).toEqual(bridgeAmount); + }); +}); diff --git a/e2e/src/common/utils.ts b/e2e/src/common/utils.ts index 0c229353..12324354 100644 --- a/e2e/src/common/utils.ts +++ b/e2e/src/common/utils.ts @@ -3,7 +3,7 @@ import assert from "assert"; import { AbstractSigner, BaseContract, BlockTag, TransactionReceipt, TransactionRequest, Wallet, ethers } from "ethers"; import path from "path"; import { exec } from "child_process"; -import { L2MessageService, LineaRollupV5 } from "../typechain"; +import { L2MessageService, TokenBridge, LineaRollupV5 } from "../typechain"; import { PayableOverrides, TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog } from "../typechain/common"; import { MessageEvent, SendMessageArgs } from "./types"; @@ -147,7 +147,10 @@ export async function getBlockByNumberOrBlockTag(rpcUrl: URL, blockTag: BlockTag } } -export async function getEvents( +export async function getEvents< + TContract extends LineaRollupV5 | L2MessageService | TokenBridge, + TEvent extends TypedContractEvent, +>( contract: TContract, eventFilter: TypedDeferredTopicFilter, fromBlock?: BlockTag, @@ -168,7 +171,7 @@ export async function getEvents( contract: TContract, diff --git a/e2e/src/config/jest/global-setup.ts b/e2e/src/config/jest/global-setup.ts index d16e4083..10dd74fe 100644 --- a/e2e/src/config/jest/global-setup.ts +++ b/e2e/src/config/jest/global-setup.ts @@ -9,10 +9,18 @@ declare global { } export default async (): Promise => { + const l1JsonRpcProvider = config.getL1Provider(); + const l1AccountManager = config.getL1AccountManager(); + const l2AccountManager = config.getL2AccountManager(); + const account = config.getL1AccountManager().whaleAccount(0); const l2Account = config.getL2AccountManager().whaleAccount(0); const lineaRollup = config.getLineaRollupContract(account); - const l1JsonRpcProvider = config.getL1Provider(); + + const l1TokenBridge = config.getL1TokenBridgeContract(); + const l2TokenBridge = config.getL2TokenBridgeContract(); + const l1SecurityCouncil = l1AccountManager.whaleAccount(3); + const l2SecurityCouncil = l2AccountManager.whaleAccount(3); const [l1AccountNonce, l2AccountNonce, { maxPriorityFeePerGas, maxFeePerGas }] = await Promise.all([ account.getNonce(), @@ -37,6 +45,8 @@ export default async (): Promise => { nonce: l1AccountNonce + 1, }) ).wait(), + (await l1TokenBridge.connect(l1SecurityCouncil).setRemoteTokenBridge(await l2TokenBridge.getAddress())).wait(), + (await l2TokenBridge.connect(l2SecurityCouncil).setRemoteTokenBridge(await l1TokenBridge.getAddress())).wait(), ]); console.log(`L1 Dummy contract deployed at address: ${await dummyContract.getAddress()}`); diff --git a/e2e/src/config/tests-config/environments/dev.ts b/e2e/src/config/tests-config/environments/dev.ts index f5833168..4a2d414a 100644 --- a/e2e/src/config/tests-config/environments/dev.ts +++ b/e2e/src/config/tests-config/environments/dev.ts @@ -26,6 +26,8 @@ const config: Config = { rpcUrl: L1_RPC_URL, chainId: L1_CHAIN_ID, lineaRollupAddress: "0x2A5CDCfc38856e2590E9Bd32F54Fa348e5De5f48", + tokenBridgeAddress: "", + l1TokenAddress: "", accountManager: new EnvironmentBasedAccountManager( new ethers.JsonRpcProvider(L1_RPC_URL.toString()), L1_WHALE_ACCOUNTS, @@ -37,6 +39,8 @@ const config: Config = { rpcUrl: L2_RPC_URL, chainId: L2_CHAIN_ID, l2MessageServiceAddress: "0x33bf916373159A8c1b54b025202517BfDbB7863D", + tokenBridgeAddress: "", + l2TokenAddress: "", l2TestContractAddress: "", accountManager: new EnvironmentBasedAccountManager( new ethers.JsonRpcProvider(L2_RPC_URL.toString()), diff --git a/e2e/src/config/tests-config/environments/local.ts b/e2e/src/config/tests-config/environments/local.ts index 30d27d87..7fb8aec3 100644 --- a/e2e/src/config/tests-config/environments/local.ts +++ b/e2e/src/config/tests-config/environments/local.ts @@ -16,7 +16,9 @@ const config: Config = { rpcUrl: L1_RPC_URL, chainId: 31648428, lineaRollupAddress: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", - dummyContractAddress: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9", + dummyContractAddress: "0x610178dA211FEF7D417bC0e6FeD39F05609AD788", + tokenBridgeAddress: "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6", + l1TokenAddress: "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318", accountManager: new GenesisBasedAccountManager( new ethers.JsonRpcProvider(L1_RPC_URL.toString()), path.resolve( @@ -30,8 +32,10 @@ const config: Config = { besuNodeRpcUrl: L2_BESU_NODE_RPC_URL, chainId: 1337, l2MessageServiceAddress: "0xe537D669CA013d86EBeF1D64e40fC74CADC91987", - l2TestContractAddress: "0xeB0b0a14F92e3BA35aEF3a2B6A24D7ED1D11631B", - dummyContractAddress: "0x2f6dAaF8A81AB675fbD37Ca6Ed5b72cf86237453", + l2TestContractAddress: "0x997FC3aF1F193Cbdc013060076c67A13e218980e", + dummyContractAddress: "0xE4392c8ecC46b304C83cDB5edaf742899b1bda93", + tokenBridgeAddress: "0x5C95Bcd50E6D1B4E3CDC478484C9030Ff0a7D493", + l2TokenAddress: "0xCC1B08B17301e090cbb4c1F5598Cbaa096d591FB", accountManager: new GenesisBasedAccountManager( new ethers.JsonRpcProvider(L2_RPC_URL.toString()), path.resolve( diff --git a/e2e/src/config/tests-config/environments/sepolia.ts b/e2e/src/config/tests-config/environments/sepolia.ts index c525ceb8..ebc10709 100644 --- a/e2e/src/config/tests-config/environments/sepolia.ts +++ b/e2e/src/config/tests-config/environments/sepolia.ts @@ -25,6 +25,8 @@ const config: Config = { rpcUrl: L1_RPC_URL, chainId: L1_CHAIN_ID, lineaRollupAddress: "0xB218f8A4Bc926cF1cA7b3423c154a0D627Bdb7E5", + tokenBridgeAddress: "0x5A0a48389BB0f12E5e017116c1105da97E129142", + l1TokenAddress: "", accountManager: new EnvironmentBasedAccountManager( new ethers.JsonRpcProvider(L1_RPC_URL.toString()), L1_WHALE_ACCOUNTS, @@ -36,6 +38,8 @@ const config: Config = { rpcUrl: L2_RPC_URL, chainId: L2_CHAIN_ID, l2MessageServiceAddress: "0x971e727e956690b9957be6d51Ec16E73AcAC83A7", + tokenBridgeAddress: "0x93DcAdf238932e6e6a85852caC89cBd71798F463", + l2TokenAddress: "", l2TestContractAddress: "", accountManager: new EnvironmentBasedAccountManager( new ethers.JsonRpcProvider(L2_RPC_URL.toString()), diff --git a/e2e/src/config/tests-config/setup.ts b/e2e/src/config/tests-config/setup.ts index 314f2316..ca4da723 100644 --- a/e2e/src/config/tests-config/setup.ts +++ b/e2e/src/config/tests-config/setup.ts @@ -1,6 +1,8 @@ import { AbstractSigner, JsonRpcProvider, Wallet } from "ethers"; import { Config, L2Config, LocalL2Config } from "./types"; import { + BridgedToken, + BridgedToken__factory, DummyContract, DummyContract__factory, L2MessageService, @@ -9,6 +11,10 @@ import { LineaRollupV5__factory, TestContract, TestContract__factory, + TestERC20, + TestERC20__factory, + TokenBridge, + TokenBridge__factory, } from "../../typechain"; import { AccountManager } from "./accounts/account-manager"; @@ -99,6 +105,71 @@ export default class TestSetup { return l2MessageService; } + public getL1TokenBridgeContract(signer?: Wallet): TokenBridge { + const l1TokenBridge: TokenBridge = TokenBridge__factory.connect( + this.config.L1.tokenBridgeAddress, + this.getL1Provider(), + ); + + if (signer) { + return l1TokenBridge.connect(signer); + } + + return l1TokenBridge; + } + + public getL2TokenBridgeContract(signer?: Wallet): TokenBridge { + const l2TokenBridge: TokenBridge = TokenBridge__factory.connect( + this.config.L2.tokenBridgeAddress, + this.getL2Provider(), + ); + + if (signer) { + return l2TokenBridge.connect(signer); + } + + return l2TokenBridge; + } + + public getL1TokenContract(signer?: Wallet): TestERC20 { + const l1Token: TestERC20 = TestERC20__factory.connect(this.config.L1.l1TokenAddress, this.getL1Provider()); + + if (signer) { + return l1Token.connect(signer); + } + + return l1Token; + } + + public getL2TokenContract(signer?: Wallet): TestERC20 { + const l2Token: TestERC20 = TestERC20__factory.connect(this.config.L2.l2TokenAddress, this.getL2Provider()); + + if (signer) { + return l2Token.connect(signer); + } + + return l2Token; + } + + public getL1BridgedTokenContract(bridgedTokenAddress: string, signer?: Wallet): BridgedToken { + const l1BridgedToken: BridgedToken = BridgedToken__factory.connect(bridgedTokenAddress, this.getL1Provider()); + + if (signer) { + return l1BridgedToken.connect(signer); + } + + return l1BridgedToken; + } + + public getL2BridgedTokenContract(bridgedTokenAddress: string, signer?: Wallet): BridgedToken { + const l2BridgedToken: BridgedToken = BridgedToken__factory.connect(bridgedTokenAddress, this.getL2Provider()); + + if (signer) { + return l2BridgedToken.connect(signer); + } + + return l2BridgedToken; + } public getL1DummyContract(signer?: Wallet): DummyContract { const dummyContract = DummyContract__factory.connect(this.config.L1.dummyContractAddress, this.getL1Provider()); diff --git a/e2e/src/config/tests-config/types.ts b/e2e/src/config/tests-config/types.ts index ddb02fbc..22b98485 100644 --- a/e2e/src/config/tests-config/types.ts +++ b/e2e/src/config/tests-config/types.ts @@ -9,11 +9,20 @@ export type BaseConfig = { export type L1Config = BaseConfig & { lineaRollupAddress: string; + tokenBridgeAddress: string; + l1TokenAddress: string; }; export type BaseL2Config = BaseConfig & { l2MessageServiceAddress: string; - l2TestContractAddress: string; + l2TestContractAddress?: string; + besuNodeRpcUrl?: URL; + tokenBridgeAddress: string; + l2TokenAddress: string; + shomeiEndpoint?: URL; + shomeiFrontendEndpoint?: URL; + sequencerEndpoint?: URL; + transactionExclusionEndpoint?: URL; }; export type LocalL2Config = BaseL2Config & { diff --git a/e2e/src/l2.spec.ts b/e2e/src/l2.spec.ts index e506d145..651424cf 100644 --- a/e2e/src/l2.spec.ts +++ b/e2e/src/l2.spec.ts @@ -7,6 +7,8 @@ import { TRANSACTION_CALLDATA_LIMIT } from "./common/constants"; const l2AccountManager = config.getL2AccountManager(); describe("Layer 2 test suite", () => { + const l2Provider = config.getL2Provider(); + it.concurrent("Should revert if transaction data size is above the limit", async () => { const account = await l2AccountManager.generateAccount(); const dummyContract = config.getL2DummyContract(account); @@ -19,8 +21,14 @@ describe("Layer 2 test suite", () => { it.concurrent("Should succeed if transaction data size is below the limit", async () => { const account = await l2AccountManager.generateAccount(); const dummyContract = config.getL2DummyContract(account); + const nonce = await l2Provider.getTransactionCount(account.address, "pending"); + const { maxPriorityFeePerGas, maxFeePerGas } = await l2Provider.getFeeData(); - const tx = await dummyContract.connect(account).setPayload(ethers.randomBytes(1000)); + const tx = await dummyContract.connect(account).setPayload(ethers.randomBytes(1000), { + nonce: nonce, + maxPriorityFeePerGas: maxPriorityFeePerGas, + maxFeePerGas: maxFeePerGas, + }); const receipt = await tx.wait(); expect(receipt?.status).toEqual(1);