@gooddollar/goodprotocol 1.0.25 → 1.0.27

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 (146) hide show
  1. package/artifacts/abis/FuseFaucet.min.json +1 -0
  2. package/artifacts/abis/FuseStakingV3.min.json +1 -0
  3. package/artifacts/abis/IConsensus.min.json +1 -0
  4. package/artifacts/abis/InvitesV1.min.json +1 -0
  5. package/artifacts/abis/PegSwap.min.json +1 -0
  6. package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
  7. package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
  8. package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
  9. package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
  10. package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
  11. package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
  12. package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
  13. package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
  14. package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
  15. package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
  16. package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
  17. package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
  18. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
  19. package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
  20. package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
  21. package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
  22. package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
  23. package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
  24. package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
  25. package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
  27. package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
  28. package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
  29. package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
  30. package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
  31. package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
  32. package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
  33. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +4 -0
  34. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.json +325 -0
  35. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  36. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  37. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  38. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  39. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  40. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  41. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  42. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +4 -0
  43. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.json +492 -0
  44. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  45. package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
  46. package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
  47. package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
  48. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  49. package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
  50. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  51. package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
  52. package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
  53. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  54. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  55. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  56. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  57. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  58. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  59. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  60. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  61. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  62. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  63. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  64. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
  65. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
  66. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  67. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  68. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  69. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  70. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  71. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  72. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  73. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  74. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  75. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  76. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  77. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  78. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  79. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  80. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  81. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +4 -0
  82. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.json +733 -0
  83. package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +4 -0
  84. package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.json +104 -0
  85. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +4 -0
  86. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.json +34 -0
  87. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  88. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  89. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  90. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  91. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  92. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  93. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  94. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  95. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  96. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  97. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  98. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  99. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
  100. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  101. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  102. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  103. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  104. package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
  105. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  106. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  107. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  108. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  109. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
  110. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
  111. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  112. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  113. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  114. package/contracts/fuseFaucet/FuseFaucet.sol +172 -0
  115. package/contracts/invite/InvitesV1.sol +316 -0
  116. package/contracts/staking/FuseStakingV3.sol +641 -0
  117. package/hardhat.config.ts +18 -1
  118. package/package.json +12 -12
  119. package/scripts/bulkProof.ts +0 -5
  120. package/scripts/misc/faucetStats.ts +103 -0
  121. package/scripts/multichain-deploy/basicdao-deploy.ts +0 -1
  122. package/scripts/upgradeScheme.ts +7 -12
  123. package/scripts/upgradeToV2/upgradeToV2.ts +22 -15
  124. package/scripts/upgradeToV2/upgradeToV2Recover.ts +0 -8
  125. package/test/FuseFaucet.test.ts +168 -0
  126. package/test/InvitesV1.test.ts +354 -0
  127. package/test/staking/FuseStaking.test.ts +152 -0
  128. package/test/utils/ProtocolUpgrade.test.ts +1 -4
  129. package/types/FuseFaucet.ts +498 -0
  130. package/types/FuseStakingV3.ts +1234 -0
  131. package/types/IConsensus.ts +225 -0
  132. package/types/InvitesV1.ts +797 -0
  133. package/types/OwnableUpgradeable.ts +166 -0
  134. package/types/PegSwap.ts +112 -0
  135. package/types/factories/FuseFaucet__factory.ts +373 -0
  136. package/types/factories/FuseStakingV3__factory.ts +781 -0
  137. package/types/factories/IConsensus__factory.ts +116 -0
  138. package/types/factories/InvitesV1__factory.ts +540 -0
  139. package/types/factories/OwnableUpgradeable__factory.ts +78 -0
  140. package/types/factories/PegSwap__factory.ts +46 -0
  141. package/types/hardhat.d.ts +54 -0
  142. package/types/index.ts +12 -0
  143. package/yarn.lock +320 -217
  144. package/patches/@nomiclabs+hardhat-etherscan+3.0.3.patch +0 -41
  145. package/patches/@openzeppelin+hardhat-upgrades+1.7.0.patch +0 -67
  146. package/patches/@openzeppelin+upgrades-core+1.4.2.patch +0 -21
