@gooddollar/goodprotocol 2.0.3-beta.0 → 2.0.3
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/abis/Faucet.min.json +1 -1
- package/artifacts/abis/FuseFaucetV2.min.json +1 -1
- package/artifacts/abis/GoodDollarMintBurnWrapper.min.json +1 -1
- 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/IIdentityV2.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IMultichainRouter.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/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.json +43 -17
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.json +37 -17
- 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/GReputation.sol/GReputation.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
- package/artifacts/contracts/governance/GovernanceStaking.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/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
- 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/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.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/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.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/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.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/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.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/DistributionHelper.sol/DistributionHelper.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/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.json +2 -2
- package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
- 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/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
- package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
- package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
- package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
- package/artifacts/contracts/token/FeesFormula.sol/IFeesFormula.dbg.json +1 -1
- package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.json +2 -2
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.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/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.json +2 -9
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.json +2 -2
- package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.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/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
- package/contracts/fuseFaucet/Faucet.sol +19 -10
- package/contracts/fuseFaucet/FuseFaucetV2.sol +28 -16
- package/contracts/ubi/UBIScheme.sol +1 -1
- package/contracts/utils/GoodDollarMintBurnWrapper.sol +1 -19
- package/package.json +1 -1
- package/releases/deployment.json +11 -3
- package/scripts/multichain-deploy/2_helpers-deploy.ts +46 -21
- package/scripts/multichain-deploy/4_ubi-deploy.ts +19 -35
- package/scripts/multichain-deploy/helpers.ts +2 -2
- package/scripts/multichain-deploy/multichainWrapper-deploy.ts +7 -4
- package/scripts/upgradeToV3/v3-fuse-multichain.ts +117 -0
- package/scripts/upgrades/celo-defi-ubi-deploy.ts +1 -1
- package/scripts/upgrades/identity-upgrade.ts +20 -12
- package/test/faucet/Faucet.test.ts +4 -3
- package/test/faucet/FuseFaucet.test.ts +1 -1
- package/test/ubi/UBISchemeCycle.test.ts +20 -58
- package/test/utils/GoodDollarMintBurnWrapper.test.ts +66 -224
- package/types/Faucet.ts +61 -32
- package/types/FuseFaucetV2.ts +69 -32
- package/types/GoodDollarMintBurnWrapper.ts +0 -27
- package/types/factories/Faucet__factory.ts +42 -16
- package/types/factories/FuseFaucetV2__factory.ts +36 -16
- package/types/factories/FuseStakingV3__factory.ts +1 -1
- package/types/factories/GoodDollarMintBurnWrapper__factory.ts +1 -8
- package/types/factories/UBIScheme__factory.ts +1 -1
- package/scripts/multichain-deploy/v3-fix.ts +0 -120
- package/scripts/multichain-deploy/v3-upgrade.ts +0 -219
|
@@ -18,7 +18,7 @@ contract FuseFaucetV2 is Initializable {
|
|
|
18
18
|
);
|
|
19
19
|
|
|
20
20
|
uint256 public perDayRoughLimit;
|
|
21
|
-
uint256 public
|
|
21
|
+
uint256 public gasTopping;
|
|
22
22
|
uint256 public gasRefund;
|
|
23
23
|
uint256 public startTime;
|
|
24
24
|
uint256 public currentDay;
|
|
@@ -55,7 +55,7 @@ contract FuseFaucetV2 is Initializable {
|
|
|
55
55
|
) public initializer {
|
|
56
56
|
if (relayer != address(0)) relayer = _relayer;
|
|
57
57
|
gasPrice = _gasPrice;
|
|
58
|
-
|
|
58
|
+
setGasTopping(gweiTopping);
|
|
59
59
|
maxDailyToppings = 3;
|
|
60
60
|
startTime = block.timestamp;
|
|
61
61
|
nameService = _ns;
|
|
@@ -64,6 +64,12 @@ contract FuseFaucetV2 is Initializable {
|
|
|
64
64
|
maxDailyNewWallets = 5000;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
modifier upgrader(uint32 _newversion) {
|
|
68
|
+
require(version == _newversion - 1, "wrong upgrade version");
|
|
69
|
+
version++;
|
|
70
|
+
_;
|
|
71
|
+
}
|
|
72
|
+
|
|
67
73
|
function getIdentity() public view returns (IIdentityV2) {
|
|
68
74
|
return IIdentityV2(nameService.getAddress("IDENTITY"));
|
|
69
75
|
}
|
|
@@ -72,19 +78,21 @@ contract FuseFaucetV2 is Initializable {
|
|
|
72
78
|
address _relayer,
|
|
73
79
|
address _owner,
|
|
74
80
|
NameService _ns
|
|
75
|
-
) public {
|
|
76
|
-
require(version == 0, "already upgraded");
|
|
77
|
-
version++;
|
|
81
|
+
) public upgrader(1) {
|
|
78
82
|
owner = _owner;
|
|
79
83
|
if (maxDailyNewWallets == 0) maxDailyNewWallets = 5000;
|
|
80
84
|
relayer = _relayer;
|
|
81
85
|
upgrade2(_ns);
|
|
82
86
|
}
|
|
83
87
|
|
|
84
|
-
function upgrade2(NameService _ns) public {
|
|
85
|
-
require(version == 1, "already upgraded");
|
|
86
|
-
version++;
|
|
88
|
+
function upgrade2(NameService _ns) public upgrader(2) {
|
|
87
89
|
nameService = _ns;
|
|
90
|
+
upgrade3();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function upgrade3() public upgrader(3) {
|
|
94
|
+
gasTopping = gasTopping / gasPrice;
|
|
95
|
+
perDayRoughLimit = gasTopping * 2;
|
|
88
96
|
}
|
|
89
97
|
|
|
90
98
|
modifier reimburseGas() {
|
|
@@ -153,7 +161,7 @@ contract FuseFaucetV2 is Initializable {
|
|
|
153
161
|
}
|
|
154
162
|
|
|
155
163
|
require(
|
|
156
|
-
weekTotal < perDayRoughLimit * maxPerWeekMultiplier,
|
|
164
|
+
weekTotal < perDayRoughLimit * gasPrice * maxPerWeekMultiplier,
|
|
157
165
|
"User wallet has been topped too many times this week"
|
|
158
166
|
);
|
|
159
167
|
_;
|
|
@@ -166,7 +174,7 @@ contract FuseFaucetV2 is Initializable {
|
|
|
166
174
|
}
|
|
167
175
|
|
|
168
176
|
function canTop(address _user) external view returns (bool) {
|
|
169
|
-
if (
|
|
177
|
+
if (getToppingAmount() < address(_user).balance) return false;
|
|
170
178
|
|
|
171
179
|
address whitelistedRoot = getIdentity().getWhitelistedRoot(_user);
|
|
172
180
|
_user = whitelistedRoot == address(0) ? _user : whitelistedRoot;
|
|
@@ -193,7 +201,7 @@ contract FuseFaucetV2 is Initializable {
|
|
|
193
201
|
for (uint256 i = 0; i <= dayOfWeek; i++) {
|
|
194
202
|
weekTotal += lastWeekToppings[uint256(i)];
|
|
195
203
|
}
|
|
196
|
-
can = can && weekTotal < perDayRoughLimit * maxPerWeekMultiplier;
|
|
204
|
+
can = can && weekTotal < perDayRoughLimit * gasPrice * maxPerWeekMultiplier;
|
|
197
205
|
return can;
|
|
198
206
|
}
|
|
199
207
|
|
|
@@ -219,8 +227,8 @@ contract FuseFaucetV2 is Initializable {
|
|
|
219
227
|
? _wallet
|
|
220
228
|
: payable(whitelistedRoot);
|
|
221
229
|
|
|
222
|
-
require(
|
|
223
|
-
uint256 toTop =
|
|
230
|
+
require(getToppingAmount() > address(_wallet).balance);
|
|
231
|
+
uint256 toTop = getToppingAmount() - address(_wallet).balance;
|
|
224
232
|
|
|
225
233
|
uint256 dayOfWeek = currentDay % 7;
|
|
226
234
|
|
|
@@ -256,9 +264,13 @@ contract FuseFaucetV2 is Initializable {
|
|
|
256
264
|
return true;
|
|
257
265
|
}
|
|
258
266
|
|
|
259
|
-
function
|
|
260
|
-
|
|
261
|
-
|
|
267
|
+
function getToppingAmount() public view returns (uint256) {
|
|
268
|
+
return gasTopping * gasPrice;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function setGasTopping(uint256 _gasUnits) public onlyOwner {
|
|
272
|
+
gasTopping = _gasUnits;
|
|
273
|
+
perDayRoughLimit = 2 * gasTopping;
|
|
262
274
|
}
|
|
263
275
|
|
|
264
276
|
function setGasPrice(uint64 _price) external onlyOwner {
|
|
@@ -156,7 +156,7 @@ contract UBIScheme is DAOUpgradeableContract {
|
|
|
156
156
|
maxInactiveDays = _maxInactiveDays;
|
|
157
157
|
firstClaimPool = _firstClaimPool;
|
|
158
158
|
shouldWithdrawFromDAO = false;
|
|
159
|
-
cycleLength =
|
|
159
|
+
cycleLength = 30; //30 days
|
|
160
160
|
iterationGasLimit = 185000; //token transfer cost under superfluid
|
|
161
161
|
periodStart = (block.timestamp / (1 days)) * 1 days + 12 hours; //set start time to GMT noon
|
|
162
162
|
startOfCycle = periodStart;
|
|
@@ -199,7 +199,7 @@ contract GoodDollarMintBurnWrapper is
|
|
|
199
199
|
setDAO(_nameService);
|
|
200
200
|
require(_admin != address(0), "zero admin address");
|
|
201
201
|
token = address(nativeToken());
|
|
202
|
-
updateFrequency =
|
|
202
|
+
updateFrequency = 7 days;
|
|
203
203
|
_setupRole(DEFAULT_ADMIN_ROLE, avatar);
|
|
204
204
|
_setupRole(DEFAULT_ADMIN_ROLE, _admin);
|
|
205
205
|
}
|
|
@@ -625,22 +625,4 @@ contract GoodDollarMintBurnWrapper is
|
|
|
625
625
|
minterSupply[minter].lastDayReset = currentDay;
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
|
-
|
|
629
|
-
function upgradeSuperGoodDollar() external onlyRole(DEFAULT_ADMIN_ROLE) {
|
|
630
|
-
address _newns = 0x0F5dB7a64A6a64052693676CA898EC7F7A94FF4e;
|
|
631
|
-
_revokeRole(DEFAULT_ADMIN_ROLE, avatar); //old avatar
|
|
632
|
-
setDAO(INameService(_newns)); //changes avatar + nativeToken
|
|
633
|
-
token = address(nativeToken());
|
|
634
|
-
_setupRole(DEFAULT_ADMIN_ROLE, avatar); //new avatar
|
|
635
|
-
updateFrequency = 3 days;
|
|
636
|
-
_setMinterCaps(
|
|
637
|
-
0xf27Ee99622C3C9b264583dACB2cCE056e194494f,
|
|
638
|
-
0,
|
|
639
|
-
0,
|
|
640
|
-
0,
|
|
641
|
-
0,
|
|
642
|
-
300 * 1e6 * 1e18, //300M
|
|
643
|
-
5000 //50%
|
|
644
|
-
);
|
|
645
|
-
}
|
|
646
628
|
}
|
package/package.json
CHANGED
package/releases/deployment.json
CHANGED
|
@@ -409,6 +409,7 @@
|
|
|
409
409
|
"DistributionHelper": "0xAcadA0C9795fdBb6921AE96c4D7Db2F8B8c52Fd0"
|
|
410
410
|
},
|
|
411
411
|
"production": {
|
|
412
|
+
"ProxyFactory": "0xDa85fceD9Bd193526b7667F2AD1fD4A0F900d3A7",
|
|
412
413
|
"NameService": "0xec6dcE387B1616a0c44fF2E4fA9E90E53Cf14eb0",
|
|
413
414
|
"GReputation": "0x603B8C0F110E037b51A381CBCacAbb8d6c6E4543",
|
|
414
415
|
"CompoundVotingMachine": "0x57Ee6Ceff51CB30Ecb1245934a882c500Fbec1e9",
|
|
@@ -425,7 +426,7 @@
|
|
|
425
426
|
"Invites": "0xCa2F09c3ccFD7aD5cB9276918Bd1868f2b922ea0",
|
|
426
427
|
"AdminWallet": "0x9A34822112BC73BDc941C62dCc311Ca905Aef2a3",
|
|
427
428
|
"AdminWalletOld": "0x9F75dAcB77419b87f568d417eBc84346e134144E",
|
|
428
|
-
"Identity": "
|
|
429
|
+
"Identity": "0x2F9C28de9e6d44b71B91b8BA337A5D82e308E7BE",
|
|
429
430
|
"GoodDollar": "0x495d133B938596C9984d462F007B676bDc57eCEC",
|
|
430
431
|
"Controller": "0xBcE053b99e22158f8B62f4DBFbEdE1f936b2D4e4",
|
|
431
432
|
"Avatar": "0xf96dADc6D71113F6500e97590760C924dA1eF70e",
|
|
@@ -433,7 +434,10 @@
|
|
|
433
434
|
"ProxyAdmin": "0x57179b2A8eB019157b0C3E761cdB26c82C982a3B",
|
|
434
435
|
"FuseFaucet": "0x01ab5966C1d742Ae0CFF7f14cC0F4D85156e83d9",
|
|
435
436
|
"FuseStaking": "0xA199F0C353E25AdF022378B0c208D600f39a6505",
|
|
436
|
-
"GuardiansSafe": "0x5878123fe880881f1Ecc92D5fd31e5D3F5Fba2e9"
|
|
437
|
+
"GuardiansSafe": "0x5878123fe880881f1Ecc92D5fd31e5D3F5Fba2e9",
|
|
438
|
+
"IdentityOld": "0xFa8d865A962ca8456dF331D78806152d3aC5B84F",
|
|
439
|
+
"MultichainRouter": "0x735aBE48e8782948a37C7765ECb76b98CdE97B0F",
|
|
440
|
+
"GoodDollarMintBurnWrapper": "0x031b2B7C7854dd8EE9C4A644D7e54aD17F56e3cB"
|
|
437
441
|
},
|
|
438
442
|
"pre-production-celo": {
|
|
439
443
|
"ProxyFactory": "0x99C22e78A579e2176311c736C4c9F0b0D5A47806",
|
|
@@ -466,7 +470,11 @@
|
|
|
466
470
|
"GoodDollarMintBurnWrapper": "0x5566b6E4962BA83e05a426Ad89031ec18e9CadD3",
|
|
467
471
|
"GuardiansSafeOld": "0xC9D09BA972B4EB6Bb7347F2229FB6d50434fFCa6",
|
|
468
472
|
"GuardiansSafe": "0xa2521e8F5A990903fdD8Afa6570C52526e7E0D5E",
|
|
469
|
-
"MultichainRouter": "0xf27Ee99622C3C9b264583dACB2cCE056e194494f"
|
|
473
|
+
"MultichainRouter": "0xf27Ee99622C3C9b264583dACB2cCE056e194494f",
|
|
474
|
+
"AdminWallet": "0x7119CD89D4792aF90277d84cDffa3F2Ab22a0022",
|
|
475
|
+
"Faucet": "0x4F93Fa058b03953C851eFaA2e4FC5C34afDFAb84",
|
|
476
|
+
"Invites": "0x36829D1Cda92FFF5782d5d48991620664FC857d3",
|
|
477
|
+
"UBIScheme": "0x43d72Ff17701B2DA814620735C39C620Ce0ea4A1"
|
|
470
478
|
},
|
|
471
479
|
"gnosis": {
|
|
472
480
|
"GuardiansSafe": "0x84c10b45fe51bfb4f86c19a47fdbc187d4572fb8"
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import { network, ethers, upgrades, run } from "hardhat";
|
|
6
6
|
import { Contract } from "ethers";
|
|
7
7
|
import { defaultsDeep } from "lodash";
|
|
8
|
-
import {
|
|
8
|
+
import { getImplementationAddress } from "@openzeppelin/upgrades-core";
|
|
9
|
+
import { deployDeterministic, verifyProductionSigner, verifyContract } from "./helpers";
|
|
9
10
|
import releaser from "../releaser";
|
|
10
11
|
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
11
12
|
import dao from "../../releases/deployment.json";
|
|
@@ -51,33 +52,32 @@ export const deployHelpers = async () => {
|
|
|
51
52
|
walletAdmins.push(wallet.address);
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
console.log("deploying adminwallet", { walletAdmins });
|
|
55
|
+
console.log("deploying adminwallet", { walletAdmins, gasprice: protocolSettings.gasPrice });
|
|
55
56
|
const AdminWallet = (await deployDeterministic(
|
|
56
57
|
{
|
|
57
58
|
// address payable[] memory _admins,
|
|
59
|
+
// NameService _ns,
|
|
58
60
|
// address _owner,
|
|
59
|
-
//
|
|
61
|
+
// uint256 _gasPrice
|
|
60
62
|
name: "AdminWallet",
|
|
61
63
|
salt: "AdminWallet",
|
|
62
64
|
isUpgradeable: true
|
|
63
65
|
},
|
|
64
66
|
[walletAdmins, release.NameService, root.address, protocolSettings.gasPrice]
|
|
65
67
|
).then(printDeploy)) as Contract;
|
|
68
|
+
// const AdminWallet = await ethers.getContractAt("AdminWallet", release.AdminWallet);
|
|
66
69
|
|
|
67
|
-
console.log("giving AdminWallet identity_admin permissions");
|
|
68
70
|
const gd = await ethers.getContractAt("IGoodDollar", release.GoodDollar);
|
|
69
71
|
|
|
70
72
|
const decimals = await gd.decimals();
|
|
71
73
|
|
|
72
|
-
const identity = await ethers.getContractAt("IdentityV2", release.Identity);
|
|
73
|
-
await identity.grantRole(ethers.utils.keccak256(ethers.utils.toUtf8Bytes("identity_admin")), AdminWallet.address);
|
|
74
|
-
|
|
75
74
|
const Faucet = await deployDeterministic({ name: "Faucet", salt: "Faucet", isUpgradeable: true }, [
|
|
76
75
|
release.NameService,
|
|
77
76
|
protocolSettings.gasPrice,
|
|
78
77
|
AdminWallet.address,
|
|
79
78
|
root.address
|
|
80
79
|
]);
|
|
80
|
+
// const Faucet = await ethers.getContractAt("Faucet", release.Faucet);
|
|
81
81
|
|
|
82
82
|
const Invites = await deployDeterministic({ name: "InvitesV2", salt: "InvitesV2", isUpgradeable: true }, [
|
|
83
83
|
release.NameService,
|
|
@@ -85,18 +85,42 @@ export const deployHelpers = async () => {
|
|
|
85
85
|
root.address
|
|
86
86
|
]);
|
|
87
87
|
|
|
88
|
+
// const Invites = await ethers.getContractAt("AdminWallet", release.Invites);
|
|
89
|
+
|
|
90
|
+
const torelease = {
|
|
91
|
+
AdminWallet: AdminWallet.address,
|
|
92
|
+
Faucet: Faucet.address,
|
|
93
|
+
Invites: Invites.address
|
|
94
|
+
};
|
|
95
|
+
await releaser(torelease, network.name, "deployment", false);
|
|
96
|
+
|
|
88
97
|
const adminWalletOwner = await AdminWallet.hasRole(ethers.constants.HashZero, root.address);
|
|
89
98
|
const faucetOwner = await Faucet.hasRole(ethers.constants.HashZero, root.address);
|
|
90
99
|
|
|
100
|
+
console.log("giving AdminWallet identity_admin permissions");
|
|
101
|
+
const identity = await ethers.getContractAt("IdentityV2", release.Identity);
|
|
102
|
+
await identity
|
|
103
|
+
.grantRole(ethers.utils.keccak256(ethers.utils.toUtf8Bytes("identity_admin")), AdminWallet.address)
|
|
104
|
+
.then(printDeploy);
|
|
105
|
+
|
|
106
|
+
const walletIsIdentityAdmin = await identity.hasRole(
|
|
107
|
+
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("identity_admin")),
|
|
108
|
+
AdminWallet.address
|
|
109
|
+
);
|
|
110
|
+
|
|
91
111
|
console.log("topping adminwallet and faucet with 1 native token");
|
|
92
|
-
await root
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
112
|
+
await root
|
|
113
|
+
.sendTransaction({
|
|
114
|
+
to: AdminWallet.address,
|
|
115
|
+
value: ethers.constants.WeiPerEther
|
|
116
|
+
})
|
|
117
|
+
.then(printDeploy);
|
|
118
|
+
await root
|
|
119
|
+
.sendTransaction({
|
|
120
|
+
to: Faucet.address,
|
|
121
|
+
value: ethers.constants.WeiPerEther
|
|
122
|
+
})
|
|
123
|
+
.then(printDeploy);
|
|
100
124
|
|
|
101
125
|
if (!network.name.includes("production")) {
|
|
102
126
|
console.log("minting G$s to invites on dev envs");
|
|
@@ -104,16 +128,17 @@ export const deployHelpers = async () => {
|
|
|
104
128
|
}
|
|
105
129
|
|
|
106
130
|
console.log({
|
|
131
|
+
walletIsIdentityAdmin,
|
|
107
132
|
adminWalletOwner,
|
|
108
133
|
faucetOwner
|
|
109
134
|
});
|
|
110
135
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
await
|
|
136
|
+
let impl = await getImplementationAddress(ethers.provider, AdminWallet.address);
|
|
137
|
+
await verifyContract(impl, "AdminWallet", network.name);
|
|
138
|
+
impl = await getImplementationAddress(ethers.provider, Faucet.address);
|
|
139
|
+
await verifyContract(impl, "Faucet", network.name);
|
|
140
|
+
impl = await getImplementationAddress(ethers.provider, Invites.address);
|
|
141
|
+
await verifyContract(impl, "InvitesV2", network.name);
|
|
117
142
|
};
|
|
118
143
|
|
|
119
144
|
export const main = async () => {
|
|
@@ -5,24 +5,23 @@
|
|
|
5
5
|
import { network, ethers, upgrades, run } from "hardhat";
|
|
6
6
|
import { Contract } from "ethers";
|
|
7
7
|
import { defaultsDeep } from "lodash";
|
|
8
|
+
import { getImplementationAddress } from "@openzeppelin/upgrades-core";
|
|
8
9
|
import {
|
|
9
10
|
deployDeterministic,
|
|
10
11
|
executeViaGuardian,
|
|
11
12
|
executeViaSafe,
|
|
13
|
+
verifyContract,
|
|
12
14
|
verifyProductionSigner
|
|
13
15
|
} from "./helpers";
|
|
14
16
|
import releaser from "../releaser";
|
|
15
17
|
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
16
18
|
import dao from "../../releases/deployment.json";
|
|
17
19
|
import { TransactionResponse } from "@ethersproject/providers";
|
|
18
|
-
import { InvitesV1__factory } from "../../types";
|
|
19
20
|
import { keccak256, toUtf8Bytes } from "ethers/lib/utils";
|
|
20
21
|
|
|
21
22
|
const { name } = network;
|
|
22
23
|
|
|
23
|
-
const printDeploy = async (
|
|
24
|
-
c: Contract | TransactionResponse
|
|
25
|
-
): Promise<Contract | TransactionResponse> => {
|
|
24
|
+
const printDeploy = async (c: Contract | TransactionResponse): Promise<Contract | TransactionResponse> => {
|
|
26
25
|
if (c instanceof Contract) {
|
|
27
26
|
await c.deployed();
|
|
28
27
|
console.log("deployed to: ", c.address);
|
|
@@ -35,16 +34,14 @@ const printDeploy = async (
|
|
|
35
34
|
};
|
|
36
35
|
|
|
37
36
|
export const deployHelpers = async () => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
ProtocolSettings["default"]
|
|
42
|
-
);
|
|
37
|
+
const viaGuardians = false;
|
|
38
|
+
|
|
39
|
+
let protocolSettings = defaultsDeep({}, ProtocolSettings[network.name], ProtocolSettings["default"]);
|
|
43
40
|
let release: { [key: string]: any } = dao[network.name];
|
|
44
41
|
|
|
45
42
|
let [root, ...signers] = await ethers.getSigners();
|
|
46
43
|
const isProduction = network.name.includes("production");
|
|
47
|
-
|
|
44
|
+
|
|
48
45
|
if (isProduction) verifyProductionSigner(root);
|
|
49
46
|
//generic call permissions
|
|
50
47
|
let schemeMock = root;
|
|
@@ -53,9 +50,7 @@ export const deployHelpers = async () => {
|
|
|
53
50
|
network,
|
|
54
51
|
root: root.address,
|
|
55
52
|
schemeMock: schemeMock.address,
|
|
56
|
-
balance: await ethers.provider
|
|
57
|
-
.getBalance(root.address)
|
|
58
|
-
.then(_ => _.toString())
|
|
53
|
+
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
59
54
|
});
|
|
60
55
|
|
|
61
56
|
console.log("deploying ubi pool");
|
|
@@ -64,19 +59,14 @@ export const deployHelpers = async () => {
|
|
|
64
59
|
name: "UBIScheme",
|
|
65
60
|
isUpgradeable: true
|
|
66
61
|
},
|
|
67
|
-
[
|
|
68
|
-
release.NameService,
|
|
69
|
-
ethers.constants.AddressZero,
|
|
70
|
-
protocolSettings.ubi.maxInactiveDays
|
|
71
|
-
]
|
|
62
|
+
[release.NameService, ethers.constants.AddressZero, protocolSettings.ubi.maxInactiveDays]
|
|
72
63
|
).then(printDeploy)) as Contract;
|
|
73
64
|
|
|
74
65
|
console.log("deploying claimers distribution");
|
|
75
66
|
|
|
76
|
-
const ClaimersDistribution = (await deployDeterministic(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
).then(printDeploy)) as Contract;
|
|
67
|
+
const ClaimersDistribution = (await deployDeterministic({ name: "ClaimersDistribution", isUpgradeable: true }, [
|
|
68
|
+
release.NameService
|
|
69
|
+
]).then(printDeploy)) as Contract;
|
|
80
70
|
|
|
81
71
|
console.log("setting nameservice addresses via guardian");
|
|
82
72
|
const proposalContracts = [
|
|
@@ -93,10 +83,7 @@ export const deployHelpers = async () => {
|
|
|
93
83
|
ethers.utils.defaultAbiCoder.encode(
|
|
94
84
|
["bytes32[]", "address[]"],
|
|
95
85
|
[
|
|
96
|
-
[
|
|
97
|
-
keccak256(toUtf8Bytes("UBISCHEME")),
|
|
98
|
-
keccak256(toUtf8Bytes("GDAO_CLAIMERS"))
|
|
99
|
-
],
|
|
86
|
+
[keccak256(toUtf8Bytes("UBISCHEME")), keccak256(toUtf8Bytes("GDAO_CLAIMERS"))],
|
|
100
87
|
[UBIScheme.address, ClaimersDistribution.address]
|
|
101
88
|
]
|
|
102
89
|
)
|
|
@@ -106,17 +93,14 @@ export const deployHelpers = async () => {
|
|
|
106
93
|
console.log("minting G$s to pool on dev envs");
|
|
107
94
|
const gd = await ethers.getContractAt("IGoodDollar", release.GoodDollar);
|
|
108
95
|
const decimals = await gd.decimals();
|
|
109
|
-
await gd.mint(
|
|
110
|
-
UBIScheme.address,
|
|
111
|
-
ethers.BigNumber.from(1e6).mul(ethers.BigNumber.from("10").pow(decimals))
|
|
112
|
-
); //1million GD
|
|
96
|
+
await gd.mint(UBIScheme.address, ethers.BigNumber.from(1e6).mul(ethers.BigNumber.from("10").pow(decimals))); //1million GD
|
|
113
97
|
}
|
|
114
98
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
await
|
|
99
|
+
let impl = await getImplementationAddress(ethers.provider, UBIScheme.address);
|
|
100
|
+
await verifyContract(impl, "UBIScheme", network.name);
|
|
101
|
+
|
|
102
|
+
impl = await getImplementationAddress(ethers.provider, ClaimersDistribution.address);
|
|
103
|
+
await verifyContract(impl, "ClaimersDistribution", network.name);
|
|
120
104
|
|
|
121
105
|
try {
|
|
122
106
|
if (viaGuardians) {
|
|
@@ -207,7 +207,7 @@ export const executeViaSafe = async (
|
|
|
207
207
|
txServiceUrl = "https://safe-transaction-mainnet.safe.global";
|
|
208
208
|
break;
|
|
209
209
|
case 122:
|
|
210
|
-
txServiceUrl = "https://
|
|
210
|
+
txServiceUrl = "https://transaction-fuse.safe.fuse.io";
|
|
211
211
|
break;
|
|
212
212
|
case 42220:
|
|
213
213
|
txServiceUrl = "https://mainnet-tx-svc.celo-safe-prod.celo-networks-dev.org";
|
|
@@ -236,8 +236,8 @@ export const executeViaSafe = async (
|
|
|
236
236
|
const contract = contracts[i];
|
|
237
237
|
|
|
238
238
|
const sigHash = ethers.utils.keccak256(ethers.utils.toUtf8Bytes(functionSigs[i])).slice(0, 10);
|
|
239
|
+
console.log("creating tx:", contracts[i], functionSigs[i], functionInputs[i]);
|
|
239
240
|
const encoded = ethers.utils.solidityPack(["bytes4", "bytes"], [sigHash, functionInputs[i]]);
|
|
240
|
-
console.log("creating tx:", contracts[i], functionSigs[i], functionInputs[i], encoded);
|
|
241
241
|
if (contract === ctrl.address) {
|
|
242
242
|
const simulationResult =
|
|
243
243
|
isSimulation === false &&
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { network, ethers, upgrades, run } from "hardhat";
|
|
2
2
|
import { Contract } from "ethers";
|
|
3
|
+
import { getImplementationAddress } from "@openzeppelin/upgrades-core";
|
|
3
4
|
|
|
4
|
-
import { deployDeterministic, printDeploy } from "./helpers";
|
|
5
|
+
import { deployDeterministic, printDeploy, verifyContract } from "./helpers";
|
|
5
6
|
import releaser from "../../scripts/releaser";
|
|
6
7
|
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
7
8
|
import dao from "../../releases/deployment.json";
|
|
@@ -20,9 +21,7 @@ export const deployWrapper = async (defaultAdmin = null) => {
|
|
|
20
21
|
network,
|
|
21
22
|
root: root.address,
|
|
22
23
|
schemeMock: schemeMock.address,
|
|
23
|
-
balance: await ethers.provider
|
|
24
|
-
.getBalance(root.address)
|
|
25
|
-
.then(_ => _.toString())
|
|
24
|
+
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
26
25
|
});
|
|
27
26
|
|
|
28
27
|
console.log("MintBurnWrapper deploy params:", [
|
|
@@ -44,6 +43,10 @@ export const deployWrapper = async (defaultAdmin = null) => {
|
|
|
44
43
|
GoodDollarMintBurnWrapper: Wrapper.address
|
|
45
44
|
};
|
|
46
45
|
await releaser(release, network.name, "deployment", false);
|
|
46
|
+
|
|
47
|
+
const impl = await getImplementationAddress(ethers.provider, Wrapper.address);
|
|
48
|
+
await verifyContract(impl, "GoodDollarMintBurnWrapper", network.name);
|
|
49
|
+
|
|
47
50
|
return Wrapper;
|
|
48
51
|
};
|
|
49
52
|
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* This script will deploy a reserve upgrade and the DistributionHelper so that some of the expansion can be allocated
|
|
3
|
+
* for non-ubi purposes
|
|
4
|
+
* Upgrade process:
|
|
5
|
+
* mainnet:
|
|
6
|
+
* - deploy reserve
|
|
7
|
+
* - deploy distributionHelper
|
|
8
|
+
* - create proposal that:
|
|
9
|
+
* - upgrades the reserve
|
|
10
|
+
* - sets the distributionHelper at reserve with the agreed bps
|
|
11
|
+
* - add to the distributionHelper the contracts addresses to receive part of the UBI
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { network, ethers } from "hardhat";
|
|
15
|
+
import { defaultsDeep } from "lodash";
|
|
16
|
+
import {
|
|
17
|
+
deployDeterministic,
|
|
18
|
+
printDeploy,
|
|
19
|
+
executeViaGuardian,
|
|
20
|
+
executeViaSafe,
|
|
21
|
+
verifyProductionSigner
|
|
22
|
+
} from "../multichain-deploy/helpers";
|
|
23
|
+
import { deployWrapper } from "../multichain-deploy/multichainWrapper-deploy";
|
|
24
|
+
|
|
25
|
+
import releaser from "../releaser";
|
|
26
|
+
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
27
|
+
import dao from "../../releases/deployment.json";
|
|
28
|
+
import { BigNumber } from "ethers";
|
|
29
|
+
const { name: networkName } = network;
|
|
30
|
+
|
|
31
|
+
export const deployFuse = async () => {
|
|
32
|
+
const isProduction = networkName.includes("production");
|
|
33
|
+
let [root, ...signers] = await ethers.getSigners();
|
|
34
|
+
|
|
35
|
+
if (isProduction) verifyProductionSigner(root);
|
|
36
|
+
|
|
37
|
+
let executionMethod = "safe";
|
|
38
|
+
|
|
39
|
+
const networkKey = networkName === "localhost" ? "production-mainnet" : networkName;
|
|
40
|
+
let release: { [key: string]: any } = dao[networkKey];
|
|
41
|
+
let settings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
|
|
42
|
+
|
|
43
|
+
console.log("got signers:", {
|
|
44
|
+
networkName,
|
|
45
|
+
networkKey,
|
|
46
|
+
root: root.address,
|
|
47
|
+
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const Wrapper = await deployWrapper();
|
|
51
|
+
// const Wrapper = await ethers.getContractAt("GoodDollarMintBurnWrapper", release.GoodDollarMintBurnWrapper);
|
|
52
|
+
|
|
53
|
+
const proposalContracts = [
|
|
54
|
+
release.NameService, //nameservice add Wrapper,MultiChainRouter
|
|
55
|
+
release.GoodDollar, // give mint rights to Wrapper
|
|
56
|
+
Wrapper.address //add multichainrouter as minter
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
60
|
+
|
|
61
|
+
const proposalFunctionSignatures = [
|
|
62
|
+
"setAddresses(bytes32[],address[])",
|
|
63
|
+
"addMinter(address)",
|
|
64
|
+
"addMinter(address,uint256,uint256,uint32,uint256,uint256,uint32,bool)"
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
const proposalFunctionInputs = [
|
|
68
|
+
ethers.utils.defaultAbiCoder.encode(
|
|
69
|
+
["bytes32[]", "address[]"],
|
|
70
|
+
[
|
|
71
|
+
[
|
|
72
|
+
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("MINTBURN_WRAPPER")),
|
|
73
|
+
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("MULTICHAIN_ROUTER"))
|
|
74
|
+
],
|
|
75
|
+
[Wrapper.address, release.MultichainRouter]
|
|
76
|
+
]
|
|
77
|
+
), //setAddresses(bytes32[],address[])"
|
|
78
|
+
ethers.utils.defaultAbiCoder.encode(["address"], [Wrapper.address]), //addMinter(address)
|
|
79
|
+
ethers.utils.defaultAbiCoder.encode(
|
|
80
|
+
["address", "uint256", "uint256", "uint32", "uint256", "uint256", "uint32", "bool"],
|
|
81
|
+
[
|
|
82
|
+
release.MultichainRouter,
|
|
83
|
+
0,
|
|
84
|
+
0,
|
|
85
|
+
0,
|
|
86
|
+
0,
|
|
87
|
+
300 * 1e6 * 100, //300M G$ 2 decimals
|
|
88
|
+
1000, //10%
|
|
89
|
+
false
|
|
90
|
+
]
|
|
91
|
+
) //addMinter(address,uint256,uint256,uint32,uint256,uint256,uint32,bool)
|
|
92
|
+
];
|
|
93
|
+
|
|
94
|
+
if (executionMethod === "safe") {
|
|
95
|
+
return executeViaSafe(
|
|
96
|
+
proposalContracts,
|
|
97
|
+
proposalEthValues,
|
|
98
|
+
proposalFunctionSignatures,
|
|
99
|
+
proposalFunctionInputs,
|
|
100
|
+
networkName === "localhost" ? "0xE0c5daa7CC6F88d29505f702a53bb5E67600e7Ec" : release.GuardiansSafe,
|
|
101
|
+
"fuse"
|
|
102
|
+
);
|
|
103
|
+
} else {
|
|
104
|
+
return executeViaGuardian(
|
|
105
|
+
proposalContracts,
|
|
106
|
+
proposalEthValues,
|
|
107
|
+
proposalFunctionSignatures,
|
|
108
|
+
proposalFunctionInputs,
|
|
109
|
+
root
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export const main = async () => {
|
|
115
|
+
await deployFuse().catch(console.log);
|
|
116
|
+
};
|
|
117
|
+
if (process.argv[1].includes("v3-fuse-multichain")) main();
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - add 1000 celo to adminwallet and faucet
|
|
8
8
|
* - monitor adminwallet + faucet on defender
|
|
9
9
|
*
|
|
10
|
-
* Step 3:
|
|
10
|
+
* Step 3: (once guardians sign Identity upgrade)
|
|
11
11
|
* - upgrade AdminWallet+Invites+Faucet on Fuse to support whitelisting chainid
|
|
12
12
|
* - upgrade backend server to support whitelisting with chainid
|
|
13
13
|
*
|