@gooddollar/goodprotocol 2.0.13 → 2.0.14-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.
Files changed (489) hide show
  1. package/artifacts/abis/DistributionBridgeMock.min.json +1 -1
  2. package/artifacts/abis/DistributionHelper.min.json +1 -1
  3. package/artifacts/abis/DistributionHelperTest.min.json +1 -1
  4. package/artifacts/abis/DistributionHelperTestHelper.min.json +1 -1
  5. package/artifacts/abis/GasPriceMockOracle.min.json +1 -1
  6. package/artifacts/abis/GoodCompoundStakingTest.min.json +1 -1
  7. package/artifacts/abis/GoodReserveCDai.min.json +1 -1
  8. package/artifacts/abis/IFeesFormula.min.json +1 -1
  9. package/artifacts/abis/ISuperGoodDollar.min.json +1 -1
  10. package/artifacts/abis/ISuperToken.min.json +1 -0
  11. package/artifacts/abis/MultichainFeeFormula.min.json +1 -0
  12. package/artifacts/abis/SuperGoodDollar.min.json +1 -1
  13. package/artifacts/abis/SuperToken.min.json +1 -1
  14. package/artifacts/abis/UBIScheme.min.json +1 -1
  15. package/artifacts/abis/UBISchemeV2.min.json +1 -1
  16. package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
  17. package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
  18. package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
  19. package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
  20. package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
  21. package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
  22. package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
  23. package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
  24. package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
  25. package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
  27. package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
  28. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
  29. package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
  30. package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
  31. package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
  32. package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
  33. package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
  34. package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
  35. package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
  36. package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
  37. package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
  38. package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
  39. package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
  40. package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
  41. package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
  42. package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
  43. package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
  44. package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
  45. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
  46. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.json +2 -2
  47. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  48. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.json +2 -2
  49. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
  50. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.json +2 -2
  51. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  52. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.json +2 -2
  53. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  54. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.json +2 -2
  55. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  56. package/artifacts/contracts/governance/GReputation.sol/GReputation.json +2 -2
  57. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
  58. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.json +2 -2
  59. package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
  60. package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
  61. package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
  62. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  63. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.json +2 -2
  64. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  65. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  66. package/artifacts/contracts/governance/Reputation.sol/Reputation.json +2 -2
  67. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  68. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.json +2 -2
  69. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
  70. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +2 -2
  71. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
  72. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.json +2 -2
  73. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  74. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.json +2 -2
  75. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
  76. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.json +2 -2
  77. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  78. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.json +2 -2
  79. package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
  80. package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.json +2 -2
  81. package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
  82. package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.json +2 -2
  83. package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
  84. package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.json +2 -2
  85. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  86. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.json +2 -2
  87. package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
  88. package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.json +2 -2
  89. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  90. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.json +2 -2
  91. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
  92. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.json +122 -17
  93. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
  94. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.json +242 -17
  95. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
  96. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.json +256 -18
  97. package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
  98. package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.json +2 -2
  99. package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
  100. package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.json +2 -2
  101. package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
  102. package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.json +15 -2
  103. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  104. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +6 -6
  105. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
  106. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.json +2 -2
  107. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  108. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.json +2 -2
  109. package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
  110. package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.json +2 -2
  111. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  112. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.json +2 -2
  113. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  114. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.json +2 -2
  115. package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
  116. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
  117. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.json +2 -2
  118. package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
  119. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  120. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.json +2 -2
  121. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  122. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.json +2 -2
  123. package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
  124. package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.json +2 -2
  125. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  126. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.json +2 -2
  127. package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
  128. package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.json +2 -2
  129. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  130. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.json +2 -2
  131. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  132. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.json +2 -2
  133. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  134. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.json +2 -2
  135. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  136. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.json +2 -2
  137. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
  138. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.json +2 -2
  139. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
  140. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.json +2 -2
  141. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  142. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.json +2 -2
  143. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  144. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.json +2 -2
  145. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  146. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.json +2 -2
  147. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  148. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.json +2 -2
  149. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  150. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.json +2 -2
  151. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  152. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.json +2 -2
  153. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  154. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.json +2 -2
  155. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  156. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.json +2 -2
  157. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
  158. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.json +242 -17
  159. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  160. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.json +2 -2
  161. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  162. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.json +2 -2
  163. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  164. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  165. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.json +45 -19
  166. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  167. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.json +2 -2
  168. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  169. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.json +2 -2
  170. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  171. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.json +2 -2
  172. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
  173. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.json +2 -2
  174. package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
  175. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
  176. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  177. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.json +2 -2
  178. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  179. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  180. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  181. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.json +2 -2
  182. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  183. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.json +2 -2
  184. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  185. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +2 -2
  186. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  187. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.json +2 -2
  188. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  189. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.json +2 -2
  190. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  191. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.json +2 -2
  192. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  193. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.json +2 -2
  194. package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
  195. package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.json +2 -2
  196. package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
  197. package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
  198. package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.json +2 -2
  199. package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
  200. package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
  201. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
  202. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.json +2 -2
  203. package/artifacts/contracts/token/IFeesFormula.sol/IFeesFormula.dbg.json +4 -0
  204. package/artifacts/contracts/token/{FeesFormula.sol → IFeesFormula.sol}/IFeesFormula.json +1 -1
  205. package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.dbg.json +4 -0
  206. package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.json +58 -0
  207. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
  208. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
  209. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
  210. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
  211. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.json +159 -5
  212. package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.dbg.json +4 -0
  213. package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.json +1609 -0
  214. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
  215. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +233 -190
  216. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
  217. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.json +198 -193
  218. package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
  219. package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
  220. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
  221. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
  222. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.json +2 -2
  223. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
  224. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.json +2 -2
  225. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  226. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.json +20 -2
  227. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
  228. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.json +20 -2
  229. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
  230. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.json +2 -2
  231. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
  232. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.json +2 -2
  233. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  234. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.json +2 -2
  235. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
  236. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.json +2 -2
  237. package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
  238. package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.json +2 -2
  239. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
  240. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.json +2 -2
  241. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
  242. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.json +2 -2
  243. package/artifacts/contracts/utils/BuyGDClone.sol/ISwapRouter.dbg.json +1 -1
  244. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  245. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.json +2 -2
  246. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  247. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.json +2 -2
  248. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  249. package/artifacts/contracts/utils/DSMath.sol/DSMath.json +2 -2
  250. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  251. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.json +2 -2
  252. package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
  253. package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.json +2 -2
  254. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
  255. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.json +2 -2
  256. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
  257. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
  258. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
  259. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.json +2 -2
  260. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
  261. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.json +2 -2
  262. package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
  263. package/artifacts/contracts/utils/MultiCall.sol/Multicall.json +2 -2
  264. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
  265. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.json +2 -2
  266. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  267. package/artifacts/contracts/utils/NameService.sol/NameService.json +2 -2
  268. package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
  269. package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.json +2 -2
  270. package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
  271. package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.json +2 -2
  272. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  273. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  274. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.json +2 -2
  275. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  276. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.json +2 -2
  277. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
  278. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.json +2 -2
  279. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
  280. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.json +2 -2
  281. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  282. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.json +2 -2
  283. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  284. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.json +2 -2
  285. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  286. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.json +2 -2
  287. package/contracts/invite/InvitesFuseV2.sol +3 -2
  288. package/contracts/mocks/DistributionBridgeMock.sol +42 -15
  289. package/contracts/mocks/DistributionHelperTest.sol +6 -2
  290. package/contracts/mocks/FeesFormularMock.sol +14 -14
  291. package/contracts/mocks/GasPriceMockOracle.sol +7 -1
  292. package/contracts/reserve/DistributionHelper.sol +147 -23
  293. package/contracts/reserve/GoodReserveCDai.sol +39 -47
  294. package/contracts/staking/GoodFundManager.sol +18 -37
  295. package/contracts/token/GoodDollar.sol +11 -16
  296. package/contracts/token/MultichainFeeFormula.sol +34 -0
  297. package/contracts/token/superfluid/ConstantFlowNFTs.sol +3 -0
  298. package/contracts/token/superfluid/ISuperGoodDollar.sol +4 -5
  299. package/contracts/token/superfluid/ISuperToken.sol +464 -0
  300. package/contracts/token/superfluid/SuperGoodDollar.sol +408 -376
  301. package/contracts/token/superfluid/SuperToken.sol +144 -144
  302. package/contracts/ubi/UBIScheme.sol +9 -5
  303. package/contracts/ubi/UBISchemeV2.sol +6 -0
  304. package/contracts/utils/AdminWallet.sol +2 -1
  305. package/contracts/utils/AdminWalletFuse.sol +2 -1
  306. package/contracts/utils/BuyAndBridgeHelper.sol +13 -13
  307. package/contracts/utils/MultiCall.sol +8 -10
  308. package/dist/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +2 -2
  309. package/dist/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +233 -190
  310. package/dist/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.json +2 -2
  311. package/dist/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.json +2 -2
  312. package/hardhat.config.ts +46 -15
  313. package/package.json +7 -7
  314. package/releases/deploy-settings.json +3 -1
  315. package/releases/deployment.json +6 -2
  316. package/scripts/analytics/faucetStats.ts +19 -15
  317. package/scripts/fv.ts +305 -0
  318. package/scripts/multichain-deploy/1_basicdao-deploy.ts +18 -9
  319. package/scripts/multichain-deploy/helpers.ts +204 -64
  320. package/scripts/proposals/gip-15.ts +427 -0
  321. package/scripts/upgrades/multichain-formula-upgrade.ts +140 -0
  322. package/scripts/upgrades/restoreFunds.ts +91 -0
  323. package/scripts/upgrades/superfluid-nft-celo-gas-token.ts +159 -0
  324. package/scripts/utils.ts +15 -0
  325. package/test/helpers.ts +73 -10
  326. package/test/reserve/DistributionHelper.test.ts +183 -218
  327. package/test/reserve/GoodReserveCDai.distribution.test.ts +21 -144
  328. package/test/reserve/GoodReserveCDai.test.ts +98 -302
  329. package/test/staking/StakingRewards.test.ts +324 -936
  330. package/test/token/CeloGasToken.test.ts +108 -0
  331. package/test/token/SuperGoodDollar.test.ts +15 -6
  332. package/test/utils/AdminWallet.test.ts +97 -38
  333. package/test/utils/BuyAndBridgeHelper.test.ts +9 -33
  334. package/truffle-config.js +24 -6
  335. package/types/ConstantInflowNFT.ts +969 -0
  336. package/types/ConstantOutflowNFT.ts +1031 -0
  337. package/types/DistributionBridgeMock.ts +203 -70
  338. package/types/DistributionHelper.ts +325 -30
  339. package/types/DistributionHelperTest.ts +325 -30
  340. package/types/DistributionHelperTestHelper.ts +355 -35
  341. package/types/FlowNFTBase.ts +887 -0
  342. package/types/GasPriceMockOracle.ts +29 -0
  343. package/types/GoodReserveCDai.ts +79 -20
  344. package/types/IConstantFlowAgreementV1.ts +1391 -0
  345. package/types/IConstantInflowNFT.ts +772 -0
  346. package/types/IConstantOutflowNFT.ts +834 -0
  347. package/types/IERC721.ts +487 -0
  348. package/types/IERC721Metadata.ts +538 -0
  349. package/types/IFlowNFTBase.ts +711 -0
  350. package/types/IInstantDistributionAgreementV1.ts +1183 -0
  351. package/types/ILayerZeroFeeEstimator.ts +136 -0
  352. package/types/IMessagePassingBridge.ts +774 -0
  353. package/types/ISETH.ts +2668 -0
  354. package/types/ISETHCustom.ts +161 -0
  355. package/types/ISuperGoodDollar.ts +277 -25
  356. package/types/ISuperToken.ts +202 -346
  357. package/types/ISuperfluid.ts +7 -2
  358. package/types/ISuperfluidGovernance.ts +40 -5
  359. package/types/MultichainFeeFormula.ts +130 -0
  360. package/types/SuperGoodDollar.ts +383 -349
  361. package/types/SuperToken.ts +319 -344
  362. package/types/UBIScheme.ts +36 -0
  363. package/types/UBISchemeV2.ts +36 -0
  364. package/types/factories/AaveMock__factory.ts +1 -1
  365. package/types/factories/AaveStakingFactory__factory.ts +1 -1
  366. package/types/factories/AaveUSDMockOracle__factory.ts +1 -1
  367. package/types/factories/AdminWalletFuse__factory.ts +1 -1
  368. package/types/factories/AdminWallet__factory.ts +1 -1
  369. package/types/factories/BancorFormula__factory.ts +1 -1
  370. package/types/factories/BaseShareFieldV2__factory.ts +1 -1
  371. package/types/factories/BaseShareField__factory.ts +1 -1
  372. package/types/factories/BatUSDMockOracle__factory.ts +1 -1
  373. package/types/factories/BuyAndBridgeHelper__factory.ts +1 -1
  374. package/types/factories/BuyGDCloneFactory__factory.ts +1 -1
  375. package/types/factories/BuyGDClone__factory.ts +1 -1
  376. package/types/factories/CBATMock__factory.ts +1 -1
  377. package/types/factories/CDAILowWorthMock__factory.ts +1 -1
  378. package/types/factories/CDAIMock__factory.ts +1 -1
  379. package/types/factories/CDAINonMintableMock__factory.ts +1 -1
  380. package/types/factories/CDecimalsMock__factory.ts +1 -1
  381. package/types/factories/CSDTMock__factory.ts +1 -1
  382. package/types/factories/CUSDCMock__factory.ts +1 -1
  383. package/types/factories/ClaimersDistribution__factory.ts +1 -1
  384. package/types/factories/CompUSDMockOracle__factory.ts +1 -1
  385. package/types/factories/CompoundStakingFactory__factory.ts +1 -1
  386. package/types/factories/CompoundVotingMachine__factory.ts +1 -1
  387. package/types/factories/ConstantInflowNFT__factory.ts +758 -0
  388. package/types/factories/ConstantOutflowNFT__factory.ts +817 -0
  389. package/types/factories/DAIMock__factory.ts +1 -1
  390. package/types/factories/DAOContract__factory.ts +1 -1
  391. package/types/factories/DAOUpgradeableContract__factory.ts +1 -1
  392. package/types/factories/DaiEthPriceMockOracle__factory.ts +1 -1
  393. package/types/factories/DecimalsMock__factory.ts +1 -1
  394. package/types/factories/DistributionBridgeMock__factory.ts +121 -16
  395. package/types/factories/DistributionHelperTestHelper__factory.ts +255 -17
  396. package/types/factories/DistributionHelperTest__factory.ts +241 -16
  397. package/types/factories/DistributionHelper__factory.ts +241 -16
  398. package/types/factories/DonationsStaking__factory.ts +1 -1
  399. package/types/factories/ERC1967Proxy__factory.ts +1 -1
  400. package/types/factories/ERC20PresetMinterPauserUpgradeable__factory.ts +1 -1
  401. package/types/factories/ERC20Upgradeable__factory.ts +1 -1
  402. package/types/factories/EthUSDMockOracle__factory.ts +1 -1
  403. package/types/factories/EventsEmitter__factory.ts +1 -1
  404. package/types/factories/ExchangeHelper__factory.ts +1 -1
  405. package/types/factories/Faucet__factory.ts +1 -1
  406. package/types/factories/FeesFormulaMock__factory.ts +1 -1
  407. package/types/factories/FlowNFTBase__factory.ts +642 -0
  408. package/types/factories/FuseFaucetV2__factory.ts +1 -1
  409. package/types/factories/FuseFaucet__factory.ts +1 -1
  410. package/types/factories/FuseStakingV3__factory.ts +1 -1
  411. package/types/factories/GDFaucet__factory.ts +1 -1
  412. package/types/factories/GReputation__factory.ts +1 -1
  413. package/types/factories/GasPriceMockOracle__factory.ts +14 -1
  414. package/types/factories/GoodAaveStakingV2__factory.ts +1 -1
  415. package/types/factories/GoodAaveStaking__factory.ts +1 -1
  416. package/types/factories/GoodCompoundStakingTest__factory.ts +1 -1
  417. package/types/factories/GoodCompoundStakingV2__factory.ts +1 -1
  418. package/types/factories/GoodCompoundStaking__factory.ts +1 -1
  419. package/types/factories/GoodDollarMintBurnWrapper__factory.ts +1 -1
  420. package/types/factories/GoodDollarStakingMock__factory.ts +1 -1
  421. package/types/factories/GoodDollarStaking__factory.ts +1 -1
  422. package/types/factories/GoodDollar__factory.ts +1 -1
  423. package/types/factories/GoodFundManagerTest__factory.ts +1 -1
  424. package/types/factories/GoodFundManager__factory.ts +1 -1
  425. package/types/factories/GoodMarketMaker__factory.ts +1 -1
  426. package/types/factories/GoodReserveCDai__factory.ts +44 -18
  427. package/types/factories/GovernanceStaking__factory.ts +1 -1
  428. package/types/factories/IConstantFlowAgreementV1__factory.ts +1064 -0
  429. package/types/factories/IConstantInflowNFT__factory.ts +551 -0
  430. package/types/factories/IConstantOutflowNFT__factory.ts +614 -0
  431. package/types/factories/IERC721Metadata__factory.ts +356 -0
  432. package/types/factories/IERC721__factory.ts +308 -0
  433. package/types/factories/IFlowNFTBase__factory.ts +512 -0
  434. package/types/factories/IInstantDistributionAgreementV1__factory.ts +1015 -0
  435. package/types/factories/ILayerZeroFeeEstimator__factory.ts +79 -0
  436. package/types/factories/IMessagePassingBridge__factory.ts +446 -0
  437. package/types/factories/ISETHCustom__factory.ts +56 -0
  438. package/types/factories/ISETH__factory.ts +1866 -0
  439. package/types/factories/ISuperGoodDollar__factory.ts +159 -5
  440. package/types/factories/ISuperTokenFactory__factory.ts +5 -0
  441. package/types/factories/ISuperToken__factory.ts +130 -191
  442. package/types/factories/ISuperfluidGovernance__factory.ts +23 -5
  443. package/types/factories/ISuperfluid__factory.ts +10 -0
  444. package/types/factories/IdentityFix__factory.ts +1 -1
  445. package/types/factories/IdentityMock__factory.ts +1 -1
  446. package/types/factories/IdentityV2__factory.ts +1 -1
  447. package/types/factories/IncentiveControllerMock__factory.ts +1 -1
  448. package/types/factories/InvitesFuseV2__factory.ts +1 -1
  449. package/types/factories/InvitesV1__factory.ts +1 -1
  450. package/types/factories/InvitesV2__factory.ts +1 -1
  451. package/types/factories/LendingPoolMock__factory.ts +1 -1
  452. package/types/factories/Multicall__factory.ts +1 -1
  453. package/types/factories/MultichainBridgeHelper__factory.ts +1 -1
  454. package/types/factories/MultichainFeeFormula__factory.ts +113 -0
  455. package/types/factories/MultichainRouterMock__factory.ts +1 -1
  456. package/types/factories/NameService__factory.ts +1 -1
  457. package/types/factories/OneTimePaymentsV2__factory.ts +1 -1
  458. package/types/factories/OneTimePayments__factory.ts +1 -1
  459. package/types/factories/OverMintTesterRegularStake__factory.ts +1 -1
  460. package/types/factories/OverMintTester__factory.ts +1 -1
  461. package/types/factories/PayableMock__factory.ts +1 -1
  462. package/types/factories/ProtocolUpgradeFuseRecover__factory.ts +1 -1
  463. package/types/factories/ProtocolUpgradeFuse__factory.ts +1 -1
  464. package/types/factories/ProtocolUpgradeRecover__factory.ts +1 -1
  465. package/types/factories/ProtocolUpgrade__factory.ts +1 -1
  466. package/types/factories/ProxyFactory1967__factory.ts +1 -1
  467. package/types/factories/ReputationTestHelper__factory.ts +1 -1
  468. package/types/factories/Reputation__factory.ts +1 -1
  469. package/types/factories/SixteenDecimalsTokenMock__factory.ts +1 -1
  470. package/types/factories/StakersDistribution__factory.ts +1 -1
  471. package/types/factories/StakingMockFixedAPY__factory.ts +1 -1
  472. package/types/factories/SuperGoodDollar__factory.ts +230 -187
  473. package/types/factories/SuperToken__factory.ts +197 -192
  474. package/types/factories/SwapHelperTest__factory.ts +1 -1
  475. package/types/factories/TwentyDecimalsTokenMock__factory.ts +1 -1
  476. package/types/factories/UBISchemeV2__factory.ts +19 -1
  477. package/types/factories/UBIScheme__factory.ts +19 -1
  478. package/types/factories/USDCMock__factory.ts +1 -1
  479. package/types/factories/UUPSProxy__factory.ts +1 -1
  480. package/types/factories/UniswapV2SwapHelper__factory.ts +1 -1
  481. package/types/factories/UpgradableMock2__factory.ts +1 -1
  482. package/types/factories/UpgradableMock3__factory.ts +1 -1
  483. package/types/factories/UpgradableMock4__factory.ts +1 -1
  484. package/types/factories/UpgradableMock__factory.ts +1 -1
  485. package/types/hardhat.d.ts +166 -4
  486. package/types/index.ts +34 -4
  487. package/yarn.lock +1288 -719
  488. package/artifacts/contracts/token/FeesFormula.sol/IFeesFormula.dbg.json +0 -4
  489. /package/contracts/token/{FeesFormula.sol → IFeesFormula.sol} +0 -0
