@gooddollar/goodprotocol 2.0.7-beta.1 → 2.0.7-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/abis/BuyGDClone.min.json +1 -0
- package/artifacts/abis/BuyGDCloneFactory.min.json +1 -0
- package/artifacts/abis/GDFaucet.min.json +1 -0
- package/artifacts/abis/ISwapRouter.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/governance/StakersDistribution.sol/StakersDistribution.json +2 -2
- 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/InvitesFuseV2.sol/InvitesFuseV2.json +2 -2
- 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/InvitesV2.sol/InvitesV2.json +2 -2
- 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/DistributionHelperTest.json +2 -2
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.json +2 -2
- 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/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +2 -2
- 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/GoodFundManagerTest.sol/GoodFundManagerTest.json +2 -2
- 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/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.json +2 -2
- 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/DistributionHelper.sol/DistributionHelper.json +2 -2
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.json +2 -2
- 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/reserve/GoodReserveCDai.sol/GoodReserveCDai.json +2 -2
- 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/DonationsStaking.sol/DonationsStaking.json +2 -2
- 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/GoodFundManager.sol/GoodFundManager.json +2 -2
- 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/AaveStakingFactory.sol/AaveStakingFactory.json +2 -2
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +2 -2
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.json +2 -2
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.json +2 -2
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.json +2 -2
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.json +2 -2
- 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/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/BulkProof.sol/BulkProof.json +2 -2
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.json +2 -2
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +4 -0
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.json +206 -0
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +4 -0
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.json +80 -0
- package/artifacts/contracts/utils/BuyGDClone.sol/ISwapRouter.dbg.json +4 -0
- package/artifacts/contracts/utils/BuyGDClone.sol/ISwapRouter.json +205 -0
- 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 +4 -0
- package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.json +125 -0
- 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/InvitesFuseV2.sol +5 -3
- package/contracts/invite/InvitesV2.sol +5 -3
- package/contracts/reserve/DistributionHelper.sol +12 -9
- package/contracts/utils/BuyGDClone.sol +171 -0
- package/contracts/utils/GDFaucet.sol +28 -0
- package/hardhat.config.ts +10 -1
- package/package.json +1 -1
- package/releases/deployment.json +9 -4
- package/scripts/multichain-deploy/6_testnetFaucet.ts +85 -0
- package/scripts/multichain-deploy/helpers.ts +1 -1
- package/scripts/upgrades/multichain-temp-fix.ts +126 -0
- package/truffle-config.js +8 -0
- package/types/BuyGDClone.ts +277 -0
- package/types/BuyGDCloneFactory.ts +143 -0
- package/types/GDFaucet.ts +221 -0
- package/types/ISwapRouter.ts +298 -0
- package/types/factories/AaveStakingFactory__factory.ts +1 -1
- package/types/factories/BuyAndBridgeHelper__factory.ts +1 -1
- package/types/factories/BuyGDCloneFactory__factory.ts +142 -0
- package/types/factories/BuyGDClone__factory.ts +265 -0
- package/types/factories/CompoundStakingFactory__factory.ts +1 -1
- package/types/factories/DistributionHelperTestHelper__factory.ts +1 -1
- package/types/factories/DistributionHelperTest__factory.ts +1 -1
- package/types/factories/DistributionHelper__factory.ts +1 -1
- package/types/factories/DonationsStaking__factory.ts +1 -1
- package/types/factories/ExchangeHelper__factory.ts +1 -1
- package/types/factories/GDFaucet__factory.ts +188 -0
- package/types/factories/GoodAaveStakingV2__factory.ts +1 -1
- package/types/factories/GoodAaveStaking__factory.ts +1 -1
- package/types/factories/GoodCompoundStakingTest__factory.ts +1 -1
- package/types/factories/GoodCompoundStakingV2__factory.ts +1 -1
- package/types/factories/GoodCompoundStaking__factory.ts +1 -1
- package/types/factories/GoodFundManagerTest__factory.ts +1 -1
- package/types/factories/GoodFundManager__factory.ts +1 -1
- package/types/factories/GoodReserveCDai__factory.ts +1 -1
- package/types/factories/ISwapRouter__factory.ts +217 -0
- package/types/factories/InvitesFuseV2__factory.ts +1 -1
- package/types/factories/InvitesV2__factory.ts +1 -1
- package/types/factories/OverMintTesterRegularStake__factory.ts +1 -1
- package/types/factories/StakersDistribution__factory.ts +1 -1
- package/types/hardhat.d.ts +36 -0
- package/types/index.ts +8 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
|
|
3
|
+
pragma solidity >=0.8;
|
|
4
|
+
import "@openzeppelin/contracts-upgradeable/proxy/ClonesUpgradeable.sol";
|
|
5
|
+
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
|
6
|
+
import "../Interfaces.sol";
|
|
7
|
+
|
|
8
|
+
interface ISwapRouter {
|
|
9
|
+
struct ExactInputSingleParams {
|
|
10
|
+
address tokenIn;
|
|
11
|
+
address tokenOut;
|
|
12
|
+
uint24 fee;
|
|
13
|
+
address recipient;
|
|
14
|
+
uint256 amountIn;
|
|
15
|
+
uint256 amountOutMinimum;
|
|
16
|
+
uint160 sqrtPriceLimitX96;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/// @notice Swaps `amountIn` of one token for as much as possible of another token
|
|
20
|
+
/// @dev Setting `amountIn` to 0 will cause the contract to look up its own balance,
|
|
21
|
+
/// and swap the entire amount, enabling contracts to send tokens before calling this function.
|
|
22
|
+
/// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
|
|
23
|
+
/// @return amountOut The amount of the received token
|
|
24
|
+
function exactInputSingle(
|
|
25
|
+
ExactInputSingleParams calldata params
|
|
26
|
+
) external payable returns (uint256 amountOut);
|
|
27
|
+
|
|
28
|
+
struct ExactInputParams {
|
|
29
|
+
bytes path;
|
|
30
|
+
address recipient;
|
|
31
|
+
uint256 amountIn;
|
|
32
|
+
uint256 amountOutMinimum;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
|
|
36
|
+
/// @dev Setting `amountIn` to 0 will cause the contract to look up its own balance,
|
|
37
|
+
/// and swap the entire amount, enabling contracts to send tokens before calling this function.
|
|
38
|
+
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
|
|
39
|
+
/// @return amountOut The amount of the received token
|
|
40
|
+
function exactInput(
|
|
41
|
+
ExactInputParams calldata params
|
|
42
|
+
) external payable returns (uint256 amountOut);
|
|
43
|
+
|
|
44
|
+
struct ExactOutputSingleParams {
|
|
45
|
+
address tokenIn;
|
|
46
|
+
address tokenOut;
|
|
47
|
+
uint24 fee;
|
|
48
|
+
address recipient;
|
|
49
|
+
uint256 amountOut;
|
|
50
|
+
uint256 amountInMaximum;
|
|
51
|
+
uint160 sqrtPriceLimitX96;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/// @notice Swaps as little as possible of one token for `amountOut` of another token
|
|
55
|
+
/// that may remain in the router after the swap.
|
|
56
|
+
/// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
|
|
57
|
+
/// @return amountIn The amount of the input token
|
|
58
|
+
function exactOutputSingle(
|
|
59
|
+
ExactOutputSingleParams calldata params
|
|
60
|
+
) external payable returns (uint256 amountIn);
|
|
61
|
+
|
|
62
|
+
struct ExactOutputParams {
|
|
63
|
+
bytes path;
|
|
64
|
+
address recipient;
|
|
65
|
+
uint256 amountOut;
|
|
66
|
+
uint256 amountInMaximum;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
|
|
70
|
+
/// that may remain in the router after the swap.
|
|
71
|
+
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
|
|
72
|
+
/// @return amountIn The amount of the input token
|
|
73
|
+
function exactOutput(
|
|
74
|
+
ExactOutputParams calldata params
|
|
75
|
+
) external payable returns (uint256 amountIn);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
contract BuyGDClone is Initializable {
|
|
79
|
+
error NOT_ALLOWED(address);
|
|
80
|
+
error REFUND_FAILED(uint256);
|
|
81
|
+
|
|
82
|
+
ISwapRouter public immutable router;
|
|
83
|
+
address public constant celo = 0x471EcE3750Da237f93B8E339c536989b8978a438;
|
|
84
|
+
address public immutable cusd;
|
|
85
|
+
address public immutable gd;
|
|
86
|
+
|
|
87
|
+
address public owner;
|
|
88
|
+
address public executer;
|
|
89
|
+
|
|
90
|
+
receive() external payable {}
|
|
91
|
+
|
|
92
|
+
constructor(ISwapRouter _router, address _cusd, address _gd) {
|
|
93
|
+
router = _router;
|
|
94
|
+
cusd = _cusd;
|
|
95
|
+
gd = _gd;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function initialize(address _owner, address _executer) external initializer {
|
|
99
|
+
owner = _owner;
|
|
100
|
+
executer = _executer;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function swap(uint256 _minAmount) external {
|
|
104
|
+
uint256 gasCosts = msg.sender == owner ? 0 : (block.basefee + 1e9) * 400000;
|
|
105
|
+
if (msg.sender != owner && msg.sender != executer)
|
|
106
|
+
revert NOT_ALLOWED(msg.sender);
|
|
107
|
+
uint256 balance = address(this).balance;
|
|
108
|
+
ERC20(celo).approve(address(router), balance);
|
|
109
|
+
ISwapRouter.ExactInputParams memory params = ISwapRouter.ExactInputParams({
|
|
110
|
+
path: abi.encodePacked(celo, uint24(3000), cusd, uint24(10000), gd),
|
|
111
|
+
recipient: owner,
|
|
112
|
+
amountIn: balance - gasCosts,
|
|
113
|
+
amountOutMinimum: _minAmount
|
|
114
|
+
});
|
|
115
|
+
router.exactInput(params);
|
|
116
|
+
if (msg.sender != owner) {
|
|
117
|
+
(bool sent, ) = msg.sender.call{ value: gasCosts }("");
|
|
118
|
+
if (!sent) revert REFUND_FAILED(gasCosts);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function swapCusd(uint256 _minAmount) external {
|
|
123
|
+
uint256 gasCosts = msg.sender == executer ? 1e17 : 0;
|
|
124
|
+
if (msg.sender != owner && msg.sender != executer)
|
|
125
|
+
revert NOT_ALLOWED(msg.sender);
|
|
126
|
+
uint balance = ERC20(cusd).balanceOf(address(this));
|
|
127
|
+
ERC20(cusd).approve(address(router), balance);
|
|
128
|
+
ISwapRouter.ExactInputParams memory params = ISwapRouter.ExactInputParams({
|
|
129
|
+
path: abi.encodePacked(cusd, uint24(10000), gd),
|
|
130
|
+
recipient: owner,
|
|
131
|
+
amountIn: balance - gasCosts,
|
|
132
|
+
amountOutMinimum: _minAmount
|
|
133
|
+
});
|
|
134
|
+
router.exactInput(params);
|
|
135
|
+
if (msg.sender == executer) {
|
|
136
|
+
ERC20(cusd).transfer(msg.sender, gasCosts);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function recover(address token) external {
|
|
141
|
+
if (token == address(0)) {
|
|
142
|
+
(bool sent, ) = payable(owner).call{ value: address(this).balance }("");
|
|
143
|
+
if (!sent) revert REFUND_FAILED(address(this).balance);
|
|
144
|
+
} else ERC20(token).transfer(owner, ERC20(token).balanceOf(address(this)));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
contract BuyGDCloneFactory {
|
|
149
|
+
address immutable impl;
|
|
150
|
+
|
|
151
|
+
constructor(ISwapRouter _router, address _cusd, address _gd) {
|
|
152
|
+
impl = address(new BuyGDClone(_router, _cusd, _gd));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function create(address owner, address executer) external returns (address) {
|
|
156
|
+
bytes32 salt = keccak256(abi.encode(owner, executer));
|
|
157
|
+
address clone = ClonesUpgradeable.cloneDeterministic(impl, salt);
|
|
158
|
+
BuyGDClone(payable(clone)).initialize(owner, executer);
|
|
159
|
+
return clone;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function predict(
|
|
163
|
+
address owner,
|
|
164
|
+
address executer
|
|
165
|
+
) external view returns (address) {
|
|
166
|
+
bytes32 salt = keccak256(abi.encode(owner, executer));
|
|
167
|
+
|
|
168
|
+
return
|
|
169
|
+
ClonesUpgradeable.predictDeterministicAddress(impl, salt, address(this));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
|
|
3
|
+
pragma solidity >=0.8.0;
|
|
4
|
+
|
|
5
|
+
import "./DAOContract.sol";
|
|
6
|
+
|
|
7
|
+
contract GDFaucet is DAOContract {
|
|
8
|
+
uint256 public dripAmount;
|
|
9
|
+
mapping(address => uint256) public lastDripTime;
|
|
10
|
+
|
|
11
|
+
constructor(INameService _dao, uint256 _dripAmount) {
|
|
12
|
+
setDAO(_dao);
|
|
13
|
+
dripAmount = _dripAmount;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function drip() external {
|
|
17
|
+
require(
|
|
18
|
+
block.timestamp - lastDripTime[msg.sender] >= 24 hours,
|
|
19
|
+
"drip limit"
|
|
20
|
+
);
|
|
21
|
+
lastDripTime[msg.sender] = block.timestamp;
|
|
22
|
+
uint decimals = nativeToken().decimals();
|
|
23
|
+
require(
|
|
24
|
+
dao.mintTokens(dripAmount * (10 ** decimals), msg.sender, dao.avatar()),
|
|
25
|
+
"mint failed"
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
}
|
package/hardhat.config.ts
CHANGED
|
@@ -59,7 +59,8 @@ const hhconfig: HardhatUserConfig = {
|
|
|
59
59
|
etherscan: {
|
|
60
60
|
apiKey: {
|
|
61
61
|
mainnet: etherscan_key,
|
|
62
|
-
celo: celoscan_key
|
|
62
|
+
celo: celoscan_key,
|
|
63
|
+
alfajores: celoscan_key
|
|
63
64
|
},
|
|
64
65
|
customChains: [
|
|
65
66
|
{
|
|
@@ -69,6 +70,14 @@ const hhconfig: HardhatUserConfig = {
|
|
|
69
70
|
apiURL: "https://api.celoscan.io/api",
|
|
70
71
|
browserURL: "https://celoscan.io/"
|
|
71
72
|
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
network: "alfajores",
|
|
76
|
+
chainId: 44787,
|
|
77
|
+
urls: {
|
|
78
|
+
apiURL: "https://api.alfajores.celoscan.io/api",
|
|
79
|
+
browserURL: "https://alfajores.celoscan.io/"
|
|
80
|
+
}
|
|
72
81
|
}
|
|
73
82
|
]
|
|
74
83
|
},
|
package/package.json
CHANGED
package/releases/deployment.json
CHANGED
|
@@ -479,7 +479,8 @@
|
|
|
479
479
|
"Invites": "0x36829D1Cda92FFF5782d5d48991620664FC857d3",
|
|
480
480
|
"UBIScheme": "0x43d72Ff17701B2DA814620735C39C620Ce0ea4A1",
|
|
481
481
|
"OneTimePayments": "0xB27D247f5C2a61D2Cb6b6E67FEE51d839447e97d",
|
|
482
|
-
"SwapHelper": "0xE45CaB86609a16dFaDec112FDd61E4EA80EdaA8D"
|
|
482
|
+
"SwapHelper": "0xE45CaB86609a16dFaDec112FDd61E4EA80EdaA8D",
|
|
483
|
+
"UniswapV3Router": "0x5615CDAb10dc425a742d643d949a7F474C01abc4"
|
|
483
484
|
},
|
|
484
485
|
"gnosis": {
|
|
485
486
|
"GuardiansSafe": "0x84c10b45fe51bfb4f86c19a47fdbc187d4572fb8"
|
|
@@ -506,7 +507,8 @@
|
|
|
506
507
|
"CompoundVotingMachine": "0xC2C303131939370ed75c95686F691f290b56Be66",
|
|
507
508
|
"GuardiansSafe": "0x84C10B45fE51bfB4f86c19A47Fdbc187d4572Fb8",
|
|
508
509
|
"OneTimePayments": "0xB23e54fd8c2f35F9d38884Fc1611F5e9004f10ea",
|
|
509
|
-
"OneTimePaymentsV2": "0x2cb1c7d50371e277d7a36B171c0ACe9B157518EE"
|
|
510
|
+
"OneTimePaymentsV2": "0x2cb1c7d50371e277d7a36B171c0ACe9B157518EE",
|
|
511
|
+
"UniswapV3Router": "0x5615CDAb10dc425a742d643d949a7F474C01abc4"
|
|
510
512
|
},
|
|
511
513
|
"staging-celo": {
|
|
512
514
|
"network": "staging-celo",
|
|
@@ -530,7 +532,8 @@
|
|
|
530
532
|
"CompoundVotingMachine": "0xCd25fB84AB22582F1034bcd80c399a3126f2E775",
|
|
531
533
|
"GuardiansSafe": "0x84C10B45fE51bfB4f86c19A47Fdbc187d4572Fb8",
|
|
532
534
|
"OneTimePayments": "0x514820Af2DaE5F537dE16E576471528176318113",
|
|
533
|
-
"OneTimePaymentsV2": "0x963E7B4c970626Bb103c61fA16b002AFf6E6c2C7"
|
|
535
|
+
"OneTimePaymentsV2": "0x963E7B4c970626Bb103c61fA16b002AFf6E6c2C7",
|
|
536
|
+
"UniswapV3Router": "0x5615CDAb10dc425a742d643d949a7F474C01abc4"
|
|
534
537
|
},
|
|
535
538
|
"development-goerli": {
|
|
536
539
|
"ProxyFactory": "0x65D8eACBCd9618b8780C4b444081915a5D54D611",
|
|
@@ -555,6 +558,8 @@
|
|
|
555
558
|
"GReputation": "0x3647469733C01713A7d9bdf6834bd4aBd59D66fa",
|
|
556
559
|
"DAOCreator": "0x35ea7176cfde2D35Dff3E688F7bA45D1d5dF0A76",
|
|
557
560
|
"SuperFluidResolver": "0x6e9CaBE4172344Db81a1E1D735a6AD763700064A",
|
|
558
|
-
"SuperFluidHost": "0x14764E92A63e73a2Dac1fF08F35A64647fB50C91"
|
|
561
|
+
"SuperFluidHost": "0x14764E92A63e73a2Dac1fF08F35A64647fB50C91",
|
|
562
|
+
"UniswapV3Router": "0x5615CDAb10dc425a742d643d949a7F474C01abc4",
|
|
563
|
+
"GDFaucet": "0x8986F9C6b3D0b9A8b92ef7f1eF7EB9e767D414e1"
|
|
559
564
|
}
|
|
560
565
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* Deploy helper contracts
|
|
3
|
+
* AdminWallet, Faucet, Invites
|
|
4
|
+
*/
|
|
5
|
+
import { network, ethers, upgrades, run } from "hardhat";
|
|
6
|
+
import { Contract } from "ethers";
|
|
7
|
+
import { defaultsDeep } from "lodash";
|
|
8
|
+
import { getImplementationAddress } from "@openzeppelin/upgrades-core";
|
|
9
|
+
import { deployDeterministic, verifyProductionSigner, verifyContract } from "./helpers";
|
|
10
|
+
import releaser from "../releaser";
|
|
11
|
+
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
12
|
+
import dao from "../../releases/deployment.json";
|
|
13
|
+
import { TransactionResponse } from "@ethersproject/providers";
|
|
14
|
+
|
|
15
|
+
const { name } = network;
|
|
16
|
+
|
|
17
|
+
const printDeploy = async (c: Contract | TransactionResponse): Promise<Contract | TransactionResponse> => {
|
|
18
|
+
if (c instanceof Contract) {
|
|
19
|
+
await c.deployed();
|
|
20
|
+
console.log("deployed to: ", c.address);
|
|
21
|
+
}
|
|
22
|
+
if (c.wait) {
|
|
23
|
+
await c.wait();
|
|
24
|
+
console.log("tx done:", c.hash);
|
|
25
|
+
}
|
|
26
|
+
return c;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const deployHelpers = async () => {
|
|
30
|
+
let protocolSettings = defaultsDeep({}, ProtocolSettings[network.name], ProtocolSettings["default"]);
|
|
31
|
+
|
|
32
|
+
let release: { [key: string]: any } = dao[network.name];
|
|
33
|
+
|
|
34
|
+
let [root] = await ethers.getSigners();
|
|
35
|
+
const isProduction = network.name.includes("production");
|
|
36
|
+
|
|
37
|
+
if (isProduction) verifyProductionSigner(root);
|
|
38
|
+
|
|
39
|
+
//generic call permissions
|
|
40
|
+
let schemeMock = root;
|
|
41
|
+
|
|
42
|
+
console.log("got signers:", {
|
|
43
|
+
network,
|
|
44
|
+
root: root.address,
|
|
45
|
+
schemeMock: schemeMock.address,
|
|
46
|
+
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const GDFaucet = release.GDFaucet
|
|
50
|
+
? await ethers.getContractAt("GDFaucet", release.GDFaucet)
|
|
51
|
+
: ((await deployDeterministic(
|
|
52
|
+
{
|
|
53
|
+
name: "GDFaucet",
|
|
54
|
+
salt: "GDFaucet",
|
|
55
|
+
isUpgradeable: false
|
|
56
|
+
},
|
|
57
|
+
[release.NameService, 10000]
|
|
58
|
+
).then(printDeploy)) as Contract);
|
|
59
|
+
|
|
60
|
+
const torelease = {
|
|
61
|
+
GDFaucet: GDFaucet.address
|
|
62
|
+
};
|
|
63
|
+
await releaser(torelease, network.name, "deployment", false);
|
|
64
|
+
|
|
65
|
+
const controller = await ethers.getContractAt("Controller", release.Controller);
|
|
66
|
+
|
|
67
|
+
const tx = await controller
|
|
68
|
+
.registerScheme(GDFaucet.address, ethers.constants.HashZero, "0x00000001", release.Avatar)
|
|
69
|
+
.then(printDeploy);
|
|
70
|
+
|
|
71
|
+
console.log("TokenFaucet deployed and registered as a scheme via the controller");
|
|
72
|
+
|
|
73
|
+
await verifyContract(
|
|
74
|
+
GDFaucet.address,
|
|
75
|
+
"GDFaucet",
|
|
76
|
+
network.name,
|
|
77
|
+
undefined,
|
|
78
|
+
ethers.utils.defaultAbiCoder.encode(["address", "uint"], [release.NameService, 10000])
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const main = async () => {
|
|
83
|
+
await deployHelpers();
|
|
84
|
+
};
|
|
85
|
+
if (process.argv[1].includes("6_testnetFaucet")) main();
|
|
@@ -332,7 +332,7 @@ export const verifyContract = async (
|
|
|
332
332
|
proxyName?: string,
|
|
333
333
|
forcedConstructorArguments?: string
|
|
334
334
|
) => {
|
|
335
|
-
let networkProvider = network.name.includes("-") ? network.name.split("-")[1] :
|
|
335
|
+
let networkProvider = network.name.includes("-") ? network.name.split("-")[1] : network.name;
|
|
336
336
|
networkProvider = networkProvider === "mainnet" ? "ethereum" : networkProvider;
|
|
337
337
|
console.log("truffle compile...");
|
|
338
338
|
await exec("npx truffle compile");
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* Disable UBI bridge via multichain
|
|
3
|
+
* Upgrade Plan:
|
|
4
|
+
* - deploy new DistHelper
|
|
5
|
+
* - disable multichain distribution
|
|
6
|
+
* - create new distribution instead to guardians
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { network, ethers } from "hardhat";
|
|
10
|
+
import { Contract } from "ethers";
|
|
11
|
+
import { defaultsDeep } from "lodash";
|
|
12
|
+
|
|
13
|
+
import { printDeploy, executeViaGuardian, executeViaSafe, verifyProductionSigner } from "../multichain-deploy/helpers";
|
|
14
|
+
|
|
15
|
+
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
16
|
+
|
|
17
|
+
import dao from "../../releases/deployment.json";
|
|
18
|
+
import { verifyContract } from "../multichain-deploy/helpers";
|
|
19
|
+
let { name: networkName } = network;
|
|
20
|
+
|
|
21
|
+
export const upgrade = async () => {
|
|
22
|
+
const isProduction = networkName.includes("production");
|
|
23
|
+
let [root, ...signers] = await ethers.getSigners();
|
|
24
|
+
|
|
25
|
+
if (isProduction) verifyProductionSigner(root);
|
|
26
|
+
|
|
27
|
+
let guardian = root;
|
|
28
|
+
// simulate on fork
|
|
29
|
+
if (network.name === "hardhat") {
|
|
30
|
+
networkName = "production-mainnet";
|
|
31
|
+
root = await ethers.getImpersonatedSigner("0x5128E3C1f8846724cc1007Af9b4189713922E4BB");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let release: { [key: string]: any } = dao[networkName];
|
|
35
|
+
let protocolSettings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
|
|
36
|
+
//make sure safe has enough eth to simulate txs
|
|
37
|
+
if (network.name === "hardhat") {
|
|
38
|
+
guardian = await ethers.getImpersonatedSigner(protocolSettings.guardiansSafe);
|
|
39
|
+
await root.sendTransaction({ value: ethers.constants.WeiPerEther, to: protocolSettings.guardiansSafe });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
console.log("got signers:", {
|
|
43
|
+
networkName,
|
|
44
|
+
root: root.address,
|
|
45
|
+
guardian: guardian.address,
|
|
46
|
+
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString()),
|
|
47
|
+
guardianBalance: await ethers.provider.getBalance(guardian.address).then(_ => _.toString())
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
let networkEnv = networkName.split("-")[0];
|
|
51
|
+
const fuseNetwork = networkEnv;
|
|
52
|
+
if (networkEnv === "fuse") networkEnv = "development";
|
|
53
|
+
const celoNetwork = networkEnv + "-celo";
|
|
54
|
+
|
|
55
|
+
let f = await ethers.getContractFactory("GoodFundManager");
|
|
56
|
+
console.log("bytecode", f.bytecode.length);
|
|
57
|
+
let newDistHelper = (await ethers.deployContract("DistributionHelper").then(printDeploy)) as Contract;
|
|
58
|
+
|
|
59
|
+
if (isProduction) await verifyContract(newDistHelper, "GoodReserveCDai", networkName);
|
|
60
|
+
|
|
61
|
+
const proposalContracts = [
|
|
62
|
+
release.DistributionHelper, //controller -> upgrade disthelper
|
|
63
|
+
release.DistributionHelper, //set new distribution params
|
|
64
|
+
release.DistributionHelper //set new distribution params
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
68
|
+
|
|
69
|
+
const proposalFunctionSignatures = [
|
|
70
|
+
"upgradeTo(address)", //upgrade disthelper
|
|
71
|
+
"addOrUpdateRecipient((uint32,uint32,address,uint8))", // remove multichain
|
|
72
|
+
"addOrUpdateRecipient((uint32,uint32,address,uint8))" // guardians distribution
|
|
73
|
+
];
|
|
74
|
+
|
|
75
|
+
const proposalFunctionInputs = [
|
|
76
|
+
ethers.utils.defaultAbiCoder.encode(["address"], [newDistHelper.address]),
|
|
77
|
+
ethers.utils.defaultAbiCoder.encode(
|
|
78
|
+
["uint32", "uint32", "address", "uint8"],
|
|
79
|
+
[0, 42220, dao[celoNetwork].UBIScheme, 1]
|
|
80
|
+
),
|
|
81
|
+
ethers.utils.defaultAbiCoder.encode(
|
|
82
|
+
["uint32", "uint32", "address", "uint8"],
|
|
83
|
+
[8182, 42220, release.GuardiansSafe, 3] //ubi to guardians
|
|
84
|
+
)
|
|
85
|
+
];
|
|
86
|
+
|
|
87
|
+
if (isProduction) {
|
|
88
|
+
await executeViaSafe(
|
|
89
|
+
proposalContracts,
|
|
90
|
+
proposalEthValues,
|
|
91
|
+
proposalFunctionSignatures,
|
|
92
|
+
proposalFunctionInputs,
|
|
93
|
+
protocolSettings.guardiansSafe,
|
|
94
|
+
"mainnet"
|
|
95
|
+
);
|
|
96
|
+
} else {
|
|
97
|
+
//simulation or dev envs
|
|
98
|
+
await executeViaGuardian(
|
|
99
|
+
proposalContracts,
|
|
100
|
+
proposalEthValues,
|
|
101
|
+
proposalFunctionSignatures,
|
|
102
|
+
proposalFunctionInputs,
|
|
103
|
+
guardian,
|
|
104
|
+
networkName
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (!isProduction) {
|
|
109
|
+
//check simulation results
|
|
110
|
+
let fm = await ethers.getContractAt("GoodFundManager", release.GoodFundManager);
|
|
111
|
+
let dh = await ethers.getContractAt("DistributionHelper", release.DistributionHelper);
|
|
112
|
+
|
|
113
|
+
console.log(await dh.distributionRecipients(0));
|
|
114
|
+
console.log(await dh.distributionRecipients(1));
|
|
115
|
+
console.log(await dh.distributionRecipients(2));
|
|
116
|
+
let tx = await (await fm.collectInterest(["0x7b7246c78e2f900d17646ff0cb2ec47d6ba10754"], true)).wait();
|
|
117
|
+
let gd = await ethers.getContractAt("IGoodDollar", "0x67C5870b4A41D4Ebef24d2456547A03F1f3e094B");
|
|
118
|
+
const safeBalance = await gd.balanceOf("0xE0c5daa7CC6F88d29505f702a53bb5E67600e7Ec");
|
|
119
|
+
console.log({ safeBalance }, tx.events);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const main = async () => {
|
|
124
|
+
await upgrade().catch(console.log);
|
|
125
|
+
};
|
|
126
|
+
if (process.argv[1].includes("multichain-temp-fix")) main();
|
package/truffle-config.js
CHANGED
|
@@ -103,6 +103,14 @@ module.exports = {
|
|
|
103
103
|
confirmations: 1, // # of confs to wait between deployments. (default: 0)
|
|
104
104
|
timeoutBlocks: 20, // # of blocks before a deployment times out (minimum/default: 50)
|
|
105
105
|
skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
|
|
106
|
+
},
|
|
107
|
+
alfajores: {
|
|
108
|
+
provider: () => new Web3.providers.HttpProvider(`https://alfajores-forno.celo-testnet.org`),
|
|
109
|
+
network_id: 44787, // Ropsten's id
|
|
110
|
+
gas: 150000, // Ropsten has a lower block limit than mainnet
|
|
111
|
+
confirmations: 1, // # of confs to wait between deployments. (default: 0)
|
|
112
|
+
timeoutBlocks: 20, // # of blocks before a deployment times out (minimum/default: 50)
|
|
113
|
+
skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
|
|
106
114
|
}
|
|
107
115
|
|
|
108
116
|
// Useful for private networks
|