Skip to content

Commit 57edc75

Browse files
authored
feat: Deploy Polygon CCTP enabled contracts (#493)
* feat: Deploy Polygon CCTP enabled contracts * Eth spoke pool 0x08C21b200eD06D2e32cEC91a770C3FcA8aD5F877 * add zksync * Update 016_deploy_zksync_spokepool.ts * Update Linea_SpokePool.json * deploy optimism spoke pool * Base spoke pool depoyed * Update 013_deploy_boba_spokepool.ts * Update 011_deploy_polygon_spokepool.ts * new arbitrum spoke * new adapters * flattened contracts * fix * Update polygon adapter * Add base adapter * Add arbitrum adapter * Add optimism adapter
1 parent 0e0905f commit 57edc75

29 files changed

+4872
-466
lines changed
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ZERO_ADDRESS } from "@uma/common";
21
import { L1_ADDRESS_MAP } from "./consts";
32
import { DeployFunction } from "hardhat-deploy/types";
43
import { HardhatRuntimeEnvironment } from "hardhat/types";
@@ -11,23 +10,21 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
1110

1211
const chainId = parseInt(await getChainId());
1312

14-
await deploy("Optimism_Adapter", {
13+
const args = [
14+
L1_ADDRESS_MAP[chainId].weth,
15+
L1_ADDRESS_MAP[chainId].optimismCrossDomainMessenger,
16+
L1_ADDRESS_MAP[chainId].optimismStandardBridge,
17+
L1_ADDRESS_MAP[chainId].usdc,
18+
L1_ADDRESS_MAP[chainId].cctpTokenMessenger,
19+
];
20+
const instance = await deploy("Optimism_Adapter", {
1521
from: deployer,
1622
log: true,
1723
skipIfAlreadyDeployed: true,
18-
args: [
19-
L1_ADDRESS_MAP[chainId].weth,
20-
L1_ADDRESS_MAP[chainId].optimismCrossDomainMessenger,
21-
L1_ADDRESS_MAP[chainId].optimismStandardBridge,
22-
L1_ADDRESS_MAP[chainId].usdc,
23-
// L1_ADDRESS_MAP[chainId].cctpTokenMessenger,
24-
// For now, we are not using the CCTP bridge and can disable by setting
25-
// the cctpTokenMessenger to the zero address.
26-
ZERO_ADDRESS,
27-
],
24+
args: args,
2825
});
26+
await run("verify:verify", { address: instance.address, constructorArguments: args });
2927
};
3028

3129
module.exports = func;
32-
func.dependencies = ["HubPool"];
3330
func.tags = ["OptimismAdapter", "mainnet"];

deploy/003_deploy_optimism_spokepool.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { deployNewProxy, getSpokePoolDeploymentInfo } from "../utils/utils.hre";
22
import { DeployFunction } from "hardhat-deploy/types";
33
import { HardhatRuntimeEnvironment } from "hardhat/types";
44
import { L2_ADDRESS_MAP } from "./consts";
5-
import { ZERO_ADDRESS } from "@uma/common";
65

76
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
87
const { hubPool, spokeChainId } = await getSpokePoolDeploymentInfo(hre);
@@ -19,18 +18,15 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
1918
// Construct this spokepool with a:
2019
// * A WETH address of the WETH address
2120
// * A depositQuoteTimeBuffer of 1 hour
22-
// * A fillDeadlineBuffer of 8 hours
21+
// * A fillDeadlineBuffer of 6 hours
2322
// * Native USDC address on L2
2423
// * CCTP token messenger address on L2
2524
const constructorArgs = [
2625
"0x4200000000000000000000000000000000000006",
2726
3600,
2827
21600,
2928
L2_ADDRESS_MAP[spokeChainId].l2Usdc,
30-
// L2_ADDRESS_MAP[spokeChainId].cctpTokenMessenger,
31-
// For now, we are not using the CCTP bridge and can disable by setting
32-
// the cctpTokenMessenger to the zero address.
33-
ZERO_ADDRESS,
29+
L2_ADDRESS_MAP[spokeChainId].cctpTokenMessenger,
3430
];
3531
await deployNewProxy("Optimism_SpokePool", constructorArgs, initArgs, spokeChainId === 10);
3632
};

deploy/004_deploy_arbitrum_adapter.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ZERO_ADDRESS } from "@uma/common";
21
import { L1_ADDRESS_MAP } from "./consts";
32
import { DeployFunction } from "hardhat-deploy/types";
43
import { HardhatRuntimeEnvironment } from "hardhat/types";
@@ -15,7 +14,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
1514
// set to the Risk Labs relayer address. The deployer should change this if necessary.
1615
const l2RefundAddress = "0x428AB2BA90Eba0a4Be7aF34C9Ac451ab061AC010";
1716

