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

Add fuse/spark networks #536

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
23 changes: 23 additions & 0 deletions configs/networks/fusetest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {
contracts as defaultContracts,
ContractConfig,
} from "../contracts.config";

const disabled: Array<string> = [
// Utility & Test Contracts disabled by default
"OLToken",
"TestToken1",
"TestToken2",
"TestFairShareCalc",
"PixelNFT",
"ProxToken",
"ERC20Minter",
"MockDao",
];

export const contracts: Array<ContractConfig> = defaultContracts.map((c) => {
if (disabled.find((e) => e === c.name)) {
return { ...c, enabled: false };
}
return c;
});
24 changes: 24 additions & 0 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ module.exports = {
"myth like bonus scare over problem client lizard pioneer submit female collect",
},
},
fusetest: {
url: process.env.ETH_NODE_URL,
chainId: 123,
network_id: 123,
skipDryRun: true,
gasPrice: 1000000000,
accounts: {
mnemonic: process.env.WALLET_MNEMONIC || "",
count: 10,
},
signerId: process.env.SIGNER || undefined,
},
goerli: {
url: process.env.ETH_NODE_URL,
network_id: 5,
Expand Down Expand Up @@ -172,6 +184,18 @@ module.exports = {
},
signerId: process.env.SIGNER || undefined,
},
fuse: {
url: process.env.ETH_NODE_URL,
chainId: 122,
network_id: 122,
skipDryRun: true,
gasPrice: 1000000000,
accounts: {
mnemonic: process.env.WALLET_MNEMONIC || "",
count: 10,
},
signerId: process.env.SIGNER || undefined,
},
},

// External Signers configs
Expand Down
15 changes: 11 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 9 additions & 21 deletions tasks/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,18 +523,15 @@ const deployPolygonTestDao = async ({
maintainerTokenAddress: getOptionalEnvVar("MAINTAINER_TOKEN_ADDR", UNITS),
});
};

const deployAvalancheTestDao = async ({
const deployFuseDao = async ({
deployFunction,
attachFunction,
contractImports,
contractConfigs,
}) => {
return await deployDao({
...contractImports,
contractConfigs,
deployFunction,
attachFunction,
maxAmount: getOptionalEnvVar("MAX_AMOUNT", maxAmount),
unitPrice: toWei("0.1"),
nbUnits: toBN("100000"),
Expand Down Expand Up @@ -578,26 +575,20 @@ const deployAvalancheTestDao = async ({
gasPriceLimit: getOptionalEnvVar("GAS_PRICE_LIMIT", 0 /* disabled */),
spendLimitPeriod: getOptionalEnvVar("SPEND_LIMIT_PERIOD", 0 /* disabled */),
spendLimitEth: getOptionalEnvVar("SPEND_LIMIT_ETH", 0 /* disabled */),
gelato: getOptionalEnvVar(
"GELATO_ADDR",
"0xDe6ab16a4015c680daab58021815D09ddB57db8E"
),
weth: "0xc778417e063141139fce010982780140aa0cd5ab",
gelato: getOptionalEnvVar("GELATO_ADDR", ZERO_ADDRESS),
weth: getOptionalEnvVar("WETH_ADDR", ZERO_ADDRESS),
maintainerTokenAddress: getOptionalEnvVar("MAINTAINER_TOKEN_ADDR", UNITS),
});
};

const deployAvalancheDao = async ({
const deploySparkDao = async ({
deployFunction,
attachFunction,
contractImports,
contractConfigs,
}) => {
return await deployDao({
...contractImports,
contractConfigs,
deployFunction,
attachFunction,
maxAmount: getOptionalEnvVar("MAX_AMOUNT", maxAmount),
unitPrice: toWei("0.1"),
nbUnits: toBN("100000"),
Expand Down Expand Up @@ -641,11 +632,8 @@ const deployAvalancheDao = async ({
gasPriceLimit: getOptionalEnvVar("GAS_PRICE_LIMIT", 0 /* disabled */),
spendLimitPeriod: getOptionalEnvVar("SPEND_LIMIT_PERIOD", 0 /* disabled */),
spendLimitEth: getOptionalEnvVar("SPEND_LIMIT_ETH", 0 /* disabled */),
gelato: getOptionalEnvVar(
"GELATO_ADDR",
"0xDe6ab16a4015c680daab58021815D09ddB57db8E"
),
weth: "0xc778417e063141139fce010982780140aa0cd5ab",
gelato: getOptionalEnvVar("GELATO_ADDR", ZERO_ADDRESS),
weth: getOptionalEnvVar("WETH_ADDR", ZERO_ADDRESS),
maintainerTokenAddress: getOptionalEnvVar("MAINTAINER_TOKEN_ADDR", UNITS),
});
};
Expand Down Expand Up @@ -686,7 +674,7 @@ const getEnvVar = (name) => {
};

const getOptionalEnvVar = (name, defaultValue) => {
const envVar = process.env[name];
const envVar = process.env[name];
return envVar ? envVar : defaultValue;
};

Expand All @@ -708,8 +696,8 @@ const DeploymentActions = {
harmonytest: deployHarmonyTestDao,
polygon: deployPolygonDao,
polygontest: deployPolygonTestDao,
avalanchetest: deployAvalancheTestDao,
avalanche: deployAvalancheDao,
fuse: deployFuseDao,
spark: deploySparkDao,

// Goerli and Rinkeby should be treated the same
goerli: deployRinkebyDao,
Expand Down
12 changes: 12 additions & 0 deletions truffle-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ module.exports = {
skipDryRun: true,
gasPrice: 10000000000,
},
fuse: {
provider: getNetworkProvider,
chainId: 122,
skipDryRun: true,
gasPrice: 1000000000,
},
fusetest: {
provider: getNetworkProvider,
chainId: 123,
skipDryRun: true,
gasPrice: 1000000000,
},
},

// Configure your compilers
Expand Down