Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mobycrypt committed Sep 8, 2023
1 parent 2709707 commit 152841f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
14 changes: 13 additions & 1 deletion deploy/01-deploy-erc-20-dao-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,32 @@
import { DeployFunction, DeployResult } from "hardhat-deploy/dist/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { network } from "hardhat";
import fs from 'fs';

const deployErc20DaoFactory: DeployFunction = async (
hre: HardhatRuntimeEnvironment
) => {
const { deploy } = hre.deployments;
const { deployer } = await hre.getNamedAccounts();
const chainId = network.config.chainId!;
const currentNetwork = network.name;

await deploy("ERC20DaoFactory", {
const deployerResult = await deploy("ERC20DaoFactory", {
from: deployer,
log: true,
args: [],
waitConfirmations: chainId == 31337 ? 1 : 6,
});

if (!fs.existsSync('deployments')) {
fs.mkdirSync('deployments');
}
fs.writeFileSync(
`deployments/erc-20-dao-factory-${currentNetwork}.json`,
JSON.stringify({
address: deployerResult.address,
}, null, 2));
console.log('Done!');
};

export default deployErc20DaoFactory;
Expand Down
19 changes: 15 additions & 4 deletions deploy/02-deploy-nft-dao-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,32 @@
import { DeployFunction, DeployResult } from "hardhat-deploy/dist/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { network } from "hardhat";
import fs from 'fs';

const deployErc20DaoFactory: DeployFunction = async (
const deployNftDaoFactory: DeployFunction = async (
hre: HardhatRuntimeEnvironment
) => {
const { deploy } = hre.deployments;
const { deployer } = await hre.getNamedAccounts();
const chainId = network.config.chainId!;
const currentNetwork = network.name;

await deploy("NFTDaoFactory", {
const deployerResult = await deploy("NFTDaoFactory", {
from: deployer,
log: true,
args: [],
waitConfirmations: chainId == 31337 ? 1 : 6,
});
if (!fs.existsSync('deployments')) {
fs.mkdirSync('deployments');
}
fs.writeFileSync(
`deployments/nft-dao-factory-${currentNetwork}.json`,
JSON.stringify({
address: deployerResult.address,
}, null, 2));
console.log('Done!');
};

export default deployErc20DaoFactory;
deployErc20DaoFactory.tags = ["all", "NFTDaoFactory"];
export default deployNftDaoFactory;
deployNftDaoFactory.tags = ["all", "NFTDaoFactory"];
2 changes: 1 addition & 1 deletion scripts/send-to-dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { readFileSync } from 'fs';

async function main() {
// TODO EDIT dao address
const daoAddress = '0xE6135Dd153266E9001728765Cb101e3F233F0E8b';
const daoAddress = '0xC88Bc7C6e67cc1a2Ae9a39f2fB97509902D6672E';
const abi = ['function transfer(address recipient, uint256 amount) external returns (bool)'];
const nftAbi = ['function createNFT(address,string) external returns (uint256)'];

Expand Down

0 comments on commit 152841f

Please sign in to comment.