Skip to content

Commit

Permalink
deploy uns to base sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-gnativ committed Aug 1, 2024
1 parent c8c63aa commit 5b12450
Show file tree
Hide file tree
Showing 9 changed files with 1,139 additions and 1 deletion.
977 changes: 977 additions & 0 deletions .openzeppelin/base-sepolia.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ Mainnet | MAINNET_INFURA_KEY <br /> MAINNET_UNS_PRIVATE_KEY <br /> ETHERSCAN_API
Sepolia | SEPOLIA_INFURA_KEY <br /> SEPOLIA_UNS_PRIVATE_KEY <br /> ETHERSCAN_API_KEY
Polygon | POLYGON_INFURA_KEY <br /> POLYGON_UNS_PRIVATE_KEY <br /> POLYGONSCAN_API_KEY
Amoy | AMOY_INFURA_KEY <br /> AMOY_UNS_PRIVATE_KEY <br /> POLYGONSCAN_API_KEY
Base | BASE_INFURA_KEY <br /> BASE_UNS_PRIVATE_KEY <br /> BASESCAN_API_KEY
Base sepolia | BASE_INFURA_KEY <br /> BASE_UNS_PRIVATE_KEY <br /> BASESCAN_API_KEY

<div id="backward-incompatibility"></div>

Expand Down
22 changes: 22 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ const config: HardhatUserConfig = {
accounts: process.env.POLYGON_UNS_PRIVATE_KEY ? [process.env.POLYGON_UNS_PRIVATE_KEY] : undefined,
loggingEnabled: true,
},
base: {
url: `https://base-mainnet.infura.io/v3/${process.env.BASE_INFURA_KEY}`,
chainId: 8453,
accounts: process.env.BASE_UNS_PRIVATE_KEY ? [process.env.BASE_UNS_PRIVATE_KEY] : undefined,
loggingEnabled: true,
},
baseSepolia: {
url: `https://base-sepolia.infura.io/v3/${process.env.BASE_INFURA_KEY}`,
chainId: 84532,
accounts: process.env.BASE_UNS_PRIVATE_KEY ? [process.env.BASE_UNS_PRIVATE_KEY] : undefined,
loggingEnabled: true,
},
},
typechain: {
outDir: 'types',
Expand All @@ -194,6 +206,8 @@ const config: HardhatUserConfig = {
sepolia: process.env.ETHERSCAN_API_KEY,
polygon: process.env.POLYGONSCAN_API_KEY,
polygonAmoy: process.env.POLYGONSCAN_API_KEY,
base: process.env.BASESCAN_API_KEY,
baseSepolia: process.env.BASESCAN_API_KEY,
}) as Record<string, string>,
customChains: [
{
Expand All @@ -204,6 +218,14 @@ const config: HardhatUserConfig = {
browserURL: 'https://amoy.polygonscan.com/',
},
},
{
network: 'baseSepolia',
chainId: 84532,
urls: {
apiURL: 'https://api-sepolia.basescan.org/api',
browserURL: 'https://sepolia.basescan.org/',
},
},
],
},
abiExporter: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"@openzeppelin/contracts-upgradeable": "^4.7.3",
"@openzeppelin/hardhat-upgrades": "^2.0.0",
"@openzeppelin/upgrades-core": "^1.32.5",
"@safe-global/protocol-kit": "^4.0.3",
"@typechain/ethers-v6": "^0.5.0",
"@typechain/hardhat": "^9.1.0",
"@types/bip39": "^3.0.0",
Expand Down
1 change: 1 addition & 0 deletions scripts/deploy_UNS_only.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ async function main () {
MintingController: { address: '0x0000000000000000000000000000000000000000' },
URIPrefixController: { address: '0x0000000000000000000000000000000000000000' },
Resolver: { address: '0x0000000000000000000000000000000000000000' },
RootChainManager: { address: '0x0000000000000000000000000000000000000000' },
},
});

Expand Down
46 changes: 46 additions & 0 deletions scripts/deploy_base_sepolia.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { ethers, network } from 'hardhat';
import merge from 'lodash.merge';
import { getNetworkConfig, mergeNetworkConfig } from '../src/config';
import { Deployer } from '../src/deployer';
import { unwrap } from '../src/utils';
import { deployProxy } from '../src/helpers';
import { ArtifactName } from '../src/types';

