@gooddollar/goodprotocol 1.0.13-beta.0 → 1.0.13

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 (129) 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/governance/StakersDistribution.sol/StakersDistribution.json +2 -2
  36. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  37. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  38. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  39. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  40. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +2 -2
  41. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  42. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.json +2 -2
  43. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  44. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  45. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  46. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  47. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.json +2 -2
  48. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  49. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  50. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  51. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  52. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  53. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  54. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  55. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  56. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  57. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  58. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  59. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  60. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  61. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  62. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.json +2 -2
  63. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  64. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.json +7 -2
  65. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  66. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  67. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.json +15 -2
  68. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  69. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  70. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  71. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.json +6 -6
  72. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  73. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.json +2 -2
  74. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  75. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  76. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  77. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  78. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.json +2 -2
  79. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  80. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +2 -2
  81. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  82. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.json +2 -2
  83. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  84. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.json +2 -2
  85. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  86. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.json +2 -2
  87. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  88. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.json +2 -2
  89. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  90. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.json +60 -2
  91. package/artifacts/contracts/unaudited-foundation/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  92. package/artifacts/contracts/unaudited-foundation/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  93. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  94. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  95. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  96. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  97. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  98. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  99. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  100. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  101. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.json +2 -2
  102. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  103. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +4 -0
  104. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.json +83 -0
  105. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +4 -0
  106. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.json +121 -0
  107. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  108. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.json +2 -2
  109. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  110. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.json +2 -2
  111. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  112. package/contracts/reserve/GoodMarketMaker.sol +3 -2
  113. package/contracts/reserve/GoodReserveCDai.sol +25 -21
  114. package/contracts/staking/DonationsStaking.sol +1 -0
  115. package/contracts/ubi/UBIScheme.sol +32 -4
  116. package/contracts/utils/ProtocolUpgrade.sol +3 -2
  117. package/contracts/utils/ProtocolUpgradeFuseRecover.sol +116 -0
  118. package/contracts/utils/ProtocolUpgradeRecover.sol +198 -0
  119. package/contracts/utils/ProxyFactory1967.sol +1 -0
  120. package/package.json +1 -1
  121. package/releases/deployment.json +65 -2
  122. package/scripts/deployFullDAO.ts +2 -1
  123. package/scripts/upgradeToV2/upgradeToV2Recover.ts +947 -0
  124. package/test/helpers.ts +1 -1
  125. package/test/reserve/GoodMarketMaker.test.ts +6 -5
  126. package/test/staking/DonationsStaking.test.ts +32 -19
  127. package/test/ubi/UBIScheme.e2e.test.ts +1 -1
  128. package/test/ubi/UBIScheme.test.ts +4 -4
  129. package/test/utils/ProxyFactory.test.ts +31 -0
