Skip to content

Commit

Permalink
adding sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
jfschwarz committed Aug 1, 2023
1 parent 202c097 commit eb77523
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 31 deletions.
3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
6 changes: 5 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if (PK) {
}

if (
["mainnet", "goerli", "ropsten"].includes(network) &&
["mainnet", "goerli", "sepolia", "ropsten"].includes(network) &&
INFURA_KEY === undefined
) {
throw new Error(
Expand Down Expand Up @@ -77,6 +77,10 @@ export default {
...sharedNetworkConfig,
url: `https://goerli.infura.io/v3/${INFURA_KEY}`,
},
sepolia: {
...sharedNetworkConfig,
url: `https://sepolia.infura.io/v3/${INFURA_KEY}`,
},
arbitrum: {
...sharedNetworkConfig,
url: `https://arb-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}`,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"build": "hardhat compile",
"build:sdk": "rm -rf dist && yarn generate:types && tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json",
"clean": "rm -rf dist build typechain-types",
"deploy": "hardhat singleton-deployment --network",
"deploy:factory": "hardhat singleton-deployment --network",
"deploy": "hardhat deploy-replay",
"test:sdk": "hardhat test ./sdk/factory/__tests__/index.spec.ts",
"test": "hardhat test && yarn test:sdk",
"coverage": "hardhat coverage",
Expand Down
2 changes: 2 additions & 0 deletions sdk/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export enum SupportedNetworks {
BinanceSmartChain = 56,
HardhatNetwork = 31337,
LineaGoerli = 59140,
Sepolia = 11155111,
}

// const canonicalMasterCopyAddress = (contract: KnownContracts) => {
Expand Down Expand Up @@ -217,6 +218,7 @@ export const ContractVersions: Record<
},
},
[SupportedNetworks.LineaGoerli]: CanonicalAddresses,
[SupportedNetworks.Sepolia]: CanonicalAddresses,
};

/** Addresses of the head versions of all contracts */
Expand Down
56 changes: 28 additions & 28 deletions tasks/deploy-replay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,38 @@ export const deploy = async (
for (const network of networkList) {
console.log(`\n\x1B[4m\x1B[1m${network.toUpperCase()}\x1B[0m`);

try {
hre.changeNetwork(network);
const [deployer] = await hre.ethers.getSigners();
const signer = hre.ethers.provider.getSigner(deployer.address);
for (let index = 0; index < contracts.length; index++) {
const initData: InitData | undefined =
MasterCopyInitData[contracts[index]];
// try {
hre.changeNetwork(network);
const [deployer] = await hre.ethers.getSigners();
const signer = hre.ethers.provider.getSigner(deployer.address);
for (let index = 0; index < contracts.length; index++) {
const initData: InitData | undefined =
MasterCopyInitData[contracts[index]];

if (initData && initData.initCode && initData.salt) {
console.log(` \x1B[4m${contracts[index]}\x1B[0m`);
try {
await deployMastercopyWithInitData(
signer,
initData.initCode,
initData.salt
);
} catch (error: any) {
console.log(
` \x1B[31m✘ Deployment failed:\x1B[0m ${
error?.reason || error
}`
);
}
if (initData && initData.initCode && initData.salt) {
console.log(` \x1B[4m${contracts[index]}\x1B[0m`);
try {
await deployMastercopyWithInitData(
signer,
initData.initCode,
initData.salt
);
} catch (error: any) {
console.log(
` \x1B[31m✘ Deployment failed:\x1B[0m ${
error?.reason || error
}`
);
}
}
} catch (error: any) {
console.log(
` \x1B[31m✘ Network skipped because:\x1B[0m ${
error?.reason || error
}`
);
}
// } catch (error: any) {
// console.log(
// ` \x1B[31m✘ Network skipped because:\x1B[0m ${
// error?.reason || error
// }`
// );
// }
}
};

Expand Down
2 changes: 1 addition & 1 deletion tasks/singleton-deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const deploy = async (_: null, hre: HardhatRuntimeEnvironment) => {
const Factory = await hre.ethers.getContractFactory("ModuleProxyFactory");
if (Factory.bytecode !== FactoryInitCode) {
console.warn(
" The compiled Module Proxy Factory (from src/factory/contracts.ts) is outdated, it does " +
" The compiled Module Proxy Factory is outdated, it does " +
"not match the bytecode stored at MasterCopyInitData[KnownContracts.FACTORY].initCode"
);
}
Expand Down

0 comments on commit eb77523

Please sign in to comment.