async function main () {
console.log('Network:', network.name);

const chainId: number = unwrap(network.config, 'chainId');
const config = merge(getNetworkConfig(chainId), {
contracts: {
CNSRegistry: { address: '0x0000000000000000000000000000000000000000' },
MintingController: { address: '0x0000000000000000000000000000000000000000' },
URIPrefixController: { address: '0x0000000000000000000000000000000000000000' },
Resolver: { address: '0x0000000000000000000000000000000000000000' },
RootChainManager: { address: '0x0000000000000000000000000000000000000000' },
},
});

if (!config) {
throw new Error(`Config not found for network ${chainId}`);
}
// before running this script, remove only sandbox verification in seaport_proxy_buyer
// and check if min_uns_tlds task should be included

const deployer = await Deployer.create();
console.log('start uns execute:', config);
const deployConfig = await deployer.execute(['uns'], config);
console.log('start seaport execute', JSON.stringify(deployConfig));
mergeNetworkConfig(deployConfig);

const deployConfig2 = await deployer.execute(['seaport_proxy_buyer'], config);
mergeNetworkConfig(deployConfig2);

console.log('Deployed!');
}

main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
42 changes: 42 additions & 0 deletions scripts/deploy_multisig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import Safe, { SafeAccountConfig, SafeFactory } from '@safe-global/protocol-kit';


async function createSafe () {
const owners = [
'0x6EC0DEeD30605Bcd19342f3c30201DB263291589',
'0xc0354e4E83Cc214b402A5063e2C90e0e5C18cC87',
'0xECE49066537d1816915cBe2312D7BBeF0647b820',
'0x0e5DFb1569602d0dcFCb4287Fe53c28FAC1Ea1bE',
'0xEe203ec04a5F635A78414466883cffB24B669B2C',
];

const threshold = 2;
const safeAccountConfig: SafeAccountConfig = {
owners,
threshold,
};

const safeFactory = await SafeFactory.init({
provider: `https://base-sepolia.infura.io/v3/${process.env.BASE_INFURA_KEY}`,
signer: 'PRIVATE_KEY',
safeVersion: '1.3.0',
});

const safe: Safe = await safeFactory.deploySafe({ safeAccountConfig });

console.log('Is deployed: ' + await safe.isSafeDeployed());
console.log('Threshold: ' + await safe.getThreshold());
console.log('Owners: ' + await safe.getOwners());
console.log('Address: ' + await safe.getAddress());
}

async function main () {
await createSafe();
}

main()
.then(() => process.exit(0))
.catch((e) => {
console.log('Error: ' + e.message);
process.exit(1);
});
2 changes: 1 addition & 1 deletion src/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const deployUNSTask = {
);
await mintingManagerInitTx.wait();

if (ctx.minters.length) {
if (ctx.minters?.length) {
const chunkSize = 100;
for (let i = 0, j = ctx.minters.length; i < j; i += chunkSize) {
const array = ctx.minters.slice(i, i + chunkSize);
Expand Down
47 changes: 47 additions & 0 deletions uns-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,53 @@
}
}
},
"84532": {
"contracts": {
"Seaport": {
"address": "0x0000000000000068F116a894984e2DB1123eB395",
"deploymentBlock": "0x0",
"legacyAddresses": []
},
"ProxyAdmin": {
"address": "0xd57f8F7be4BaE8f2bf24792Fec2Ca06513c83c1D",
"legacyAddresses": [],
"deploymentBlock": "0xcbf182"
},
"UNSRegistry": {
"address": "0xEc353DCE22C2B97814608A6b2e44889506A4Aabf",
"deploymentBlock": "0xcbf184",
"implementation": "0xD0AB7f2490736c60575123aF2Ce0D2D6b13D5490",
"forwarder": "0xEc353DCE22C2B97814608A6b2e44889506A4Aabf",
"legacyAddresses": []
},
"MintingManager": {
"address": "0x050Ceb85167D510558E793a483b479f2917B4b9b",
"deploymentBlock": "0xcbf18d",
"implementation": "0x6B5F9068Aa94eFf728585665244cb5AB8735E71A",
"forwarder": "0xEa5AE30C714ccd63Fca6D791Eea1E26CB1be0c1d",
"legacyAddresses": []
},
"UNSOperator": {
"address": "0x99d55A02f5d9c76d31C6Ff57cc36A7862D5E1029",
"deploymentBlock": "0xcbf193",
"implementation": "0x3a2Ad968667a8214BEAe6AfA45192DD24109a3e7",
"legacyAddresses": []
},
"ProxyReader": {
"address": "0x8Fc4DBA4A6F5AE8992E8f9B64D6d995BD3AfE2c4",
"deploymentBlock": "0xcbf1a9",
"implementation": "0x37e22Fd398B8c95128f5235e991682cF6e9F5d9c",
"legacyAddresses": []
},
"SeaportProxyBuyer": {
"address": "0x78c4B414e1AbdF0dE267deDa01DFFd4cd0817A16",
"deploymentBlock": "0xcbf1b5",
"implementation": "0x6C95A12CcEA79971C51b16f707D8CdDd7d1b5033",
"forwarder": "0x78c4B414e1AbdF0dE267deDa01DFFd4cd0817A16",
"legacyAddresses": []
}
}
},
"11155111": {
"contracts": {
"ProxyAdmin": {
Expand Down

0 comments on commit 5b12450

Please sign in to comment.