Skip to content

Commit

Permalink
Merge pull request #157 from Reinis-FRP/core-networks
Browse files Browse the repository at this point in the history
feat: core networks for osnap
  • Loading branch information
auryn-macmillan committed Feb 26, 2024
2 parents a12f2c3 + 2a03742 commit 7bfaef6
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 7 deletions.
26 changes: 26 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ export default {
...sharedNetworkConfig,
url: `https://linea-goerli.infura.io/v3/${INFURA_KEY}`,
},
core: {
...sharedNetworkConfig,
url: "https://rpc.coredao.org",
},
coreTestnet: {
...sharedNetworkConfig,
url: "https://rpc.test.btcs.network",
},
},
namedAccounts: {
deployer: 0,
Expand All @@ -119,5 +127,23 @@ export default {
},
etherscan: {
apiKey: ETHERSCAN_API_KEY,
customChains: [
{
network: "coreTestnet",
chainId: 1115,
urls: {
apiURL: "https://api.test.btcs.network/api",
browserURL: "https://scan.test.btcs.network/",
},
},
{
network: "core",
chainId: 1116,
urls: {
apiURL: "https://openapi.coredao.org/api",
browserURL: "https://scan.coredao.org/",
},
},
],
},
};
14 changes: 14 additions & 0 deletions sdk/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export enum SupportedNetworks {
HardhatNetwork = 31337,
LineaGoerli = 59140,
Sepolia = 11155111,
CoreTestnet = 1115,
Core = 1116,
}

// const canonicalMasterCopyAddress = (contract: KnownContracts) => {
Expand Down Expand Up @@ -215,6 +217,18 @@ export const ContractVersions: Record<
},
[SupportedNetworks.LineaGoerli]: CanonicalAddresses,
[SupportedNetworks.Sepolia]: CanonicalAddresses,
[SupportedNetworks.CoreTestnet]: {
...CanonicalAddresses,
[KnownContracts.OPTIMISTIC_GOVERNOR]: {
"1.2.0": "0xD43463Fadd73373bE260b67F5825274F4403dAF0",
},
},
[SupportedNetworks.Core]: {
...CanonicalAddresses,
[KnownContracts.OPTIMISTIC_GOVERNOR]: {
"1.2.0": "0x596Fd6A5A185c67aBD1c845b39f593fBA9C233aa",
},
},
};

/** Addresses of the head versions of all contracts */
Expand Down
2 changes: 1 addition & 1 deletion sdk/factory/mastercopyDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const deployMastercopyWithInitData = async (
const initCodeHash = keccak256(initCode);

const computedTargetAddress = getCreate2Address(
await singletonFactory.address(),
await singletonFactory.getAddress(),
salt,
initCodeHash
);
Expand Down
10 changes: 6 additions & 4 deletions sdk/factory/singletonFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ export const getSingletonFactory = async (
"Singleton factory is not deployed on this chain. Deploying singleton factory..."
);
// fund the singleton factory deployer account
await signer.sendTransaction({
to: singletonDeployer,
value: parseEther("0.0247"),
});
await (
await signer.sendTransaction({
to: singletonDeployer,
value: parseEther("0.0247"),
})
).wait();

// deploy the singleton factory
await (
Expand Down
2 changes: 1 addition & 1 deletion tasks/deploy-replay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const deploy = async (_: unknown, hre: HardhatRuntimeEnvironment) => {
console.log(`\n\x1B[4m\x1B[1m${hre.network.name}\x1B[0m`);

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

Expand Down
2 changes: 1 addition & 1 deletion tasks/singleton-deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const deploy = async (_: unknown, hre: HardhatRuntimeEnvironment) => {
}

const [deployer] = await hre.ethers.getSigners();
await deployModuleFactory(hre.ethers.provider.getSigner(deployer.address));
await deployModuleFactory(await hre.ethers.provider.getSigner(deployer.address));
};

task(
Expand Down

0 comments on commit 7bfaef6

Please sign in to comment.