Skip to content

Commit

Permalink
chore: Deployment on mainnet (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
alainncls authored Sep 5, 2023
1 parent 892eabf commit 77a4e2b
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 26 deletions.
19 changes: 13 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ INFURA_KEY=
PRIVATE_KEY=0000000000000000000000000000000000000000000000000000000000000001
ETHERSCAN_API_KEY=

# Verax Config
ROUTER_ADDRESS=0x20e5B43cD2bb0EcC4771055736DA161AaE4D3bb6
PORTAL_REGISTRY_ADDRESS=0x1D4Aab8050b194e99aB476A5F9645c60a1CD9FD6
SCHEMA_REGISTRY_ADDRESS=0xe504b69AD3c1957Ed64949bA16F8dbCaA66BC783
MODULE_REGISTRY_ADDRESS=0xb78cED2B34e9E7760CE807905ffFBdbd2De36062
ATTESTATION_REGISTRY_ADDRESS=0xB1E9b1E8c75e698d048Fe92F42953c6E1646Ef90
# Verax Testnet Config
ROUTER_ADDRESS=0x98a6C094B8e804b84C619C3Eaf1DE523389F7039
PORTAL_REGISTRY_ADDRESS=0x83eEAA59D6d707d3044a7CB47E865c5Bf7375dB5
SCHEMA_REGISTRY_ADDRESS=0x7A977275E2D035295537c4f6322ED3D77e372C79
MODULE_REGISTRY_ADDRESS=0xc064DdB7CB99f279017043a18133E143740509Fa
ATTESTATION_REGISTRY_ADDRESS=0x05Bf06d3E7C02aa2F0FC54554a03696861348321

# Verax Mainnet Config
#ROUTER_ADDRESS=0x4d3a380A03f3a18A5dC44b01119839D8674a552E
#PORTAL_REGISTRY_ADDRESS=0xd5d61e4ECDf6d46A63BfdC262af92544DFc19083
#SCHEMA_REGISTRY_ADDRESS=0x0f95dCec4c7a93F2637eb13b655F2223ea036B59
#MODULE_REGISTRY_ADDRESS=0xf851513A732996F22542226341748f3C9978438f
#ATTESTATION_REGISTRY_ADDRESS=0x3de3893aa4Cdea029e84e75223a152FD08315138
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,38 @@ Transaction hash: 0x15b25752da1dfd458b92069248825ce959f5be104f974d62b4ae95050710

1. Check your `.env` file contains the address of the proxy for the contract you want to upgrade
2. Run `pnpm run upgrade:ContractName:goerli`, replacing `ContractName` with the contract you want to upgrade
3. Alternatively, you can upgrade all contracts at once via `pnpm run upgrade:all:goerli`

### On the Linea mainnet:

1. Check your `.env` file contains the address of the proxy for the contract you want to upgrade
2. Run `pnpm run upgrade:ContractName`, replacing `ContractName` with the contract you want to upgrade
3. Alternatively, you can upgrade all contracts at once via `pnpm run upgrade:all`

## Contracts addresses

### Testnet

- Router =
[0x736c78b2f2cBf4F921E8551b2acB6A5Edc9177D5](https://goerli.lineascan.build/address/0x736c78b2f2cBf4F921E8551b2acB6A5Edc9177D5)
- AttestationRegistry =
[0xC765F28096F6121C2F2b82D35A4346280164428b](https://goerli.lineascan.build/address/0xC765F28096F6121C2F2b82D35A4346280164428b)
- ModuleRegistry =
[0x1a20b2CFA134686306436D2c9f778D7eC6c43A43](https://goerli.lineascan.build/address/0x1a20b2CFA134686306436D2c9f778D7eC6c43A43)
- PortalRegistry =
[0x506f88a5Ca8D5F001f2909b029738A40042e42a6](https://goerli.lineascan.build/address/0x506f88a5Ca8D5F001f2909b029738A40042e42a6)
- SchemaRegistry =
[0xB2c4Da1f8F08A0CA25862509E5431289BE2b598B](https://goerli.lineascan.build/address/0xB2c4Da1f8F08A0CA25862509E5431289BE2b598B)

### Mainnet

- Router =
[0x4d3a380A03f3a18A5dC44b01119839D8674a552E](https://lineascan.build/address/0x4d3a380A03f3a18A5dC44b01119839D8674a552E)
- AttestationRegistry =
[0x3de3893aa4Cdea029e84e75223a152FD08315138](https://lineascan.build/address/0x3de3893aa4Cdea029e84e75223a152FD08315138)
- ModuleRegistry =
[0xf851513A732996F22542226341748f3C9978438f](https://lineascan.build/address/0xf851513A732996F22542226341748f3C9978438f)
- PortalRegistry =
[0xd5d61e4ECDf6d46A63BfdC262af92544DFc19083](https://lineascan.build/address/0xd5d61e4ECDf6d46A63BfdC262af92544DFc19083)
- SchemaRegistry =
[0x0f95dCec4c7a93F2637eb13b655F2223ea036B59](https://lineascan.build/address/0x0f95dCec4c7a93F2637eb13b655F2223ea036B59)
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@
"deploy:IncorrectModule:goerli": "npx hardhat run --network linea-goerli script/deploy/deployIncorrectModule.ts",
"deploy:MsgSenderModule": "npx hardhat run --network linea script/deploy/deployMsgSenderModule.ts",
"deploy:MsgSenderModule:goerli": "npx hardhat run --network linea-goerli script/deploy/deployMsgSenderModule.ts",
"deploy:all": "npx hardhat run --network linea script/deploy/deploySchemaRegistry.ts",
"deploy:all:goerli": "npx hardhat run --network linea-goerli script/deploy/deploySchemaRegistry.ts",
"deploy:all": "npx hardhat run --network linea script/deploy/deployEverything.ts",
"deploy:all:goerli": "npx hardhat run --network linea-goerli script/deploy/deployEverything.ts",
"lint": "pnpm lint:sol && pnpm prettier:check",
"lint:sol": "pnpm solhint \"{script,src,test}/**/*.sol\"",
"prepare": "husky install",
"prettier:check": "prettier --check \"**/*.{json,md,svg,yml,sol}\"",
"prettier:write": "prettier --write \"**/*.{json,md,svg,yml,sol}\"",
"test": "forge test",
"upgrade:all": "pnpm run upgrade:AttestationRegistry && pnpm run upgrade:ModuleRegistry && pnpm run upgrade:PortalRegistry && pnpm run upgrade:Router && pnpm run upgrade:SchemaRegistry",
"upgrade:all:goerli": "pnpm run upgrade:AttestationRegistry:goerli && pnpm run upgrade:ModuleRegistry:goerli && pnpm run upgrade:PortalRegistry:goerli && pnpm run upgrade:Router:goerli && pnpm run upgrade:SchemaRegistry:goerli",
"upgrade:AttestationRegistry": "npx hardhat run --network linea script/upgrade/upgradeAttestationRegistry.ts",
"upgrade:AttestationRegistry:goerli": "npx hardhat run --network linea-goerli script/upgrade/upgradeAttestationRegistry.ts",
"upgrade:ModuleRegistry": "npx hardhat run --network linea script/upgrade/upgradeModuleRegistry.ts",
Expand Down
16 changes: 0 additions & 16 deletions script/deploy/deployEverything.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,28 +127,12 @@ async function main() {

console.log(`\n----\n`);

console.log("Deploying EASPortal...");
const EASPortal = await ethers.getContractFactory("EASPortal");
const easPortal = await EASPortal.deploy();
await easPortal.waitForDeployment();
const easPortalAddress = await easPortal.getAddress();

await run("verify:verify", {
address: easPortalAddress,
});

console.log(`EASPortal successfully deployed and verified!`);
console.log(`EASPortal is at ${easPortalAddress}`);

console.log(`\n----\n`);

console.log(`** SUMMARY **`);
console.log(`Router = ${routerProxyAddress}`);
console.log(`AttestationRegistry = ${attestationRegistryProxyAddress}`);
console.log(`ModuleRegistry = ${moduleRegistryProxyAddress}`);
console.log(`PortalRegistry = ${portalRegistryProxyAddress}`);
console.log(`SchemaRegistry = ${schemaRegistryProxyAddress}`);
console.log(`EASPortal = ${easPortalAddress}`);

console.log(`END SCRIPT`);
}
Expand Down
7 changes: 5 additions & 2 deletions script/upgrade/upgradeAttestationRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ async function main() {
const proxyAddress = process.env.ATTESTATION_REGISTRY_ADDRESS ?? "";
console.log("Upgrading AttestationRegistry, with proxy at", proxyAddress);
const AttestationRegistry = await ethers.getContractFactory("AttestationRegistry");
await upgrades.upgradeProxy(proxyAddress, AttestationRegistry);
const attestationRegistry = await upgrades.upgradeProxy(proxyAddress, AttestationRegistry);
const implementationAddress = await upgrades.erc1967.getImplementationAddress(proxyAddress);

await run("verify:verify", {
address: proxyAddress,
});

console.log(`AttestationRegistry successfully upgraded and verified!`);
await attestationRegistry.incrementVersionNumber();
const newVersion = await attestationRegistry.getVersionNumber();

console.log(`AttestationRegistry successfully upgraded to version ${newVersion} and verified!`);
console.log(`Proxy is at ${proxyAddress}`);
console.log(`Implementation is at ${implementationAddress}`);
}
Expand Down

0 comments on commit 77a4e2b

Please sign in to comment.