@@ -288,11 +288,12 @@ contract ProtocolUpgrade {
288
288
  (ok, ) = controller.genericCall(
289
289
  ns.getAddress("MARKET_MAKER"),
290
290
  abi.encodeWithSignature(
291
- "initializeToken(address,uint256,uint256,uint32)",
291
+ "initializeToken(address,uint256,uint256,uint32,uint256)",
292
292
  cdai,
293
293
  rToken.gdSupply,
294
294
  rToken.reserveSupply,
295
- rToken.reserveRatio
295
+ rToken.reserveRatio,
296
+ 0
296
297
  ),
297
298
  avatar,
298
299
  0
@@ -0,0 +1,116 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity >=0.8.0;
3
+
4
+ import "../utils/NameService.sol";
5
+ import "../Interfaces.sol";
6
+
7
+ /**
8
+ a scheme that once approved in old AbsoluteVotingMachine will
9
+ set initial settings and permissions for the new protocol contracts and revoke old permissions
10
+ */
11
+ contract ProtocolUpgradeFuseRecover {
12
+ Controller controller;
13
+ address owner;
14
+ address avatar;
15
+
16
+ constructor(Controller _controller, address _owner) {
17
+ controller = _controller;
18
+ owner = _owner;
19
+ avatar = address(controller.avatar());
20
+ }
21
+
22
+ function upgrade(
23
+ INameService ns,
24
+ address firstClaimPool, //schemeRegistrar,upgradeScheme, old ubi, firstclaim
25
+ address ubiScheme,
26
+ bytes32[] calldata nameHash,
27
+ address[] calldata nameAddress
28
+ ) external {
29
+ require(msg.sender == owner, "only owner");
30
+ require(nameHash.length == nameAddress.length, "length mismatch");
31
+
32
+ setNameServiceContracts(ns, nameHash, nameAddress);
33
+ upgradeUBI(ubiScheme, firstClaimPool);
34
+ }
35
+
36
+ function upgradeUBI(address newUBI, address firstClaim) internal {
37
+ IGoodDollar gd = IGoodDollar(Avatar(avatar).nativeToken());
38
+
39
+ uint256 ubiBalance = gd.balanceOf(avatar);
40
+
41
+ (bool ok, ) = controller.genericCall(
42
+ address(firstClaim),
43
+ abi.encodeWithSignature("setUBIScheme(address)", newUBI),
44
+ address(avatar),
45
+ 0
46
+ );
47
+ require(ok, "setUBIScheme failed");
48
+
49
+ (ok, ) = controller.genericCall(
50
+ address(newUBI),
51
+ abi.encodeWithSignature("setUseFirstClaimPool(bool)", false),
52
+ address(avatar),
53
+ 0
54
+ );
55
+ require(ok, "setUseFirstClaimPool failed");
56
+
57
+ if (ubiBalance > 0) {
58
+ ok = controller.externalTokenTransfer(
59
+ address(gd),
60
+ newUBI,
61
+ ubiBalance,
62
+ address(avatar)
63
+ );
64
+ require(ok, "funds transfer to new ubischeme failed");
65
+ }
66
+ }
67
+
68
+ /**
69
+ * unregister old voting schemes
70
+ * register new voting scheme with all DAO permissions
71
+ */
72
+ function upgradeGovernance(
73
+ address schemeRegistrar,
74
+ address upgradeScheme,
75
+ address compoundVotingMachine
76
+ ) public {
77
+ require(msg.sender == owner, "only owner");
78
+
79
+ require(
80
+ controller.registerScheme(
81
+ compoundVotingMachine,
82
+ bytes32(0x0),
83
+ bytes4(0x0000001F),
84
+ avatar
85
+ ),
86
+ "registering compoundVotingMachine failed"
87
+ );
88
+
89
+ require(
90
+ controller.unregisterSelf(avatar),
91
+ "unregistering ProtocolUpgradeFuse failed"
92
+ );
93
+
94
+ selfdestruct(payable(owner));
95
+ }
96
+
97
+ //set contracts in nameservice that are deployed after INameService is created
98
+ // FUND_MANAGER RESERVE REPUTATION GDAO_STAKING GDAO_CLAIMERS ...
99
+ function setNameServiceContracts(
100
+ INameService ns,
101
+ bytes32[] memory names,
102
+ address[] memory addresses
103
+ ) internal {
104
+ (bool ok, ) = controller.genericCall(
105
+ address(ns),
106
+ abi.encodeWithSignature(
107
+ "setAddresses(bytes32[],address[])",
108
+ names,
109
+ addresses
110
+ ),
111
+ avatar,
112
+ 0
113
+ );
114
+ require(ok, "Calling setNameServiceContracts failed");
115
+ }
116
+ }
@@ -0,0 +1,198 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity >=0.8.0;
3
+
4
+ import "../Interfaces.sol";
5
+ import "../DAOStackInterfaces.sol";
6
+ import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
7
+
8
+ /**
9
+ a scheme that once approved in old AbsoluteVotingMachine is in charge of upgrading to new contracts
10
+ */
11
+ contract ProtocolUpgradeRecover {
12
+ Controller controller;
13
+ address owner;
14
+ address avatar;
15
+
16
+ modifier onlyOwner() {
17
+ require(msg.sender == owner, "only owner");
18
+ _;
19
+ }
20
+
21
+ constructor(Controller _controller, address _owner) {
22
+ controller = _controller;
23
+ owner = _owner;
24
+ avatar = address(controller.avatar());
25
+ }
26
+
27
+ /**
28
+ 1. set the DAO contracts in registery after they have been deployedDAO
29
+ 2. set the initial staking contracts and their rewards
30
+ */
31
+ function upgradeBasic(
32
+ INameService ns,
33
+ bytes32[] calldata nameHash,
34
+ address[] calldata nameAddress
35
+ ) external onlyOwner {
36
+ require(nameHash.length == nameAddress.length, "length mismatch");
37
+
38
+ _setNameServiceContracts(ns, nameHash, nameAddress);
39
+ }
40
+
41
+ //initialize rewards for v2 starting staking contracts
42
+ function setStakingRewards(
43
+ INameService ns,
44
+ address[] memory contracts,
45
+ uint256[] memory rewards
46
+ ) external onlyOwner {
47
+ require(contracts.length == rewards.length, "staking length mismatch");
48
+ for (uint256 i = 0; i < contracts.length; i++) {
49
+ (bool ok, ) = controller.genericCall(
50
+ ns.getAddress("FUND_MANAGER"),
51
+ abi.encodeWithSignature(
52
+ "setStakingReward(uint32,address,uint32,uint32,bool)",
53
+ rewards[i],
54
+ contracts[i],
55
+ 0,
56
+ 0,
57
+ false
58
+ ),
59
+ avatar,
60
+ 0
61
+ );
62
+ require(ok, "Calling setStakingRewards failed");
63
+ }
64
+ }
65
+
66
+ /**
67
+ 3. set new reserve as sole minter
68
+ 4. upgrade to new reserve
69
+ */
70
+ function upgradeReserve(INameService ns) external onlyOwner {
71
+ _setReserveSoleMinter(ns);
72
+
73
+ _setNewReserve(ns);
74
+ }
75
+
76
+ function setReserveGDXAirdrop(INameService ns, bytes32 airdrop)
77
+ external
78
+ onlyOwner
79
+ {
80
+ (bool ok, ) = controller.genericCall(
81
+ ns.getAddress("RESERVE"),
82
+ abi.encodeWithSignature("setGDXAirdrop(bytes32)", airdrop),
83
+ avatar,
84
+ 0
85
+ );
86
+ require(ok, "Calling setReserveGDXAirdrop failed");
87
+ }
88
+
89
+ receive() external payable {}
90
+
91
+ /**
92
+ * 6. upgrade to new DAO and relinquish control
93
+ * register new voting scheme with all DAO permissions
94
+ * NOTICE: call this last to finalize DAO decentralization!!!
95
+ */
96
+ function upgradeGovernance(address compoundVotingMachine) external onlyOwner {
97
+ require(
98
+ controller.registerScheme(
99
+ compoundVotingMachine,
100
+ bytes32(0x0),
101
+ bytes4(0x0000001F),
102
+ avatar
103
+ ),
104
+ "registering compoundVotingMachine failed"
105
+ );
106
+
107
+ require(
108
+ controller.unregisterSelf(avatar),
109
+ "unregistering protocolupgrade failed"
110
+ );
111
+ selfdestruct(payable(owner));
112
+ }
113
+
114
+ //add new reserve as minter
115
+ //renounace minter from avatar
116
+ //add reserve as global constraint on controller
117
+ function _setReserveSoleMinter(INameService ns) internal {
118
+ bool ok;
119
+ (ok, ) = controller.genericCall(
120
+ ns.getAddress("GOODDOLLAR"),
121
+ abi.encodeWithSignature("addMinter(address)", ns.getAddress("RESERVE")),
122
+ avatar,
123
+ 0
124
+ );
125
+ require(ok, "Calling addMinter failed");
126
+
127
+ (ok, ) = controller.genericCall(
128
+ address(ns.getAddress("GOODDOLLAR")),
129
+ abi.encodeWithSignature("renounceMinter()"),
130
+ avatar,
131
+ 0
132
+ );
133
+ require(ok, "Calling renounceMinter failed");
134
+
135
+ ok = controller.addGlobalConstraint(
136
+ ns.getAddress("RESERVE"),
137
+ bytes32(0x0),
138
+ avatar
139
+ );
140
+
141
+ require(ok, "Calling addGlobalConstraint failed");
142
+ }
143
+
144
+ //transfer funds(cdai + comp) from old reserve to new reserve/avatar
145
+ //end old reserve
146
+ //initialize new marketmaker with current cdai price, rr, reserves
147
+ function _setNewReserve(INameService ns) internal {
148
+ bool ok;
149
+
150
+ address cdai = ns.getAddress("CDAI");
151
+ uint256 oldReserveCdaiBalance = ERC20(cdai).balanceOf(avatar);
152
+
153
+ ok = controller.externalTokenTransfer(
154
+ cdai,
155
+ ns.getAddress("RESERVE"),
156
+ oldReserveCdaiBalance,
157
+ avatar
158
+ );
159
+
160
+ require(ok, "transfer cdai to new reserve failed");
161
+
162
+ (ok, ) = controller.genericCall(
163
+ ns.getAddress("MARKET_MAKER"),
164
+ abi.encodeWithSignature(
165
+ "initializeToken(address,uint256,uint256,uint32,uint256)",
166
+ cdai,
167
+ 604798140091,
168
+ 4325586750999495,
169
+ 805643,
170
+ 1645623572
171
+ ),
172
+ avatar,
173
+ 0
174
+ );
175
+
176
+ require(ok, "calling marketMaker initializeToken failed");
177
+ }
178
+
179
+ //set contracts in nameservice that are deployed after INameService is created
180
+ // FUND_MANAGER RESERVE REPUTATION GDAO_STAKING GDAO_CLAIMERS ...
181
+ function _setNameServiceContracts(
182
+ INameService ns,
183
+ bytes32[] memory names,
184
+ address[] memory addresses
185
+ ) internal {
186
+ (bool ok, ) = controller.genericCall(
187
+ address(ns),
188
+ abi.encodeWithSignature(
189
+ "setAddresses(bytes32[],address[])",
190
+ names,
191
+ addresses
192
+ ),
193
+ avatar,
194
+ 0
195
+ );
196
+ require(ok, "Calling setNameServiceContracts failed");
197
+ }
198
+ }
@@ -12,6 +12,7 @@ contract ERC1967Proxy is Proxy, ERC1967Upgrade {
12
12
  * function call, and allows initializating the storage of the proxy like a Solidity constructor.
13
13
  */
14
14
  function initialize(address _logic, bytes calldata _data) external payable {
15
+ require(_getImplementation() == address(0), "initialized");
15
16
  assert(
16
17
  _IMPLEMENTATION_SLOT ==
17
18
  bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddollar/goodprotocol",
3
- "version": "1.0.13-beta.0",
3
+ "version": "1.0.13",
4
4
  "description": "GoodDollar Protocol",
5
5
  "scripts": {
6
6
  "build": "scripts/build.sh deploy",
@@ -382,7 +382,7 @@
382
382
  "cDAI": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0",
383
383
  "COMP": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
384
384
  },
385
- "production": {
385
+ "production-bug": {
386
386
  "ProxyFactory": "0x4659176E962763e7C8A4eF965ecfD0fdf9f52057",
387
387
  "NameService": "0xe26867DDd22F9342d9F0D566D182f2c960683971",
388
388
  "GReputation": "0x3A9299BE789ac3730e4E4c49d6d2Ad1b8BC34DFf",
@@ -407,7 +407,7 @@
407
407
  "FuseFaucet": "0x01ab5966C1d742Ae0CFF7f14cC0F4D85156e83d9",
408
408
  "FuseStaking": "0xA199F0C353E25AdF022378B0c208D600f39a6505"
409
409
  },
410
- "production-mainnet": {
410
+ "production-mainnet-bug": {
411
411
  "ProxyFactory": "0x4659176E962763e7C8A4eF965ecfD0fdf9f52057",
412
412
  "NameService": "0xe26867DDd22F9342d9F0D566D182f2c960683971",
413
413
  "GReputation": "0x3A9299BE789ac3730e4E4c49d6d2Ad1b8BC34DFf",
@@ -451,5 +451,68 @@
451
451
  "DAI": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
452
452
  "cDAI": "0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643",
453
453
  "COMP": "0xc00e94cb662c3520282e6f5717214004a7f26888"
454
+ },
455
+ "production-mainnet": {
456
+ "ProxyFactory": "0xDa85fceD9Bd193526b7667F2AD1fD4A0F900d3A7",
457
+ "NameService": "0xec6dcE387B1616a0c44fF2E4fA9E90E53Cf14eb0",
458
+ "GoodMarketMaker": "0xDAC6A0c973Ba7cF3526dE456aFfA43AB421f659F",
459
+ "GoodReserveCDai": "0xa150a825d425B36329D8294eeF8bD0fE68f8F6E0",
460
+ "ExchangeHelper": "0x98FA532Dd5C3a6b66fbf370813803192DE4e0abd",
461
+ "ProtocolUpgradeRecover": "0x6f1b4dFDd7156FC5752541Ef35EDF57B48E74475",
462
+ "network": "production-mainnet",
463
+ "networkId": 1,
464
+ "ForeignBridge": "0xD5D11eE582c8931F336fbcd135e98CEE4DB8CCB0",
465
+ "Contribution": "0x8eEC64bb6807c0178f96277cCE6a334B4e565E5C",
466
+ "Identity": "0x76e76e10Ac308A1D54a00f9df27EdCE4801F288b",
467
+ "GoodDollar": "0x67C5870b4A41D4Ebef24d2456547A03F1f3e094B",
468
+ "Controller": "0x95C0d9dCEA1E243ED696F34CAc5e6559C3c128a3",
469
+ "Avatar": "0x1ecFD1afb601C406fF0e13c3485f2d75699b6817",
470
+ "ProxyAdmin": "0xA2db14C68aB35e620fEA5bF07d65e9bff84c994C",
471
+ "BancorFormula": "0xA049894d5dcaD406b7C827D6dc6A0B58CA4AE73a",
472
+ "DAI": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
473
+ "cDAI": "0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643",
474
+ "COMP": "0xc00e94cb662c3520282e6f5717214004a7f26888",
475
+ "StakingContracts": [
476
+ [
477
+ "0xD33bA17C8A644C585089145e86E282fada6F3bfd",
478
+ 310
479
+ ]
480
+ ],
481
+ "StakingContractsV2": [
482
+ [
483
+ "0x02416eb83cff1f19163f21010149c3867f3261e1",
484
+ 13888
485
+ ],
486
+ [
487
+ "0xf4c34bed7dd779485692bb1857acf9c561b45010",
488
+ 6944
489
+ ]
490
+ ],
491
+ "StakersDistribution": "0x12D15EfC3c9661AD68209CD197D416BFd9B145f5",
492
+ "GoodFundManager": "0x3F55BD3B432EDC73Bbb704Fa5a29CC08dc1aDBEB"
493
+ },
494
+ "production": {
495
+ "NameService": "0xec6dcE387B1616a0c44fF2E4fA9E90E53Cf14eb0",
496
+ "GReputation": "0x603B8C0F110E037b51A381CBCacAbb8d6c6E4543",
497
+ "CompoundVotingMachine": "0x57Ee6Ceff51CB30Ecb1245934a882c500Fbec1e9",
498
+ "ClaimersDistribution": "0x1aE4929090258A9D5000D98Cfb8A27174d345834",
499
+ "GovernanceStaking": "0x280226A143b7Dfdf84645006e32F899B531C2F98",
500
+ "UBIScheme": "0xd253A5203817225e9768C05E5996d642fb96bA86",
501
+ "ProtocolUpgradeFuseRecover": "0xBE43eCb37Af7F7C4A8606E672c504BE55Fc6226B",
502
+ "network": "production",
503
+ "networkId": 122,
504
+ "HomeBridge": "0xD39021DB018E2CAEadb4B2e6717D31550e7918D0",
505
+ "SignupBonus": "0x0000000000000000000000000000000000000000",
506
+ "OneTimePayments": "0xd9Aa86e0Ddb932bD78ab8c71C1B98F83cF610Bd4",
507
+ "Invites": "0xCa2F09c3ccFD7aD5cB9276918Bd1868f2b922ea0",
508
+ "AdminWallet": "0x9F75dAcB77419b87f568d417eBc84346e134144E",
509
+ "Identity": "0xFa8d865A962ca8456dF331D78806152d3aC5B84F",
510
+ "GoodDollar": "0x495d133B938596C9984d462F007B676bDc57eCEC",
511
+ "Controller": "0xBcE053b99e22158f8B62f4DBFbEdE1f936b2D4e4",
512
+ "Avatar": "0xf96dADc6D71113F6500e97590760C924dA1eF70e",
513
+ "FirstClaimPool": "0x18BcdF79A724648bF34eb06701be81bD072A2384",
514
+ "ProxyAdmin": "0x57179b2A8eB019157b0C3E761cdB26c82C982a3B",
515
+ "FuseFaucet": "0x01ab5966C1d742Ae0CFF7f14cC0F4D85156e83d9",
516
+ "FuseStaking": "0xA199F0C353E25AdF022378B0c208D600f39a6505"
454
517
  }
455
518
  }
@@ -256,7 +256,8 @@ export const createDAO = async () => {
256
256
  release.cDAI,
257
257
  "100",
258
258
  "10000",
259
- "1000000"
259
+ "1000000",
260
+ "0"
260
261
  ]);
261
262
 
262
263
  await genericCall(release.GoodMarketMaker, encoded);