@gooddollar/goodprotocol 1.0.2-beta.2 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.json +20 -2
- package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
- package/artifacts/contracts/governance/GovarnanceStaking.sol/GovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
- package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.json +2 -2
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +2 -2
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.json +2 -2
- package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
- package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.json +2 -2
- package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
- package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
- package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.json +2 -2
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.json +2 -2
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +2 -2
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.json +2 -2
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.json +2 -2
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.json +15 -2
- package/artifacts/contracts/unaudited-foundation/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/unaudited-foundation/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
- package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
- package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
- package/contracts/governance/CompoundVotingMachine.sol +10 -2
- package/contracts/staking/UniswapV2SwapHelper.sol +0 -1
- package/contracts/ubi/UBIScheme.sol +20 -4
- package/hardhat.config.ts +12 -2
- package/package.json +1 -1
- package/releases/deploy-settings.json +26 -22
- package/releases/deployment.json +425 -330
- package/releases/olddao.json +406 -1
- package/scripts/upgradeToV2/upgradeToV2.ts +54 -34
- package/test/governance/CompoundVotingMachine.castvote.test.ts +0 -3
- package/test/governance/CompoundVotingMachine.daoscheme.ts +0 -9
- package/test/governance/CompoundVotingMachine.guardian.test.ts +10 -5
- package/test/governance/CompoundVotingMachine.propose.test.ts +0 -3
- package/test/governance/CompoundVotingMachine.state.test.ts +0 -3
- package/test/helpers.ts +30 -30
- package/test/ubi/UBIScheme.test.ts +6 -17
- package/test/ubi/UBISchemeCycle.test.ts +3 -4
- package/test/utils/ProtocolUpgrade.test.ts +19 -1
- package/truffle-config.js +21 -3
|
@@ -11,6 +11,7 @@ import { network, ethers, upgrades, run } from "hardhat";
|
|
|
11
11
|
import { networkNames } from "@openzeppelin/upgrades-core";
|
|
12
12
|
import { isFunction, get, omitBy } from "lodash";
|
|
13
13
|
import { getImplementationAddress } from "@openzeppelin/upgrades-core";
|
|
14
|
+
// import pressAnyKey from "press-any-key";
|
|
14
15
|
import {
|
|
15
16
|
AaveStakingFactory,
|
|
16
17
|
CompoundStakingFactory,
|
|
@@ -32,7 +33,7 @@ import OldDAO from "../../releases/olddao.json";
|
|
|
32
33
|
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
33
34
|
import { keccak256 } from "@ethersproject/keccak256";
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
let GAS_SETTINGS: any = {
|
|
36
37
|
maxPriorityFeePerGas: ethers.utils.parseUnits("1", "gwei"),
|
|
37
38
|
maxFeePerGas: ethers.utils.parseUnits("50", "gwei"),
|
|
38
39
|
gasLimit: 30000000
|
|
@@ -70,10 +71,17 @@ export const main = async (
|
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
const isProduction = networkName.startsWith("production");
|
|
73
|
-
if (isProduction) {
|
|
74
|
-
GAS_SETTINGS.gasLimit =
|
|
75
|
-
GAS_SETTINGS.maxFeePerGas = ethers.utils.parseUnits("
|
|
74
|
+
if (isProduction && networkName.includes("mainnet")) {
|
|
75
|
+
GAS_SETTINGS.gasLimit = 6000000;
|
|
76
|
+
GAS_SETTINGS.maxFeePerGas = ethers.utils.parseUnits("80", "gwei");
|
|
77
|
+
} else if (!networkName.includes("mainnet")) {
|
|
78
|
+
//case we are on fusefuse
|
|
79
|
+
GAS_SETTINGS = {
|
|
80
|
+
gasLimit: 6000000,
|
|
81
|
+
gasPrice: ethers.utils.parseUnits("1", "gwei")
|
|
82
|
+
};
|
|
76
83
|
}
|
|
84
|
+
|
|
77
85
|
const isBackendTest = networkName.startsWith("dapptest");
|
|
78
86
|
const isTest = network.name === "hardhat";
|
|
79
87
|
const isCoverage = process.env.CODE_COVERAGE;
|
|
@@ -132,7 +140,7 @@ export const main = async (
|
|
|
132
140
|
}
|
|
133
141
|
];
|
|
134
142
|
|
|
135
|
-
let release: { [key: string]: any } =
|
|
143
|
+
let release: { [key: string]: any } = newdao;
|
|
136
144
|
|
|
137
145
|
const toDeployUpgradable = [
|
|
138
146
|
{
|
|
@@ -207,7 +215,8 @@ export const main = async (
|
|
|
207
215
|
name: "CompoundVotingMachine",
|
|
208
216
|
args: [
|
|
209
217
|
() => get(release, "NameService", newdao.NameService),
|
|
210
|
-
protocolSettings.governance.proposalVotingPeriod
|
|
218
|
+
protocolSettings.governance.proposalVotingPeriod,
|
|
219
|
+
protocolSettings.governance.guardian || root.address
|
|
211
220
|
]
|
|
212
221
|
},
|
|
213
222
|
{
|
|
@@ -303,14 +312,20 @@ export const main = async (
|
|
|
303
312
|
let proxyFactory: ProxyFactory1967;
|
|
304
313
|
const getProxyFactory = async () => {
|
|
305
314
|
if (isDevelop === false && newdao.ProxyFactory) {
|
|
306
|
-
|
|
307
|
-
return (proxyFactory = ethers.getContractAt(
|
|
315
|
+
return (proxyFactory = (await ethers.getContractAt(
|
|
308
316
|
"ProxyFactory1967",
|
|
309
317
|
newdao.ProxyFactory
|
|
310
|
-
) as unknown as ProxyFactory1967);
|
|
318
|
+
)) as unknown as ProxyFactory1967);
|
|
311
319
|
} else {
|
|
320
|
+
console.info(
|
|
321
|
+
"deploying ProxyFactory1967",
|
|
322
|
+
isDevelop,
|
|
323
|
+
newdao.ProxyFactory
|
|
324
|
+
);
|
|
325
|
+
// await pressAnyKey();
|
|
326
|
+
|
|
312
327
|
const pf = await (
|
|
313
|
-
await ethers.getContractFactory("ProxyFactory1967",
|
|
328
|
+
await ethers.getContractFactory("ProxyFactory1967", root)
|
|
314
329
|
).deploy(GAS_SETTINGS);
|
|
315
330
|
await pf.deployed();
|
|
316
331
|
await releaser(
|
|
@@ -446,6 +461,7 @@ export const main = async (
|
|
|
446
461
|
// release
|
|
447
462
|
// pf: ProxyFactory.factory.address
|
|
448
463
|
});
|
|
464
|
+
// await pressAnyKey();
|
|
449
465
|
let opts = {};
|
|
450
466
|
if (contract.libraries) {
|
|
451
467
|
let libraries = {};
|
|
@@ -457,12 +473,21 @@ export const main = async (
|
|
|
457
473
|
let deployed = await deployDeterministic(contract, args, opts);
|
|
458
474
|
|
|
459
475
|
console.log(`${contract.name} deployed to: ${deployed.address}`);
|
|
460
|
-
await releaser(release, networkName, "deployment", false);
|
|
461
476
|
release[contract.name] = deployed.address;
|
|
477
|
+
await releaser(release, networkName, "deployment", false);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
if (!isProduction || get(release, "StakingContracts", []).length == 0) {
|
|
481
|
+
const { DonationsStaking, StakingContracts } =
|
|
482
|
+
isMainnet && (await deployStakingContracts(release));
|
|
483
|
+
release["StakingContracts"] = StakingContracts;
|
|
484
|
+
release["DonationsStaking"] = DonationsStaking;
|
|
485
|
+
console.log("staking contracts result:", {
|
|
486
|
+
StakingContracts,
|
|
487
|
+
DonationsStaking
|
|
488
|
+
});
|
|
462
489
|
}
|
|
463
490
|
|
|
464
|
-
const { DonationsStaking, StakingContracts } =
|
|
465
|
-
isMainnet && (await deployStakingContracts(release));
|
|
466
491
|
release["network"] = networkName;
|
|
467
492
|
release["networkId"] = network.config.chainId || 4447;
|
|
468
493
|
if (!isMainnet) {
|
|
@@ -475,8 +500,7 @@ export const main = async (
|
|
|
475
500
|
release["ForeignBridge"] = dao.ForeignBridge;
|
|
476
501
|
release["Contribution"] = dao.Contribution;
|
|
477
502
|
}
|
|
478
|
-
|
|
479
|
-
release["DonationsStaking"] = DonationsStaking;
|
|
503
|
+
|
|
480
504
|
release["Identity"] = dao.Identity;
|
|
481
505
|
release["GoodDollar"] = dao.GoodDollar;
|
|
482
506
|
release["Controller"] = dao.Controller;
|
|
@@ -489,10 +513,6 @@ export const main = async (
|
|
|
489
513
|
release["cDAI"] = get(protocolSettings, "compound.cdai", dao.cDAI);
|
|
490
514
|
release["COMP"] = get(protocolSettings, "compound.comp", dao.COMP);
|
|
491
515
|
|
|
492
|
-
console.log("staking contracts result:", {
|
|
493
|
-
StakingContracts,
|
|
494
|
-
DonationsStaking
|
|
495
|
-
});
|
|
496
516
|
release = omitBy(release, _ => _ === undefined);
|
|
497
517
|
let res = Object.assign(newdao, release);
|
|
498
518
|
await releaser(release, networkName);
|
|
@@ -775,7 +795,8 @@ export const main = async (
|
|
|
775
795
|
protocolSettings.staking.fullRewardsThreshold, //blocks before switching for 0.5x rewards to 1x multiplier
|
|
776
796
|
token.usdOracle,
|
|
777
797
|
token.compUsdOracle,
|
|
778
|
-
token.swapPath
|
|
798
|
+
token.swapPath,
|
|
799
|
+
GAS_SETTINGS
|
|
779
800
|
)
|
|
780
801
|
).wait();
|
|
781
802
|
await countTotalGas(tx, "deploy comp staking");
|
|
@@ -813,7 +834,8 @@ export const main = async (
|
|
|
813
834
|
dao.AaveIncentiveController
|
|
814
835
|
),
|
|
815
836
|
token.aaveUsdOracle,
|
|
816
|
-
token.swapPath
|
|
837
|
+
token.swapPath,
|
|
838
|
+
GAS_SETTINGS
|
|
817
839
|
)
|
|
818
840
|
).wait();
|
|
819
841
|
await countTotalGas(tx, "deploy aave staking");
|
|
@@ -873,22 +895,17 @@ export const main = async (
|
|
|
873
895
|
) {
|
|
874
896
|
console.log(
|
|
875
897
|
contract,
|
|
876
|
-
" Skipping non mainnet/sidechain contract:",
|
|
898
|
+
" Skipping verification non mainnet/sidechain contract:",
|
|
877
899
|
contract.network,
|
|
878
900
|
contract.name
|
|
879
901
|
);
|
|
880
902
|
continue;
|
|
881
903
|
}
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
"upgrading:",
|
|
888
|
-
!!process.env.UPGRADE
|
|
889
|
-
);
|
|
890
|
-
continue;
|
|
891
|
-
}
|
|
904
|
+
console.log(
|
|
905
|
+
"Running contract verification:",
|
|
906
|
+
{ contract },
|
|
907
|
+
release[contract.name]
|
|
908
|
+
);
|
|
892
909
|
if (contract.isUpgradable !== false) {
|
|
893
910
|
const implementationAddress = await getImplementationAddress(
|
|
894
911
|
network.provider,
|
|
@@ -905,7 +922,10 @@ export const main = async (
|
|
|
905
922
|
try {
|
|
906
923
|
await run("verify:verify", {
|
|
907
924
|
address: release[contract.name],
|
|
908
|
-
constructorArguments: contract.args
|
|
925
|
+
constructorArguments: contract.args,
|
|
926
|
+
libraries: {
|
|
927
|
+
UniswapV2SwapHelper: release["UniswapV2SwapHelper"]
|
|
928
|
+
}
|
|
909
929
|
});
|
|
910
930
|
} catch (err) {
|
|
911
931
|
console.log("err", err);
|
|
@@ -933,7 +953,7 @@ export const main = async (
|
|
|
933
953
|
// await proveNewRep();
|
|
934
954
|
};
|
|
935
955
|
if (network.name !== "hardhat") {
|
|
936
|
-
main(name)
|
|
956
|
+
main(name, false)
|
|
937
957
|
.catch(e => {
|
|
938
958
|
console.log(e);
|
|
939
959
|
throw e;
|
|
@@ -22,9 +22,6 @@ describe("CompoundVotingMachine#CastVote", () => {
|
|
|
22
22
|
|
|
23
23
|
before(async () => {
|
|
24
24
|
[root, acct, ...signers] = await ethers.getSigners();
|
|
25
|
-
const CompoundVotingMachine = await ethers.getContractFactory(
|
|
26
|
-
"CompoundVotingMachine"
|
|
27
|
-
);
|
|
28
25
|
|
|
29
26
|
let {
|
|
30
27
|
daoCreator,
|
|
@@ -59,15 +59,6 @@ describe("CompoundVotingMachine#DAOScheme", () => {
|
|
|
59
59
|
before(async () => {
|
|
60
60
|
[root, acct, ...signers] = await ethers.getSigners();
|
|
61
61
|
|
|
62
|
-
// const GReputation = await ethers.getContractFactory("GReputation");
|
|
63
|
-
const CompoundVotingMachine = await ethers.getContractFactory(
|
|
64
|
-
"CompoundVotingMachine"
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
// grep = (await upgrades.deployProxy(GReputation, [root.address], {
|
|
68
|
-
// unsafeAllowCustomTypes: true
|
|
69
|
-
// })) as GReputation;
|
|
70
|
-
|
|
71
62
|
let {
|
|
72
63
|
daoCreator,
|
|
73
64
|
controller,
|
|
@@ -50,10 +50,6 @@ describe("CompoundVotingMachine#Guardian", () => {
|
|
|
50
50
|
before(async () => {
|
|
51
51
|
[root, acct, ...signers] = await ethers.getSigners();
|
|
52
52
|
|
|
53
|
-
const CompoundVotingMachine = await ethers.getContractFactory(
|
|
54
|
-
"CompoundVotingMachine"
|
|
55
|
-
);
|
|
56
|
-
|
|
57
53
|
let {
|
|
58
54
|
daoCreator,
|
|
59
55
|
controller,
|
|
@@ -94,6 +90,15 @@ describe("CompoundVotingMachine#Guardian", () => {
|
|
|
94
90
|
mock.mock.rec.returns();
|
|
95
91
|
});
|
|
96
92
|
|
|
93
|
+
it("should set guardian from initializer", async () => {
|
|
94
|
+
const votingMachine = (await upgrades.deployProxy(
|
|
95
|
+
await ethers.getContractFactory("CompoundVotingMachine"),
|
|
96
|
+
[nameService.address, 5760, signers[2].address],
|
|
97
|
+
{ kind: "uups" }
|
|
98
|
+
)) as unknown as CompoundVotingMachine;
|
|
99
|
+
expect(await votingMachine.guardian()).to.equal(signers[2].address);
|
|
100
|
+
});
|
|
101
|
+
|
|
97
102
|
it("Should have deployer as guardian", async () => {
|
|
98
103
|
expect(await gov.guardian()).to.equal(root.address);
|
|
99
104
|
});
|
|
@@ -146,7 +151,7 @@ describe("CompoundVotingMachine#Guardian", () => {
|
|
|
146
151
|
|
|
147
152
|
const gov2 = (await upgrades.deployProxy(
|
|
148
153
|
CompoundVotingMachine,
|
|
149
|
-
[nameService.address, 5760],
|
|
154
|
+
[nameService.address, 5760, root.address],
|
|
150
155
|
{ kind: "uups" }
|
|
151
156
|
)) as CompoundVotingMachine;
|
|
152
157
|
|
|
@@ -22,9 +22,6 @@ describe("CompoundVotingMachine#propose", () => {
|
|
|
22
22
|
|
|
23
23
|
before(async () => {
|
|
24
24
|
[root, acct, ...signers] = await ethers.getSigners();
|
|
25
|
-
const CompoundVotingMachine = await ethers.getContractFactory(
|
|
26
|
-
"CompoundVotingMachine"
|
|
27
|
-
);
|
|
28
25
|
|
|
29
26
|
let { avatar, reputation, setDAOAddress, nameService, votingMachine } =
|
|
30
27
|
await createDAO();
|
|
@@ -58,9 +58,6 @@ describe("CompoundVotingMachine#States", () => {
|
|
|
58
58
|
|
|
59
59
|
before(async () => {
|
|
60
60
|
[root, acct, ...signers] = await ethers.getSigners();
|
|
61
|
-
const CompoundVotingMachine = await ethers.getContractFactory(
|
|
62
|
-
"CompoundVotingMachine"
|
|
63
|
-
);
|
|
64
61
|
|
|
65
62
|
let {
|
|
66
63
|
setSchemes,
|
package/test/helpers.ts
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
GoodMarketMaker,
|
|
20
20
|
CompoundVotingMachine,
|
|
21
21
|
GoodCompoundStaking,
|
|
22
|
-
GoodAaveStaking
|
|
22
|
+
GoodAaveStaking
|
|
23
23
|
} from "../types";
|
|
24
24
|
import { Contract } from "@ethersproject/contracts";
|
|
25
25
|
import { BigNumber } from "@ethersproject/bignumber";
|
|
@@ -29,12 +29,12 @@ export const getStakingFactory = async (
|
|
|
29
29
|
) => {
|
|
30
30
|
let swapHelper = await ethers
|
|
31
31
|
.getContractFactory("UniswapV2SwapHelper")
|
|
32
|
-
.then(
|
|
32
|
+
.then(_ => _.deploy());
|
|
33
33
|
|
|
34
34
|
const simpleStakingFactory = await ethers.getContractFactory(factory, {
|
|
35
35
|
libraries: {
|
|
36
|
-
UniswapV2SwapHelper: swapHelper.address
|
|
37
|
-
}
|
|
36
|
+
UniswapV2SwapHelper: swapHelper.address
|
|
37
|
+
}
|
|
38
38
|
});
|
|
39
39
|
return simpleStakingFactory;
|
|
40
40
|
};
|
|
@@ -96,7 +96,7 @@ export const createDAO = async () => {
|
|
|
96
96
|
await daoCreator.avatar(),
|
|
97
97
|
[
|
|
98
98
|
"function owner() view returns (address)",
|
|
99
|
-
"function nativeToken() view returns (address)"
|
|
99
|
+
"function nativeToken() view returns (address)"
|
|
100
100
|
],
|
|
101
101
|
root
|
|
102
102
|
);
|
|
@@ -120,7 +120,7 @@ export const createDAO = async () => {
|
|
|
120
120
|
contribution.address,
|
|
121
121
|
BancorFormula.address,
|
|
122
122
|
dai.address,
|
|
123
|
-
cDAI.address
|
|
123
|
+
cDAI.address
|
|
124
124
|
]);
|
|
125
125
|
const nameService = await upgrades.deployProxy(
|
|
126
126
|
await ethers.getContractFactory("NameService"),
|
|
@@ -138,8 +138,8 @@ export const createDAO = async () => {
|
|
|
138
138
|
"COMP",
|
|
139
139
|
"UBISCHEME",
|
|
140
140
|
"BRIDGE_CONTRACT",
|
|
141
|
-
"UBI_RECIPIENT"
|
|
142
|
-
].map(
|
|
141
|
+
"UBI_RECIPIENT"
|
|
142
|
+
].map(_ => ethers.utils.keccak256(ethers.utils.toUtf8Bytes(_))),
|
|
143
143
|
[
|
|
144
144
|
controller,
|
|
145
145
|
Avatar.address,
|
|
@@ -152,11 +152,11 @@ export const createDAO = async () => {
|
|
|
152
152
|
COMP.address,
|
|
153
153
|
root.address,
|
|
154
154
|
root.address,
|
|
155
|
-
root.address
|
|
156
|
-
]
|
|
155
|
+
root.address
|
|
156
|
+
]
|
|
157
157
|
],
|
|
158
158
|
{
|
|
159
|
-
kind: "uups"
|
|
159
|
+
kind: "uups"
|
|
160
160
|
}
|
|
161
161
|
);
|
|
162
162
|
|
|
@@ -167,11 +167,11 @@ export const createDAO = async () => {
|
|
|
167
167
|
[
|
|
168
168
|
nameService.address,
|
|
169
169
|
//check sample merkle tree generated by gdxAirdropCalculation.ts script
|
|
170
|
-
"0x26ef809f3f845395c0bc66ce1eea85146516cb99afd030e2085b13e79514e94c"
|
|
170
|
+
"0x26ef809f3f845395c0bc66ce1eea85146516cb99afd030e2085b13e79514e94c"
|
|
171
171
|
],
|
|
172
172
|
{
|
|
173
173
|
initializer: "initialize(address, bytes32)",
|
|
174
|
-
kind: "uups"
|
|
174
|
+
kind: "uups"
|
|
175
175
|
}
|
|
176
176
|
);
|
|
177
177
|
console.log("deploying marketMaker...");
|
|
@@ -190,7 +190,7 @@ export const createDAO = async () => {
|
|
|
190
190
|
[nameService.address, "", ethers.constants.HashZero, 0],
|
|
191
191
|
{
|
|
192
192
|
kind: "uups",
|
|
193
|
-
initializer: "initialize(address, string, bytes32, uint256)"
|
|
193
|
+
initializer: "initialize(address, string, bytes32, uint256)"
|
|
194
194
|
}
|
|
195
195
|
);
|
|
196
196
|
|
|
@@ -218,7 +218,7 @@ export const createDAO = async () => {
|
|
|
218
218
|
const setDAOAddress = async (name, addr) => {
|
|
219
219
|
const encoded = nameService.interface.encodeFunctionData("setAddress", [
|
|
220
220
|
name,
|
|
221
|
-
addr
|
|
221
|
+
addr
|
|
222
222
|
]);
|
|
223
223
|
|
|
224
224
|
await ictrl.genericCall(nameService.address, encoded, Avatar.address, 0);
|
|
@@ -285,7 +285,7 @@ export const createDAO = async () => {
|
|
|
285
285
|
);
|
|
286
286
|
const votingMachine = (await upgrades.deployProxy(
|
|
287
287
|
await ethers.getContractFactory("CompoundVotingMachine"),
|
|
288
|
-
[nameService.address, 5760],
|
|
288
|
+
[nameService.address, 5760, root.address],
|
|
289
289
|
{ kind: "uups" }
|
|
290
290
|
)) as unknown as CompoundVotingMachine;
|
|
291
291
|
return {
|
|
@@ -308,10 +308,10 @@ export const createDAO = async () => {
|
|
|
308
308
|
cdaiAddress: cDAI.address,
|
|
309
309
|
COMP,
|
|
310
310
|
reputation: reputation.address,
|
|
311
|
-
votingMachine
|
|
311
|
+
votingMachine
|
|
312
312
|
};
|
|
313
313
|
};
|
|
314
|
-
export const deployUBI = async
|
|
314
|
+
export const deployUBI = async deployedDAO => {
|
|
315
315
|
let { nameService, setSchemes, genericCall, setDAOAddress } = deployedDAO;
|
|
316
316
|
const fcFactory = new ethers.ContractFactory(
|
|
317
317
|
FirstClaimPool.abi,
|
|
@@ -321,7 +321,7 @@ export const deployUBI = async (deployedDAO) => {
|
|
|
321
321
|
|
|
322
322
|
console.log("deploying first claim...", {
|
|
323
323
|
avatar: await nameService.getAddress("AVATAR"),
|
|
324
|
-
identity: await nameService.getAddress("IDENTITY")
|
|
324
|
+
identity: await nameService.getAddress("IDENTITY")
|
|
325
325
|
});
|
|
326
326
|
const firstClaim = await fcFactory.deploy(
|
|
327
327
|
await nameService.getAddress("AVATAR"),
|
|
@@ -330,7 +330,7 @@ export const deployUBI = async (deployedDAO) => {
|
|
|
330
330
|
);
|
|
331
331
|
|
|
332
332
|
console.log("deploying ubischeme and starting...", {
|
|
333
|
-
input: [nameService.address, firstClaim.address, 14]
|
|
333
|
+
input: [nameService.address, firstClaim.address, 14]
|
|
334
334
|
});
|
|
335
335
|
|
|
336
336
|
let ubiScheme = await upgrades.deployProxy(
|
|
@@ -354,7 +354,7 @@ export const deployUBI = async (deployedDAO) => {
|
|
|
354
354
|
await genericCall(gd, encoded);
|
|
355
355
|
|
|
356
356
|
encoded = firstClaim.interface.encodeFunctionData("setUBIScheme", [
|
|
357
|
-
ubiScheme.address
|
|
357
|
+
ubiScheme.address
|
|
358
358
|
]);
|
|
359
359
|
|
|
360
360
|
await genericCall(firstClaim.address, encoded);
|
|
@@ -365,7 +365,7 @@ export const deployUBI = async (deployedDAO) => {
|
|
|
365
365
|
setDAOAddress("UBISCHEME", ubiScheme.address);
|
|
366
366
|
return { firstClaim, ubiScheme };
|
|
367
367
|
};
|
|
368
|
-
export const deployOldUBI = async
|
|
368
|
+
export const deployOldUBI = async deployedDAO => {
|
|
369
369
|
let { nameService, setSchemes, genericCall, setDAOAddress } = deployedDAO;
|
|
370
370
|
const fcFactory = new ethers.ContractFactory(
|
|
371
371
|
FirstClaimPool.abi,
|
|
@@ -379,7 +379,7 @@ export const deployOldUBI = async (deployedDAO) => {
|
|
|
379
379
|
);
|
|
380
380
|
console.log("deploying first claim...", {
|
|
381
381
|
avatar: await nameService.getAddress("AVATAR"),
|
|
382
|
-
identity: await nameService.getAddress("IDENTITY")
|
|
382
|
+
identity: await nameService.getAddress("IDENTITY")
|
|
383
383
|
});
|
|
384
384
|
const firstClaim = await fcFactory.deploy(
|
|
385
385
|
await nameService.getAddress("AVATAR"),
|
|
@@ -388,7 +388,7 @@ export const deployOldUBI = async (deployedDAO) => {
|
|
|
388
388
|
);
|
|
389
389
|
|
|
390
390
|
console.log("deploying ubischeme and starting...", {
|
|
391
|
-
input: [nameService.address, firstClaim.address, 14]
|
|
391
|
+
input: [nameService.address, firstClaim.address, 14]
|
|
392
392
|
});
|
|
393
393
|
const block = await ethers.provider.getBlock("latest");
|
|
394
394
|
const startUBI = block.timestamp - 60 * 60 * 24 * 2;
|
|
@@ -439,7 +439,7 @@ export const advanceBlocks = async (blocks: number) => {
|
|
|
439
439
|
}
|
|
440
440
|
};
|
|
441
441
|
|
|
442
|
-
export const deployOldVoting = async
|
|
442
|
+
export const deployOldVoting = async dao => {
|
|
443
443
|
try {
|
|
444
444
|
const SchemeRegistrarF = new ethers.ContractFactory(
|
|
445
445
|
SchemeRegistrar.abi,
|
|
@@ -460,7 +460,7 @@ export const deployOldVoting = async (dao) => {
|
|
|
460
460
|
const [absoluteVote, upgradeScheme, schemeRegistrar] = await Promise.all([
|
|
461
461
|
AbsoluteVoteF.deploy(),
|
|
462
462
|
UpgradeSchemeF.deploy(),
|
|
463
|
-
SchemeRegistrarF.deploy()
|
|
463
|
+
SchemeRegistrarF.deploy()
|
|
464
464
|
]);
|
|
465
465
|
console.log("setting parameters");
|
|
466
466
|
const voteParametersHash = await absoluteVote.getParametersHash(
|
|
@@ -477,7 +477,7 @@ export const deployOldVoting = async (dao) => {
|
|
|
477
477
|
absoluteVote.address
|
|
478
478
|
),
|
|
479
479
|
absoluteVote.setParameters(50, ethers.constants.AddressZero),
|
|
480
|
-
upgradeScheme.setParameters(voteParametersHash, absoluteVote.address)
|
|
480
|
+
upgradeScheme.setParameters(voteParametersHash, absoluteVote.address)
|
|
481
481
|
]);
|
|
482
482
|
const upgradeParametersHash = await upgradeScheme.getParametersHash(
|
|
483
483
|
voteParametersHash,
|
|
@@ -502,7 +502,7 @@ export const deployOldVoting = async (dao) => {
|
|
|
502
502
|
return {
|
|
503
503
|
schemeRegistrar,
|
|
504
504
|
upgradeScheme,
|
|
505
|
-
absoluteVote
|
|
505
|
+
absoluteVote
|
|
506
506
|
};
|
|
507
507
|
} catch (e) {
|
|
508
508
|
console.log("deployVote failed", e);
|
|
@@ -565,7 +565,7 @@ export const deployUniswap = async (comp, dai) => {
|
|
|
565
565
|
);
|
|
566
566
|
console.log("depositing eth to liquidity pools");
|
|
567
567
|
await weth.deposit({ value: ethers.utils.parseEther("4000") });
|
|
568
|
-
console.log(await weth.balanceOf(founder.address).then(
|
|
568
|
+
console.log(await weth.balanceOf(founder.address).then(_ => _.toString()));
|
|
569
569
|
await weth.transfer(compPair.address, ethers.utils.parseEther("2000"));
|
|
570
570
|
await weth.transfer(daiPair.address, ethers.utils.parseEther("2000"));
|
|
571
571
|
console.log("minting liquidity pools");
|
|
@@ -578,6 +578,6 @@ export const deployUniswap = async (comp, dai) => {
|
|
|
578
578
|
factory,
|
|
579
579
|
weth,
|
|
580
580
|
compPairContract: compPair,
|
|
581
|
-
daiPairContract: daiPair
|
|
581
|
+
daiPairContract: daiPair
|
|
582
582
|
};
|
|
583
583
|
};
|
|
@@ -478,10 +478,7 @@ describe("UBIScheme", () => {
|
|
|
478
478
|
await ubi.connect(claimer2).claim();
|
|
479
479
|
let claimer4BalanceAfter = await goodDollar.balanceOf(claimer2.address);
|
|
480
480
|
expect(
|
|
481
|
-
ubiBalance
|
|
482
|
-
.add(avatarBalance)
|
|
483
|
-
.div(activeUsersCount)
|
|
484
|
-
.toNumber()
|
|
481
|
+
ubiBalance.add(avatarBalance).div(activeUsersCount).toNumber()
|
|
485
482
|
).to.be.equal(
|
|
486
483
|
claimer4BalanceAfter.toNumber() - claimer4BalanceBefore.toNumber()
|
|
487
484
|
);
|
|
@@ -498,18 +495,12 @@ describe("UBIScheme", () => {
|
|
|
498
495
|
let claimer4BalanceAfter = await goodDollar.balanceOf(claimer2.address);
|
|
499
496
|
let dailyUbi = await ubi.dailyUbi();
|
|
500
497
|
expect(
|
|
501
|
-
ubiBalance
|
|
502
|
-
.add(avatarBalance)
|
|
503
|
-
.div(activeUsersCount)
|
|
504
|
-
.toNumber()
|
|
498
|
+
ubiBalance.add(avatarBalance).div(activeUsersCount).toNumber()
|
|
505
499
|
).to.be.equal(
|
|
506
500
|
claimer4BalanceAfter.toNumber() - claimer4BalanceBefore.toNumber()
|
|
507
501
|
);
|
|
508
502
|
expect(
|
|
509
|
-
ubiBalance
|
|
510
|
-
.add(avatarBalance)
|
|
511
|
-
.div(activeUsersCount)
|
|
512
|
-
.toNumber()
|
|
503
|
+
ubiBalance.add(avatarBalance).div(activeUsersCount).toNumber()
|
|
513
504
|
).to.be.equal(dailyUbi.toNumber());
|
|
514
505
|
});
|
|
515
506
|
|
|
@@ -553,16 +544,14 @@ describe("UBIScheme", () => {
|
|
|
553
544
|
expect(res).to.be.true;
|
|
554
545
|
});
|
|
555
546
|
|
|
556
|
-
it("should return the
|
|
547
|
+
it("should return the estimated claim value for entitlement user before anyone claimed", async () => {
|
|
557
548
|
await increaseTime(ONE_DAY);
|
|
558
549
|
await ubi.connect(claimer1).claim();
|
|
559
550
|
await increaseTime(ONE_DAY);
|
|
560
551
|
let amount = await ubi.connect(claimer1).checkEntitlement();
|
|
561
552
|
let balance2 = await goodDollar.balanceOf(ubi.address);
|
|
562
|
-
let
|
|
563
|
-
expect(amount
|
|
564
|
-
balance2.div(activeUsersCount).toString()
|
|
565
|
-
);
|
|
553
|
+
let estimated = await ubi.estimateNextDailyUBI();
|
|
554
|
+
expect(amount).to.be.equal(estimated);
|
|
566
555
|
});
|
|
567
556
|
|
|
568
557
|
it("should set the ubi claim amount by avatar", async () => {
|
|
@@ -154,18 +154,18 @@ describe("UBIScheme cycle", () => {
|
|
|
154
154
|
|
|
155
155
|
const cycleLength = await ubiScheme.cycleLength();
|
|
156
156
|
const curDailyPool = await ubiScheme.dailyCyclePool();
|
|
157
|
-
console.log({ balance, cycleLength, curDailyPool });
|
|
158
157
|
|
|
159
158
|
//verify new daily pool IS gonna be larger than current
|
|
160
159
|
expect(balance.div(cycleLength)).to.be.gt(curDailyPool);
|
|
161
160
|
|
|
161
|
+
const estimated = await ubiScheme.estimateNextDailyUBI();
|
|
162
162
|
await increaseTime(ONE_DAY); //make sure
|
|
163
163
|
let transaction = await (await ubiScheme.connect(claimer1).claim()).wait();
|
|
164
|
-
|
|
165
164
|
const cycleEvent = transaction.events.find(
|
|
166
165
|
e => e.event === "UBICycleCalculated"
|
|
167
166
|
);
|
|
168
|
-
|
|
167
|
+
const dailyUBI = await ubiScheme.dailyUbi();
|
|
168
|
+
expect(dailyUBI).to.eq(estimated); //the estimated before actual calculation should be correct, ie equal to actual dailyUBI calculated after first claim.
|
|
169
169
|
expect(cycleEvent).to.be.not.empty;
|
|
170
170
|
expect(cycleEvent.args.day.toNumber()).to.be.a("number");
|
|
171
171
|
expect(cycleEvent.args.pool).to.be.equal(balance);
|
|
@@ -183,7 +183,6 @@ describe("UBIScheme cycle", () => {
|
|
|
183
183
|
let balance = await goodDollar.balanceOf(ubiScheme.address);
|
|
184
184
|
const curCycleLen = await ubiScheme.cycleLength();
|
|
185
185
|
const curDailyPool = await ubiScheme.dailyCyclePool();
|
|
186
|
-
console.log({ balance, curCycleLen, curDailyPool });
|
|
187
186
|
//verify new daily pool is not gonna be larger than current
|
|
188
187
|
expect(balance.div(curCycleLen)).to.be.lt(curDailyPool);
|
|
189
188
|
|
|
@@ -17,6 +17,7 @@ export const BLOCK_INTERVAL = 1;
|
|
|
17
17
|
describe("ProtocolUpgrade - Upgrade old protocol contracts to new ones", () => {
|
|
18
18
|
let avatar,
|
|
19
19
|
fuseAvatar,
|
|
20
|
+
deployment,
|
|
20
21
|
dai,
|
|
21
22
|
cDAI,
|
|
22
23
|
signers,
|
|
@@ -186,7 +187,7 @@ describe("ProtocolUpgrade - Upgrade old protocol contracts to new ones", () => {
|
|
|
186
187
|
oldDonationsStaking
|
|
187
188
|
);
|
|
188
189
|
const fse = require("fs-extra");
|
|
189
|
-
|
|
190
|
+
deployment = await fse.readJson("releases/deployment.json");
|
|
190
191
|
console.log("got deployment json file");
|
|
191
192
|
cdaiBalanceOfNewReserve = await cDAI.balanceOf(
|
|
192
193
|
deployment["test-mainnet"].GoodReserveCDai
|
|
@@ -399,6 +400,23 @@ describe("ProtocolUpgrade - Upgrade old protocol contracts to new ones", () => {
|
|
|
399
400
|
expect(isUpgradeSchemeRegisteredAfterUpgradeFuse).to.be.equal(false);
|
|
400
401
|
expect(isCompoundVotingMachineRegisteredFuse).to.be.equal(true);
|
|
401
402
|
});
|
|
403
|
+
it("should set guardian from settings", async () => {
|
|
404
|
+
const cvm = await ethers.getContractAt(
|
|
405
|
+
"CompoundVotingMachine",
|
|
406
|
+
deployment["test-mainnet"].CompoundVotingMachine
|
|
407
|
+
);
|
|
408
|
+
expect(await cvm.guardian()).to.equal(
|
|
409
|
+
"0x914dA3B2508634998d244059dAb5488D9bA1814f"
|
|
410
|
+
);
|
|
411
|
+
const fuseCVM = await ethers.getContractAt(
|
|
412
|
+
"CompoundVotingMachine",
|
|
413
|
+
deployment["test"].CompoundVotingMachine
|
|
414
|
+
);
|
|
415
|
+
expect(await fuseCVM.guardian()).to.equal(
|
|
416
|
+
"0x914dA3B2508634998d244059dAb5488D9bA1814f"
|
|
417
|
+
);
|
|
418
|
+
});
|
|
419
|
+
|
|
402
420
|
it("it should set fuse nameservice variables properly", async () => {
|
|
403
421
|
const fse = require("fs-extra");
|
|
404
422
|
const deployment = await fse.readJson("releases/deployment.json");
|
package/truffle-config.js
CHANGED
|
@@ -69,7 +69,25 @@ module.exports = {
|
|
|
69
69
|
confirmations: 2, // # of confs to wait between deployments. (default: 0)
|
|
70
70
|
timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
|
|
71
71
|
skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
|
|
72
|
+
},
|
|
73
|
+
fuse: {
|
|
74
|
+
provider: () => new HDWalletProvider(mnemonic, `https://rpc.fuse.io`),
|
|
75
|
+
network_id: 122, // Ropsten's id
|
|
76
|
+
gas: 8000000, // Ropsten has a lower block limit than mainnet
|
|
77
|
+
confirmations: 1, // # of confs to wait between deployments. (default: 0)
|
|
78
|
+
timeoutBlocks: 20, // # of blocks before a deployment times out (minimum/default: 50)
|
|
79
|
+
skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
|
|
80
|
+
},
|
|
81
|
+
fusespark: {
|
|
82
|
+
provider: () =>
|
|
83
|
+
new HDWalletProvider(mnemonic, `https://rpc.fusespark.io`),
|
|
84
|
+
network_id: 123, // Ropsten's id
|
|
85
|
+
gas: 8000000, // Ropsten has a lower block limit than mainnet
|
|
86
|
+
confirmations: 1, // # of confs to wait between deployments. (default: 0)
|
|
87
|
+
timeoutBlocks: 20, // # of blocks before a deployment times out (minimum/default: 50)
|
|
88
|
+
skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
|
|
72
89
|
}
|
|
90
|
+
|
|
73
91
|
// Useful for private networks
|
|
74
92
|
// private: {
|
|
75
93
|
// provider: () => new HDWalletProvider(mnemonic, `https://network.io`),
|
|
@@ -86,12 +104,12 @@ module.exports = {
|
|
|
86
104
|
// Configure your compilers
|
|
87
105
|
compilers: {
|
|
88
106
|
solc: {
|
|
89
|
-
version: "0.8.
|
|
107
|
+
version: "0.8.8", // Fetch exact version from solc-bin (default: truffle's version)
|
|
90
108
|
settings: {
|
|
91
109
|
// See the solidity docs for advice about optimization and evmVersion
|
|
92
110
|
optimizer: {
|
|
93
111
|
enabled: true,
|
|
94
|
-
runs:
|
|
112
|
+
runs: 0
|
|
95
113
|
}
|
|
96
114
|
}
|
|
97
115
|
}
|
|
@@ -109,5 +127,5 @@ module.exports = {
|
|
|
109
127
|
api_keys: {
|
|
110
128
|
etherscan: process.env.ETHERSCAN_KEY
|
|
111
129
|
},
|
|
112
|
-
plugins: ["truffle-
|
|
130
|
+
plugins: ["truffle-source-verify"]
|
|
113
131
|
};
|