@gooddollar/goodprotocol 2.0.16-beta.0 → 2.0.17

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.
Files changed (184) hide show
  1. package/artifacts/abis/ISuperToken.min.json +1 -1
  2. package/artifacts/abis/SuperGoodDollar.min.json +1 -1
  3. package/artifacts/abis/SuperToken.min.json +1 -1
  4. package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
  5. package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
  6. package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
  7. package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
  8. package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
  9. package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
  10. package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
  11. package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
  12. package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
  13. package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
  14. package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
  15. package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
  16. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
  17. package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
  18. package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
  19. package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
  20. package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
  21. package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
  22. package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
  23. package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
  24. package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
  25. package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
  27. package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
  28. package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
  29. package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
  30. package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
  31. package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
  32. package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
  33. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
  34. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  35. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
  36. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  37. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  38. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  39. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
  40. package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
  41. package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
  42. package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
  43. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  44. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  45. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  46. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  47. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
  48. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
  49. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  50. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
  51. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  52. package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
  53. package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
  54. package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
  55. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  56. package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
  57. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  58. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
  59. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
  60. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
  61. package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
  62. package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
  63. package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
  64. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  65. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
  66. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  67. package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
  68. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  69. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  70. package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
  71. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
  72. package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
  73. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  74. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  75. package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
  76. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  77. package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
  78. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  79. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  80. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  81. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  82. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
  83. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
  84. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  85. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  86. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  87. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  88. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  89. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  90. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  91. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  92. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
  93. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  94. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  95. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  96. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  97. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  98. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  99. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  100. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
  101. package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
  102. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
  103. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  104. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  105. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  106. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  107. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  108. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  109. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  110. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  111. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  112. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  113. package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
  114. package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
  115. package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
  116. package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
  117. package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
  118. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
  119. package/artifacts/contracts/token/IFeesFormula.sol/IFeesFormula.dbg.json +1 -1
  120. package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.dbg.json +1 -1
  121. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
  122. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
  123. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
  124. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
  125. package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.dbg.json +1 -1
  126. package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.json +26 -26
  127. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
  128. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +41 -28
  129. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
  130. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.json +28 -28
  131. package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
  132. package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
  133. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
  134. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
  135. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
  136. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  137. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
  138. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.json +2 -2
  139. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
  140. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
  141. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  142. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
  143. package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
  144. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
  145. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
  146. package/artifacts/contracts/utils/BuyGDClone.sol/ISwapRouter.dbg.json +1 -1
  147. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  148. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  149. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  150. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  151. package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
  152. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
  153. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
  154. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
  155. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
  156. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
  157. package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
  158. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
  159. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  160. package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
  161. package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
  162. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  163. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  164. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  165. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
  166. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
  167. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  168. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  169. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  170. package/contracts/token/superfluid/ISuperToken.sol +2 -2
  171. package/contracts/token/superfluid/SuperGoodDollar.sol +405 -407
  172. package/contracts/token/superfluid/SuperToken.sol +2 -2
  173. package/contracts/ubi/UBISchemeV2.sol +1 -1
  174. package/dist/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +41 -28
  175. package/dist/test-sdk/deploySuperGoodDollar.js +7 -3
  176. package/package.json +1 -1
  177. package/scripts/fv.ts +7 -3
  178. package/types/contracts/token/superfluid/ISuperToken.ts +43 -41
  179. package/types/contracts/token/superfluid/SuperGoodDollar.ts +66 -42
  180. package/types/contracts/token/superfluid/SuperToken.ts +44 -42
  181. package/types/factories/contracts/token/superfluid/ISuperToken__factory.ts +26 -26
  182. package/types/factories/contracts/token/superfluid/SuperGoodDollar__factory.ts +40 -27
  183. package/types/factories/contracts/token/superfluid/SuperToken__factory.ts +27 -27
  184. package/types/factories/contracts/ubi/UBISchemeV2__factory.ts +1 -1
@@ -4,13 +4,13 @@ pragma solidity >=0.8;
4
4
 
5
5
  import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol";
6
6
  import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
7
- import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
7
+ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
8
8
 
