Skip to content

Commit

Permalink
fix kyc configs and deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
fforbeck committed Nov 29, 2021
1 parent efe4b10 commit d6057ae
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 13 deletions.
74 changes: 67 additions & 7 deletions migrations/2_deploy_contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ const {
toBN,
toWei,
ETH_TOKEN,
ZERO_ADDRESS,
UNITS,
maximumChunks,
unitPrice,
numberOfUnits,
maxAmount,
maxUnits,
} = require("../utils/contract-util");

const { deployDao, getNetworkDetails } = require("../utils/deployment-util");
Expand Down Expand Up @@ -74,9 +76,10 @@ const deployRinkebyDao = async (
...truffleImports,
contractConfigs,
deployFunction,
maxAmount,
maxAmount: getOptionalEnvVar("MAX_AMOUNT", maxAmount),
unitPrice: toBN(toWei("100", "finney")),
nbUnits: toBN("100000"),
maxUnits: getOptionalEnvVar("MAX_UNITS", maxUnits),
tokenAddr: ETH_TOKEN,
erc20TokenName: getEnvVar("ERC20_TOKEN_NAME"),
erc20TokenSymbol: getEnvVar("ERC20_TOKEN_SYMBOL"),
Expand All @@ -93,6 +96,15 @@ const deployRinkebyDao = async (
"COUPON_CREATOR_ADDR",
getEnvVar("DAO_OWNER_ADDR")
),
kycSignerAddress: getOptionalEnvVar(
"KYC_SIGNER_ADDR",
getEnvVar("DAO_OWNER_ADDR")
),
kycMaxMembers: getOptionalEnvVar("KYC_MAX_MEMBERS", toBN(1000)),
kycFundTargetAddress: getOptionalEnvVar(
"KYC_MULTISIG_FUND_ADDR",
ZERO_ADDRESS
),
daoName: getEnvVar("DAO_NAME"),
owner: getEnvVar("DAO_OWNER_ADDR"),
offchainAdmin: getOptionalEnvVar(
Expand All @@ -105,6 +117,10 @@ const deployRinkebyDao = async (
supplyPixelNFT: 100,
supplyOLToken: toBN("1000000000000000000000000"),
erc1155TestTokenUri: "1155 test token",
weth: getOptionalEnvVar(
"WETH_ADDR",
"0xc778417e063141139fce010982780140aa0cd5ab"
),
});
};

Expand All @@ -118,9 +134,10 @@ const deployMainnetDao = async (
...truffleImports,
contractConfigs,
deployFunction,
maxAmount,
maxAmount: getOptionalEnvVar("MAX_AMOUNT", maxAmount),
unitPrice: toBN(toWei("100", "finney")),
nbUnits: toBN("100000"),
maxUnits: getOptionalEnvVar("MAX_UNITS", maxUnits),
tokenAddr: ETH_TOKEN,
erc20TokenName: getEnvVar("ERC20_TOKEN_NAME"),
erc20TokenSymbol: getEnvVar("ERC20_TOKEN_SYMBOL"),
Expand All @@ -135,9 +152,19 @@ const deployMainnetDao = async (
finalize: false,
maxExternalTokens: 100,
couponCreatorAddress: getEnvVar("COUPON_CREATOR_ADDR"),
kycSignerAddress: getEnvVar("KYC_SIGNER_ADDR"),
kycMaxMembers: getEnvVar("KYC_MAX_MEMBERS"),
kycFundTargetAddress: getOptionalEnvVar(
"KYC_MULTISIG_FUND_ADDR",
ZERO_ADDRESS
),
daoName: getEnvVar("DAO_NAME"),
owner: getEnvVar("DAO_OWNER_ADDR"),
offchainAdmin: getEnvVar("OFFCHAIN_ADMIN_ADDR"),
weth: getOptionalEnvVar(
"WETH_ADDR",
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
),
});
};

