Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion deploy/004_deploy_arbitrum_adapter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { CHAIN_IDs } from "@across-protocol/constants";
import { getOftEid, toWei } from "../utils/utils";
import { L1_ADDRESS_MAP, USDC } from "./consts";
import { getDeployedAddress } from "../src/DeploymentUtils";
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

Expand All @@ -16,14 +17,15 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

const oftDstEid = getOftEid(spokeChainId);
const oftFeeCap = toWei("1"); // 1 eth transfer fee cap
const adapterStore = getDeployedAddress("AdapterStore", chainId);

const args = [
L1_ADDRESS_MAP[chainId].l1ArbitrumInbox,
L1_ADDRESS_MAP[chainId].l1ERC20GatewayRouter,
l2RefundAddress,
USDC[chainId],
L1_ADDRESS_MAP[chainId].cctpTokenMessenger,
L1_ADDRESS_MAP[chainId].adapterStore,
adapterStore,
oftDstEid,
oftFeeCap,
];
Expand Down
4 changes: 3 additions & 1 deletion deploy/009_deploy_polygon_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
import { CHAIN_IDs, TOKEN_SYMBOLS_MAP } from "../utils";
import { getOftEid, toWei } from "../utils/utils";
import { L1_ADDRESS_MAP, USDC, WETH } from "./consts";
import { getDeployedAddress } from "../src/DeploymentUtils";

const MATIC = TOKEN_SYMBOLS_MAP.MATIC.addresses;

Expand All @@ -14,6 +15,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

const oftDstEid = getOftEid(spokeChainId);
const oftFeeCap = toWei("1"); // 1 eth transfer fee cap
const adapterStore = getDeployedAddress("AdapterStore", chainId);

const args = [
L1_ADDRESS_MAP[chainId].polygonRootChainManager,
Expand All @@ -24,7 +26,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
WETH[chainId],
USDC[chainId],
L1_ADDRESS_MAP[chainId].cctpTokenMessenger,
L1_ADDRESS_MAP[chainId].adapterStore,
adapterStore,
oftDstEid,
oftFeeCap,
];
Expand Down
10 changes: 6 additions & 4 deletions deploy/110_deploy_universal_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { CIRCLE_DOMAIN_IDs, L1_ADDRESS_MAP, USDC, ZERO_ADDRESS } from "./consts"
import { CCTP_NO_DOMAIN } from "@across-protocol/constants";
import { CIRCLE_UNINITIALIZED_DOMAIN_ID } from "./consts";
import assert from "assert";
import { getDeployedAddress } from "../src/DeploymentUtils";

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { SPOKE_CHAIN_ID } = process.env;
Expand All @@ -15,23 +16,24 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

// Warning: re-using the same HubPoolStore for different L2's is only safe if the L2 spoke pools have
// unique addresses, since the relayed message `targets` are part of the unique data hash.
const hubPoolStore = await hre.deployments.get("HubPoolStore");
const hubPoolStore = getDeployedAddress("HubPoolStore", chainId);

// todo: implement similar treatment to `CIRCLE_DOMAIN_IDs`
const oftDstEid = getOftEid(Number(SPOKE_CHAIN_ID));
const oftFeeCap = toWei("1"); // 1 eth transfer fee cap
const adapterStore = getDeployedAddress("AdapterStore", chainId);

