Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/deploy use artifact #385

Merged
merged 1 commit into from
May 26, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {HardhatRuntimeEnvironment} from 'hardhat/types';
import {DAO__factory, ENSRegistry__factory} from '../../../typechain';
import {getContractAddress, getENSAddress} from '../../helpers';

import ensSubdomainRegistrarArtifact from '../../../artifacts/src/framework/utils/ens/ENSSubdomainRegistrar.sol/ENSSubdomainRegistrar.json';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const {deployments, ethers, network} = hre;
const {deploy} = deployments;
Expand All @@ -27,7 +29,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
}

await deploy('DAO_ENSSubdomainRegistrar', {
contract: 'ENSSubdomainRegistrar',
contract: ensSubdomainRegistrarArtifact,
from: deployer.address,
args: [],
log: true,
Expand All @@ -51,7 +53,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
);

await deploy('Plugin_ENSSubdomainRegistrar', {
contract: 'ENSSubdomainRegistrar',
contract: ensSubdomainRegistrarArtifact,
from: deployer.address,
args: [],
log: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {HardhatRuntimeEnvironment} from 'hardhat/types';
import {DeployFunction} from 'hardhat-deploy/types';

import {getContractAddress} from '../../helpers';

import daoRegistryArtifact from '../../../artifacts/src/framework/dao/DAORegistry.sol/DAORegistry.json';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const {deployments, ethers} = hre;
const {deploy} = deployments;
Expand All @@ -18,6 +19,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
);

await deploy('DAORegistry', {
contract: daoRegistryArtifact,
from: deployer.address,
args: [],
log: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {DeployFunction} from 'hardhat-deploy/types';

import {getContractAddress} from '../../helpers';

import pluginRepoRegistryArtifact from '../../../artifacts/src/framework/plugin/repo/PluginRepoRegistry.sol/PluginRepoRegistry.json';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const {deployments, ethers} = hre;
const {deploy} = deployments;
Expand All @@ -18,6 +20,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
);

await deploy('PluginRepoRegistry', {
contract: pluginRepoRegistryArtifact,
from: deployer.address,
args: [],
log: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {HardhatRuntimeEnvironment} from 'hardhat/types';
import {DeployFunction} from 'hardhat-deploy/types';

import {getContractAddress} from '../../helpers';

import pluginRepoFactoryArtifact from '../../../artifacts/src/framework/plugin/repo/PluginRepoFactory.sol/PluginRepoFactory.json';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const {deployments, ethers} = hre;
const {deploy} = deployments;
Expand All @@ -15,6 +16,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
);

await deploy('PluginRepoFactory', {
contract: pluginRepoFactoryArtifact,
from: deployer.address,
args: [pluginRepoRegistryAddress],
log: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {HardhatRuntimeEnvironment} from 'hardhat/types';
import {DeployFunction} from 'hardhat-deploy/types';

import {getContractAddress} from '../../helpers';

import pluginSetupProcessorFactoryArtifact from '../../../artifacts/src/framework/plugin/setup/PluginSetupProcessor.sol/PluginSetupProcessor.json';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const {deployments, ethers} = hre;
const {deploy} = deployments;
Expand All @@ -15,6 +16,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
);

await deploy('PluginSetupProcessor', {
contract: pluginSetupProcessorFactoryArtifact,
from: deployer.address,
args: [pluginRepoRegistryAddress],
log: true,
Expand Down
4 changes: 3 additions & 1 deletion packages/contracts/deploy/new/10_framework/50_dao-factory.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {HardhatRuntimeEnvironment} from 'hardhat/types';
import {DeployFunction} from 'hardhat-deploy/types';

import {getContractAddress} from '../../helpers';

import daoFactoryArtifact from '../../../artifacts/src/framework/dao/DAOFactory.sol/DAOFactory.json';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const {deployments, ethers} = hre;
const {deploy} = deployments;
Expand All @@ -18,6 +19,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
);

await deploy('DAOFactory', {
contract: daoFactoryArtifact,
from: deployer.address,
args: [daoRegistryAddress, pluginSetupProcessorAddress],
log: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {HardhatRuntimeEnvironment} from 'hardhat/types';
import {DeployFunction} from 'hardhat-deploy/types';

import addresslistVotingSetupArtifact from '../../../../artifacts/src/plugins/governance/majority-voting/addresslist/AddresslistVotingSetup.sol/AddresslistVotingSetup.json';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
console.log(`\nDeploying plugins.`);

Expand All @@ -9,6 +11,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const [deployer] = await ethers.getSigners();

await deploy('AddresslistVotingSetup', {
contract: addresslistVotingSetupArtifact,
from: deployer.address,
args: [],
log: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import {HardhatRuntimeEnvironment} from 'hardhat/types';
import {DeployFunction} from 'hardhat-deploy/types';

import tokenVotingSetupArtifact from '../../../../artifacts/src/plugins/governance/majority-voting/token/TokenVotingSetup.sol/TokenVotingSetup.json';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const {deployments, ethers} = hre;
const {deploy} = deployments;
const [deployer] = await ethers.getSigners();

await deploy('TokenVotingSetup', {
contract: tokenVotingSetupArtifact,
from: deployer.address,
args: [],
log: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import {HardhatRuntimeEnvironment} from 'hardhat/types';
import {DeployFunction} from 'hardhat-deploy/types';

import adminSetupArtifact from '../../../../artifacts/src/plugins/governance/admin/AdminSetup.sol/AdminSetup.json';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const {deployments, ethers} = hre;
const {deploy} = deployments;
const [deployer] = await ethers.getSigners();

await deploy('AdminSetup', {
contract: adminSetupArtifact,
from: deployer.address,
args: [],
log: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import {HardhatRuntimeEnvironment} from 'hardhat/types';
import {DeployFunction} from 'hardhat-deploy/types';

import multisigSetupArtifact from '../../../../artifacts/src/plugins/governance/multisig/MultisigSetup.sol/MultisigSetup.json';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const {deployments, ethers} = hre;
const {deploy} = deployments;
const [deployer] = await ethers.getSigners();

await deploy('MultisigSetup', {
contract: multisigSetupArtifact,
from: deployer.address,
args: [],
log: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {HardhatRuntimeEnvironment} from 'hardhat/types';
import {DeployFunction} from 'hardhat-deploy/types';
import {uploadToIPFS} from '../../../helpers';

import placeholderSetupArtifact from '../../../../artifacts/src/plugins/placeholder-version/PlaceholderSetup.sol/PlaceholderSetup.json';
import placeholderBuildMetadata from '../../../../src/plugins/placeholder-version/build-metadata.json';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
Expand All @@ -10,6 +11,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const [deployer] = await ethers.getSigners();

await deploy('PlaceholderSetup', {
contract: placeholderSetupArtifact,
from: deployer.address,
args: [],
log: true,
Expand Down
5 changes: 5 additions & 0 deletions packages/contracts/utils/ens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import {ethers} from 'hardhat';
import {ENSRegistry__factory} from '../typechain';
import {EHRE} from './types';

import ensRegistryArtifact from '../artifacts/@ensdomains/ens-contracts/contracts/registry/ENSRegistry.sol/ENSRegistry.json';
import publicResolverArtifact from '../artifacts/@ensdomains/ens-contracts/contracts/resolvers/PublicResolver.sol/PublicResolver.json';

export function ensLabelHash(label: string): string {
return ethers.utils.id(label);
}
Expand All @@ -17,6 +20,7 @@ export async function setupENS(domains: string[], hre: EHRE): Promise<any> {

// Deploy the ENSRegistry
await deploy('ENSRegistry', {
contract: ensRegistryArtifact,
from: deployer.address,
heueristik marked this conversation as resolved.
Show resolved Hide resolved
args: [],
log: true,
Expand All @@ -27,6 +31,7 @@ export async function setupENS(domains: string[], hre: EHRE): Promise<any> {

// Deploy the Resolver
await deploy('PublicResolver', {
contract: publicResolverArtifact,
from: deployer.address,
args: [ensDeployment.address, ethers.constants.AddressZero],
});
Expand Down