@gooddollar/goodprotocol 1.0.7-beta.0 → 1.0.7

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.
Files changed (98) hide show
  1. package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
  2. package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
  3. package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
  4. package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
  5. package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
  6. package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
  7. package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
  8. package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
  9. package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
  10. package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
  11. package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
  12. package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
  13. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
  14. package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
  15. package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
  16. package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
  17. package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
  18. package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
  19. package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
  20. package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
  21. package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
  22. package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
  23. package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
  24. package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
  25. package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
  27. package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
  28. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  29. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  30. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  31. package/artifacts/contracts/governance/GovarnanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  32. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  33. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  34. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  35. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  36. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  37. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  38. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  39. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +6 -6
  40. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  41. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  42. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  43. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  44. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  45. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  46. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  47. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  48. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  49. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  50. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  51. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  52. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  53. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  54. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  55. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  56. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  57. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  58. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  59. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  60. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  61. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  62. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  63. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  64. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  65. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  66. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  67. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  68. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.json +3 -3
  69. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  70. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +4 -4
  71. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  72. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.json +2 -2
  73. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  74. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.json +4 -4
  75. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  76. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.json +2 -2
  77. package/artifacts/contracts/unaudited-foundation/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  78. package/artifacts/contracts/unaudited-foundation/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  79. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  80. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  81. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  82. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  83. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  84. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  85. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  86. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  87. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  88. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  89. package/contracts/staking/aave/GoodAaveStaking.sol +4 -3
  90. package/contracts/staking/compound/GoodCompoundStaking.sol +4 -3
  91. package/contracts/ubi/UBIScheme.sol +16 -11
  92. package/package.json +1 -1
  93. package/releases/deployment.json +107 -96
  94. package/releases/olddao.json +1 -406
  95. package/scripts/deployFullDAO.ts +19 -8
  96. package/scripts/misc/goodgiveback.ts +65 -0
  97. package/scripts/verify.ts +60 -47
  98. package/truffle-config.js +12 -0
package/scripts/verify.ts CHANGED
@@ -1,54 +1,67 @@
1
- import fs from "fs"
2
- import { isArray } from "lodash"
1
+ import fs from "fs";
2
+ import { isArray } from "lodash";
3
3
  import type EthersT from "ethers";
4
- import type HreT from "hardhat"
5
- import { HardhatEthersHelpers } from "@nomiclabs/hardhat-ethers/types"
6
- import { execSync } from "child_process"
7
- type Ethers = typeof EthersT.ethers & HardhatEthersHelpers
8
- type HRE = typeof HreT
4
+ import type HreT from "hardhat";
5
+ import { HardhatEthersHelpers } from "@nomiclabs/hardhat-ethers/types";
6
+ import { execSync } from "child_process";
7
+ type Ethers = typeof EthersT.ethers & HardhatEthersHelpers;
8
+ type HRE = typeof HreT;
9
9
 
10
- let ethers:Ethers
10
+ let ethers: Ethers;
11
11
  export const verify = async (hre: HRE) => {
12
- console.log("truffle compiling....")
13
- const Verify = require("truffle-plugin-verify") //not imported because of bug
14
- const truffleOutput = execSync("npx truffle compile").toString("utf8")
15
- console.log({truffleOutput})
16
- ethers = hre.ethers
17
- const deployed = JSON.parse(fs.readFileSync("releases/deployment.json").toString())
18
- const contracts = deployed[hre.network.name]
19
-
20
- const contractPairs = (await Promise.all(Object.entries(contracts).map(async (entry) => {
21
- if(isArray(entry[1]))
22
- return
23
- const addr = await getImplementationAddress(entry[1])
24
- return entry[0]+'@'+addr
25
- }))).filter(_ => _)
12
+ console.log("truffle compiling....");
13
+ const Verify = require("truffle-plugin-verify"); //not imported because of bug
14
+ const truffleOutput = execSync("npx truffle compile").toString("utf8");
15
+ console.log({ truffleOutput });
16
+ ethers = hre.ethers;
17
+ const deployed = JSON.parse(
18
+ fs.readFileSync("releases/deployment.json").toString()
19
+ );
20
+ const contracts = deployed[hre.network.name];
26
21
 
27
- contractPairs.unshift()
22
+ const contractPairs = (
23
+ await Promise.all(
24
+ Object.entries(contracts).map(async entry => {
25
+ if (isArray(entry[1])) return;
26
+ if (
27
+ typeof entry[1] !== "string" ||
28
+ (entry[1] as string).startsWith("0x") === false
29
+ )
30
+ return;
31
+ const addr = await getImplementationAddress(entry[1]);
32
+ return entry[0] + "@" + addr;
33
+ })
34
+ )
35
+ ).filter(_ => _);
28
36
 
29
- const config = {
30
- debug: false,
31
- network_id: hre.network.config.chainId,
32
- api_keys: {
33
- etherscan: hre.config.etherscan.apiKey
34
- },
35
- working_directory: ".",
36
- contracts_build_directory: "build/contracts",
37
- '_':contractPairs
38
- }
39
- return Verify(config)
37
+ contractPairs.unshift();
38
+
39
+ const config = {
40
+ debug: false,
41
+ network_id: hre.network.config.chainId,
42
+ api_keys: {
43
+ etherscan: hre.config.etherscan.apiKey
44
+ },
45
+ working_directory: ".",
46
+ contracts_build_directory: "build/contracts",
47
+ _: contractPairs
48
+ };
49
+ return Verify(config);
40
50
  };
41
51
 
42
- const getImplementationAddress = async (addr) => {
43
- let proxy = await ethers.provider.getStorageAt(addr,"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc")
44
- let res = addr
45
- if(proxy != ethers.constants.HashZero)
46
- res = "0x"+proxy.slice(-40)
47
- else {
48
- const code = await ethers.getDefaultProvider().getCode(addr)
49
- if(code.startsWith("0x363d3d373d3d3d363d73"))
50
- res = "0x"+code.slice(22,62)
51
- }
52
- console.log("impl address for:",addr,res)
53
- return res
54
- }
52
+ const getImplementationAddress = async addr => {
53
+ console.log("finding impl for:", addr);
54
+ let proxy = await ethers.provider.getStorageAt(
55
+ addr,
56
+ "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"
57
+ );
58
+ let res = addr;
59
+ if (proxy != ethers.constants.HashZero) res = "0x" + proxy.slice(-40);
60
+ else {
61
+ const code = await ethers.getDefaultProvider().getCode(addr);
62
+ if (code.startsWith("0x363d3d373d3d3d363d73"))
63
+ res = "0x" + code.slice(22, 62);
64
+ }
65
+ console.log("impl address for:", addr, res);
66
+ return res;
67
+ };
package/truffle-config.js CHANGED
@@ -70,6 +70,18 @@ module.exports = {
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
72
  },
73
+ ropsten: {
74
+ provider: () =>
75
+ new HDWalletProvider(
76
+ mnemonic,
77
+ `https://ropsten.infura.io/v3/YOUR-PROJECT-ID`
78
+ ),
79
+ network_id: 3, // Ropsten's id
80
+ gas: 5000000, // Ropsten has a lower block limit than mainnet
81
+ confirmations: 2, // # of confs to wait between deployments. (default: 0)
82
+ timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
83
+ skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
84
+ },
73
85
  fuse: {
74
86
  provider: () => new HDWalletProvider(mnemonic, `https://rpc.fuse.io`),
75
87
  network_id: 122, // Ropsten's id