@gooddollar/goodprotocol 2.0.2 → 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/AdminWalletFuse.min.json +1 -1
- 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 +55 -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/identity/IdentityV2.sol/IdentityV2.json +2 -2
- 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/AdminWalletFuse.sol/AdminWalletFuse.json +28 -2
- 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 +36 -13
- package/contracts/identity/IdentityV2.sol +9 -4
- package/contracts/ubi/UBIScheme.sol +1 -1
- package/contracts/utils/AdminWalletFuse.sol +8 -0
- package/contracts/utils/GoodDollarMintBurnWrapper.sol +1 -19
- package/hardhat.config.ts +17 -42
- package/package.json +1 -1
- package/releases/deploy-settings.json +3 -3
- package/releases/deployment.json +11 -3
- package/scripts/multichain-deploy/2_helpers-deploy.ts +64 -68
- 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 +15 -2
- package/scripts/upgrades/identity-upgrade.ts +28 -11
- package/test/faucet/Faucet.test.ts +4 -3
- package/test/faucet/FuseFaucet.test.ts +5 -4
- package/test/ubi/UBISchemeCycle.test.ts +20 -58
- package/test/utils/GoodDollarMintBurnWrapper.test.ts +66 -224
- package/types/AdminWalletFuse.ts +38 -0
- package/types/Faucet.ts +61 -32
- package/types/FuseFaucetV2.ts +101 -34
- package/types/GoodDollarMintBurnWrapper.ts +0 -27
- package/types/factories/AdminWalletFuse__factory.ts +27 -1
- package/types/factories/Faucet__factory.ts +42 -16
- package/types/factories/FuseFaucetV2__factory.ts +54 -16
- package/types/factories/FuseStakingV3__factory.ts +1 -1
- package/types/factories/GoodDollarMintBurnWrapper__factory.ts +1 -8
- package/types/factories/IdentityV2__factory.ts +1 -1
- 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,16 +64,35 @@ 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
|
}
|
|
70
76
|
|
|
71
|
-
function upgrade(
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
function upgrade(
|
|
78
|
+
address _relayer,
|
|
79
|
+
address _owner,
|
|
80
|
+
NameService _ns
|
|
81
|
+
) public upgrader(1) {
|
|
74
82
|
owner = _owner;
|
|
75
83
|
if (maxDailyNewWallets == 0) maxDailyNewWallets = 5000;
|
|
76
84
|
relayer = _relayer;
|
|
85
|
+
upgrade2(_ns);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function upgrade2(NameService _ns) public upgrader(2) {
|
|
89
|
+
nameService = _ns;
|
|
90
|
+
upgrade3();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function upgrade3() public upgrader(3) {
|
|
94
|
+
gasTopping = gasTopping / gasPrice;
|
|
95
|
+
perDayRoughLimit = gasTopping * 2;
|
|
77
96
|
}
|
|
78
97
|
|
|
79
98
|
modifier reimburseGas() {
|
|
@@ -142,7 +161,7 @@ contract FuseFaucetV2 is Initializable {
|
|
|
142
161
|
}
|
|
143
162
|
|
|
144
163
|
require(
|
|
145
|
-
weekTotal < perDayRoughLimit * maxPerWeekMultiplier,
|
|
164
|
+
weekTotal < perDayRoughLimit * gasPrice * maxPerWeekMultiplier,
|
|
146
165
|
"User wallet has been topped too many times this week"
|
|
147
166
|
);
|
|
148
167
|
_;
|
|
@@ -155,7 +174,7 @@ contract FuseFaucetV2 is Initializable {
|
|
|
155
174
|
}
|
|
156
175
|
|
|
157
176
|
function canTop(address _user) external view returns (bool) {
|
|
158
|
-
if (
|
|
177
|
+
if (getToppingAmount() < address(_user).balance) return false;
|
|
159
178
|
|
|
160
179
|
address whitelistedRoot = getIdentity().getWhitelistedRoot(_user);
|
|
161
180
|
_user = whitelistedRoot == address(0) ? _user : whitelistedRoot;
|
|
@@ -182,7 +201,7 @@ contract FuseFaucetV2 is Initializable {
|
|
|
182
201
|
for (uint256 i = 0; i <= dayOfWeek; i++) {
|
|
183
202
|
weekTotal += lastWeekToppings[uint256(i)];
|
|
184
203
|
}
|
|
185
|
-
can = can && weekTotal < perDayRoughLimit * maxPerWeekMultiplier;
|
|
204
|
+
can = can && weekTotal < perDayRoughLimit * gasPrice * maxPerWeekMultiplier;
|
|
186
205
|
return can;
|
|
187
206
|
}
|
|
188
207
|
|
|
@@ -208,8 +227,8 @@ contract FuseFaucetV2 is Initializable {
|
|
|
208
227
|
? _wallet
|
|
209
228
|
: payable(whitelistedRoot);
|
|
210
229
|
|
|
211
|
-
require(
|
|
212
|
-
uint256 toTop =
|
|
230
|
+
require(getToppingAmount() > address(_wallet).balance);
|
|
231
|
+
uint256 toTop = getToppingAmount() - address(_wallet).balance;
|
|
213
232
|
|
|
214
233
|
uint256 dayOfWeek = currentDay % 7;
|
|
215
234
|
|
|
@@ -245,9 +264,13 @@ contract FuseFaucetV2 is Initializable {
|
|
|
245
264
|
return true;
|
|
246
265
|
}
|
|
247
266
|
|
|
248
|
-
function
|
|
249
|
-
|
|
250
|
-
|
|
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;
|
|
251
274
|
}
|
|
252
275
|
|
|
253
276
|
function setGasPrice(uint64 _price) external onlyOwner {
|
|
@@ -238,8 +238,9 @@ contract IdentityV2 is
|
|
|
238
238
|
onlyRole(IDENTITY_ADMIN_ROLE)
|
|
239
239
|
whenNotPaused
|
|
240
240
|
{
|
|
241
|
-
if (
|
|
242
|
-
oldIdentity.
|
|
241
|
+
if (
|
|
242
|
+
address(oldIdentity) != address(0) && oldIdentity.isBlacklisted(account)
|
|
243
|
+
) oldIdentity.removeBlacklisted(account);
|
|
243
244
|
|
|
244
245
|
identities[account].status = 0;
|
|
245
246
|
emit BlacklistRemoved(account);
|
|
@@ -270,7 +271,9 @@ contract IdentityV2 is
|
|
|
270
271
|
onlyRole(IDENTITY_ADMIN_ROLE)
|
|
271
272
|
whenNotPaused
|
|
272
273
|
{
|
|
273
|
-
if (
|
|
274
|
+
if (
|
|
275
|
+
address(oldIdentity) != address(0) && oldIdentity.isDAOContract(account)
|
|
276
|
+
) {
|
|
274
277
|
oldIdentity.removeContract(account);
|
|
275
278
|
}
|
|
276
279
|
_removeWhitelisted(account);
|
|
@@ -355,7 +358,9 @@ contract IdentityV2 is
|
|
|
355
358
|
emit WhitelistedRemoved(account);
|
|
356
359
|
}
|
|
357
360
|
|
|
358
|
-
if (
|
|
361
|
+
if (
|
|
362
|
+
address(oldIdentity) != address(0) && oldIdentity.isWhitelisted(account)
|
|
363
|
+
) {
|
|
359
364
|
oldIdentity.removeWhitelisted(account);
|
|
360
365
|
}
|
|
361
366
|
}
|
|
@@ -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;
|
|
@@ -37,6 +37,8 @@ contract AdminWalletFuse is
|
|
|
37
37
|
uint64 public maxDailyNewWallets;
|
|
38
38
|
uint64 public day;
|
|
39
39
|
|
|
40
|
+
uint32 public version;
|
|
41
|
+
|
|
40
42
|
event AdminsAdded(address payable[] indexed admins);
|
|
41
43
|
event AdminsRemoved(address[] indexed admins);
|
|
42
44
|
event WalletTopped(address indexed user, uint256 amount);
|
|
@@ -68,6 +70,12 @@ contract AdminWalletFuse is
|
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
|
|
73
|
+
function upgrade(NameService _ns) public {
|
|
74
|
+
require(version == 0, "already upgraded");
|
|
75
|
+
version++;
|
|
76
|
+
nameService = _ns;
|
|
77
|
+
}
|
|
78
|
+
|
|
71
79
|
function getIdentity() public view returns (IIdentityV2) {
|
|
72
80
|
return IIdentityV2(nameService.getAddress("IDENTITY"));
|
|
73
81
|
}
|
|
@@ -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/hardhat.config.ts
CHANGED
|
@@ -17,21 +17,15 @@ import { airdrop } from "./scripts/governance/airdropCalculationSorted";
|
|
|
17
17
|
import { airdrop as repAirdropRecover } from "./scripts/governance/airdropCalculationRecover";
|
|
18
18
|
import { airdrop as goodCheckpoint } from "./scripts/governance/goodCheckpointSorted";
|
|
19
19
|
|
|
20
|
-
import {
|
|
21
|
-
airdrop as gdxAirdrop,
|
|
22
|
-
airdropRecover as gdxAirdropRecover
|
|
23
|
-
} from "./scripts/gdx/gdxAirdropCalculation";
|
|
20
|
+
import { airdrop as gdxAirdrop, airdropRecover as gdxAirdropRecover } from "./scripts/gdx/gdxAirdropCalculation";
|
|
24
21
|
import { sumStakersGdRewards } from "./scripts/staking/stakersGdRewardsCalculation";
|
|
25
22
|
import { verify } from "./scripts/verify";
|
|
26
23
|
import { ethers } from "ethers";
|
|
27
24
|
import { fstat, readFileSync, writeFileSync } from "fs";
|
|
28
25
|
config();
|
|
29
26
|
|
|
30
|
-
const mnemonic =
|
|
31
|
-
|
|
32
|
-
"test test test test test test test test test test test junk";
|
|
33
|
-
const deployerPrivateKey =
|
|
34
|
-
process.env.PRIVATE_KEY || ethers.utils.hexZeroPad("0x11", 32);
|
|
27
|
+
const mnemonic = process.env.MNEMONIC || "test test test test test test test test test test test junk";
|
|
28
|
+
const deployerPrivateKey = process.env.PRIVATE_KEY || ethers.utils.hexZeroPad("0x11", 32);
|
|
35
29
|
const infura_api = process.env.INFURA_API;
|
|
36
30
|
const alchemy_key = process.env.ALCHEMY_KEY;
|
|
37
31
|
const etherscan_key = process.env.ETHERSCAN_KEY;
|
|
@@ -79,9 +73,7 @@ const hhconfig: HardhatUserConfig = {
|
|
|
79
73
|
|
|
80
74
|
networks: {
|
|
81
75
|
hardhat: {
|
|
82
|
-
chainId: process.env.FORK_CHAIN_ID
|
|
83
|
-
? Number(process.env.FORK_CHAIN_ID)
|
|
84
|
-
: 4447,
|
|
76
|
+
chainId: process.env.FORK_CHAIN_ID ? Number(process.env.FORK_CHAIN_ID) : 4447,
|
|
85
77
|
allowUnlimitedContractSize: true,
|
|
86
78
|
accounts: {
|
|
87
79
|
accountsBalance: "10000000000000000000000000"
|
|
@@ -194,28 +186,28 @@ const hhconfig: HardhatUserConfig = {
|
|
|
194
186
|
accounts: [deployerPrivateKey],
|
|
195
187
|
url: "https://forno.celo.org",
|
|
196
188
|
gas: 8000000,
|
|
197
|
-
gasPrice:
|
|
189
|
+
gasPrice: 5000000000,
|
|
198
190
|
chainId: 42220
|
|
199
191
|
},
|
|
200
192
|
celo: {
|
|
201
|
-
accounts:
|
|
193
|
+
accounts: { mnemonic },
|
|
202
194
|
url: "https://forno.celo.org",
|
|
203
195
|
gas: 3000000,
|
|
204
|
-
gasPrice:
|
|
196
|
+
gasPrice: 5000000000,
|
|
205
197
|
chainId: 42220
|
|
206
198
|
},
|
|
207
199
|
"staging-celo": {
|
|
208
200
|
accounts: { mnemonic },
|
|
209
201
|
url: "https://forno.celo.org",
|
|
210
202
|
gas: 3000000,
|
|
211
|
-
gasPrice:
|
|
203
|
+
gasPrice: 5000000000,
|
|
212
204
|
chainId: 42220
|
|
213
205
|
},
|
|
214
206
|
"development-celo": {
|
|
215
207
|
accounts: { mnemonic },
|
|
216
208
|
url: "https://forno.celo.org",
|
|
217
209
|
gas: 3000000,
|
|
218
|
-
gasPrice:
|
|
210
|
+
gasPrice: 5000000000,
|
|
219
211
|
chainId: 42220
|
|
220
212
|
},
|
|
221
213
|
gnosis: {
|
|
@@ -240,10 +232,7 @@ task("repAirdrop", "Calculates airdrop data and merkle tree")
|
|
|
240
232
|
const actions = airdrop(hre.ethers, ethplorer_key, etherscan_key);
|
|
241
233
|
switch (taskArgs.action) {
|
|
242
234
|
case "calculate":
|
|
243
|
-
return actions.collectAirdropData(
|
|
244
|
-
taskArgs.fusesnapshotblock,
|
|
245
|
-
taskArgs.ethsnapshotblock
|
|
246
|
-
);
|
|
235
|
+
return actions.collectAirdropData(taskArgs.fusesnapshotblock, taskArgs.ethsnapshotblock);
|
|
247
236
|
case "tree":
|
|
248
237
|
return actions.buildMerkleTree();
|
|
249
238
|
case "proof":
|
|
@@ -253,10 +242,7 @@ task("repAirdrop", "Calculates airdrop data and merkle tree")
|
|
|
253
242
|
}
|
|
254
243
|
});
|
|
255
244
|
|
|
256
|
-
task(
|
|
257
|
-
"repAirdropRecover",
|
|
258
|
-
"Calculates airdrop data and merkle tree after critical bug"
|
|
259
|
-
)
|
|
245
|
+
task("repAirdropRecover", "Calculates airdrop data and merkle tree after critical bug")
|
|
260
246
|
.addParam("action", "calculate/tree/proof")
|
|
261
247
|
.addOptionalPositionalParam("address", "proof for address")
|
|
262
248
|
.setAction(async (taskArgs, hre) => {
|
|
@@ -305,10 +291,7 @@ task("gdxAirdropRecover", "Calculates new airdrop data for recovery")
|
|
|
305
291
|
}
|
|
306
292
|
});
|
|
307
293
|
|
|
308
|
-
task(
|
|
309
|
-
"goodCheckpoint",
|
|
310
|
-
"Calculates good checkpoint data and merkle tree for GOOD sync"
|
|
311
|
-
)
|
|
294
|
+
task("goodCheckpoint", "Calculates good checkpoint data and merkle tree for GOOD sync")
|
|
312
295
|
.addParam("action", "calculate/tree/proof")
|
|
313
296
|
.addOptionalPositionalParam("address", "proof for address")
|
|
314
297
|
.setAction(async (taskArgs, hre) => {
|
|
@@ -325,17 +308,12 @@ task(
|
|
|
325
308
|
}
|
|
326
309
|
});
|
|
327
310
|
|
|
328
|
-
task("verifyjson", "verify contracts on etherscan").setAction(
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}
|
|
332
|
-
);
|
|
311
|
+
task("verifyjson", "verify contracts on etherscan").setAction(async (taskArgs, hre) => {
|
|
312
|
+
return verify(hre);
|
|
313
|
+
});
|
|
333
314
|
export default hhconfig;
|
|
334
315
|
|
|
335
|
-
task(
|
|
336
|
-
"sumStakersGdRewards",
|
|
337
|
-
"Sums the GoodDollar reward for each staker"
|
|
338
|
-
).setAction(async (taskArgs, hre) => {
|
|
316
|
+
task("sumStakersGdRewards", "Sums the GoodDollar reward for each staker").setAction(async (taskArgs, hre) => {
|
|
339
317
|
const actions = sumStakersGdRewards(hre.ethers);
|
|
340
318
|
return actions.getStakersGdRewards();
|
|
341
319
|
});
|
|
@@ -348,10 +326,7 @@ task("cleanflat", "Cleans multiple SPDX and Pragma from flattened file")
|
|
|
348
326
|
});
|
|
349
327
|
|
|
350
328
|
// Remove every line started with "// SPDX-License-Identifier:"
|
|
351
|
-
flattened = flattened.replace(
|
|
352
|
-
/SPDX-License-Identifier:/gm,
|
|
353
|
-
"License-Identifier:"
|
|
354
|
-
);
|
|
329
|
+
flattened = flattened.replace(/SPDX-License-Identifier:/gm, "License-Identifier:");
|
|
355
330
|
|
|
356
331
|
flattened = `// SPDX-License-Identifier: MIXED\n\n${flattened}`;
|
|
357
332
|
|
package/package.json
CHANGED
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
},
|
|
253
253
|
"development-celo": {
|
|
254
254
|
"guardiansSafe": "0xdF3e980a175904a26A7BA627048a789Ae6A141cD",
|
|
255
|
-
"gasPrice":
|
|
255
|
+
"gasPrice": 5e9,
|
|
256
256
|
"superfluidHost": "0xA4Ff07cF81C02CFD356184879D953970cA957585",
|
|
257
257
|
"governance": {
|
|
258
258
|
"claimersGOODMonthly": "1000000000000000000000000",
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
},
|
|
262
262
|
"staging-celo": {
|
|
263
263
|
"guardiansSafe": "0xdF3e980a175904a26A7BA627048a789Ae6A141cD",
|
|
264
|
-
"gasPrice":
|
|
264
|
+
"gasPrice": 5e9,
|
|
265
265
|
"superfluidHost": "0xA4Ff07cF81C02CFD356184879D953970cA957585",
|
|
266
266
|
"governance": {
|
|
267
267
|
"claimersGOODMonthly": "1000000000000000000000000",
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
"proposalVotingPeriod": 241920,
|
|
276
276
|
"guardian": "0xa2521e8F5A990903fdD8Afa6570C52526e7E0D5E"
|
|
277
277
|
},
|
|
278
|
-
"gasPrice":
|
|
278
|
+
"gasPrice": 5e9,
|
|
279
279
|
"guardiansSafe": "0xC9D09BA972B4EB6Bb7347F2229FB6d50434fFCa6",
|
|
280
280
|
"superfluidHost": "0xA4Ff07cF81C02CFD356184879D953970cA957585"
|
|
281
281
|
}
|
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";
|
|
@@ -13,9 +14,7 @@ import { TransactionResponse } from "@ethersproject/providers";
|
|
|
13
14
|
|
|
14
15
|
const { name } = network;
|
|
15
16
|
|
|
16
|
-
const printDeploy = async (
|
|
17
|
-
c: Contract | TransactionResponse
|
|
18
|
-
): Promise<Contract | TransactionResponse> => {
|
|
17
|
+
const printDeploy = async (c: Contract | TransactionResponse): Promise<Contract | TransactionResponse> => {
|
|
19
18
|
if (c instanceof Contract) {
|
|
20
19
|
await c.deployed();
|
|
21
20
|
console.log("deployed to: ", c.address);
|
|
@@ -28,11 +27,7 @@ const printDeploy = async (
|
|
|
28
27
|
};
|
|
29
28
|
|
|
30
29
|
export const deployHelpers = async () => {
|
|
31
|
-
let protocolSettings = defaultsDeep(
|
|
32
|
-
{},
|
|
33
|
-
ProtocolSettings[network.name],
|
|
34
|
-
ProtocolSettings["default"]
|
|
35
|
-
);
|
|
30
|
+
let protocolSettings = defaultsDeep({}, ProtocolSettings[network.name], ProtocolSettings["default"]);
|
|
36
31
|
|
|
37
32
|
let release: { [key: string]: any } = dao[network.name];
|
|
38
33
|
|
|
@@ -48,104 +43,105 @@ export const deployHelpers = async () => {
|
|
|
48
43
|
network,
|
|
49
44
|
root: root.address,
|
|
50
45
|
schemeMock: schemeMock.address,
|
|
51
|
-
balance: await ethers.provider
|
|
52
|
-
.getBalance(root.address)
|
|
53
|
-
.then(_ => _.toString())
|
|
46
|
+
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
54
47
|
});
|
|
55
48
|
|
|
56
49
|
const walletAdmins = [];
|
|
57
50
|
for (let i = 0; i < protocolSettings.walletAdminsCount; i++) {
|
|
58
|
-
const wallet = ethers.Wallet.fromMnemonic(
|
|
59
|
-
process.env.ADMIN_WALLET_MNEMONIC,
|
|
60
|
-
`m/44'/60'/0'/0/${i}`
|
|
61
|
-
);
|
|
51
|
+
const wallet = ethers.Wallet.fromMnemonic(process.env.ADMIN_WALLET_MNEMONIC, `m/44'/60'/0'/0/${i}`);
|
|
62
52
|
walletAdmins.push(wallet.address);
|
|
63
53
|
}
|
|
64
54
|
|
|
65
|
-
console.log("deploying adminwallet", { walletAdmins });
|
|
55
|
+
console.log("deploying adminwallet", { walletAdmins, gasprice: protocolSettings.gasPrice });
|
|
66
56
|
const AdminWallet = (await deployDeterministic(
|
|
67
57
|
{
|
|
68
58
|
// address payable[] memory _admins,
|
|
59
|
+
// NameService _ns,
|
|
69
60
|
// address _owner,
|
|
70
|
-
//
|
|
61
|
+
// uint256 _gasPrice
|
|
71
62
|
name: "AdminWallet",
|
|
72
63
|
salt: "AdminWallet",
|
|
73
64
|
isUpgradeable: true
|
|
74
65
|
},
|
|
75
66
|
[walletAdmins, release.NameService, root.address, protocolSettings.gasPrice]
|
|
76
67
|
).then(printDeploy)) as Contract;
|
|
68
|
+
// const AdminWallet = await ethers.getContractAt("AdminWallet", release.AdminWallet);
|
|
77
69
|
|
|
78
|
-
console.log("giving AdminWallet identity_admin permissions");
|
|
79
70
|
const gd = await ethers.getContractAt("IGoodDollar", release.GoodDollar);
|
|
80
71
|
|
|
81
72
|
const decimals = await gd.decimals();
|
|
82
73
|
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
AdminWallet.address
|
|
87
|
-
|
|
74
|
+
const Faucet = await deployDeterministic({ name: "Faucet", salt: "Faucet", isUpgradeable: true }, [
|
|
75
|
+
release.NameService,
|
|
76
|
+
protocolSettings.gasPrice,
|
|
77
|
+
AdminWallet.address,
|
|
78
|
+
root.address
|
|
79
|
+
]);
|
|
80
|
+
// const Faucet = await ethers.getContractAt("Faucet", release.Faucet);
|
|
88
81
|
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
AdminWallet.address,
|
|
95
|
-
root.address
|
|
96
|
-
]
|
|
97
|
-
);
|
|
82
|
+
const Invites = await deployDeterministic({ name: "InvitesV2", salt: "InvitesV2", isUpgradeable: true }, [
|
|
83
|
+
release.NameService,
|
|
84
|
+
ethers.BigNumber.from(100).mul(ethers.BigNumber.from("10").pow(decimals)),
|
|
85
|
+
root.address
|
|
86
|
+
]);
|
|
98
87
|
|
|
99
|
-
const Invites = await
|
|
100
|
-
{ name: "InvitesV2", salt: "InvitesV2", isUpgradeable: true },
|
|
101
|
-
[
|
|
102
|
-
release.NameService,
|
|
103
|
-
ethers.BigNumber.from(100).mul(ethers.BigNumber.from("10").pow(decimals)),
|
|
104
|
-
root.address
|
|
105
|
-
]
|
|
106
|
-
);
|
|
88
|
+
// const Invites = await ethers.getContractAt("AdminWallet", release.Invites);
|
|
107
89
|
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
+
|
|
97
|
+
const adminWalletOwner = await AdminWallet.hasRole(ethers.constants.HashZero, root.address);
|
|
98
|
+
const faucetOwner = await Faucet.hasRole(ethers.constants.HashZero, root.address);
|
|
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
|
|
115
109
|
);
|
|
116
110
|
|
|
117
111
|
console.log("topping adminwallet and faucet with 1 native token");
|
|
118
|
-
await root
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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);
|
|
126
124
|
|
|
127
125
|
if (!network.name.includes("production")) {
|
|
128
126
|
console.log("minting G$s to invites on dev envs");
|
|
129
|
-
await gd.mint(
|
|
130
|
-
Invites.address,
|
|
131
|
-
ethers.BigNumber.from(1e6).mul(ethers.BigNumber.from("10").pow(decimals))
|
|
132
|
-
); //1million GD
|
|
127
|
+
await gd.mint(Invites.address, ethers.BigNumber.from(1e6).mul(ethers.BigNumber.from("10").pow(decimals))); //1million GD
|
|
133
128
|
}
|
|
134
129
|
|
|
135
130
|
console.log({
|
|
131
|
+
walletIsIdentityAdmin,
|
|
136
132
|
adminWalletOwner,
|
|
137
133
|
faucetOwner
|
|
138
134
|
});
|
|
139
135
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
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);
|
|
146
142
|
};
|
|
147
143
|
|
|
148
|
-
export const main = async (
|
|
144
|
+
export const main = async () => {
|
|
149
145
|
await deployHelpers();
|
|
150
146
|
};
|
|
151
|
-
main();
|
|
147
|
+
if (process.argv[1].includes("2_helpers-deploy")) main();
|