const cctpDomainId = CIRCLE_DOMAIN_IDs[Number(SPOKE_CHAIN_ID)] ?? CCTP_NO_DOMAIN;
const args = [
hubPoolStore.address,
hubPoolStore,
USDC[chainId],
cctpDomainId === CCTP_NO_DOMAIN ? ZERO_ADDRESS : L1_ADDRESS_MAP[chainId].cctpTokenMessenger,
cctpDomainId === CCTP_NO_DOMAIN ? CIRCLE_UNINITIALIZED_DOMAIN_ID : cctpDomainId,
L1_ADDRESS_MAP[chainId].adapterStore,
adapterStore,
oftDstEid,
oftFeeCap,
];
const instance = await deployments.deploy("Universal_Adapter", {
const instance = await hre.deployments.deploy("Universal_Adapter", {
from: deployer,
log: true,
skipIfAlreadyDeployed: false,
Expand Down
9 changes: 6 additions & 3 deletions deploy/111_deploy_universal_spokepool.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { deployNewProxy, getSpokePoolDeploymentInfo } from "../utils/utils.hre";
import { FILL_DEADLINE_BUFFER, L1_ADDRESS_MAP, L2_ADDRESS_MAP, QUOTE_TIME_BUFFER, USDC, ZERO_ADDRESS } from "./consts";
import { FILL_DEADLINE_BUFFER, L2_ADDRESS_MAP, QUOTE_TIME_BUFFER, USDC, ZERO_ADDRESS } from "./consts";
import { CHAIN_IDs, PRODUCTION_NETWORKS, TOKEN_SYMBOLS_MAP } from "../utils/constants";
import { getOftEid, toWei } from "../utils/utils";
import { getDeployedAddress } from "../src/DeploymentUtils";

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { hubPool, hubChainId, spokeChainId } = await getSpokePoolDeploymentInfo(hre);
Expand All @@ -30,10 +31,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
// ! Notice. Deployed has to adjust this fee cap based on dst chain's native token. 4.4 BNB for BSC
const oftFeeCap = toWei(4.4); // ~1 ETH fee cap

const heliosAddress = getDeployedAddress("Helios", spokeChainId);

const constructorArgs = [
24 * 60 * 60, // 1 day; Helios latest head timestamp must be 1 day old before an admin can force execute a message.
L2_ADDRESS_MAP[spokeChainId]?.helios,
L1_ADDRESS_MAP[CHAIN_IDs.MAINNET]?.hubPoolStore,
heliosAddress,
getDeployedAddress("HubPoolStore", hubChainId),
expectedWrappedNative,
QUOTE_TIME_BUFFER,
FILL_DEADLINE_BUFFER,
Expand Down
3 changes: 0 additions & 3 deletions deploy/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ export const L1_ADDRESS_MAP: { [key: number]: { [contractName: string]: string }
l1AlephZeroInbox: "0x56D8EC76a421063e1907503aDd3794c395256AEb",
l1AlephZeroERC20GatewayRouter: "0xeBb17f398ed30d02F2e8733e7c1e5cf566e17812",
donationBox: "0x0d57392895Db5aF3280e9223323e20F3951E81B1",
adapterStore: "0x42df4D71f35ffBD28ae217d52E83C1DA0007D63b",
hubPoolStore: "0x1Ace3BbD69b63063F859514Eca29C9BDd8310E61",
zkBridgeHub: "0x303a465B659cBB0ab36eE643eA362c509EEb5213",
zkUsdcSharedBridge_232: "0xf553E6D903AA43420ED7e3bc2313bE9286A8F987",
zkUsdcSharedBridge_324: "0xD7f9f54194C633F36CCD5F3da84ad4a1c38cB2cB", // This is the standard shared bridge contract.
Expand Down Expand Up @@ -184,7 +182,6 @@ export const L2_ADDRESS_MAP: { [key: number]: { [contractName: string]: string }
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
},
[CHAIN_IDs.BSC]: {
helios: "0xE58480CA74f1A819faFd777BEDED4E2D5629943d",
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
},
[CHAIN_IDs.POLYGON]: {
Expand Down
4 changes: 3 additions & 1 deletion deployments/deployments.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"1": {
"AcrossConfigStore": { "address": "0x3B03509645713718B78951126E0A6de6f10043f5", "blockNumber": 14717196 },
"AcrossMerkleDistributor": { "address": "0xE50b2cEAC4f60E840Ae513924033E753e2366487", "blockNumber": 15976846 },
"AdapterStore": { "address": "0x42df4D71f35ffBD28ae217d52E83C1DA0007D63b", "blockNumber": 23086526 },
"Arbitrum_Adapter": { "address": "0x5eC9844936875E27eBF22172f4d92E107D35B57C", "blockNumber": 23086601 },
"Arbitrum_RescueAdapter": { "address": "0xC6fA0a4EBd802c01157d6E7fB1bbd2ae196ae375", "blockNumber": 16233939 },
"Arbitrum_SendTokensAdapter": { "address": "0xC06A68DF12376271817FcEBfb45Be996B0e1593E", "blockNumber": 16691987 },
Expand Down Expand Up @@ -55,7 +56,8 @@
"SpokePool": { "address": "0x4e8E101924eDE233C13e2D8622DC8aED2872d505", "blockNumber": 48762335 },
"SpokePoolVerifier": { "address": "0x3Fb9cED51E968594C87963a371Ed90c39519f65A", "blockNumber": 49157612 },
"MulticallHandler": { "address": "0xAC537C12fE8f544D712d71ED4376a502EEa944d7", "blockNumber": 48762440 },
"SpokePoolPeriphery": { "address": "0x89415a82d909a7238d69094C3Dd1dCC1aCbDa85C", "blockNumber": 52135703 }
"SpokePoolPeriphery": { "address": "0x89415a82d909a7238d69094C3Dd1dCC1aCbDa85C", "blockNumber": 52135703 },
"Helios": { "address": "0xE58480CA74f1A819faFd777BEDED4E2D5629943d", "blockNumber": 59344945 }
},
"137": {
"MintableERC1155": { "address": "0xA15a90E7936A2F8B70E181E955760860D133e56B", "blockNumber": 40600414 },
Expand Down
Loading