@@ -1,41 +0,0 @@
1
- diff --git a/node_modules/@nomiclabs/hardhat-etherscan/dist/src/ChainConfig.js b/node_modules/@nomiclabs/hardhat-etherscan/dist/src/ChainConfig.js
2
- index 007d740..139c489 100644
3
- --- a/node_modules/@nomiclabs/hardhat-etherscan/dist/src/ChainConfig.js
4
- +++ b/node_modules/@nomiclabs/hardhat-etherscan/dist/src/ChainConfig.js
5
- @@ -10,6 +10,13 @@ exports.chainConfig = {
6
- browserURL: "https://etherscan.io",
7
- },
8
- },
9
- + celo: {
10
- + chainId: 42220,
11
- + urls: {
12
- + apiURL: "https://api.celoscan.xyz/api",
13
- + browserURL: "https://celoscan.xyz",
14
- + },
15
- + },
16
- harmony: {
17
- chainId: 1666600000,
18
- urls: {
19
- diff --git a/node_modules/@nomiclabs/hardhat-etherscan/dist/src/types.d.ts b/node_modules/@nomiclabs/hardhat-etherscan/dist/src/types.d.ts
20
- index 0a9efc3..88bdaac 100644
21
- --- a/node_modules/@nomiclabs/hardhat-etherscan/dist/src/types.d.ts
22
- +++ b/node_modules/@nomiclabs/hardhat-etherscan/dist/src/types.d.ts
23
- @@ -1,4 +1,4 @@
24
- -declare type Chain = "mainnet" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "bsc" | "bscTestnet" | "heco" | "hecoTestnet" | "opera" | "ftmTestnet" | "optimisticEthereum" | "optimisticKovan" | "polygon" | "polygonMumbai" | "arbitrumOne" | "arbitrumTestnet" | "avalanche" | "avalancheFujiTestnet" | "moonbeam" | "moonriver" | "moonbaseAlpha" | "harmony" | "harmonyTest" | "xdai" | "sokol" | "aurora" | "auroraTestnet";
25
- +declare type Chain = "celo" | "mainnet" | "ropsten" | "rinkeby" | "goerli" | "kovan" | "bsc" | "bscTestnet" | "heco" | "hecoTestnet" | "opera" | "ftmTestnet" | "optimisticEthereum" | "optimisticKovan" | "polygon" | "polygonMumbai" | "arbitrumOne" | "arbitrumTestnet" | "avalanche" | "avalancheFujiTestnet" | "moonbeam" | "moonriver" | "moonbaseAlpha" | "harmony" | "harmonyTest" | "xdai" | "sokol" | "aurora" | "auroraTestnet";
26
- export declare type ChainConfig = {
27
- [Network in Chain]: EtherscanChainConfig;
28
- };
29
- diff --git a/node_modules/@nomiclabs/hardhat-etherscan/src/types.ts b/node_modules/@nomiclabs/hardhat-etherscan/src/types.ts
30
- index b88e8fa..4c658b2 100644
31
- --- a/node_modules/@nomiclabs/hardhat-etherscan/src/types.ts
32
- +++ b/node_modules/@nomiclabs/hardhat-etherscan/src/types.ts
33
- @@ -36,7 +36,7 @@ type Chain =
34
- | "sokol"
35
- // aurora
36
- | "aurora"
37
- - | "auroraTestnet";
38
- + | "auroraTestnet" | "celo";
39
-
40
- export type ChainConfig = {
41
- [Network in Chain]: EtherscanChainConfig;
@@ -1,67 +0,0 @@
1
- diff --git a/node_modules/@openzeppelin/hardhat-upgrades/dist/deploy-proxy.d.ts b/node_modules/@openzeppelin/hardhat-upgrades/dist/deploy-proxy.d.ts
2
- index 2405883..5879166 100644
3
- --- a/node_modules/@openzeppelin/hardhat-upgrades/dist/deploy-proxy.d.ts
4
- +++ b/node_modules/@openzeppelin/hardhat-upgrades/dist/deploy-proxy.d.ts
5
- @@ -7,6 +7,7 @@ export interface DeployFunction {
6
- }
7
- export interface DeployOptions extends ValidationOptions {
8
- initializer?: string | false;
9
- + proxyFactory?: any;
10
- }
11
- export declare function makeDeployProxy(hre: HardhatRuntimeEnvironment): DeployFunction;
12
- //# sourceMappingURL=deploy-proxy.d.ts.map
13
-
14
- diff --git a/node_modules/@openzeppelin/hardhat-upgrades/dist/deploy-proxy.js b/node_modules/@openzeppelin/hardhat-upgrades/dist/deploy-proxy.js
15
- index 8dbb62a..d0761f4 100644
16
- --- a/node_modules/@openzeppelin/hardhat-upgrades/dist/deploy-proxy.js
17
- +++ b/node_modules/@openzeppelin/hardhat-upgrades/dist/deploy-proxy.js
18
- @@ -26,14 +26,15 @@ function makeDeployProxy(hre) {
19
- let proxyDeployment;
20
- switch (kind) {
21
- case 'uups': {
22
- - const ProxyFactory = await utils_1.getProxyFactory(hre, ImplFactory.signer);
23
- + const ProxyFactory = await (opts.proxyFactory || utils_1.getProxyFactory(hre, ImplFactory.signer))
24
- proxyDeployment = Object.assign({ kind }, await utils_1.deploy(ProxyFactory, impl, data));
25
- break;
26
- }
27
- case 'transparent': {
28
- const AdminFactory = await utils_1.getProxyAdminFactory(hre, ImplFactory.signer);
29
- const adminAddress = await upgrades_core_1.fetchOrDeployAdmin(provider, () => utils_1.deploy(AdminFactory));
30
- - const TransparentUpgradeableProxyFactory = await utils_1.getTransparentUpgradeableProxyFactory(hre, ImplFactory.signer);
31
- + const TransparentUpgradeableProxyFactory = await (opts.proxyFactory || utils_1.getTransparentUpgradeableProxyFactory(hre, ImplFactory.signer))
32
- +
33
- proxyDeployment = Object.assign({ kind }, await utils_1.deploy(TransparentUpgradeableProxyFactory, impl, adminAddress, data));
34
- break;
35
- }
36
- diff --git a/node_modules/@openzeppelin/hardhat-upgrades/src/deploy-proxy.ts b/node_modules/@openzeppelin/hardhat-upgrades/src/deploy-proxy.ts
37
- index c8beb0d..b187875 100644
38
- --- a/node_modules/@openzeppelin/hardhat-upgrades/src/deploy-proxy.ts
39
- +++ b/node_modules/@openzeppelin/hardhat-upgrades/src/deploy-proxy.ts
40
- @@ -25,6 +25,7 @@ export interface DeployFunction {
41
-
42
- export interface DeployOptions extends ValidationOptions {
43
- initializer?: string | false;
44
- + proxyFactory?: any;
45
- }
46
-
47
- export function makeDeployProxy(hre: HardhatRuntimeEnvironment): DeployFunction {
48
- @@ -59,7 +60,8 @@ export function makeDeployProxy(hre: HardhatRuntimeEnvironment): DeployFunction
49
- let proxyDeployment: Required<ProxyDeployment>;
50
- switch (kind) {
51
- case 'uups': {
52
- - const ProxyFactory = await getProxyFactory(hre, ImplFactory.signer);
53
- + const ProxyFactory = await (opts.proxyFactory || getProxyFactory(hre, ImplFactory.signer));
54
- +
55
- proxyDeployment = Object.assign({ kind }, await deploy(ProxyFactory, impl, data));
56
- break;
57
- }
58
- @@ -67,7 +69,8 @@ export function makeDeployProxy(hre: HardhatRuntimeEnvironment): DeployFunction
59
- case 'transparent': {
60
- const AdminFactory = await getProxyAdminFactory(hre, ImplFactory.signer);
61
- const adminAddress = await fetchOrDeployAdmin(provider, () => deploy(AdminFactory));
62
- - const TransparentUpgradeableProxyFactory = await getTransparentUpgradeableProxyFactory(hre, ImplFactory.signer);
63
- + const TransparentUpgradeableProxyFactory = await (opts.proxyFactory || getTransparentUpgradeableProxyFactory(hre, ImplFactory.signer););
64
- +
65
- proxyDeployment = Object.assign(
66
- { kind },
67
- await deploy(TransparentUpgradeableProxyFactory, impl, adminAddress, data),
@@ -1,21 +0,0 @@
1
- diff --git a/node_modules/@openzeppelin/upgrades-core/dist/provider.js b/node_modules/@openzeppelin/upgrades-core/dist/provider.js
2
- index 1fd10da..d80cf45 100644
3
- --- a/node_modules/@openzeppelin/upgrades-core/dist/provider.js
4
- +++ b/node_modules/@openzeppelin/upgrades-core/dist/provider.js
5
- @@ -33,14 +33,14 @@ async function getTransactionByHash(provider, txHash) {
6
- return provider.send('eth_getTransactionByHash', [txHash]);
7
- }
8
- exports.getTransactionByHash = getTransactionByHash;
9
- -exports.networkNames = Object.freeze({
10
- +exports.networkNames = {
11
- 1: 'mainnet',
12
- 2: 'morden',
13
- 3: 'ropsten',
14
- 4: 'rinkeby',
15
- 5: 'goerli',
16
- 42: 'kovan',
17
- -});
18
- +};
19
- async function isDevelopmentNetwork(provider) {
20
- const chainId = await getChainId(provider);
21
- // 1337 => ganache and geth --dev