Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

More deploy targets #183

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
25 changes: 25 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,31 @@ const config: HardhatUserConfig = {
accounts:
process.env.DEPLOY_KEY !== undefined ? [process.env.DEPLOY_KEY] : [],
},
goerli: {
url: "https://goerli.blockpi.network/v1/rpc/public",
accounts:
process.env.DEPLOY_KEY !== undefined ? [process.env.DEPLOY_KEY] : [],
},
sepolia: {
url: "https://eth-sepolia.public.blastapi.io",
accounts:
process.env.DEPLOY_KEY !== undefined ? [process.env.DEPLOY_KEY] : [],
},
mantle: {
url: "https://rpc.testnet.mantle.xyz",
accounts:
process.env.DEPLOY_KEY !== undefined ? [process.env.DEPLOY_KEY] : [],
},
optimism: {
url: "https://optimism-goerli.public.blastapi.io",
accounts:
process.env.DEPLOY_KEY !== undefined ? [process.env.DEPLOY_KEY] : [],
},
filecoin: {
url: "https://api.calibration.node.glif.io/rpc/v1",
accounts:
process.env.DEPLOY_KEY !== undefined ? [process.env.DEPLOY_KEY] : [],
},
// Used for testing
hardhat: {
chainId:
Expand Down
20 changes: 13 additions & 7 deletions scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const deployFunc = async function (): Promise<void> {
hardhatFundedAccount.address,
);
console.log(
`Deployer (${hardhatFundedAccount.address}) starting balance ${startingBalance}`,
`Deployer (${
hardhatFundedAccount.address
}) starting balance ${ethers.formatEther(startingBalance)} ETH`,
);
console.log("Starting deployment...");

Expand All @@ -20,38 +22,42 @@ const deployFunc = async function (): Promise<void> {

const entryPointDeployer = await ethers.getContractFactory("EntryPoint");
const entrypoint = await entryPointDeployer.deploy();
await entrypoint.waitForDeployment();

const walletDeployer = await ethers.getContractFactory("SCBridgeWallet");
console.log("EntryPoint deployed to:", await entrypoint.getAddress());
console.log("EntryPoint deploying to:", await entrypoint.getAddress());

const aliceWallet = await walletDeployer.deploy(
aliceAddress,
ireneAddress,
await entrypoint.getAddress(),
);
await aliceWallet.waitForDeployment();
console.log(
`Alice (${aliceAddress?.slice(
0,
12,
)}) SCBridgeWallet deployed to: ${await aliceWallet.getAddress()}`,
)}) SCBridgeWallet deploying to: ${await aliceWallet.getAddress()}`,
);

const bobWallet = await walletDeployer.deploy(
bobAddress,
ireneAddress,
await entrypoint.getAddress(),
);
await bobWallet.waitForDeployment();

console.log(
`Bob (${bobAddress?.slice(
0,
12,
)}) SCBridgeWallet deployed to: ${await bobWallet.getAddress()}`,
)}) SCBridgeWallet deploying to: ${await bobWallet.getAddress()}`,
);

await Promise.all([
bobWallet.waitForDeployment(),
aliceWallet.waitForDeployment(),
entrypoint.waitForDeployment(),
]);

console.log("All contracts deployed");
const initialFunding = BigInt(process.env.VITE_SCW_DEPOSIT ?? "");
await fund(
[
Expand Down
7 changes: 7 additions & 0 deletions src/ChainLogo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import React from "react";
import ScrollLogo from "./assets/scroll-logo.svg";
import PolygonLogo from "./assets/polygon-logo.svg";
import MantleLogo from "./assets/mantle-logo.svg";
import FilecoinLogo from "./assets/filecoin-logo.svg";

import { type ChainName } from "./chains";

export const ChainLogo: React.FunctionComponent<{
Expand All @@ -14,5 +17,9 @@ export const ChainLogo: React.FunctionComponent<{
return <img src={PolygonLogo} height={40} />;
case "scroll":
return <img src={ScrollLogo} height={40} />;
case "filecoin":
return <img src={FilecoinLogo} height={40} />;
case "mantle":
return <img src={MantleLogo} height={40} />;
}
};
27 changes: 27 additions & 0 deletions src/assets/filecoin-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions src/assets/mantle-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 46 additions & 1 deletion src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ export type ChainName =
| "Hardhat A"
| "Hardhat B"
| "Polygon zkEVM Testnet"
| "scroll";
| "scroll"
| "goerli"
| "sepolia"
| "mantle"
| "optimism"
| "filecoin";

export interface ChainData {
/**
Expand Down Expand Up @@ -67,4 +72,44 @@ export const chains: ChainData[] = [
explorer: "https://sepolia.scrollscan.com/address/",
exchangeRate: 1,
},
{
chainID: 5n,
symbol: "ETH",
name: "goerli",
explorer: "https://goerli.etherscan.io",
exchangeRate: 1,
url: "https://goerli.blockpi.network/v1/rpc/public",
},
{
chainID: 11155111n,
symbol: "ETH",
name: "sepolia",
explorer: "https://sepolia.etherscan.io",
exchangeRate: 1,
url: "https://eth-sepolia.public.blastapi.io",
},
{
chainID: 5001n,
symbol: "MNT",
name: "mantle",
explorer: "https://explorer.testnet.mantle.xyz",
exchangeRate: 1,
url: "https://rpc.testnet.mantle.xyz",
},
{
chainID: 420n,
symbol: "ETH",
name: "optimism",
url: "https://optimism-goerli.public.blastapi.io",
explorer: "https://goerli-optimism.etherscan.io",
exchangeRate: 1,
},
{
chainID: 314159n,
symbol: "TFIL",
name: "filecoin",
url: "https://filecoin-calibration.chainup.net/rpc/v1",
explorer: "https://calibration.filfox.info/en",
exchangeRate: 1,
},
];