9
- import {ERC777Helper} from "@superfluid-finance/ethereum-contracts/contracts/libs/ERC777Helper.sol";
10
- import {FixedSizeData} from "@superfluid-finance/ethereum-contracts/contracts/libs/FixedSizeData.sol";
9
+ import { ERC777Helper } from "@superfluid-finance/ethereum-contracts/contracts/libs/ERC777Helper.sol";
10
+ import { FixedSizeData } from "@superfluid-finance/ethereum-contracts/contracts/libs/FixedSizeData.sol";
11
11
 
12
- import {IGoodDollarCustom} from "./ISuperGoodDollar.sol";
13
- import {SuperToken} from "./SuperToken.sol";
12
+ import { IGoodDollarCustom } from "./ISuperGoodDollar.sol";
13
+ import { SuperToken } from "./SuperToken.sol";
14
14
  import "../ERC677.sol";
15
15
  import "../IFeesFormula.sol";
16
16
  import "../../Interfaces.sol";
@@ -21,407 +21,405 @@ import "./ERC20Permit.sol";
21
21
  // IMPORTANT: The order of base contracts with storage MUST REMAIN AS IS after the initial deployment.
22
22
  // Changing order can result in storage corruption when upgrading.
23
23
  contract SuperGoodDollar is
24
- SuperToken, // includes 32 storage slots padding for SuperToken
25
- AccessControlEnumerableUpgradeable, // with storage
26
- PausableUpgradeable,
27
- ERC20Permit,
28
- ERC677, // without storage
29
- IGoodDollarCustom // without storage
24
+ SuperToken, // includes 32 storage slots padding for SuperToken
25
+ AccessControlEnumerableUpgradeable, // with storage
26
+ PausableUpgradeable,
27
+ ERC20Permit,
28
+ ERC677, // without storage
29
+ IGoodDollarCustom // without storage
30
30
  {
31
- // IMPORTANT! Never change the type (storage size) or order of state variables.
32
- // If a variable isn't needed anymore, leave it as padding (renaming is ok).
33
- address public feeRecipient;
34
- IFeesFormula public formula;
35
- IIdentity public identity;
36
- uint256 public cap;
37
- bool public disableHostOperations;
38
- // Append additional state variables here!
39
-
40
- // ============== constants and immutables ==============
41
-
42
- bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
43
- bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
44
-
45
- event TransferFee(
46
- address from,
47
- address to,
48
- uint256 amount,
49
- uint256 fee,
50
- bool senderPays
51
- );
52
-
53
- // ========================================================================================
54
- // ============== Functionality to be executed on the proxy via delegateCall ==============
55
- // ========================================================================================
56
-
57
- /// initializes state specific to the GoodDollar token
58
- /// When upgrading to a new logic contract,
59
- function initialize(
60
- string calldata n,
61
- string calldata s,
62
- uint256 _cap,
63
- IFeesFormula _formula,
64
- IIdentity _identity,
65
- address _feeRecipient,
66
- address _owner,
67
- IConstantOutflowNFT _outflowNFT,
68
- IConstantInflowNFT _inflowNFT
69
- ) public initializer {
70
- initialize(IERC20(address(0)), 18, n, s);
71
- __AccessControl_init_unchained();
72
- __Pausable_init_unchained();
73
- __ERC20Permit_init(n);
74
- _setupRole(DEFAULT_ADMIN_ROLE, _owner);
75
- _setupRole(MINTER_ROLE, _owner);
76
- _setupRole(PAUSER_ROLE, _owner);
77
- feeRecipient = _feeRecipient;
78
- identity = _identity;
79
- formula = _formula;
80
- cap = _cap;
81
- _setNFTProxyContracts(
82
- _outflowNFT,
83
- _inflowNFT,
84
- IPoolAdminNFT(address(0)),
85
- IPoolMemberNFT(address(0))
86
- );
87
- }
88
-
89
- // ============ SuperFluid ============
90
-
91
- constructor(ISuperfluid _host) SuperToken(_host) {}
92
-
93
- function proxiableUUID() public pure override returns (bytes32) {
94
- return
95
- keccak256(
96
- "org.superfluid-finance.contracts.SuperGoodDollar.implementation"
97
- );
98
- }
99
-
100
- function updateCode(address newAddress) external override {
101
- _onlyOwner();
102
- UUPSProxiable._updateCodeAddress(newAddress);
103
- }
104
-
105
- /// override Superfluid agreement function in order to make it pausable
106
- /// that is, no new streams can be started when the contract is paused
107
- function createAgreement(
108
- bytes32 id,
109
- bytes32[] calldata data
110
- ) public override(ISuperfluidToken, SuperfluidToken) {
111
- require(!paused(), "Pausable: createAgreement while paused");
112
- // otherwise the wrapper of SuperToken.createAgreement does the actual job
113
- super.createAgreement(id, data);
114
- }
115
-
116
- /// failsafe in case we don't want to trust superfluid host for batch operations
117
- function allowHostOperations()
118
- internal
119
- view
120
- virtual
121
- override
122
- returns (bool hostEnabled)
123
- {
124
- return !disableHostOperations;
125
- }
126
-
127
- function enableHostOperations(bool enabled) external {
128
- _onlyOwner();
129
- disableHostOperations = !enabled;
130
- }
131
-
132
- // ============ IGoodDollarCustom ============
133
-
134
- function owner() external view override returns (address) {
135
- return getRoleMember(DEFAULT_ADMIN_ROLE, 0);
136
- }
137
-
138
- function setFormula(IFeesFormula _formula) external override {
139
- _onlyOwner();
140
- formula = _formula;
141
- }
142
-
143
- function setIdentity(IIdentityV2 _identity) external override {
144
- _onlyOwner();
145
- identity = _identity;
146
- }
147
-
148
- function transferOwnership(address _owner) public override {
149
- _onlyOwner();
150
- grantRole(DEFAULT_ADMIN_ROLE, _owner);
151
- renounceRole(DEFAULT_ADMIN_ROLE, _msgSender());
152
- }
153
-
154
- function isMinter(address _minter) external view override returns (bool) {
155
- return hasRole(MINTER_ROLE, _minter);
156
- }
157
-
158
- function addMinter(address _minter) external override {
159
- grantRole(MINTER_ROLE, _minter); // enforces permissions
160
- }
161
-
162
- function renounceMinter() external override {
163
- renounceRole(MINTER_ROLE, _msgSender()); // enforces permissions
164
- }
165
-
166
- function isPauser(address _pauser) external view override returns (bool) {
167
- return hasRole(PAUSER_ROLE, _pauser);
168
- }
169
-
170
- function addPauser(address _pauser) external override {
171
- grantRole(PAUSER_ROLE, _pauser); // enforces permissions
172
- }
173
-
174
- function pause() public override {
175
- _onlyPauser();
176
- _pause();
177
- }
178
-
179
- function unpause() public override {
180
- _onlyPauser();
181
- _unpause();
182
- }
183
-
184
- /**
185
- * @dev Processes transfer fees and calls ERC677Token transferAndCall function
186
- * @param to address to transfer to
187
- * @param amount the amount to transfer
188
- * @param data The data to pass to transferAndCall
189
- * @return a bool indicating if transfer function succeeded
190
- */
191
- function transferAndCall(
192
- address to,
193
- uint256 amount,
194
- bytes calldata data
195
- ) external override returns (bool) {
196
- //duplicated code from _transferAndCall so we can get the amount after fees correctly for transferAndCall event + callback
197
- _onlyNotPaused();
198
- uint256 netAmount = _processFees(msg.sender, to, amount);
199
- // handing over to the wrapper of SuperToken.transferFrom skipping this _transferFrom which also collects fees
200
- bool res = super._transferFrom(msg.sender, msg.sender, to, netAmount);
201
- emit ERC677.Transfer(msg.sender, to, netAmount, data);
202
- if (isContract(to)) {
203
- require(
204
- contractFallback(to, netAmount, data),
205
- "Contract fallback failed"
206
- );
207
- }
208
- return res;
209
- }
210
-
211
- function transfer(
212
- address to,
213
- uint256 amount
214
- ) public virtual override(ERC677, SuperToken) returns (bool) {
215
- return _transferFrom(msg.sender, msg.sender, to, amount);
216
- }
217
-
218
- /// make sure supertoken erc20 methods include fees and pausable
219
- function _transferFrom(
220
- address spender,
221
- address holder,
222
- address recipient,
223
- uint256 amount
224
- ) internal virtual override returns (bool) {
225
- _onlyNotPaused();
226
- uint256 bruttoValue = _processFees(holder, recipient, amount);
227
- // handing over to the wrapper of SuperToken.transferFrom
228
- super._transferFrom(spender, holder, recipient, bruttoValue);
229
- return true;
230
- }
231
-
232
- /// make sure supertoken erc777 methods include fees and pausable
233
- function _send(
234
- address operator,
235
- address from,
236
- address to,
237
- uint256 amount,
238
- bytes memory userData,
239
- bytes memory operatorData,
240
- bool requireReceptionAck
241
- ) internal virtual override {
242
- _onlyNotPaused();
243
- uint256 bruttoValue = _processFees(from, to, amount);
244
- // handing over to the wrapper of SuperToken.transferFrom
245
- super._send(
246
- operator,
247
- from,
248
- to,
249
- bruttoValue,
250
- userData,
251
- operatorData,
252
- requireReceptionAck
253
- );
254
- }
255
-
256
- /// make sure supertoken erc777 methods include pausable
257
- function _burn(
258
- address operator,
259
- address from,
260
- uint256 amount,
261
- bytes memory userData,
262
- bytes memory operatorData
263
- ) internal virtual override {
264
- _onlyNotPaused();
265
- // handing over to the wrapper of SuperToken.transferFrom
266
- super._burn(operator, from, amount, userData, operatorData);
267
- }
268
-
269
- /**
270
- * @dev Minting function
271
- * @param to the address that will receive the minted tokens
272
- * @param amount the amount of tokens to mint
273
- */
274
- function mint(
275
- address to,
276
- uint256 amount
277
- ) public override(IGoodDollarCustom) onlyMinter returns (bool) {
278
- _onlyNotPaused();
279
-
280
- if (cap > 0) {
281
- require(
282
- totalSupply() + amount <= cap,
283
- "Cannot increase supply beyond cap"
284
- );
285
- }
286
- _mint(
287
- msg.sender,
288
- to,
289
- amount,
290
- false /* requireReceptionAck */,
291
- new bytes(0),
292
- new bytes(0)
293
- );
294
-
295
- return true;
296
- }
297
-
298
- function burnFrom(address account, uint256 amount) public {
299
- uint256 currentAllowance = allowance(account, _msgSender());
300
- require(
301
- currentAllowance >= amount,
302
- "ERC20: burn amount exceeds allowance"
303
- );
304
- unchecked {
305
- _approve(account, _msgSender(), currentAllowance - amount);
306
- }
307
- _burn(msg.sender, account, amount, new bytes(0), new bytes(0));
308
- }
309
-
310
- function burn(uint256 amount) external override {
311
- _burn(msg.sender, msg.sender, amount, new bytes(0), new bytes(0));
312
- }
313
-
314
- /**
315
- * @dev Gets the current transaction fees
316
- * @return fee senderPays that represents the current transaction fees and bool true if sender pays the fee or receiver
317
- */
318
- function getFees(
319
- uint256 amount
320
- ) public view returns (uint256 fee, bool senderPays) {
321
- return formula.getTxFees(amount, address(0), address(0));
322
- }
323
-
324
- /**
325
- * @dev Gets the current transaction fees
326
- * @return fee senderPays that represents the current transaction fees and bool true if sender pays the fee or receiver
327
- */
328
- function getFees(
329
- uint256 amount,
330
- address sender,
331
- address recipient
332
- ) public view returns (uint256 fee, bool senderPays) {
333
- return formula.getTxFees(amount, sender, recipient);
334
- }
335
-
336
- /**
337
- * @dev Sets the address that receives the transactional fees.
338
- * can only be called by owner
339
- * @param _feeRecipient The new address to receive transactional fees
340
- */
341
- function setFeeRecipient(address _feeRecipient) public {
342
- _onlyOwner();
343
- feeRecipient = _feeRecipient;
344
- }
345
-
346
- // internal functions
347
-
348
- /**
349
- * @dev Sends transactional fees to feeRecipient address from given address
350
- * @param account The account that sends the fees
351
- * @param amount The amount to subtract fees from
352
- * @return an uint256 that represents the given amount minus the transactional fees
353
- */
354
- function _processFees(
355
- address account,
356
- address recipient,
357
- uint256 amount
358
- ) internal returns (uint256) {
359
- (uint256 txFees, bool senderPays) = getFees(amount, account, recipient);
360
- if (txFees > 0 && !identity.isDAOContract(msg.sender)) {
361
- require(
362
- senderPays == false || amount + txFees <= balanceOf(account),
363
- "Not enough balance to pay TX fee"
364
- );
365
- super._transferFrom(account, account, feeRecipient, txFees);
366
- emit TransferFee(account, recipient, amount, txFees, senderPays);
367
- return senderPays ? amount : amount - txFees;
368
- }
369
- return amount;
370
- }
371
-
372
- /**************************************************************************
373
- * ERC20x-specific Functions
374
- *************************************************************************/
375
-
376
- function setNFTProxyContracts(
377
- IConstantOutflowNFT _constantOutflowNFT,
378
- IConstantInflowNFT _constantInflowNFT,
379
- IPoolAdminNFT _poolAdminNFT,
380
- IPoolMemberNFT _poolMemberNFT
381
- ) public {
382
- _onlyOwner();
383
- _setNFTProxyContracts(
384
- _constantOutflowNFT,
385
- _constantInflowNFT,
386
- _poolAdminNFT,
387
- _poolMemberNFT
388
- );
389
- }
390
-
391
- function _setNFTProxyContracts(
392
- IConstantOutflowNFT _constantOutflowNFT,
393
- IConstantInflowNFT _constantInflowNFT,
394
- IPoolAdminNFT _poolAdminNFT,
395
- IPoolMemberNFT _poolMemberNFT
396
- ) internal {
397
- constantOutflowNFT = _constantOutflowNFT;
398
- constantInflowNFT = _constantInflowNFT;
399
- poolAdminNFT = _poolAdminNFT;
400
- poolMemberNFT = _poolMemberNFT;
401
-
402
- // emit NFT proxy creation events
403
- emit ConstantOutflowNFTCreated(constantOutflowNFT);
404
- emit ConstantInflowNFTCreated(constantInflowNFT);
405
- }
406
-
407
- /**************************************************************************
408
- * Modifiers
409
- *************************************************************************/
410
-
411
- function _onlyOwner() internal view {
412
- require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "not owner");
413
- }
414
-
415
- function _onlyPauser() internal view {
416
- require(hasRole(PAUSER_ROLE, msg.sender), "not pauser");
417
- }
418
-
419
- function _onlyNotPaused() internal view {
420
- require(!paused(), "Pausable: token transfer while paused");
421
- }
422
-
423
- modifier onlyMinter() {
424
- require(hasRole(MINTER_ROLE, msg.sender), "not minter");
425
- _;
426
- }
31
+ // IMPORTANT! Never change the type (storage size) or order of state variables.
32
+ // If a variable isn't needed anymore, leave it as padding (renaming is ok).
33
+ address public feeRecipient;
34
+ IFeesFormula public formula;
35
+ IIdentity public identity;
36
+ uint256 public cap;
37
+ bool public disableHostOperations;
38
+ address public getUnderlyingToken;
39
+ // Append additional state variables here!
40
+
41
+ // ============== constants and immutables ==============
42
+
43
+ bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
44
+ bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
45
+
46
+ event TransferFee(
47
+ address from,
48
+ address to,
49
+ uint256 amount,
50
+ uint256 fee,
51
+ bool senderPays
52
+ );
53
+
54
+ // ========================================================================================
55
+ // ============== Functionality to be executed on the proxy via delegateCall ==============
56
+ // ========================================================================================
57
+
58
+ /// initializes state specific to the GoodDollar token
59
+ /// When upgrading to a new logic contract,
60
+ function initialize(
61
+ string calldata n,
62
+ string calldata s,
63
+ uint256 _cap,
64
+ IFeesFormula _formula,
65
+ IIdentity _identity,
66
+ address _feeRecipient,
67
+ address _owner,
68
+ IConstantOutflowNFT _outflowNFT,
69
+ IConstantInflowNFT _inflowNFT
70
+ ) public initializer {
71
+ initialize(IERC20(address(0)), 18, n, s);
72
+ __AccessControl_init_unchained();
73
+ __Pausable_init_unchained();
74
+ __ERC20Permit_init(n);
75
+ _setupRole(DEFAULT_ADMIN_ROLE, _owner);
76
+ _setupRole(MINTER_ROLE, _owner);
77
+ _setupRole(PAUSER_ROLE, _owner);
78
+ feeRecipient = _feeRecipient;
79
+ identity = _identity;
80
+ formula = _formula;
81
+ cap = _cap;
82
+ _setNFTProxyContracts(
83
+ _outflowNFT,
84
+ _inflowNFT,
85
+ IPoolAdminNFT(address(0)),
86
+ IPoolMemberNFT(address(0))
87
+ );
88
+ }
89
+
90
+ // ============ SuperFluid ============
91
+
92
+ constructor(ISuperfluid _host) SuperToken(_host) {}
93
+
94
+ function proxiableUUID() public pure override returns (bytes32) {
95
+ return
96
+ keccak256(
97
+ "org.superfluid-finance.contracts.SuperGoodDollar.implementation"
98
+ );
99
+ }
100
+
101
+ function updateCode(address newAddress) external override {
102
+ _onlyOwner();
103
+ UUPSProxiable._updateCodeAddress(newAddress);
104
+ }
105
+
106
+ /// override Superfluid agreement function in order to make it pausable
107
+ /// that is, no new streams can be started when the contract is paused
108
+ function createAgreement(
109
+ bytes32 id,
110
+ bytes32[] calldata data
111
+ ) public override(ISuperfluidToken, SuperfluidToken) {
112
+ require(!paused(), "Pausable: createAgreement while paused");
113
+ // otherwise the wrapper of SuperToken.createAgreement does the actual job
114
+ super.createAgreement(id, data);
115
+ }
116
+
117
+ /// failsafe in case we don't want to trust superfluid host for batch operations
118
+ function allowHostOperations()
119
+ internal
120
+ view
121
+ virtual
122
+ override
123
+ returns (bool hostEnabled)
124
+ {
125
+ return !disableHostOperations;
126
+ }
127
+
128
+ function enableHostOperations(bool enabled) external {
129
+ _onlyOwner();
130
+ disableHostOperations = !enabled;
131
+ }
132
+
133
+ // ============ IGoodDollarCustom ============
134
+
135
+ function owner() external view override returns (address) {
136
+ return getRoleMember(DEFAULT_ADMIN_ROLE, 0);
137
+ }
138
+
139
+ function setFormula(IFeesFormula _formula) external override {
140
+ _onlyOwner();
141
+ formula = _formula;
142
+ }
143
+
144
+ function setIdentity(IIdentityV2 _identity) external override {
145
+ _onlyOwner();
146
+ identity = _identity;
147
+ }
148
+
149
+ function transferOwnership(address _owner) public override {
150
+ _onlyOwner();
151
+ grantRole(DEFAULT_ADMIN_ROLE, _owner);
152
+ renounceRole(DEFAULT_ADMIN_ROLE, _msgSender());
153
+ }
154
+
155
+ function isMinter(address _minter) external view override returns (bool) {
156
+ return hasRole(MINTER_ROLE, _minter);
157
+ }
158
+
159
+ function addMinter(address _minter) external override {
160
+ grantRole(MINTER_ROLE, _minter); // enforces permissions
161
+ }
162
+
163
+ function renounceMinter() external override {
164
+ renounceRole(MINTER_ROLE, _msgSender()); // enforces permissions
165
+ }
166
+
167
+ function isPauser(address _pauser) external view override returns (bool) {
168
+ return hasRole(PAUSER_ROLE, _pauser);
169
+ }
170
+
171
+ function addPauser(address _pauser) external override {
172
+ grantRole(PAUSER_ROLE, _pauser); // enforces permissions
173
+ }
174
+
175
+ function pause() public override {
176
+ _onlyPauser();
177
+ _pause();
178
+ }
179
+
180
+ function unpause() public override {
181
+ _onlyPauser();
182
+ _unpause();
183
+ }
184
+
185
+ /**
186
+ * @dev Processes transfer fees and calls ERC677Token transferAndCall function
187
+ * @param to address to transfer to
188
+ * @param amount the amount to transfer
189
+ * @param data The data to pass to transferAndCall
190
+ * @return a bool indicating if transfer function succeeded
191
+ */
192
+ function transferAndCall(
193
+ address to,
194
+ uint256 amount,
195
+ bytes calldata data
196
+ ) external override returns (bool) {
197
+ //duplicated code from _transferAndCall so we can get the amount after fees correctly for transferAndCall event + callback
198
+ _onlyNotPaused();
199
+ uint256 netAmount = _processFees(msg.sender, to, amount);
200
+ // handing over to the wrapper of SuperToken.transferFrom skipping this _transferFrom which also collects fees
201
+ bool res = super._transferFrom(msg.sender, msg.sender, to, netAmount);
202
+ emit ERC677.Transfer(msg.sender, to, netAmount, data);
203
+ if (isContract(to)) {
204
+ require(
205
+ contractFallback(to, netAmount, data),
206
+ "Contract fallback failed"
207
+ );
208
+ }
209
+ return res;
210
+ }
211
+
212
+ function transfer(
213
+ address to,
214
+ uint256 amount
215
+ ) public virtual override(ERC677, SuperToken) returns (bool) {
216
+ return _transferFrom(msg.sender, msg.sender, to, amount);
217
+ }
218
+
219
+ /// make sure supertoken erc20 methods include fees and pausable
220
+ function _transferFrom(
221
+ address spender,
222
+ address holder,
223
+ address recipient,
224
+ uint256 amount
225
+ ) internal virtual override returns (bool) {
226
+ _onlyNotPaused();
227
+ uint256 bruttoValue = _processFees(holder, recipient, amount);
228
+ // handing over to the wrapper of SuperToken.transferFrom
229
+ super._transferFrom(spender, holder, recipient, bruttoValue);
230
+ return true;
231
+ }
232
+
233
+ /// make sure supertoken erc777 methods include fees and pausable
234
+ function _send(
235
+ address operator,
236
+ address from,
237
+ address to,
238
+ uint256 amount,
239
+ bytes memory userData,
240
+ bytes memory operatorData,
241
+ bool requireReceptionAck
242
+ ) internal virtual override {
243
+ _onlyNotPaused();
244
+ uint256 bruttoValue = _processFees(from, to, amount);
245
+ // handing over to the wrapper of SuperToken.transferFrom
246
+ super._send(
247
+ operator,
248
+ from,
249
+ to,
250
+ bruttoValue,
251
+ userData,
252
+ operatorData,
253
+ requireReceptionAck
254
+ );
255
+ }
256
+
257
+ /// make sure supertoken erc777 methods include pausable
258
+ function _burn(
259
+ address operator,
260
+ address from,
261
+ uint256 amount,
262
+ bytes memory userData,
263
+ bytes memory operatorData
264
+ ) internal virtual override {
265
+ _onlyNotPaused();
266
+ // handing over to the wrapper of SuperToken.transferFrom
267
+ super._burn(operator, from, amount, userData, operatorData);
268
+ }
269
+
270
+ /**
271
+ * @dev Minting function
272
+ * @param to the address that will receive the minted tokens
273
+ * @param amount the amount of tokens to mint
274
+ */
275
+ function mint(
276
+ address to,
277
+ uint256 amount
278
+ ) public override(IGoodDollarCustom) onlyMinter returns (bool) {
279
+ _onlyNotPaused();
280
+
281
+ if (cap > 0) {
282
+ require(
283
+ totalSupply() + amount <= cap,
284
+ "Cannot increase supply beyond cap"
285
+ );
286
+ }
287
+ _mint(
288
+ msg.sender,
289
+ to,
290
+ amount,
291
+ false /* requireReceptionAck */,
292
+ new bytes(0),
293
+ new bytes(0)
294
+ );
295
+
296
+ return true;
297
+ }
298
+
299
+ function burnFrom(address account, uint256 amount) public {
300
+ uint256 currentAllowance = allowance(account, _msgSender());
301
+ require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance");
302
+ unchecked {
303
+ _approve(account, _msgSender(), currentAllowance - amount);
304
+ }
305
+ _burn(msg.sender, account, amount, new bytes(0), new bytes(0));
306
+ }
307
+
308
+ function burn(uint256 amount) external override {
309
+ _burn(msg.sender, msg.sender, amount, new bytes(0), new bytes(0));
310
+ }
311
+
312
+ /**
313
+ * @dev Gets the current transaction fees
314
+ * @return fee senderPays that represents the current transaction fees and bool true if sender pays the fee or receiver
315
+ */
316
+ function getFees(
317
+ uint256 amount
318
+ ) public view returns (uint256 fee, bool senderPays) {
319
+ return formula.getTxFees(amount, address(0), address(0));
320
+ }
321
+
322
+ /**
323
+ * @dev Gets the current transaction fees
324
+ * @return fee senderPays that represents the current transaction fees and bool true if sender pays the fee or receiver
325
+ */
326
+ function getFees(
327
+ uint256 amount,
328
+ address sender,
329
+ address recipient
330
+ ) public view returns (uint256 fee, bool senderPays) {
331
+ return formula.getTxFees(amount, sender, recipient);
332
+ }
333
+
334
+ /**
335
+ * @dev Sets the address that receives the transactional fees.
336
+ * can only be called by owner
337
+ * @param _feeRecipient The new address to receive transactional fees
338
+ */
339
+ function setFeeRecipient(address _feeRecipient) public {
340
+ _onlyOwner();
341
+ feeRecipient = _feeRecipient;
342
+ }
343
+
344
+ // internal functions
345
+
346
+ /**
347
+ * @dev Sends transactional fees to feeRecipient address from given address
348
+ * @param account The account that sends the fees
349
+ * @param amount The amount to subtract fees from
350
+ * @return an uint256 that represents the given amount minus the transactional fees
351
+ */
352
+ function _processFees(
353
+ address account,
354
+ address recipient,
355
+ uint256 amount
356
+ ) internal returns (uint256) {
357
+ (uint256 txFees, bool senderPays) = getFees(amount, account, recipient);
358
+ if (txFees > 0 && !identity.isDAOContract(msg.sender)) {
359
+ require(
360
+ senderPays == false || amount + txFees <= balanceOf(account),
361
+ "Not enough balance to pay TX fee"
362
+ );
363
+ super._transferFrom(account, account, feeRecipient, txFees);
364
+ emit TransferFee(account, recipient, amount, txFees, senderPays);
365
+ return senderPays ? amount : amount - txFees;
366
+ }
367
+ return amount;
368
+ }
369
+
370
+ /**************************************************************************
371
+ * ERC20x-specific Functions
372
+ *************************************************************************/
373
+
374
+ function setNFTProxyContracts(
375
+ IConstantOutflowNFT _constantOutflowNFT,
376
+ IConstantInflowNFT _constantInflowNFT,
377
+ IPoolAdminNFT _poolAdminNFT,
378
+ IPoolMemberNFT _poolMemberNFT
379
+ ) public {
380
+ _onlyOwner();
381
+ _setNFTProxyContracts(
382
+ _constantOutflowNFT,
383
+ _constantInflowNFT,
384
+ _poolAdminNFT,
385
+ _poolMemberNFT
386
+ );
387
+ }
388
+
389
+ function _setNFTProxyContracts(
390
+ IConstantOutflowNFT _constantOutflowNFT,
391
+ IConstantInflowNFT _constantInflowNFT,
392
+ IPoolAdminNFT _poolAdminNFT,
393
+ IPoolMemberNFT _poolMemberNFT
394
+ ) internal {
395
+ CONSTANT_OUTFLOW_NFT = _constantOutflowNFT;
396
+ CONSTANT_INFLOW_NFT = _constantInflowNFT;
397
+ poolAdminNFT = _poolAdminNFT;
398
+ poolMemberNFT = _poolMemberNFT;
399
+
400
+ // emit NFT proxy creation events
401
+ emit ConstantOutflowNFTCreated(CONSTANT_OUTFLOW_NFT);
402
+ emit ConstantInflowNFTCreated(CONSTANT_INFLOW_NFT);
403
+ }
404
+
405
+ /**************************************************************************
406
+ * Modifiers
407
+ *************************************************************************/
408
+
409
+ function _onlyOwner() internal view {
410
+ require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "not owner");
411
+ }
412
+
413
+ function _onlyPauser() internal view {
414
+ require(hasRole(PAUSER_ROLE, msg.sender), "not pauser");
415
+ }
416
+
417
+ function _onlyNotPaused() internal view {
418
+ require(!paused(), "Pausable: token transfer while paused");
419
+ }
420
+
421
+ modifier onlyMinter() {
422
+ require(hasRole(MINTER_ROLE, msg.sender), "not minter");
423
+ _;
424
+ }
427
425
  }