From a76df239b3bd9a19c68508e95b2d0040ab85bb17 Mon Sep 17 00:00:00 2001 From: idyllsss <137248235+idyllsss@users.noreply.github.com> Date: Tue, 21 Nov 2023 17:26:13 +0800 Subject: [PATCH] update ERC20BridgedPermit deployment config --- hardhat.config.ts | 16 ++++++++++++++-- package-lock.json | 14 +++++++------- package.json | 5 ++++- test/bridge-executor/mantle.integration.test.ts | 4 ++-- test/mantle/bridging.e2e.test.ts | 4 ++-- test/mantle/managing-proxy.e2e.test.ts | 4 ++-- utils/mantle/deployment.ts | 6 +++--- utils/mantle/testing.ts | 4 ++-- utils/network.ts | 4 ++-- 9 files changed, 38 insertions(+), 23 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 39733424..6a5954d8 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -97,6 +97,7 @@ const config: HardhatUserConfig = { }, mnt_goerli_fork: { url: "http://localhost:9545", + }, }, gasReporter: { @@ -110,8 +111,19 @@ const config: HardhatUserConfig = { arbitrumGoerli: env.string("ETHERSCAN_API_KEY_ARB", ""), arbitrumOne: env.string("ETHERSCAN_API_KEY_ARB", ""), optimisticEthereum: env.string("ETHERSCAN_API_KEY_OPT", ""), - optimisticGoerli: env.string("ETHERSCAN_API_KEY_OPT", ""), - }, + mnt_goerli: env.string("ETHERSCAN_API_KEY_MNT", ""), + mnt_mainnet: env.string("ETHERSCAN_API_KEY_MNT", ""), + }, + customChains: [ + { + network: "mnt_mainnet", + chainId: 5000, + urls: { + apiURL: "https://explorer.mantle.xyz/api", + browserURL: "https://explorer.mantle.xyz/api?module=contract&action=verify" + } + } + ] }, typechain: { externalArtifacts: [ diff --git a/package-lock.json b/package-lock.json index 3c3a7744..b50b6443 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@eth-optimism/sdk": "3.0.0", "@ethersproject/providers": "^5.6.8", "@lidofinance/evm-script-decoder": "^0.2.2", - "@mantleio/sdk": "^0.2.1", + "@mantleio/sdk": "^0.2.2", "@openzeppelin/contracts": "4.6.0", "chalk": "4.1.2" }, @@ -1524,9 +1524,9 @@ } }, "node_modules/@mantleio/sdk": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@mantleio/sdk/-/sdk-0.2.1.tgz", - "integrity": "sha512-bPC3eHEsRHSPAVv4EGC6lY43btiMaEK0e39yArz9LBtub8EkxyokDnD+XLdaeQrL8flucTH5DRcZAanqn9bq4g==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@mantleio/sdk/-/sdk-0.2.2.tgz", + "integrity": "sha512-mmMGDG09GFpcWu/qPhJ18cU1N7m+qI7d5leykNoITw9Gwn70oGor9oDoH4ZtFfRe8W0XjP2jo0nGafS7FvOWJg==", "dependencies": { "@mantleio/contracts": "0.2.1", "@mantleio/core-utils": "0.1.0", @@ -25922,9 +25922,9 @@ } }, "@mantleio/sdk": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@mantleio/sdk/-/sdk-0.2.1.tgz", - "integrity": "sha512-bPC3eHEsRHSPAVv4EGC6lY43btiMaEK0e39yArz9LBtub8EkxyokDnD+XLdaeQrL8flucTH5DRcZAanqn9bq4g==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@mantleio/sdk/-/sdk-0.2.2.tgz", + "integrity": "sha512-mmMGDG09GFpcWu/qPhJ18cU1N7m+qI7d5leykNoITw9Gwn70oGor9oDoH4ZtFfRe8W0XjP2jo0nGafS7FvOWJg==", "requires": { "@mantleio/contracts": "0.2.1", "@mantleio/core-utils": "0.1.0", diff --git a/package.json b/package.json index ed6362f9..1ff6d214 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,8 @@ "fork:arb:mainnet": "hardhat node:fork arb_mainnet 8546", "fork:opt:goerli": "hardhat node:fork opt_goerli 9545", "fork:opt:mainnet": "hardhat node:fork opt_mainnet 9545", + "fork:mnt:goerli": "hardhat node:fork mnt_goerli 9545", + "fork:mnt:mainnet": "hardhat node:fork mnt_mainnet 9545", "arbitrum:deploy": "ts-node --files ./scripts/arbitrum/deploy-gateway.ts", "arbitrum:finalize-message": "ts-node --files ./scripts/arbitrum/finalize-message.ts", "arbitrum:test:e2e": "hardhat test ./test/arbitrum/*.e2e.test.ts", @@ -33,6 +35,7 @@ "optimism:test:executor": "hardhat test ./test/bridge-executor/optimism.integration.test.ts", "optimism:test:launch": "REVERT=false hardhat test ./test/optimism/{_launch.test.ts,bridging.integration.test.ts}", "mantle:deploy": "ts-node --files ./scripts/mantle/deploy-bridge.ts", + "mantle:test:permit": "hardhat test ./test/token/ERC20BridgedPermit.unit.test.ts", "mantle:finalize-message": "ts-node --files ./scripts/mantle/finalize-message.ts", "mantle:test:e2e": "hardhat test ./test/mantle/*.e2e.test.ts", "mantle:test:bridginge2e": "hardhat test ./test/mantle/bridging.e2e.test.ts", @@ -82,7 +85,7 @@ "@eth-optimism/sdk": "3.0.0", "@ethersproject/providers": "^5.6.8", "@lidofinance/evm-script-decoder": "^0.2.2", - "@mantleio/sdk": "^0.2.1", + "@mantleio/sdk": "^0.2.2", "@openzeppelin/contracts": "4.6.0", "chalk": "4.1.2" } diff --git a/test/bridge-executor/mantle.integration.test.ts b/test/bridge-executor/mantle.integration.test.ts index 3696c9dc..21400185 100644 --- a/test/bridge-executor/mantle.integration.test.ts +++ b/test/bridge-executor/mantle.integration.test.ts @@ -4,7 +4,7 @@ import { L2ERC20TokenBridge__factory, OssifiableProxy__factory, MantleBridgeExecutor__factory, - ERC20Bridged__factory, + ERC20BridgedPermit__factory, } from "../../typechain"; import { wei } from "../../utils/wei"; import mantle from "../../utils/mantle"; @@ -248,7 +248,7 @@ async function ctxFactory() { await l2DeployScript.run(); - const l2Token = ERC20Bridged__factory.connect( + const l2Token = ERC20BridgedPermit__factory.connect( l2DeployScript.getContractAddress(1), l2Deployer ); diff --git a/test/mantle/bridging.e2e.test.ts b/test/mantle/bridging.e2e.test.ts index 1a2d5301..c6d10ed4 100644 --- a/test/mantle/bridging.e2e.test.ts +++ b/test/mantle/bridging.e2e.test.ts @@ -126,8 +126,8 @@ async function ctxFactory() { const testingSetup = await mantle.testing(networkName).getE2ETestSetup(); return { - depositAmount: wei`0.0025 ether`, - withdrawalAmount: wei`0.0025 ether`, + depositAmount: wei`0.000025 ether`, + withdrawalAmount: wei`0.0000025 ether`, l1Tester: testingSetup.l1Tester, l1Token: testingSetup.l1Token, l2Token: testingSetup.l2Token, diff --git a/test/mantle/managing-proxy.e2e.test.ts b/test/mantle/managing-proxy.e2e.test.ts index ff6e27f7..504f3c00 100644 --- a/test/mantle/managing-proxy.e2e.test.ts +++ b/test/mantle/managing-proxy.e2e.test.ts @@ -2,7 +2,7 @@ import { assert } from "chai"; import { TransactionResponse } from "@ethersproject/providers"; import { - ERC20Bridged__factory, + ERC20BridgedPermit__factory, GovBridgeExecutor__factory, OssifiableProxy__factory, L2ERC20TokenBridge__factory, @@ -200,7 +200,7 @@ async function ctxFactory() { l1Tester, l2Tester, l1LDOHolder, - l2Token: ERC20Bridged__factory.connect( + l2Token: ERC20BridgedPermit__factory.connect( E2E_TEST_CONTRACTS.l2.l2Token, l2Tester ), diff --git a/utils/mantle/deployment.ts b/utils/mantle/deployment.ts index 4a536032..4082077b 100644 --- a/utils/mantle/deployment.ts +++ b/utils/mantle/deployment.ts @@ -1,7 +1,7 @@ import { assert } from "chai"; import { Overrides, Wallet } from "ethers"; import { - ERC20Bridged__factory, + ERC20BridgedPermit__factory, IERC20Metadata__factory, L1ERC20TokenBridge__factory, L2ERC20TokenBridge__factory, @@ -97,7 +97,7 @@ export default function deployment( options?.logger ) .addStep({ - factory: ERC20Bridged__factory, + factory: ERC20BridgedPermit__factory, args: [ l2TokenName, l2TokenSymbol, @@ -113,7 +113,7 @@ export default function deployment( args: [ expectedL2TokenImplAddress, l2Params.admins.proxy, - ERC20Bridged__factory.createInterface().encodeFunctionData( + ERC20BridgedPermit__factory.createInterface().encodeFunctionData( "initialize", [l2TokenName, l2TokenSymbol] ), diff --git a/utils/mantle/testing.ts b/utils/mantle/testing.ts index 73d87ffb..05fc884a 100644 --- a/utils/mantle/testing.ts +++ b/utils/mantle/testing.ts @@ -7,7 +7,7 @@ import { IERC20__factory, L1ERC20TokenBridge, L2ERC20TokenBridge, - ERC20Bridged__factory, + ERC20BridgedPermit__factory, ERC20BridgedStub__factory, L1ERC20TokenBridge__factory, L2ERC20TokenBridge__factory, @@ -254,7 +254,7 @@ function connectBridgeContracts( addresses.l2ERC20TokenBridge, mntSignerOrProvider ); - const l2Token = ERC20Bridged__factory.connect( + const l2Token = ERC20BridgedPermit__factory.connect( addresses.l2Token, mntSignerOrProvider ); diff --git a/utils/network.ts b/utils/network.ts index 65bab605..4a84a115 100644 --- a/utils/network.ts +++ b/utils/network.ts @@ -163,8 +163,8 @@ function getBlockExplorerBaseUrlByChainId(chainId: number) { // forked node 31337: "https://etherscan.io", // mantle - 5000: "https://rpc.mantle.xyz", - 5001: "https://blockscout.com/mantle/goerli" + 5000: "https://explorer.mantle.xyz/", + 5001: "https://explorer.testnet.mantle.xyz/" }; return baseUrlByChainId[chainId]; }