@gooddollar/goodprotocol 2.0.25-beta.6 → 2.0.25-beta.8
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/BulkWhitelist.min.json +1 -0
- package/artifacts/abis/OneTimeReward.min.json +1 -0
- 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/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/invite/OneTimeReward.sol/OneTimeReward.dbg.json +4 -0
- package/artifacts/contracts/invite/OneTimeReward.sol/OneTimeReward.json +291 -0
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.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/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.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/PayableMock.sol/PayableMock.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/GoodDollar.sol/GoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/IFeesFormula.sol/IFeesFormula.dbg.json +1 -1
- package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.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/ISuperToken.sol/ISuperToken.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/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.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/BancorFormula.sol/BancorFormula.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkWhitelist.sol/BulkWhitelist.dbg.json +4 -0
- package/artifacts/contracts/utils/BulkWhitelist.sol/BulkWhitelist.json +67 -0
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/IQuoterV2.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/ISwapRouter.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/GDFaucet.sol/GDFaucet.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/IdentityFix.sol/IdentityFix.dbg.json +1 -1
- package/artifacts/contracts/utils/MultiCall.sol/Multicall.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/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.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/invite/OneTimeReward.sol +87 -0
- package/contracts/utils/BulkWhitelist.sol +51 -0
- package/package.json +1 -1
- package/releases/deployment.json +546 -599
- package/scripts/deployFullDAO.ts +6 -4
- package/scripts/fv.ts +134 -17
- package/scripts/utils.ts +11 -0
- package/test/helpers.ts +2 -0
- package/test/reserve/GoodReserveCDai.test.ts +2 -1
- package/types/@openzeppelin/contracts/access/Ownable.ts +175 -0
- package/types/@openzeppelin/contracts/access/index.ts +1 -0
- package/types/contracts/invite/OneTimeReward.ts +521 -0
- package/types/contracts/invite/index.ts +1 -0
- package/types/contracts/utils/BulkWhitelist.ts +153 -0
- package/types/contracts/utils/index.ts +1 -0
- package/types/factories/@openzeppelin/contracts/access/Ownable__factory.ts +78 -0
- package/types/factories/@openzeppelin/contracts/access/index.ts +1 -0
- package/types/factories/contracts/invite/OneTimeReward__factory.ts +361 -0
- package/types/factories/contracts/invite/index.ts +1 -0
- package/types/factories/contracts/utils/BulkWhitelist__factory.ts +123 -0
- package/types/factories/contracts/utils/index.ts +1 -0
- package/types/hardhat.d.ts +27 -0
- package/types/index.ts +6 -0
package/scripts/deployFullDAO.ts
CHANGED
|
@@ -88,6 +88,8 @@ export const createDAO = async () => {
|
|
|
88
88
|
.deploy()
|
|
89
89
|
.then(printDeploy)) as Contract;
|
|
90
90
|
|
|
91
|
+
await BancorFormula.init()
|
|
92
|
+
|
|
91
93
|
const AddFounders = (await AddFoundersFactory.deploy().then(
|
|
92
94
|
printDeploy
|
|
93
95
|
)) as Contract;
|
|
@@ -421,14 +423,14 @@ const deployMainnet = async (Avatar, Identity) => {
|
|
|
421
423
|
let DAIEthOracle = daiEthOracleAddr
|
|
422
424
|
? await ethers.getContractAt("DaiEthPriceMockOracle", daiEthOracleAddr)
|
|
423
425
|
: ((await (await ethers.getContractFactory("DaiEthPriceMockOracle"))
|
|
424
|
-
|
|
425
|
-
|
|
426
|
+
.deploy()
|
|
427
|
+
.then(printDeploy)) as Contract);
|
|
426
428
|
|
|
427
429
|
let ETHUsdOracle = ethUsdOracleAddr
|
|
428
430
|
? await ethers.getContractAt("EthUSDMockOracle", ethUsdOracleAddr)
|
|
429
431
|
: ((await (await ethers.getContractFactory("EthUSDMockOracle"))
|
|
430
|
-
|
|
431
|
-
|
|
432
|
+
.deploy()
|
|
433
|
+
.then(printDeploy)) as Contract);
|
|
432
434
|
|
|
433
435
|
return {
|
|
434
436
|
Contribution,
|
package/scripts/fv.ts
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import fetch from "cross-fetch";
|
|
2
1
|
import fs from "fs";
|
|
3
2
|
import { chunk, uniqBy } from "lodash";
|
|
4
|
-
import
|
|
3
|
+
import delay from "delay";
|
|
5
4
|
|
|
5
|
+
import { bulkIsWhitelisted, bulkIsWhitelistedFuse, bulkLastAuth } from "./utils";
|
|
6
|
+
|
|
7
|
+
const fetchImages = async a => {
|
|
8
|
+
const i1 = await fetch("http://localhost:9090/enrollment-3d/" + a[1]).then(_ => _.json());
|
|
9
|
+
const i2 = await fetch("http://localhost:9090/enrollment-3d/" + a[2]).then(_ => _.json());
|
|
10
|
+
if (i1.auditTrailBase64 && i2.auditTrailBase64) {
|
|
11
|
+
fs.writeFileSync("fvimages/" + a.join("_") + "-a.jpg", i1.auditTrailBase64, {
|
|
12
|
+
encoding: "base64"
|
|
13
|
+
});
|
|
14
|
+
fs.writeFileSync("fvimages/" + a.join("_") + "-b.jpg", i2.auditTrailBase64, {
|
|
15
|
+
encoding: "base64"
|
|
16
|
+
});
|
|
17
|
+
} else console.log("not found", a, !!i1.auditTrailBase64, !!i2.auditTrailBase64);
|
|
18
|
+
};
|
|
6
19
|
//create tunnel to fv server ssh -L 9090:server:8080 -N user@server -i sshkey
|
|
7
20
|
const main = async () => {
|
|
8
21
|
const data = JSON.parse(fs.readFileSync("fvtriplets2.txt").toString());
|
|
@@ -20,22 +33,125 @@ const main = async () => {
|
|
|
20
33
|
return fs.existsSync(key) === false;
|
|
21
34
|
});
|
|
22
35
|
console.log({ notfetched });
|
|
23
|
-
const ps = notfetched.map(
|
|
24
|
-
const i1 = await fetch("http://localhost:9090/enrollment-3d/" + a[1]).then(_ => _.json());
|
|
25
|
-
const i2 = await fetch("http://localhost:9090/enrollment-3d/" + a[2]).then(_ => _.json());
|
|
26
|
-
if (i1.auditTrailBase64 && i2.auditTrailBase64) {
|
|
27
|
-
fs.writeFileSync("fvimages/" + a.join("_") + "-a.jpg", i1.auditTrailBase64, {
|
|
28
|
-
encoding: "base64"
|
|
29
|
-
});
|
|
30
|
-
fs.writeFileSync("fvimages/" + a.join("_") + "-b.jpg", i2.auditTrailBase64, {
|
|
31
|
-
encoding: "base64"
|
|
32
|
-
});
|
|
33
|
-
} else console.log("not found", a, !!i1.auditTrailBase64, !!i2.auditTrailBase64);
|
|
34
|
-
});
|
|
36
|
+
const ps = notfetched.map(fetchImages);
|
|
35
37
|
|
|
36
38
|
await Promise.all(ps);
|
|
37
39
|
};
|
|
38
40
|
|
|
41
|
+
// check which ids have been indexed, if not then make sure they are whitelisted
|
|
42
|
+
const checkIndexedOrDelete = async () => {
|
|
43
|
+
const data = JSON.parse(
|
|
44
|
+
"[" + fs.readFileSync("fvids.json").toString().replace(/\n$/, "").replaceAll(/\n/g, ",\n") + "]"
|
|
45
|
+
);
|
|
46
|
+
const triplets = uniqBy(data, _ => _["wallet"]);
|
|
47
|
+
|
|
48
|
+
const accounts = triplets.map(_ => _["wallet"]);
|
|
49
|
+
console.log("Total accounts:", accounts.length, accounts[0]);
|
|
50
|
+
let whitelisted = [];
|
|
51
|
+
for (let batch of chunk(accounts, 200)) {
|
|
52
|
+
whitelisted.push(...(await bulkIsWhitelistedFuse(batch)));
|
|
53
|
+
}
|
|
54
|
+
const failed = triplets.filter(_ => whitelisted.includes(_["wallet"]) === false);
|
|
55
|
+
|
|
56
|
+
console.log("Total whitelisted:", whitelisted.length);
|
|
57
|
+
console.log("Total not whitelisted:", failed.length);
|
|
58
|
+
let ps = [];
|
|
59
|
+
|
|
60
|
+
ps = [];
|
|
61
|
+
for (let record of triplets) {
|
|
62
|
+
const isEnrolled = fetch("http://localhost:9090/enrollment-3d/" + record["identifier"].slice(0, 42))
|
|
63
|
+
.then(_ => _.json())
|
|
64
|
+
.then(_ => _.success);
|
|
65
|
+
// const isEnrolled = "unknown";
|
|
66
|
+
const isIndexed = fetch("http://localhost:9090/3d-db/get", {
|
|
67
|
+
method: "POST",
|
|
68
|
+
body: JSON.stringify({ identifier: record["identifier"].slice(0, 42), groupName: "GoodDollar" })
|
|
69
|
+
})
|
|
70
|
+
.then(_ => _.json())
|
|
71
|
+
.then(_ => _.success);
|
|
72
|
+
|
|
73
|
+
ps.push(
|
|
74
|
+
Promise.all([isEnrolled, isIndexed]).then(_ => ({
|
|
75
|
+
...record,
|
|
76
|
+
isEnrolled: _[0],
|
|
77
|
+
isIndexed: _[1],
|
|
78
|
+
isWhitelisted: whitelisted.includes(record.wallet)
|
|
79
|
+
}))
|
|
80
|
+
);
|
|
81
|
+
if (ps.length % 50 === 0) {
|
|
82
|
+
console.log("waiting...", ps.length);
|
|
83
|
+
await Promise.all(ps);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
console.log("waiting...", ps.length);
|
|
87
|
+
const r = await Promise.all(ps);
|
|
88
|
+
const toDelete = r.filter(
|
|
89
|
+
_ => (_.isWhitelisted && (!_.isEnrolled || !_.isIndexed)) || (!_.isWhitelisted && _.isIndexed && !_.isEnrolled)
|
|
90
|
+
);
|
|
91
|
+
const toWhitelist = r.filter(_ => !_.isWhitelisted && _.isEnrolled && _.isIndexed);
|
|
92
|
+
|
|
93
|
+
console.log("toDelete:", toDelete.length);
|
|
94
|
+
|
|
95
|
+
console.log("toWhitelist:", toWhitelist.length);
|
|
96
|
+
fs.writeFileSync("fvIndexedOrEnrolled.json", JSON.stringify(r));
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const fixInvalidIndexed = async () => {
|
|
100
|
+
const indexedOrEnrolled = JSON.parse(fs.readFileSync("fvIndexedOrEnrolled.json").toString());
|
|
101
|
+
const toDelete = indexedOrEnrolled.filter(
|
|
102
|
+
_ => (_.isWhitelisted && (!_.isEnrolled || !_.isIndexed)) || (!_.isWhitelisted && _.isIndexed && !_.isEnrolled)
|
|
103
|
+
);
|
|
104
|
+
const toWhitelist = indexedOrEnrolled.filter(_ => !_.isWhitelisted && _.isEnrolled && _.isIndexed);
|
|
105
|
+
|
|
106
|
+
console.log("toDelete:", toDelete.length);
|
|
107
|
+
|
|
108
|
+
console.log("toWhitelist:", toWhitelist.length);
|
|
109
|
+
|
|
110
|
+
console.log(toWhitelist);
|
|
111
|
+
return;
|
|
112
|
+
let ps = [];
|
|
113
|
+
for (let record of toWhitelist) {
|
|
114
|
+
ps.push(fetch(`https://goodserver.gooddollar.org/syncWhitelist/${record.wallet}`).then(_ => _.json()));
|
|
115
|
+
if (ps.length > 0 && ps.length % 3 === 0) {
|
|
116
|
+
console.log("waiting...", ps.length);
|
|
117
|
+
await Promise.all(ps).catch(e => console.log(e));
|
|
118
|
+
console.log("waiting 60 seconds for rate limit");
|
|
119
|
+
await delay(50000);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (ps.length > 0) {
|
|
123
|
+
console.log("waiting...", ps.length);
|
|
124
|
+
await Promise.all(ps).catch(e => console.log(e));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const removeWhitelist = toDelete.filter(_ => _.isWhitelisted).map(_ => _.wallet);
|
|
128
|
+
// removeWhitelist.push(...toWhitelist.map(_ => _.wallet));
|
|
129
|
+
ps = [];
|
|
130
|
+
for (let record of toDelete) {
|
|
131
|
+
if (record.isIndexed) {
|
|
132
|
+
// console.log("removing record from index and queuing for whitelist removal", record.wallet);
|
|
133
|
+
const isIndexed = fetch("http://localhost:9090/3d-db/delete", {
|
|
134
|
+
method: "POST",
|
|
135
|
+
body: JSON.stringify({ identifier: record["identifier"].slice(0, 42), groupName: "GoodDollar" })
|
|
136
|
+
}).then(_ => _.json());
|
|
137
|
+
|
|
138
|
+
ps.push(
|
|
139
|
+
isIndexed.then(_ => {
|
|
140
|
+
if (!_.success) throw new Error(`delete index failed: ${record.wallet}`);
|
|
141
|
+
})
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
if (ps.length > 0 && ps.length % 10 === 0) {
|
|
145
|
+
console.log("waiting...", ps.length);
|
|
146
|
+
await Promise.all(ps).catch(e => console.log(e));
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
console.log("waiting...", ps.length);
|
|
150
|
+
await Promise.all(ps).catch(e => console.log(e));
|
|
151
|
+
console.log({ removeWhitelist }, removeWhitelist.length);
|
|
152
|
+
fs.writeFileSync("removeWhitelist.json", JSON.stringify(removeWhitelist));
|
|
153
|
+
};
|
|
154
|
+
|
|
39
155
|
const deleteIdentifiers = async password => {
|
|
40
156
|
const data = JSON.parse(fs.readFileSync("fvtriplets2.txt").toString());
|
|
41
157
|
const triplets = uniqBy(chunk(data, 3), _ => _.join("_"));
|
|
@@ -89,7 +205,8 @@ const deleteIdentifiers = async password => {
|
|
|
89
205
|
const res = await Promise.all(ps);
|
|
90
206
|
console.log(res);
|
|
91
207
|
};
|
|
92
|
-
|
|
208
|
+
// checkIndexedOrDelete();
|
|
209
|
+
fixInvalidIndexed();
|
|
93
210
|
// main();
|
|
94
|
-
console.log(process.env.ADMIN_PASSWORD);
|
|
95
|
-
deleteIdentifiers(process.env.ADMIN_PASSWORD);
|
|
211
|
+
// console.log(process.env.ADMIN_PASSWORD);
|
|
212
|
+
// deleteIdentifiers(process.env.ADMIN_PASSWORD);
|
package/scripts/utils.ts
CHANGED
|
@@ -13,6 +13,17 @@ export const bulkIsWhitelisted = async (accounts: Array<String>) => {
|
|
|
13
13
|
const whitelisted = accounts.filter((v, i) => result[i]);
|
|
14
14
|
return whitelisted;
|
|
15
15
|
};
|
|
16
|
+
export const bulkIsWhitelistedFuse = async (accounts: Array<String>) => {
|
|
17
|
+
setMulticallAddress(122, "0x3CE6158b7278Bf6792e014FA7B4f3c6c46fe9410");
|
|
18
|
+
setMulticallAddress(42220, "0x75F59534dd892c1f8a7B172D639FA854D529ada3");
|
|
19
|
+
const provider = new ethers.providers.JsonRpcProvider("https://rpc.fuse.io");
|
|
20
|
+
const ethcallProvider = new Provider(provider, 122);
|
|
21
|
+
const identityContract = new Contract("0x2F9C28de9e6d44b71B91b8BA337A5D82e308E7BE", Identity.abi);
|
|
22
|
+
const calls = accounts.map(d => identityContract.isWhitelisted(d));
|
|
23
|
+
const result = await ethcallProvider.all(calls);
|
|
24
|
+
const whitelisted = accounts.filter((v, i) => result[i]);
|
|
25
|
+
return whitelisted;
|
|
26
|
+
};
|
|
16
27
|
|
|
17
28
|
export const bulkLastAuth = async (accounts: Array<String>) => {
|
|
18
29
|
setMulticallAddress(122, "0x3CE6158b7278Bf6792e014FA7B4f3c6c46fe9410");
|
package/test/helpers.ts
CHANGED
|
@@ -134,6 +134,8 @@ export const createDAO = async (tokenType: "super" | "regular" = "super") => {
|
|
|
134
134
|
await ethers.getContractFactory("BancorFormula")
|
|
135
135
|
).deploy();
|
|
136
136
|
|
|
137
|
+
await BancorFormula.init();
|
|
138
|
+
|
|
137
139
|
console.log("deploy upgradeable identity...");
|
|
138
140
|
|
|
139
141
|
const Identity = await upgrades.deployProxy(
|
|
@@ -474,6 +474,7 @@ describe("GoodReserve - staking with cDAI mocks", () => {
|
|
|
474
474
|
"BancorFormula",
|
|
475
475
|
await marketMaker.getBancor()
|
|
476
476
|
);
|
|
477
|
+
|
|
477
478
|
const expectedReturn = await bancor.calculateSaleReturn(
|
|
478
479
|
supplyBefore.toString(),
|
|
479
480
|
reserveBalanceBefore.toString(),
|
|
@@ -966,7 +967,7 @@ describe("GoodReserve - staking with cDAI mocks", () => {
|
|
|
966
967
|
parseInt(reserveBalance.toString()) *
|
|
967
968
|
(1 -
|
|
968
969
|
(1 - amount.toNumber() / parseInt(supply.toString())) **
|
|
969
|
-
|
|
970
|
+
(1000000 / reserveToken.reserveRatio));
|
|
970
971
|
|
|
971
972
|
expected = Math.ceil((0.8 * expected) / 100) * 100; //deduct 20% contribution, allow 5 points precission mismatch (due to bancor pow estimation?), match solidity no floating point
|
|
972
973
|
//expected = Math.floor(0.8 * expected);
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import type {
|
|
5
|
+
BaseContract,
|
|
6
|
+
BigNumber,
|
|
7
|
+
BytesLike,
|
|
8
|
+
CallOverrides,
|
|
9
|
+
ContractTransaction,
|
|
10
|
+
Overrides,
|
|
11
|
+
PopulatedTransaction,
|
|
12
|
+
Signer,
|
|
13
|
+
utils,
|
|
14
|
+
} from "ethers";
|
|
15
|
+
import type {
|
|
16
|
+
FunctionFragment,
|
|
17
|
+
Result,
|
|
18
|
+
EventFragment,
|
|
19
|
+
} from "@ethersproject/abi";
|
|
20
|
+
import type { Listener, Provider } from "@ethersproject/providers";
|
|
21
|
+
import type {
|
|
22
|
+
TypedEventFilter,
|
|
23
|
+
TypedEvent,
|
|
24
|
+
TypedListener,
|
|
25
|
+
OnEvent,
|
|
26
|
+
} from "../../../common";
|
|
27
|
+
|
|
28
|
+
export interface OwnableInterface extends utils.Interface {
|
|
29
|
+
functions: {
|
|
30
|
+
"owner()": FunctionFragment;
|
|
31
|
+
"renounceOwnership()": FunctionFragment;
|
|
32
|
+
"transferOwnership(address)": FunctionFragment;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
getFunction(
|
|
36
|
+
nameOrSignatureOrTopic: "owner" | "renounceOwnership" | "transferOwnership"
|
|
37
|
+
): FunctionFragment;
|
|
38
|
+
|
|
39
|
+
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
|
|
40
|
+
encodeFunctionData(
|
|
41
|
+
functionFragment: "renounceOwnership",
|
|
42
|
+
values?: undefined
|
|
43
|
+
): string;
|
|
44
|
+
encodeFunctionData(
|
|
45
|
+
functionFragment: "transferOwnership",
|
|
46
|
+
values: [string]
|
|
47
|
+
): string;
|
|
48
|
+
|
|
49
|
+
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
|
|
50
|
+
decodeFunctionResult(
|
|
51
|
+
functionFragment: "renounceOwnership",
|
|
52
|
+
data: BytesLike
|
|
53
|
+
): Result;
|
|
54
|
+
decodeFunctionResult(
|
|
55
|
+
functionFragment: "transferOwnership",
|
|
56
|
+
data: BytesLike
|
|
57
|
+
): Result;
|
|
58
|
+
|
|
59
|
+
events: {
|
|
60
|
+
"OwnershipTransferred(address,address)": EventFragment;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface OwnershipTransferredEventObject {
|
|
67
|
+
previousOwner: string;
|
|
68
|
+
newOwner: string;
|
|
69
|
+
}
|
|
70
|
+
export type OwnershipTransferredEvent = TypedEvent<
|
|
71
|
+
[string, string],
|
|
72
|
+
OwnershipTransferredEventObject
|
|
73
|
+
>;
|
|
74
|
+
|
|
75
|
+
export type OwnershipTransferredEventFilter =
|
|
76
|
+
TypedEventFilter<OwnershipTransferredEvent>;
|
|
77
|
+
|
|
78
|
+
export interface Ownable extends BaseContract {
|
|
79
|
+
connect(signerOrProvider: Signer | Provider | string): this;
|
|
80
|
+
attach(addressOrName: string): this;
|
|
81
|
+
deployed(): Promise<this>;
|
|
82
|
+
|
|
83
|
+
interface: OwnableInterface;
|
|
84
|
+
|
|
85
|
+
queryFilter<TEvent extends TypedEvent>(
|
|
86
|
+
event: TypedEventFilter<TEvent>,
|
|
87
|
+
fromBlockOrBlockhash?: string | number | undefined,
|
|
88
|
+
toBlock?: string | number | undefined
|
|
89
|
+
): Promise<Array<TEvent>>;
|
|
90
|
+
|
|
91
|
+
listeners<TEvent extends TypedEvent>(
|
|
92
|
+
eventFilter?: TypedEventFilter<TEvent>
|
|
93
|
+
): Array<TypedListener<TEvent>>;
|
|
94
|
+
listeners(eventName?: string): Array<Listener>;
|
|
95
|
+
removeAllListeners<TEvent extends TypedEvent>(
|
|
96
|
+
eventFilter: TypedEventFilter<TEvent>
|
|
97
|
+
): this;
|
|
98
|
+
removeAllListeners(eventName?: string): this;
|
|
99
|
+
off: OnEvent<this>;
|
|
100
|
+
on: OnEvent<this>;
|
|
101
|
+
once: OnEvent<this>;
|
|
102
|
+
removeListener: OnEvent<this>;
|
|
103
|
+
|
|
104
|
+
functions: {
|
|
105
|
+
owner(overrides?: CallOverrides): Promise<[string]>;
|
|
106
|
+
|
|
107
|
+
renounceOwnership(
|
|
108
|
+
overrides?: Overrides & { from?: string }
|
|
109
|
+
): Promise<ContractTransaction>;
|
|
110
|
+
|
|
111
|
+
transferOwnership(
|
|
112
|
+
newOwner: string,
|
|
113
|
+
overrides?: Overrides & { from?: string }
|
|
114
|
+
): Promise<ContractTransaction>;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
owner(overrides?: CallOverrides): Promise<string>;
|
|
118
|
+
|
|
119
|
+
renounceOwnership(
|
|
120
|
+
overrides?: Overrides & { from?: string }
|
|
121
|
+
): Promise<ContractTransaction>;
|
|
122
|
+
|
|
123
|
+
transferOwnership(
|
|
124
|
+
newOwner: string,
|
|
125
|
+
overrides?: Overrides & { from?: string }
|
|
126
|
+
): Promise<ContractTransaction>;
|
|
127
|
+
|
|
128
|
+
callStatic: {
|
|
129
|
+
owner(overrides?: CallOverrides): Promise<string>;
|
|
130
|
+
|
|
131
|
+
renounceOwnership(overrides?: CallOverrides): Promise<void>;
|
|
132
|
+
|
|
133
|
+
transferOwnership(
|
|
134
|
+
newOwner: string,
|
|
135
|
+
overrides?: CallOverrides
|
|
136
|
+
): Promise<void>;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
filters: {
|
|
140
|
+
"OwnershipTransferred(address,address)"(
|
|
141
|
+
previousOwner?: string | null,
|
|
142
|
+
newOwner?: string | null
|
|
143
|
+
): OwnershipTransferredEventFilter;
|
|
144
|
+
OwnershipTransferred(
|
|
145
|
+
previousOwner?: string | null,
|
|
146
|
+
newOwner?: string | null
|
|
147
|
+
): OwnershipTransferredEventFilter;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
estimateGas: {
|
|
151
|
+
owner(overrides?: CallOverrides): Promise<BigNumber>;
|
|
152
|
+
|
|
153
|
+
renounceOwnership(
|
|
154
|
+
overrides?: Overrides & { from?: string }
|
|
155
|
+
): Promise<BigNumber>;
|
|
156
|
+
|
|
157
|
+
transferOwnership(
|
|
158
|
+
newOwner: string,
|
|
159
|
+
overrides?: Overrides & { from?: string }
|
|
160
|
+
): Promise<BigNumber>;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
populateTransaction: {
|
|
164
|
+
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
165
|
+
|
|
166
|
+
renounceOwnership(
|
|
167
|
+
overrides?: Overrides & { from?: string }
|
|
168
|
+
): Promise<PopulatedTransaction>;
|
|
169
|
+
|
|
170
|
+
transferOwnership(
|
|
171
|
+
newOwner: string,
|
|
172
|
+
overrides?: Overrides & { from?: string }
|
|
173
|
+
): Promise<PopulatedTransaction>;
|
|
174
|
+
};
|
|
175
|
+
}
|