@gooddollar/goodprotocol 2.0.1 → 2.0.3-beta.0
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/FuseFaucetV2.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/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 +20 -2
- 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/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/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/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/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/FuseFaucetV2.sol +12 -1
- package/contracts/identity/IdentityV2.sol +9 -4
- package/contracts/utils/AdminWalletFuse.sol +8 -0
- package/hardhat.config.ts +17 -42
- package/package.json +1 -1
- package/releases/deploy-settings.json +3 -3
- package/releases/deployment.json +70 -0
- package/scripts/multichain-deploy/2_helpers-deploy.ts +22 -51
- package/scripts/upgrades/celo-defi-ubi-deploy.ts +15 -2
- package/scripts/upgrades/identity-upgrade.ts +10 -1
- package/test/faucet/FuseFaucet.test.ts +5 -4
- package/types/AdminWalletFuse.ts +38 -0
- package/types/FuseFaucetV2.ts +32 -2
- package/types/factories/AdminWalletFuse__factory.ts +27 -1
- package/types/factories/FuseFaucetV2__factory.ts +19 -1
- package/types/factories/IdentityV2__factory.ts +1 -1
|
@@ -68,12 +68,23 @@ contract FuseFaucetV2 is Initializable {
|
|
|
68
68
|
return IIdentityV2(nameService.getAddress("IDENTITY"));
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
function upgrade(
|
|
71
|
+
function upgrade(
|
|
72
|
+
address _relayer,
|
|
73
|
+
address _owner,
|
|
74
|
+
NameService _ns
|
|
75
|
+
) public {
|
|
72
76
|
require(version == 0, "already upgraded");
|
|
73
77
|
version++;
|
|
74
78
|
owner = _owner;
|
|
75
79
|
if (maxDailyNewWallets == 0) maxDailyNewWallets = 5000;
|
|
76
80
|
relayer = _relayer;
|
|
81
|
+
upgrade2(_ns);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function upgrade2(NameService _ns) public {
|
|
85
|
+
require(version == 1, "already upgraded");
|
|
86
|
+
version++;
|
|
87
|
+
nameService = _ns;
|
|
77
88
|
}
|
|
78
89
|
|
|
79
90
|
modifier reimburseGas() {
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
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
|
@@ -1,4 +1,74 @@
|
|
|
1
1
|
{
|
|
2
|
+
"dapptest": {
|
|
3
|
+
"Avatar": "0xCafac3dD18aC6c6e92c921884f9E4176737C052c",
|
|
4
|
+
"Controller": "0x9f1ac54BEF0DD2f6f3462EA0fa94fC62300d3a8e",
|
|
5
|
+
"GoodDollar": "0x856e4424f806D16E8CBC702B3c0F2ede5468eae5",
|
|
6
|
+
"Identity": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
|
|
7
|
+
"FeeFormula": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707",
|
|
8
|
+
"BancorFormula": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
|
|
9
|
+
"FirstClaimPool": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6",
|
|
10
|
+
"OneTimePayments": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788",
|
|
11
|
+
"Invites": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82",
|
|
12
|
+
"FuseFaucet": "0x0B306BF915C4d645ff596e518fAf3F9669b97016",
|
|
13
|
+
"HomeBridge": "0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f",
|
|
14
|
+
"ProxyFactory": "0xA9d0Fb5837f9c42c874e16da96094b14Af0e2784",
|
|
15
|
+
"NameService": "0x20d42a285797746FAa06067538E2194cbE8f0771",
|
|
16
|
+
"GReputation": "0xa9F1F9deBe4Ffb69D843e46234004Ca09d70E276",
|
|
17
|
+
"CompoundVotingMachine": "0x0facF584B8D88A6644564Cafd5294EBD6b5e693C",
|
|
18
|
+
"ClaimersDistribution": "0x4208449351d0DF5A03B957e0Ba55B792F1Da43e8",
|
|
19
|
+
"GovernanceStaking": "0xa82fF9aFd8f496c3d6ac40E2a0F282E47488CFc9",
|
|
20
|
+
"UBIScheme": "0x810f9f6CAA5da7d3F1D3A02461fdc5a8ee29EFf3",
|
|
21
|
+
"ProtocolUpgradeFuse": "0xf5059a5D33d5853360D16C683c16e67980206f36",
|
|
22
|
+
"network": "dapptest",
|
|
23
|
+
"networkId": 4447,
|
|
24
|
+
"DAI": "0x0000000000000000000000000000000000000000",
|
|
25
|
+
"cDAI": "0x0000000000000000000000000000000000000000",
|
|
26
|
+
"COMP": "0x0000000000000000000000000000000000000000",
|
|
27
|
+
"AdminWallet": "0x998abeb3E57409262aE5b751f60747921B33613E"
|
|
28
|
+
},
|
|
29
|
+
"dapptest-mainnet": {
|
|
30
|
+
"Avatar": "0x1007BDBA1BCc3C94e20d57768EF9fc0b1Cc2844b",
|
|
31
|
+
"Controller": "0x25bEE23e489b9ec351A3f974c3050D1be60900FE",
|
|
32
|
+
"GoodDollar": "0x55C9DCD6128e7d7e7e136d78e533C01F0cB2ef77",
|
|
33
|
+
"Identity": "0x1291Be112d480055DaFd8a610b7d1e203891C274",
|
|
34
|
+
"FeeFormula": "0xb7278A61aa25c888815aFC32Ad3cC52fF24fE575",
|
|
35
|
+
"BancorFormula": "0x809d550fca64d94Bd9F66E60752A544199cfAC3D",
|
|
36
|
+
"Contribution": "0x162A433068F51e18b7d13932F27e66a3f99E6890",
|
|
37
|
+
"DAI": "0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc",
|
|
38
|
+
"COMP": "0x1429859428C0aBc9C2C47C8Ee9FBaf82cFA0F20f",
|
|
39
|
+
"cDAI": "0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07",
|
|
40
|
+
"ETHUsdOracle": "0x5081a39b8A5f0E35a8D959395a630b68B74Dd30f",
|
|
41
|
+
"DAIEthOracle": "0x922D6956C99E12DFeB3224DEA977D0939758A1Fe",
|
|
42
|
+
"DAIUsdOracle": "0x2bdCC0de6bE1f7D2ee689a0342D76F52E8EFABa3",
|
|
43
|
+
"COMPUsdOracle": "0x7bc06c482DEAd17c0e297aFbC32f6e63d3846650",
|
|
44
|
+
"USDCUsdOracle": "0x7969c5eD335650692Bc04293B07F5BF2e7A673C0",
|
|
45
|
+
"AAVEUsdOracle": "0xc351628EB244ec633d5f21fBD6621e1a683B1181",
|
|
46
|
+
"GasPriceOracle": "0xFD471836031dc5108809D173A067e8486B9047A3",
|
|
47
|
+
"ForeignBridge": "0x04C89607413713Ec9775E14b954286519d836FEf",
|
|
48
|
+
"ProxyFactory": "0x4C4a2f8c81640e47606d3fd77B353E87Ba015584",
|
|
49
|
+
"NameService": "0xe7C01F43AaF2061f72c7991980b227dB3882B91f",
|
|
50
|
+
"GReputation": "0x0c35E84F90DA3Bd61E39A7b631c5D449Bfb42cD0",
|
|
51
|
+
"CompoundVotingMachine": "0x15E6A330801AA79fb48F23B066F4ba55882FA57D",
|
|
52
|
+
"GoodMarketMaker": "0x01c2d8c5Bb0303473DA0504A5C61626689bD8176",
|
|
53
|
+
"GoodReserveCDai": "0x09f6c88Ff66547e7B5346e144F8bE3EDE88046B9",
|
|
54
|
+
"ExchangeHelper": "0x66BFa6316f2a6c89fc36143Bd729a768c6cF7028",
|
|
55
|
+
"GoodFundManager": "0xb69e1551889e83821aE13ce425F0B14f1d5C8EDd",
|
|
56
|
+
"StakersDistribution": "0x2f16D249b20E49a8B6be42f8328c4202805789a5",
|
|
57
|
+
"ProtocolUpgrade": "0x46b142DD1E924FAb83eCc3c08e4D46E82f005e0E",
|
|
58
|
+
"UniswapV2SwapHelper": "0xC9a43158891282A2B1475592D5719c001986Aaec",
|
|
59
|
+
"CompoundStakingFactory": "0x1c85638e118b37167e9298c2268758e058DdfDA0",
|
|
60
|
+
"AaveStakingFactory": "0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb",
|
|
61
|
+
"StakingContracts": [
|
|
62
|
+
[
|
|
63
|
+
"0xC87F335Ec42BE3A3DF4E306CD9A929eD741919a0",
|
|
64
|
+
13888
|
|
65
|
+
]
|
|
66
|
+
],
|
|
67
|
+
"DonationsStaking": "0xe9aE5B6b526B813AcBBC587a4c7C2861BA75Daa6",
|
|
68
|
+
"network": "dapptest-mainnet",
|
|
69
|
+
"networkId": 4447,
|
|
70
|
+
"AdminWallet": "0x4631BCAbD6dF18D94796344963cB60d44a4136b6"
|
|
71
|
+
},
|
|
2
72
|
"olddao": {
|
|
3
73
|
"Reserve": "0x7a2088a1bFc9d81c55368AE168C2C02570cB814F",
|
|
4
74
|
"GoodDollar": "0x32467b43BFa67273FC7dDda0999Ee9A12F2AaA08",
|
|
@@ -13,9 +13,7 @@ import { TransactionResponse } from "@ethersproject/providers";
|
|
|
13
13
|
|
|
14
14
|
const { name } = network;
|
|
15
15
|
|
|
16
|
-
const printDeploy = async (
|
|
17
|
-
c: Contract | TransactionResponse
|
|
18
|
-
): Promise<Contract | TransactionResponse> => {
|
|
16
|
+
const printDeploy = async (c: Contract | TransactionResponse): Promise<Contract | TransactionResponse> => {
|
|
19
17
|
if (c instanceof Contract) {
|
|
20
18
|
await c.deployed();
|
|
21
19
|
console.log("deployed to: ", c.address);
|
|
@@ -28,11 +26,7 @@ const printDeploy = async (
|
|
|
28
26
|
};
|
|
29
27
|
|
|
30
28
|
export const deployHelpers = async () => {
|
|
31
|
-
let protocolSettings = defaultsDeep(
|
|
32
|
-
{},
|
|
33
|
-
ProtocolSettings[network.name],
|
|
34
|
-
ProtocolSettings["default"]
|
|
35
|
-
);
|
|
29
|
+
let protocolSettings = defaultsDeep({}, ProtocolSettings[network.name], ProtocolSettings["default"]);
|
|
36
30
|
|
|
37
31
|
let release: { [key: string]: any } = dao[network.name];
|
|
38
32
|
|
|
@@ -48,17 +42,12 @@ export const deployHelpers = async () => {
|
|
|
48
42
|
network,
|
|
49
43
|
root: root.address,
|
|
50
44
|
schemeMock: schemeMock.address,
|
|
51
|
-
balance: await ethers.provider
|
|
52
|
-
.getBalance(root.address)
|
|
53
|
-
.then(_ => _.toString())
|
|
45
|
+
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
54
46
|
});
|
|
55
47
|
|
|
56
48
|
const walletAdmins = [];
|
|
57
49
|
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
|
-
);
|
|
50
|
+
const wallet = ethers.Wallet.fromMnemonic(process.env.ADMIN_WALLET_MNEMONIC, `m/44'/60'/0'/0/${i}`);
|
|
62
51
|
walletAdmins.push(wallet.address);
|
|
63
52
|
}
|
|
64
53
|
|
|
@@ -81,38 +70,23 @@ export const deployHelpers = async () => {
|
|
|
81
70
|
const decimals = await gd.decimals();
|
|
82
71
|
|
|
83
72
|
const identity = await ethers.getContractAt("IdentityV2", release.Identity);
|
|
84
|
-
await identity.grantRole(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
{ name: "Faucet", salt: "Faucet", isUpgradeable: true },
|
|
91
|
-
[
|
|
92
|
-
release.NameService,
|
|
93
|
-
protocolSettings.gasPrice,
|
|
94
|
-
AdminWallet.address,
|
|
95
|
-
root.address
|
|
96
|
-
]
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
const Invites = await deployDeterministic(
|
|
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
|
-
);
|
|
107
|
-
|
|
108
|
-
const adminWalletOwner = await AdminWallet.hasRole(
|
|
109
|
-
ethers.constants.HashZero,
|
|
73
|
+
await identity.grantRole(ethers.utils.keccak256(ethers.utils.toUtf8Bytes("identity_admin")), AdminWallet.address);
|
|
74
|
+
|
|
75
|
+
const Faucet = await deployDeterministic({ name: "Faucet", salt: "Faucet", isUpgradeable: true }, [
|
|
76
|
+
release.NameService,
|
|
77
|
+
protocolSettings.gasPrice,
|
|
78
|
+
AdminWallet.address,
|
|
110
79
|
root.address
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
|
|
80
|
+
]);
|
|
81
|
+
|
|
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)),
|
|
114
85
|
root.address
|
|
115
|
-
);
|
|
86
|
+
]);
|
|
87
|
+
|
|
88
|
+
const adminWalletOwner = await AdminWallet.hasRole(ethers.constants.HashZero, root.address);
|
|
89
|
+
const faucetOwner = await Faucet.hasRole(ethers.constants.HashZero, root.address);
|
|
116
90
|
|
|
117
91
|
console.log("topping adminwallet and faucet with 1 native token");
|
|
118
92
|
await root.sendTransaction({
|
|
@@ -126,10 +100,7 @@ export const deployHelpers = async () => {
|
|
|
126
100
|
|
|
127
101
|
if (!network.name.includes("production")) {
|
|
128
102
|
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
|
|
103
|
+
await gd.mint(Invites.address, ethers.BigNumber.from(1e6).mul(ethers.BigNumber.from("10").pow(decimals))); //1million GD
|
|
133
104
|
}
|
|
134
105
|
|
|
135
106
|
console.log({
|
|
@@ -145,7 +116,7 @@ export const deployHelpers = async () => {
|
|
|
145
116
|
await releaser(release, network.name, "deployment", false);
|
|
146
117
|
};
|
|
147
118
|
|
|
148
|
-
export const main = async (
|
|
119
|
+
export const main = async () => {
|
|
149
120
|
await deployHelpers();
|
|
150
121
|
};
|
|
151
|
-
main();
|
|
122
|
+
if (process.argv[1].includes("2_helpers-deploy")) main();
|
|
@@ -3,10 +3,15 @@
|
|
|
3
3
|
* - upgrade Identity on Fuse to support whitelisting with chainid
|
|
4
4
|
*
|
|
5
5
|
* Step 2:
|
|
6
|
+
* - deploy 2_helpers on Celo
|
|
7
|
+
* - add 1000 celo to adminwallet and faucet
|
|
8
|
+
* - monitor adminwallet + faucet on defender
|
|
9
|
+
*
|
|
10
|
+
* Step 3:
|
|
6
11
|
* - upgrade AdminWallet+Invites+Faucet on Fuse to support whitelisting chainid
|
|
7
12
|
* - upgrade backend server to support whitelisting with chainid
|
|
8
13
|
*
|
|
9
|
-
* Step
|
|
14
|
+
* Step 4:
|
|
10
15
|
* 0. deploy 3_gdStaking, deploy 4_ubi
|
|
11
16
|
* 1. guardians vote send X% to celo ubi pool
|
|
12
17
|
* 2. guardians vote on celo set new GOOD distribution for gdstaking + claiming ubi
|
|
@@ -29,6 +34,7 @@ import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
|
29
34
|
import dao from "../../releases/deployment.json";
|
|
30
35
|
import { upgrade as identityUpgrade } from "./identity-upgrade";
|
|
31
36
|
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
|
37
|
+
import { deployHelpers } from "../multichain-deploy/2_helpers-deploy";
|
|
32
38
|
|
|
33
39
|
const { name: networkName } = network;
|
|
34
40
|
const isProduction = networkName.includes("production");
|
|
@@ -40,6 +46,10 @@ const step1 = async () => {
|
|
|
40
46
|
};
|
|
41
47
|
|
|
42
48
|
const step2 = async () => {
|
|
49
|
+
await deployHelpers();
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const step3 = async () => {
|
|
43
53
|
let release: { [key: string]: any } = dao[networkName];
|
|
44
54
|
let [root] = await ethers.getSigners();
|
|
45
55
|
|
|
@@ -67,7 +77,7 @@ const step2 = async () => {
|
|
|
67
77
|
console.log("upgrade backend contracts abi + call whitelist with chainid....");
|
|
68
78
|
};
|
|
69
79
|
|
|
70
|
-
const
|
|
80
|
+
const step4 = async () => {
|
|
71
81
|
// let [root, ...signers] = await ethers.getSigners();
|
|
72
82
|
|
|
73
83
|
const isSafeSimulation = process.env.SAFE_SIMULATION === "true";
|
|
@@ -160,6 +170,9 @@ const main = async () => {
|
|
|
160
170
|
case "3":
|
|
161
171
|
await step3();
|
|
162
172
|
break;
|
|
173
|
+
case "4":
|
|
174
|
+
await step4();
|
|
175
|
+
break;
|
|
163
176
|
}
|
|
164
177
|
};
|
|
165
178
|
main().catch(e => console.error(e));
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Upgrade Plan:
|
|
4
4
|
* - deploy Identity
|
|
5
5
|
* - give adminWallet admin permissions
|
|
6
|
+
* - give new identy admin permissions in old identity
|
|
6
7
|
* - revoke deployer permissions
|
|
7
8
|
* - replace pointers to old identity contract in:
|
|
8
9
|
* - GoodDollar token
|
|
@@ -10,9 +11,10 @@
|
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import { network, ethers } from "hardhat";
|
|
13
|
-
import { Contract
|
|
14
|
+
import { Contract } from "ethers";
|
|
14
15
|
import { defaultsDeep } from "lodash";
|
|
15
16
|
import { getImplementationAddress } from "@openzeppelin/upgrades-core";
|
|
17
|
+
import OldIdentityABI from "@gooddollar/goodcontracts/build/contracts/Identity.min.json";
|
|
16
18
|
|
|
17
19
|
import {
|
|
18
20
|
deployDeterministic,
|
|
@@ -44,6 +46,7 @@ export const upgrade = async () => {
|
|
|
44
46
|
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
45
47
|
});
|
|
46
48
|
|
|
49
|
+
let OldIdentity = await ethers.getContractAt(OldIdentityABI.abi, release.OldIdentity || release.Identity);
|
|
47
50
|
// let Identity = await ethers.getContractAt("IdentityV2", release.Identity);
|
|
48
51
|
// Identity = await ethers.getContractAt("IdentityV2", "0xb0cD4828Cc90C5BC28f4920Adf2Fd8F025003D7E");
|
|
49
52
|
console.log("deploying new identity...");
|
|
@@ -65,6 +68,12 @@ export const upgrade = async () => {
|
|
|
65
68
|
|
|
66
69
|
console.log("calling initDAO...");
|
|
67
70
|
const tx = await (await Identity.initDAO(release.NameService)).wait();
|
|
71
|
+
await Identity.grantRole(
|
|
72
|
+
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("identity_admin")),
|
|
73
|
+
release.AdminWallet
|
|
74
|
+
).then(printDeploy);
|
|
75
|
+
await OldIdentity.addIdentityAdmin(Identity.address).then(printDeploy);
|
|
76
|
+
|
|
68
77
|
const impl = await getImplementationAddress(ethers.provider, Identity.address);
|
|
69
78
|
await verifyContract(impl, "IdentityV2", networkName);
|
|
70
79
|
|