18-
await deploy("Arbitrum_Adapter", {
17+
const args = [
18+
L1_ADDRESS_MAP[chainId].l1ArbitrumInbox,
19+
L1_ADDRESS_MAP[chainId].l1ERC20GatewayRouter,
20+
l2RefundAddress,
21+
L1_ADDRESS_MAP[chainId].usdc,
22+
L1_ADDRESS_MAP[chainId].cctpTokenMessenger,
23+
];
24+
const instance = await deploy("Arbitrum_Adapter", {
1925
from: deployer,
2026
log: true,
2127
skipIfAlreadyDeployed: true,
@@ -24,14 +30,11 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
2430
L1_ADDRESS_MAP[chainId].l1ERC20GatewayRouter,
2531
l2RefundAddress,
2632
L1_ADDRESS_MAP[chainId].usdc,
27-
// L1_ADDRESS_MAP[chainId].cctpTokenMessenger,
28-
// For now, we are not using the CCTP bridge and can disable by setting
29-
// the cctpTokenMessenger to the zero address.
30-
ZERO_ADDRESS,
33+
L1_ADDRESS_MAP[chainId].cctpTokenMessenger,
3134
],
3235
});
36+
await run("verify:verify", { address: instance.address, constructorArguments: args });
3337
};
3438

3539
module.exports = func;
36-
func.dependencies = ["HubPool"];
3740
func.tags = ["ArbitrumAdapter", "mainnet"];

deploy/005_deploy_arbitrum_spokepool.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { DeployFunction } from "hardhat-deploy/types";
22
import { L2_ADDRESS_MAP } from "./consts";
33
import { deployNewProxy, getSpokePoolDeploymentInfo } from "../utils/utils.hre";
44
import { HardhatRuntimeEnvironment } from "hardhat/types";
5-
import { ZERO_ADDRESS } from "@uma/common";
65

76
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
87
const { hubPool, spokeChainId } = await getSpokePoolDeploymentInfo(hre);
@@ -20,18 +19,15 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
2019
// Construct this spokepool with a:
2120
// * A WETH address of the WETH address
2221
// * A depositQuoteTimeBuffer of 1 hour
23-
// * A fillDeadlineBuffer of 8 hours
22+
// * A fillDeadlineBuffer of 6 hours
2423
// * Native USDC address on L2
2524
// * CCTP token messenger address on L2
2625
const constructorArgs = [
2726
L2_ADDRESS_MAP[spokeChainId].l2Weth,
2827
3600,
2928
21600,
3029
L2_ADDRESS_MAP[spokeChainId].l2Usdc,
31-
// L2_ADDRESS_MAP[spokeChainId].cctpTokenMessenger,
32-
// For now, we are not using the CCTP bridge and can disable by setting
33-
// the cctpTokenMessenger to the zero address.
34-
ZERO_ADDRESS,
30+
L2_ADDRESS_MAP[spokeChainId].cctpTokenMessenger,
3531
];
3632
await deployNewProxy("Arbitrum_SpokePool", constructorArgs, initArgs, spokeChainId === 42161);
3733
};

deploy/007_deploy_ethereum_spokepool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
1616
// Construct this spokepool with a:
1717
// * A WETH address of the WETH address
1818
// * A depositQuoteTimeBuffer of 1 hour
19-
// * A fillDeadlineBuffer of 8 hours
19+
// * A fillDeadlineBuffer of 6 hours
2020
const constructorArgs = [L1_ADDRESS_MAP[chainId].weth, 3600, 21600];
2121
await deployNewProxy("Ethereum_SpokePool", constructorArgs, initArgs, chainId === "1");
2222

deploy/009_deploy_polygon_adapter.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { DeployFunction } from "hardhat-deploy/types";
22
import { L1_ADDRESS_MAP } from "./consts";
33
import { HardhatRuntimeEnvironment } from "hardhat/types";
4-
import { ZERO_ADDRESS } from "@uma/common";
54

65
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
76
const { deployments, getNamedAccounts, getChainId } = hre;
@@ -11,24 +10,23 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
1110

1211
const chainId = parseInt(await getChainId());
1312