Expand All @@ -151,15 +178,16 @@ const deployGanacheDao = async (
const daoOwnerAddress = accounts[0];

const { WETH } = truffleImports;
const weth = await deployer(WETH);
const weth = await deployFunction(WETH);

return await deployDao({
...truffleImports,
contractConfigs,
deployFunction,
maxAmount,
maxAmount: getOptionalEnvVar("MAX_AMOUNT", maxAmount),
unitPrice: toBN(toWei("100", "finney")),
nbUnits: toBN("100000"),
maxUnits: getOptionalEnvVar("MAX_UNITS", maxUnits),
tokenAddr: ETH_TOKEN,
erc20TokenName: getEnvVar("ERC20_TOKEN_NAME"),
erc20TokenSymbol: getEnvVar("ERC20_TOKEN_SYMBOL"),
Expand All @@ -176,6 +204,12 @@ const deployGanacheDao = async (
"COUPON_CREATOR_ADDR",
daoOwnerAddress
),
kycSignerAddress: getOptionalEnvVar("KYC_SIGNER_ADDR", daoOwnerAddress),
kycMaxMembers: getOptionalEnvVar("KYC_MAX_MEMBERS", toBN(1000)),
kycFundTargetAddress: getOptionalEnvVar(
"KYC_MULTISIG_FUND_ADDR",
ZERO_ADDRESS
),
daoName: getEnvVar("DAO_NAME"),
owner: daoOwnerAddress,
offchainAdmin: getOptionalEnvVar("OFFCHAIN_ADMIN_ADDR", daoOwnerAddress),
Expand Down Expand Up @@ -204,9 +238,10 @@ const deployTestDao = async (
...truffleImports,
contractConfigs,
deployFunction,
maxAmount,
maxAmount: getOptionalEnvVar("MAX_AMOUNT", maxAmount),
unitPrice: unitPrice,
nbUnits: numberOfUnits,
maxUnits: numberOfUnits,
tokenAddr: ETH_TOKEN,
erc20TokenName: getEnvVar("ERC20_TOKEN_NAME"),
erc20TokenSymbol: getEnvVar("ERC20_TOKEN_SYMBOL"),
Expand All @@ -221,6 +256,12 @@ const deployTestDao = async (
finalize: false,
maxExternalTokens: 100,
couponCreatorAddress: daoOwnerAddress,
kycSignerAddress: daoOwnerAddress,
kycMaxMembers: toBN(1000),
kycFundTargetAddress: getOptionalEnvVar(
"KYC_MULTISIG_FUND_ADDR",
ZERO_ADDRESS
),
offchainAdmin: daoOwnerAddress,
daoName: getEnvVar("DAO_NAME"),
owner: accounts[0],
Expand All @@ -238,9 +279,10 @@ const deployHarmonyDao = async (
...truffleImports,
contractConfigs,
deployFunction,
maxAmount,
maxAmount: getOptionalEnvVar("MAX_AMOUNT", maxAmount),
unitPrice: toBN(toWei("100", "finney")),
nbUnits: toBN("100000"),
maxUnits: getOptionalEnvVar("MAX_UNITS", maxUnits),
tokenAddr: ETH_TOKEN,
erc20TokenName: getEnvVar("ERC20_TOKEN_NAME"),
erc20TokenSymbol: getEnvVar("ERC20_TOKEN_SYMBOL"),
Expand All @@ -255,9 +297,16 @@ const deployHarmonyDao = async (
finalize: false,
maxExternalTokens: 100,
couponCreatorAddress: getEnvVar("COUPON_CREATOR_ADDR"),
kycSignerAddress: getEnvVar("KYC_SIGNER_ADDR"),
kycMaxMembers: getOptionalEnvVar("KYC_MAX_MEMBERS", toBN(99)),
kycFundTargetAddress: getOptionalEnvVar(
"KYC_MULTISIG_FUND_ADDR",
ZERO_ADDRESS
),
daoName: getEnvVar("DAO_NAME"),
owner: getEnvVar("DAO_OWNER_ADDR"),
offchainAdmin: getEnvVar("OFFCHAIN_ADMIN_ADDR"),
weth: getEnvVar("WETH_ADDR"),
});
};

Expand All @@ -267,13 +316,17 @@ const deployHarmonyTestDao = async (
truffleImports,
contractConfigs
) => {
const { WETH } = truffleImports;

const weth = await deployFunction(WETH);
return await deployDao({
...truffleImports,
contractConfigs,
deployFunction,
maxAmount,
maxAmount: getOptionalEnvVar("MAX_AMOUNT", maxAmount),
unitPrice: toBN(toWei("100", "finney")),
nbUnits: toBN("100000"),
maxUnits: getOptionalEnvVar("MAX_UNITS", maxUnits),
tokenAddr: ETH_TOKEN,
erc20TokenName: getEnvVar("ERC20_TOKEN_NAME"),
erc20TokenSymbol: getEnvVar("ERC20_TOKEN_SYMBOL"),
Expand All @@ -289,12 +342,19 @@ const deployHarmonyTestDao = async (
finalize: false,
maxExternalTokens: 100,
couponCreatorAddress: getEnvVar("COUPON_CREATOR_ADDR"),
kycSignerAddress: getEnvVar("KYC_SIGNER_ADDR"),
kycMaxMembers: getOptionalEnvVar("KYC_MAX_MEMBERS", toBN(99)),
kycFundTargetAddress: getOptionalEnvVar(
"KYC_MULTISIG_FUND_ADDR",
ZERO_ADDRESS
),
daoName: getEnvVar("DAO_NAME"),
owner: getEnvVar("DAO_OWNER_ADDR"),
offchainAdmin: getOptionalEnvVar(
"OFFCHAIN_ADMIN_ADDR",
getEnvVar("DAO_OWNER_ADDR")
),
weth: weth.address,
});
};

Expand Down
6 changes: 3 additions & 3 deletions migrations/configs/contracts.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -855,13 +855,13 @@ export const contracts: Array<ContractConfig> = [
daoConfigs: [
[
"daoAddress",
"kycAddress",
"kycSignerAddress",
"unitPrice",
"nbUnits",
"maxChunks",
"maxUnits",
"maxMembers",
"fundTargetAddress",
"kycMaxMembers",
"kycFundTargetAddress",
"tokenAddr",
"unitTokenToMint"
],
Expand Down
6 changes: 3 additions & 3 deletions utils/oz-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ const getDefaultOptions = (options) => {
maxChunks: maximumChunks,
maxAmount,
maxUnits,
maxMembers: 1000,
chainId: 1,
maxExternalTokens: 100,
couponCreatorAddress: "0x7D8cad0bbD68deb352C33e80fccd4D8e88b4aBb8",
kycAddress: "0x7D8cad0bbD68deb352C33e80fccd4D8e88b4aBb8",
fundTargetAddress: "0x823A19521A76f80EC49670BE32950900E8Cd0ED3",
kycMaxMembers: 1000,
kycSignerAddress: "0x7D8cad0bbD68deb352C33e80fccd4D8e88b4aBb8",
kycFundTargetAddress: "0x823A19521A76f80EC49670BE32950900E8Cd0ED3",
deployTestTokens: true,
erc20TokenName: "Test Token",
erc20TokenSymbol: "TTK",
Expand Down

0 comments on commit d6057ae

Please sign in to comment.