@gooddollar/goodprotocol 2.0.21 → 2.0.22-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/ISuperToken.min.json +1 -1
- package/artifacts/abis/SuperGoodDollar.min.json +1 -1
- package/artifacts/abis/SuperToken.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/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
- package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
- package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
- package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/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/ISuperToken.sol/ISuperToken.json +5 -0
- package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +25 -2
- package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.json +7 -2
- 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/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/token/superfluid/ISuperToken.sol +1 -0
- package/contracts/token/superfluid/SuperGoodDollar.sol +11 -2
- package/contracts/token/superfluid/SuperToken.sol +8 -0
- package/dist/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +25 -2
- package/hardhat.config.ts +1 -1
- package/package.json +4 -3
- package/scripts/blockchainTestSetup.sh +1 -1
- package/test/faucet/Faucet.test.ts +63 -19
- package/test/faucet/FuseFaucet.test.ts +43 -14
- package/test/governance/ClaimersDistribution.test.ts +3 -3
- package/test/governance/CompoundVotingMachine.castvote.test.ts +3 -6
- package/test/governance/CompoundVotingMachine.crossblockchain.ts +2 -2
- package/test/governance/CompoundVotingMachine.daoscheme.ts +1 -1
- package/test/governance/CompoundVotingMachine.guardian.test.ts +4 -4
- package/test/governance/CompoundVotingMachine.propose.test.ts +8 -8
- package/test/governance/CompoundVotingMachine.state.test.ts +4 -4
- package/test/governance/GReputation.test.ts +6 -6
- package/test/governance/GoodDollarStaking.gd.test.ts +44 -71
- package/test/governance/GoodDollarStaking.good.test.ts +52 -73
- package/test/governance/GovernanceStaking.test.ts +1 -1
- package/test/governance/Reputation.test.ts +2 -2
- package/test/helpers.ts +1 -1
- package/test/identity/IdentityV2.test.ts +12 -12
- package/test/invite/InvitesV1.test.ts +6 -6
- package/test/invite/InvitesV2.test.ts +272 -81
- package/test/reserve/DistributionHelper.test.ts +232 -139
- package/test/reserve/GoodMarketMaker.test.ts +17 -17
- package/test/reserve/GoodReserveCDai.cap.test.ts +4 -4
- package/test/reserve/GoodReserveCDai.distribution.test.ts +64 -42
- package/test/reserve/GoodReserveCDai.gdx.test.ts +1 -1
- package/test/reserve/GoodReserveCDai.pause.test.ts +8 -8
- package/test/reserve/GoodReserveCDai.test.ts +307 -101
- package/test/reserve/GoodReserveCDai.uniswap.test.ts +1 -1
- package/test/staking/DonationsStaking.test.ts +2 -2
- package/test/staking/FuseStaking.test.ts +3 -3
- package/test/staking/GoodAaveStakingFactory.test.ts +2 -2
- package/test/staking/StakingRewards.test.ts +913 -320
- package/test/staking/StakingRewardsFixedAPY.test.ts +62 -66
- package/test/token/CeloGasToken.test.ts +2 -2
- package/test/token/GoodDollar.test.ts +5 -5
- package/test/token/SuperGoodDollar.test.ts +17 -13
- package/test/ubi/UBIScheme.test.ts +1 -1
- package/test/utils/AdminWallet.test.ts +10 -10
- package/test/utils/BuyAndBridgeHelper.test.ts +33 -9
- package/test/utils/GoodDollarMintBurnWrapper.test.ts +265 -113
- package/test/utils/NameService.test.ts +1 -1
- package/test/utils/ProxyFactory.test.ts +2 -2
- package/types/contracts/token/superfluid/SuperGoodDollar.ts +26 -0
- package/types/factories/contracts/token/superfluid/ISuperToken__factory.ts +5 -0
- package/types/factories/contracts/token/superfluid/SuperGoodDollar__factory.ts +24 -1
- package/types/factories/contracts/token/superfluid/SuperToken__factory.ts +6 -1
- package/yarn.lock +635 -253
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
import { ethers, upgrades } from "hardhat";
|
|
2
2
|
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
3
3
|
import { expect } from "chai";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
GoodReserveCDai,
|
|
6
|
+
DistributionBridgeMock,
|
|
7
|
+
IGoodDollar
|
|
8
|
+
} from "../../types";
|
|
5
9
|
import { createDAO } from "../helpers";
|
|
6
10
|
|
|
7
11
|
export const NULL_ADDRESS = ethers.constants.AddressZero;
|
|
8
12
|
|
|
9
13
|
xdescribe("BuyAndBridgeHelper ", () => {
|
|
10
14
|
let goodReserve: GoodReserveCDai;
|
|
11
|
-
let goodDollar: IGoodDollar,
|
|
15
|
+
let goodDollar: IGoodDollar,
|
|
16
|
+
deployedDAO,
|
|
17
|
+
genericCall,
|
|
18
|
+
avatar,
|
|
19
|
+
founder,
|
|
20
|
+
signers,
|
|
21
|
+
setDAOAddress,
|
|
22
|
+
nameService,
|
|
23
|
+
cDai;
|
|
12
24
|
|
|
13
25
|
before(async () => {
|
|
14
26
|
[founder, ...signers] = await ethers.getSigners();
|
|
@@ -46,10 +58,16 @@ xdescribe("BuyAndBridgeHelper ", () => {
|
|
|
46
58
|
|
|
47
59
|
await setDAOAddress("UNISWAP_ROUTER", signers[0].address);
|
|
48
60
|
|
|
49
|
-
const exchangeHelperFactory = await ethers.getContractFactory(
|
|
61
|
+
const exchangeHelperFactory = await ethers.getContractFactory(
|
|
62
|
+
"ExchangeHelper"
|
|
63
|
+
);
|
|
50
64
|
const bnbFactory = await ethers.getContractFactory("BuyAndBridgeHelper");
|
|
51
65
|
|
|
52
|
-
const exchangeHelper = await upgrades.deployProxy(
|
|
66
|
+
const exchangeHelper = await upgrades.deployProxy(
|
|
67
|
+
exchangeHelperFactory,
|
|
68
|
+
[nameService.address],
|
|
69
|
+
{ kind: "uups" }
|
|
70
|
+
);
|
|
53
71
|
|
|
54
72
|
await setDAOAddress("EXCHANGE_HELPER", exchangeHelper.address);
|
|
55
73
|
|
|
@@ -69,7 +87,9 @@ xdescribe("BuyAndBridgeHelper ", () => {
|
|
|
69
87
|
expect(await exchangeHelper.gd()).equal(goodDollar.address);
|
|
70
88
|
expect(await exchangeHelper.fuseBridge()).equal(bridge.address);
|
|
71
89
|
expect(await exchangeHelper.multiChainBridge()).equal(bridge.address);
|
|
72
|
-
expect(await exchangeHelper.anyGoodDollar()).equal(
|
|
90
|
+
expect(await exchangeHelper.anyGoodDollar()).equal(
|
|
91
|
+
ethers.constants.AddressZero
|
|
92
|
+
);
|
|
73
93
|
});
|
|
74
94
|
|
|
75
95
|
it("should buy and bridge to Fuse", async () => {
|
|
@@ -104,7 +124,9 @@ xdescribe("BuyAndBridgeHelper ", () => {
|
|
|
104
124
|
const priceAfter = await goodReserve["currentPrice()"]();
|
|
105
125
|
const gdxBalanceAfter = await goodReserve.balanceOf(founder.address);
|
|
106
126
|
const bridgeBalanceAfter = await goodDollar.balanceOf(bridge.address);
|
|
107
|
-
const helperGdBalanceAfter = await goodDollar.balanceOf(
|
|
127
|
+
const helperGdBalanceAfter = await goodDollar.balanceOf(
|
|
128
|
+
exchangeHelper.address
|
|
129
|
+
);
|
|
108
130
|
|
|
109
131
|
expect(helperGdBalanceAfter).eq(0); //G$s should be at the fuse bridge
|
|
110
132
|
expect(helperBalanceAfter).equal(0);
|
|
@@ -154,7 +176,9 @@ xdescribe("BuyAndBridgeHelper ", () => {
|
|
|
154
176
|
const priceAfter = await goodReserve["currentPrice()"]();
|
|
155
177
|
const gdxBalanceAfter = await goodReserve.balanceOf(founder.address);
|
|
156
178
|
const bridgeBalanceAfter = await goodDollar.balanceOf(bridge.address);
|
|
157
|
-
const helperGdBalanceAfter = await goodDollar.balanceOf(
|
|
179
|
+
const helperGdBalanceAfter = await goodDollar.balanceOf(
|
|
180
|
+
exchangeHelper.address
|
|
181
|
+
);
|
|
158
182
|
|
|
159
183
|
expect(helperGdBalanceAfter).gt(0); //in case of the mock it doesnt call transferFrom, so bought G$s stay in helper when testing multichain
|
|
160
184
|
expect(helperBalanceAfter).equal(0);
|
|
@@ -194,7 +218,7 @@ xdescribe("BuyAndBridgeHelper ", () => {
|
|
|
194
218
|
},
|
|
195
219
|
12
|
|
196
220
|
)
|
|
197
|
-
).revertedWith(
|
|
221
|
+
).revertedWith(/chain/);
|
|
198
222
|
});
|
|
199
223
|
|
|
200
224
|
it("should fail only in tests on uniswap call when buying with ether", async () => {
|
|
@@ -220,6 +244,6 @@ xdescribe("BuyAndBridgeHelper ", () => {
|
|
|
220
244
|
122,
|
|
221
245
|
{ value: daiAmount }
|
|
222
246
|
)
|
|
223
|
-
).revertedWith(
|
|
247
|
+
).revertedWith(/Transaction reverted: function/);
|
|
224
248
|
});
|
|
225
249
|
});
|