@@ -4,392 +4,424 @@ 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 { UUPSProxiable } from "./UUPSProxiable.sol";
13
- import { ERC777Helper } from "@superfluid-finance/ethereum-contracts/contracts/libs/ERC777Helper.sol";
14
- import { IGoodDollarCustom } from "./ISuperGoodDollar.sol";
15
-
16
- import { SuperToken } from "./SuperToken.sol";
12
+ import {IGoodDollarCustom} from "./ISuperGoodDollar.sol";
13
+ import {SuperToken} from "./SuperToken.sol";
17
14
  import "../ERC677.sol";
18
- import "../FeesFormula.sol";
15
+ import "../IFeesFormula.sol";
19
16
  import "../../Interfaces.sol";
20
17
  import "./ERC20Permit.sol";
21
- import "./SuperToken.sol";
22
18
 
23
19
  // import "hardhat/console.sol";
24
20
 
25
21
  // IMPORTANT: The order of base contracts with storage MUST REMAIN AS IS after the initial deployment.
26
22
  // Changing order can result in storage corruption when upgrading.
27
23
  contract SuperGoodDollar is
28
- SuperToken, // includes 32 storage slots padding for SuperToken
29
- AccessControlEnumerableUpgradeable, // with storage
30
- PausableUpgradeable,
31
- ERC20Permit,
32
- ERC677, // without storage
33
- 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
34
30
  {
35
- // IMPORTANT! Never change the type (storage size) or order of state variables.
36
- // If a variable isn't needed anymore, leave it as padding (renaming is ok).
37
- address public feeRecipient;
38
- IFeesFormula public formula;
39
- IIdentity public identity;
40
- uint256 public cap;
41
- bool public disableHostOperations;
42
- // Append additional state variables here!
43
-
44
- // ============== constants and immutables ==============
45
-
46
- bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
47
- bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
48
-
49
- event TransferFee(
50
- address from,
51
- address to,
52
- uint256 amount,
53
- uint256 fee,
54
- bool senderPays
55
- );
56
-
57
- // ========================================================================================
58
- // ============== Functionality to be executed on the proxy via delegateCall ==============
59
- // ========================================================================================
60
-
61
- /// initializes state specific to the GoodDollar token
62
- /// When upgrading to a new logic contract,
63
- function initialize(
64
- string calldata n,
65
- string calldata s,
66
- uint256 _cap,
67
- IFeesFormula _formula,
68
- IIdentity _identity,
69
- address _feeRecipient,
70
- address _owner
71
- ) public initializer {
72
- initialize(IERC20(address(0)), 18, n, s);
73
- __AccessControl_init_unchained();
74
- __Pausable_init_unchained();
75
- __ERC20Permit_init(n);
76
- _setupRole(DEFAULT_ADMIN_ROLE, _owner);
77
- _setupRole(MINTER_ROLE, _owner);
78
- _setupRole(PAUSER_ROLE, _owner);
79
- feeRecipient = _feeRecipient;
80
- identity = _identity;
81
- formula = _formula;
82
- cap = _cap;
83
- }
84
-
85
- // ============ SuperFluid ============
86
-
87
- constructor(ISuperfluid _host) SuperToken(_host) {}
88
-
89
- /// @dev override superfluid initializer with onlyInitializing modifier, so our main initializer must be called
90
- function initialize(
91
- IERC20 underlyingToken,
92
- uint8 underlyingDecimals,
93
- string calldata n,
94
- string calldata s
95
- )
96
- public
97
- override
98
- onlyInitializing // OpenZeppelin Initializable
99
- {
100
- _underlyingToken = underlyingToken;
101
- _underlyingDecimals = underlyingDecimals;
102
-
103
- _name = n;
104
- _symbol = s;
105
-
106
- // register interfaces
107
- ERC777Helper.register(address(this));
108
-
109
- // help tools like explorers detect the token contract
110
- emit Transfer(address(0), address(0), 0);
111
- }
112
-
113
- function proxiableUUID() public pure override returns (bytes32) {
114
- return
115
- keccak256(
116
- "org.superfluid-finance.contracts.SuperGoodDollar.implementation"
117
- );
118
- }
119
-
120
- function updateCode(address newAddress) external override onlyOwner {
121
- UUPSProxiable._updateCodeAddress(newAddress);
122
- }
123
-
124
- /// override Superfluid agreement function in order to make it pausable
125
- /// that is, no new streams can be started when the contract is paused
126
- function createAgreement(
127
- bytes32 id,
128
- bytes32[] calldata data
129
- ) public override(ISuperfluidToken, SuperfluidToken) {
130
- require(!paused(), "Pausable: createAgreement while paused");
131
- // otherwise the wrapper of SuperToken.createAgreement does the actual job
132
- super.createAgreement(id, data);
133
- }
134
-
135
- /// failsafe in case we don't want to trust superfluid host for batch operations
136
- function allowHostOperations()
137
- internal
138
- view
139
- virtual
140
- override
141
- returns (bool hostEnabled)
142
- {
143
- return !disableHostOperations;
144
- }
145
-
146
- function enableHostOperations(bool enabled) external onlyOwner {
147
- disableHostOperations = !enabled;
148
- }
149
-
150
- // ============ IGoodDollarCustom ============
151
-
152
- modifier onlyOwner() {
153
- require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "not owner");
154
- _;
155
- }
156
-
157
- modifier onlyPauser() {
158
- require(hasRole(PAUSER_ROLE, msg.sender), "not pauser");
159
- _;
160
- }
161
-
162
- modifier onlyMinter() {
163
- require(hasRole(MINTER_ROLE, msg.sender), "not minter");
164
- _;
165
- }
166
-
167
- function owner() external view override returns (address) {
168
- return getRoleMember(DEFAULT_ADMIN_ROLE, 0);
169
- }
170
-
171
- function setFormula(IFeesFormula _formula) external override onlyOwner {
172
- formula = _formula;
173
- }
174
-
175
- function setIdentity(IIdentityV2 _identity) external override onlyOwner {
176
- identity = _identity;
177
- }
178
-
179
- function transferOwnership(address _owner) public override onlyOwner {
180
- grantRole(DEFAULT_ADMIN_ROLE, _owner);
181
- renounceRole(DEFAULT_ADMIN_ROLE, _msgSender());
182
- }
183
-
184
- function isMinter(address _minter) external view override returns (bool) {
185
- return hasRole(MINTER_ROLE, _minter);
186
- }
187
-
188
- function addMinter(address _minter) external override {
189
- grantRole(MINTER_ROLE, _minter); // enforces permissions
190
- }
191
-
192
- function renounceMinter() external override {
193
- renounceRole(MINTER_ROLE, _msgSender()); // enforces permissions
194
- }
195
-
196
- function isPauser(address _pauser) external view override returns (bool) {
197
- return hasRole(PAUSER_ROLE, _pauser);
198
- }
199
-
200
- function addPauser(address _pauser) external override {
201
- grantRole(PAUSER_ROLE, _pauser); // enforces permissions
202
- }
203
-
204
- function pause() public override onlyPauser {
205
- _pause();
206
- }
207
-
208
- function unpause() public override onlyPauser {
209
- _unpause();
210
- }
211
-
212
- /**
213
- * @dev Processes transfer fees and calls ERC677Token transferAndCall function
214
- * @param to address to transfer to
215
- * @param amount the amount to transfer
216
- * @param data The data to pass to transferAndCall
217
- * @return a bool indicating if transfer function succeeded
218
- */
219
- function transferAndCall(
220
- address to,
221
- uint256 amount,
222
- bytes calldata data
223
- ) external override returns (bool) {
224
- //duplicated code from _transferAndCall so we can get the amount after fees correctly for transferAndCall event + callback
225
- require(!paused(), "Pausable: token transfer while paused");
226
- uint256 bruttoValue = _processFees(msg.sender, to, amount);
227
- // handing over to the wrapper of SuperToken.transferFrom skipping this _transferFrom which also collects fees
228
- bool res = super._transferFrom(msg.sender, msg.sender, to, bruttoValue);
229
- emit ERC677.Transfer(msg.sender, to, bruttoValue, data);
230
- if (isContract(to)) {
231
- require(
232
- contractFallback(to, bruttoValue, data),
233
- "Contract fallback failed"
234
- );
235
- }
236
- return res;
237
- }
238
-
239
- function transfer(
240
- address to,
241
- uint256 amount
242
- ) public virtual override(ERC677, SuperToken) returns (bool) {
243
- return _transferFrom(msg.sender, msg.sender, to, amount);
244
- }
245
-
246
- /// make sure supertoken erc20 methods include fees and pausable
247
- function _transferFrom(
248
- address spender,
249
- address holder,
250
- address recipient,
251
- uint256 amount
252
- ) internal virtual override returns (bool) {
253
- require(!paused(), "Pausable: token transfer while paused");
254
- uint256 bruttoValue = _processFees(holder, recipient, amount);
255
- // handing over to the wrapper of SuperToken.transferFrom
256
- super._transferFrom(spender, holder, recipient, bruttoValue);
257
- return true;
258
- }
259
-
260
- /// make sure supertoken erc777 methods include fees and pausable
261
- function _send(
262
- address operator,
263
- address from,
264
- address to,
265
- uint256 amount,
266
- bytes memory userData,
267
- bytes memory operatorData,
268
- bool requireReceptionAck
269
- ) internal virtual override {
270
- require(!paused(), "Pausable: token transfer while paused");
271
- uint256 bruttoValue = _processFees(from, to, amount);
272
- // handing over to the wrapper of SuperToken.transferFrom
273
- super._send(
274
- operator,
275
- from,
276
- to,
277
- bruttoValue,
278
- userData,
279
- operatorData,
280
- requireReceptionAck
281
- );
282
- }
283
-
284
- /// make sure supertoken erc777 methods include pausable
285
- function _burn(
286
- address operator,
287
- address from,
288
- uint256 amount,
289
- bytes memory userData,
290
- bytes memory operatorData
291
- ) internal virtual override {
292
- require(!paused(), "Pausable: token transfer while paused");
293
- // handing over to the wrapper of SuperToken.transferFrom
294
- super._burn(operator, from, amount, userData, operatorData);
295
- }
296
-
297
- /**
298
- * @dev Minting function
299
- * @param to the address that will receive the minted tokens
300
- * @param amount the amount of tokens to mint
301
- */
302
- function mint(
303
- address to,
304
- uint256 amount
305
- ) public override(IGoodDollarCustom) onlyMinter returns (bool) {
306
- require(!paused(), "Pausable: token transfer while paused");
307
-
308
- if (cap > 0) {
309
- require(
310
- totalSupply() + amount <= cap,
311
- "Cannot increase supply beyond cap"
312
- );
313
- }
314
- _mint(
315
- msg.sender,
316
- to,
317
- amount,
318
- false /* requireReceptionAck */,
319
- new bytes(0),
320
- new bytes(0)
321
- );
322
-
323
- return true;
324
- }
325
-
326
- function burnFrom(address account, uint256 amount) public {
327
- uint256 currentAllowance = allowance(account, _msgSender());
328
- require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance");
329
- unchecked {
330
- _approve(account, _msgSender(), currentAllowance - amount);
331
- }
332
- _burn(msg.sender, account, amount, new bytes(0), new bytes(0));
333
- }
334
-
335
- function burn(uint256 amount) external override {
336
- _burn(msg.sender, msg.sender, amount, new bytes(0), new bytes(0));
337
- }
338
-
339
- /**
340
- * @dev Gets the current transaction fees
341
- * @return fee senderPays that represents the current transaction fees and bool true if sender pays the fee or receiver
342
- */
343
- function getFees(
344
- uint256 amount
345
- ) public view returns (uint256 fee, bool senderPays) {
346
- return formula.getTxFees(amount, address(0), address(0));
347
- }
348
-
349
- /**
350
- * @dev Gets the current transaction fees
351
- * @return fee senderPays that represents the current transaction fees and bool true if sender pays the fee or receiver
352
- */
353
- function getFees(
354
- uint256 amount,
355
- address sender,
356
- address recipient
357
- ) public view returns (uint256 fee, bool senderPays) {
358
- return formula.getTxFees(amount, sender, recipient);
359
- }
360
-
361
- /**
362
- * @dev Sets the address that receives the transactional fees.
363
- * can only be called by owner
364
- * @param _feeRecipient The new address to receive transactional fees
365
- */
366
- function setFeeRecipient(address _feeRecipient) public onlyOwner {
367
- feeRecipient = _feeRecipient;
368
- }
369
-
370
- // internal functions
371
-
372
- /**
373
- * @dev Sends transactional fees to feeRecipient address from given address
374
- * @param account The account that sends the fees
375
- * @param amount The amount to subtract fees from
376
- * @return an uint256 that represents the given amount minus the transactional fees
377
- */
378
- function _processFees(
379
- address account,
380
- address recipient,
381
- uint256 amount
382
- ) internal returns (uint256) {
383
- (uint256 txFees, bool senderPays) = getFees(amount, account, recipient);
384
- if (txFees > 0 && !identity.isDAOContract(msg.sender)) {
385
- require(
386
- senderPays == false || amount + txFees <= balanceOf(account),
387
- "Not enough balance to pay TX fee"
388
- );
389
- super._transferFrom(account, account, feeRecipient, txFees);
390
- emit TransferFee(account, recipient, amount, txFees, senderPays);
391
- return senderPays ? amount : amount - txFees;
392
- }
393
- return amount;
394
- }
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
+ }
395
427
  }