14-
await deploy("Polygon_Adapter", {
13+
const args = [
14+
L1_ADDRESS_MAP[chainId].polygonRootChainManager,
15+
L1_ADDRESS_MAP[chainId].polygonFxRoot,
16+
L1_ADDRESS_MAP[chainId].polygonDepositManager,
17+
L1_ADDRESS_MAP[chainId].polygonERC20Predicate,
18+
L1_ADDRESS_MAP[chainId].matic,
19+
L1_ADDRESS_MAP[chainId].weth,
20+
L1_ADDRESS_MAP[chainId].usdc,
21+
L1_ADDRESS_MAP[chainId].cctpTokenMessenger,
22+
];
23+
const instance = await deploy("Polygon_Adapter", {
1524
from: deployer,
1625
log: true,
1726
skipIfAlreadyDeployed: false,
18-
args: [
19-
L1_ADDRESS_MAP[chainId].polygonRootChainManager,
20-
L1_ADDRESS_MAP[chainId].polygonFxRoot,
21-
L1_ADDRESS_MAP[chainId].polygonDepositManager,
22-
L1_ADDRESS_MAP[chainId].polygonERC20Predicate,
23-
L1_ADDRESS_MAP[chainId].matic,
24-
L1_ADDRESS_MAP[chainId].weth,
25-
L1_ADDRESS_MAP[chainId].usdc,
26-
// L1_ADDRESS_MAP[chainId].cctpTokenMessenger,
27-
// For now, we are not using the CCTP bridge and can disable by setting
28-
// the cctpTokenMessenger to the zero address.
29-
ZERO_ADDRESS,
30-
],
27+
args,
3128
});
29+
await run("verify:verify", { address: instance.address, constructorArguments: args });
3230
};
3331

3432
module.exports = func;

deploy/011_deploy_polygon_spokepool.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { DeployFunction } from "hardhat-deploy/types";
22
import { L2_ADDRESS_MAP } from "./consts";
33
import { deployNewProxy, getSpokePoolDeploymentInfo } from "../utils/utils.hre";
44
import { HardhatRuntimeEnvironment } from "hardhat/types";
5-
import { ZERO_ADDRESS } from "@uma/common";
65

76
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
87
const { hubPool, spokeChainId } = await getSpokePoolDeploymentInfo(hre);
@@ -23,18 +22,15 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
2322
// Construct this spokepool with a:
2423
// * A WETH address of the WETH address
2524
// * A depositQuoteTimeBuffer of 1 hour
26-
// * A fillDeadlineBuffer of 8 hours
25+
// * A fillDeadlineBuffer of 6 hours
2726
// * Native USDC address on L2
2827
// * CCTP token messenger address on L2
2928
const constructorArgs = [
3029
L2_ADDRESS_MAP[spokeChainId].wMatic,
3130
3600,
3231
21600,
3332
L2_ADDRESS_MAP[spokeChainId].l2Usdc,
34-
// L2_ADDRESS_MAP[spokeChainId].cctpTokenMessenger,
35-
// For now, we are not using the CCTP bridge and can disable by setting
36-
// the cctpTokenMessenger to the zero address.
37-
ZERO_ADDRESS,
33+
L2_ADDRESS_MAP[spokeChainId].cctpTokenMessenger,
3834
];
3935
await deployNewProxy("Polygon_SpokePool", constructorArgs, initArgs, spokeChainId === 137);
4036
};

deploy/013_deploy_boba_spokepool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
1313
// Construct this spokepool with a:
1414
// * A WETH address of the WETH address
1515
// * A depositQuoteTimeBuffer of 1 hour
16-
// * A fillDeadlineBuffer of 9 hours
16+
// * A fillDeadlineBuffer of 6 hours
1717
const constructorArgs = ["0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000", 3600, 21600];
1818
await deployNewProxy("Boba_SpokePool", constructorArgs, initArgs);
1919
};

deploy/016_deploy_zksync_spokepool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
2626
// Construct this spokepool with a:
2727
// * A WETH address of the WETH address
2828
// * A depositQuoteTimeBuffer of 1 hour
29-
// * A fillDeadlineBuffer of 8 hours
29+
// * A fillDeadlineBuffer of 6 hours
3030
const constructorArgs = [L2_ADDRESS_MAP[spokeChainId].l2Weth, 3600, 21600];
3131

3232
let newAddress;

deploy/024_deploy_base_adapter.ts

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
1-
import { ZERO_ADDRESS } from "@uma/common";
21
import { L1_ADDRESS_MAP } from "./consts";
32
import { DeployFunction } from "hardhat-deploy/types";
43
import { HardhatRuntimeEnvironment } from "hardhat/types";
54

65
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
7-
const { deployments, getNamedAccounts, getChainId, network } = hre;
6+
const { deployments, getNamedAccounts, getChainId } = hre;
87
const { deploy } = deployments;
98

109
const { deployer } = await getNamedAccounts();
1110

1211
const chainId = parseInt(await getChainId());
1312

14-
await deploy("Base_Adapter", {
13+
const args = [
14+
L1_ADDRESS_MAP[chainId].weth,
15+
L1_ADDRESS_MAP[chainId].baseCrossDomainMessenger,
16+
L1_ADDRESS_MAP[chainId].baseStandardBridge,
17+
L1_ADDRESS_MAP[chainId].usdc,
18+
L1_ADDRESS_MAP[chainId].cctpTokenMessenger,
19+
];
20+
const instance = await deploy("Base_Adapter", {
1521
from: deployer,
1622
log: true,
1723
skipIfAlreadyDeployed: true,
18-
args: [
19-
L1_ADDRESS_MAP[chainId].weth,
20-
L1_ADDRESS_MAP[chainId].baseCrossDomainMessenger,
21-
L1_ADDRESS_MAP[chainId].baseStandardBridge,
22-
L1_ADDRESS_MAP[chainId].usdc,
23-
// L1_ADDRESS_MAP[chainId].cctpTokenMessenger,
24-
// For now, we are not using the CCTP bridge and can disable by setting
25-
// the cctpTokenMessenger to the zero address.
26-
ZERO_ADDRESS,
27-
],
24+
args,
2825
});
26+
await run("verify:verify", { address: instance.address, constructorArguments: args });
2927
};
3028

3129
module.exports = func;
32-
func.dependencies = ["HubPool"];
3330
func.tags = ["BaseAdapter", "mainnet"];

0 commit comments

Comments
 (0)