@gooddollar/goodprotocol 2.0.7-beta.3 → 2.0.7

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 (191) hide show
  1. package/artifacts/abis/BuyGDClone.min.json +1 -1
  2. package/artifacts/abis/BuyGDCloneFactory.min.json +1 -1
  3. package/artifacts/abis/IStaticOracle.min.json +1 -0
  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/Faucet.sol/Faucet.json +2 -2
  35. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  36. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
  37. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.json +2 -2
  38. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  39. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  40. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  41. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
  42. package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
  43. package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
  44. package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
  45. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  46. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  47. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  48. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  49. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
  50. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
  51. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  52. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
  53. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  54. package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
  55. package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
  56. package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
  57. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  58. package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
  59. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  60. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
  61. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
  62. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
  63. package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
  64. package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
  65. package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
  66. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  67. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
  68. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  69. package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
  70. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  71. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  72. package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
  73. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
  74. package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
  75. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  76. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  77. package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
  78. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  79. package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
  80. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  81. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  82. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  83. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  84. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
  85. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
  86. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  87. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  88. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  89. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  90. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  91. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  92. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  93. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  94. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
  95. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  96. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  97. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  98. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  99. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  100. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  101. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  102. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
  103. package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
  104. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
  105. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  106. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  107. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  108. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  109. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  110. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  111. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  112. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  113. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  114. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  115. package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
  116. package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
  117. package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
  118. package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
  119. package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
  120. package/artifacts/contracts/token/FeesFormula.sol/IFeesFormula.dbg.json +1 -1
  121. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
  122. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
  123. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
  124. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
  125. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
  126. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
  127. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
  128. package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
  129. package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
  130. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
  131. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
  132. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
  133. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  134. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
  135. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
  136. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
  137. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  138. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
  139. package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
  140. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
  141. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.json +68 -24
  142. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
  143. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.json +7 -12
  144. package/artifacts/contracts/utils/BuyGDClone.sol/IStaticOracle.dbg.json +4 -0
  145. package/artifacts/contracts/utils/BuyGDClone.sol/IStaticOracle.json +79 -0
  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/fuseFaucet/Faucet.sol +0 -1
  171. package/contracts/fuseFaucet/FuseFaucetV2.sol +0 -1
  172. package/contracts/utils/BuyGDClone.sol +162 -24
  173. package/hardhat.config.ts +2 -1
  174. package/package.json +1 -1
  175. package/releases/deploy-settings.json +3 -0
  176. package/releases/deployment.json +13 -0
  177. package/scripts/analytics/faucetStats.ts +61 -17
  178. package/scripts/multichain-deploy/1_basicdao-deploy.ts +20 -12
  179. package/scripts/multichain-deploy/3_gdSavings-deploy.ts +16 -88
  180. package/scripts/upgrades/multichain-temp-fix.ts +6 -3
  181. package/truffle-config.js +4 -0
  182. package/types/BuyGDClone.ts +104 -28
  183. package/types/BuyGDCloneFactory.ts +9 -40
  184. package/types/IStaticOracle.ts +170 -0
  185. package/types/factories/BuyGDCloneFactory__factory.ts +16 -12
  186. package/types/factories/BuyGDClone__factory.ts +76 -23
  187. package/types/factories/Faucet__factory.ts +1 -1
  188. package/types/factories/FuseFaucetV2__factory.ts +1 -1
  189. package/types/factories/IStaticOracle__factory.ts +91 -0
  190. package/types/hardhat.d.ts +9 -0
  191. package/types/index.ts +2 -0
@@ -19,6 +19,11 @@
19
19
  "internalType": "address",
20
20
  "name": "_gd",
21
21
  "type": "address"
22
+ },
23
+ {
24
+ "internalType": "contract IStaticOracle",
25
+ "name": "_oracle",
26
+ "type": "address"
22
27
  }
23
28
  ],
24
29
  "stateMutability": "nonpayable",
@@ -30,11 +35,6 @@
30
35
  "internalType": "address",
31
36
  "name": "owner",
32
37
  "type": "address"
33
- },
34
- {
35
- "internalType": "address",
36
- "name": "executer",
37
- "type": "address"
38
38
  }
39
39
  ],
40
40
  "name": "create",
@@ -54,11 +54,6 @@
54
54
  "internalType": "address",
55
55
  "name": "owner",
56
56
  "type": "address"
57
- },
58
- {
59
- "internalType": "address",
60
- "name": "executer",
61
- "type": "address"
62
57
  }
63
58
  ],
64
59
  "name": "predict",
@@ -73,8 +68,8 @@
73
68
  "type": "function"
74
69
  }
75
70
  ],
76
- "bytecode": "0x60a060405234801561001057600080fd5b5060405161134638038061134683398101604081905261002f916100b5565b82828260405161003e90610090565b6001600160a01b03938416815291831660208301529091166040820152606001604051809103906000f08015801561007a573d6000803e3d6000fd5b506001600160a01b031660805250610102915050565b610efb8061044b83390190565b6001600160a01b03811681146100b257600080fd5b50565b6000806000606084860312156100ca57600080fd5b83516100d58161009d565b60208501519093506100e68161009d565b60408501519092506100f78161009d565b809150509250925092565b6080516103286101236000396000818160b2015261019201526103286000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80633e68680a1461003b5780635c911b291461006a575b600080fd5b61004e6100493660046102a5565b61007d565b6040516001600160a01b03909116815260200160405180910390f35b61004e6100783660046102a5565b610145565b60008083836040516020016100939291906102d8565b60405160208183030381529060405280519060200120905060006100d77f0000000000000000000000000000000000000000000000000000000000000000836101ee565b60405163485cc95560e01b81529091506001600160a01b0382169063485cc9559061010890889088906004016102d8565b600060405180830381600087803b15801561012257600080fd5b505af1158015610136573d6000803e3d6000fd5b50929450505050505b92915050565b600080838360405160200161015b9291906102d8565b60408051808303601f190181529082905280516020909101203060388301526f5af43d82803e903d91602b57fd5bf3ff60248301527f00000000000000000000000000000000000000000000000000000000000000006014830152733d602d80600a3d3981f3363d3d373d3d3d363d73825260588201526037600c82012060788201526055604390910120949350505050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b03811661013f5760405162461bcd60e51b8152602060048201526017602482015276115490cc4c4d8dce8818dc99585d194c8819985a5b1959604a1b604482015260640160405180910390fd5b80356001600160a01b03811681146102a057600080fd5b919050565b600080604083850312156102b857600080fd5b6102c183610289565b91506102cf60208401610289565b90509250929050565b6001600160a01b039283168152911660208201526040019056fea2646970667358221220bb79b4c0132ca24f88937fb278b04c69969e89aaf8b91a22adfda79722c30bff64736f6c6343000810003360e060405234801561001057600080fd5b50604051610efb380380610efb83398101604081905261002f91610064565b6001600160a01b0392831660805290821660a0521660c0526100b1565b6001600160a01b038116811461006157600080fd5b50565b60008060006060848603121561007957600080fd5b83516100848161004c565b60208501519093506100958161004c565b60408501519092506100a68161004c565b809150509250925092565b60805160a05160c051610dcf61012c600039600081816101dd015281816107070152610a4a01526000818160e10152818161058f0152818161061f015281816106cf015281816108290152610a120152600081816102110152818161064c01528181610787015281816109670152610aca0152610dcf6000f3fe6080604052600436106100855760003560e01c8063051ed8ef146100915780630c577bdc146100cf5780630cd865ec14610103578063240ff76714610125578063485cc9551461014557806377e9acd9146101655780638da5cb5b1461018557806394b918de146101ab578063a5e598fc146101cb578063f887ea40146101ff57600080fd5b3661008c57005b600080fd5b34801561009d57600080fd5b506100b973471ece3750da237f93b8e339c536989b8978a43881565b6040516100c69190610bc7565b60405180910390f35b3480156100db57600080fd5b506100b97f000000000000000000000000000000000000000000000000000000000000000081565b34801561010f57600080fd5b5061012361011e366004610bf7565b610233565b005b34801561013157600080fd5b506001546100b9906001600160a01b031681565b34801561015157600080fd5b50610123610160366004610c19565b6103a9565b34801561017157600080fd5b50610123610180366004610c4c565b6104f5565b34801561019157600080fd5b506000546100b9906201000090046001600160a01b031681565b3480156101b757600080fd5b506101236101c6366004610c4c565b6108ab565b3480156101d757600080fd5b506100b97f000000000000000000000000000000000000000000000000000000000000000081565b34801561020b57600080fd5b506100b97f000000000000000000000000000000000000000000000000000000000000000081565b6001600160a01b0381166102c55760008054604051620100009091046001600160a01b03169047908381818185875af1925050503d8060008114610293576040519150601f19603f3d011682016040523d82523d6000602084013e610298565b606091505b50509050806102c15760405163e2a1cc9160e01b81524760048201526024015b60405180910390fd5b5050565b6000546040516370a0823160e01b81526001600160a01b038084169263a9059cbb92620100009091049091169083906370a0823190610308903090600401610bc7565b602060405180830381865afa158015610325573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103499190610c65565b6040518363ffffffff1660e01b8152600401610366929190610c7e565b6020604051808303816000875af1158015610385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102c19190610c97565b600054610100900460ff16158080156103c95750600054600160ff909116105b806103e35750303b1580156103e3575060005460ff166001145b6104465760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016102b8565b6000805460ff191660011790558015610469576000805461ff0019166101001790555b6000805462010000600160b01b031916620100006001600160a01b038681169190910291909117909155600180546001600160a01b03191691841691909117905580156104f0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6001546000906001600160a01b0316331461051157600061051b565b67016345785d8a00005b6000546001600160401b039190911691506201000090046001600160a01b0316331480159061055557506001546001600160a01b03163314155b1561057557336040516335ac4f0560e01b81526004016102b89190610bc7565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a08231906105c4903090600401610bc7565b602060405180830381865afa1580156105e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106059190610c65565b60405163095ea7b360e01b81529091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b390610676907f0000000000000000000000000000000000000000000000000000000000000000908590600401610c7e565b6020604051808303816000875af1158015610695573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b99190610c97565b50604080516080810182526001600160601b03197f0000000000000000000000000000000000000000000000000000000000000000606090811b821660a084015261027160ec1b60b48401527f0000000000000000000000000000000000000000000000000000000000000000901b1660b7820152815180820360ab01815260cb820183528152600080546201000090046001600160a01b031660208301529181016107658585610ccf565b815260200185905260405163b858183f60e01b81529091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b858183f906107bc908490600401610ce8565b6020604051808303816000875af11580156107db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ff9190610c65565b506001546001600160a01b031633036108a55760405163a9059cbb60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906108609033908790600401610c7e565b6020604051808303816000875af115801561087f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a39190610c97565b505b50505050565b600080546201000090046001600160a01b031633146108e4576108d248633b9aca00610d67565b6108df9062061a80610d7a565b6108e7565b60005b6000549091506201000090046001600160a01b0316331480159061091657506001546001600160a01b03163314155b1561093657336040516335ac4f0560e01b81526004016102b89190610bc7565b60405163095ea7b360e01b8152479073471ece3750da237f93b8e339c536989b8978a4389063095ea7b390610991907f0000000000000000000000000000000000000000000000000000000000000000908590600401610c7e565b6020604051808303816000875af11580156109b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d49190610c97565b50604080516080810182527308e3d9c6ea1b446ff2771c6738a6d313712f148760631b60a082015261017760eb1b60b48201526001600160601b03197f0000000000000000000000000000000000000000000000000000000000000000606090811b821660b784015261027160ec1b60cb8401527f0000000000000000000000000000000000000000000000000000000000000000901b1660ce820152815180820360c201815260e2820183528152600080546201000090046001600160a01b03166020830152918101610aa88585610ccf565b815260200185905260405163b858183f60e01b81529091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b858183f90610aff908490600401610ce8565b6020604051808303816000875af1158015610b1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b429190610c65565b506000546201000090046001600160a01b031633146108a557604051600090339085908381818185875af1925050503d8060008114610b9d576040519150601f19603f3d011682016040523d82523d6000602084013e610ba2565b606091505b50509050806108a35760405163e2a1cc9160e01b8152600481018590526024016102b8565b6001600160a01b0391909116815260200190565b80356001600160a01b0381168114610bf257600080fd5b919050565b600060208284031215610c0957600080fd5b610c1282610bdb565b9392505050565b60008060408385031215610c2c57600080fd5b610c3583610bdb565b9150610c4360208401610bdb565b90509250929050565b600060208284031215610c5e57600080fd5b5035919050565b600060208284031215610c7757600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b600060208284031215610ca957600080fd5b81518015158114610c1257600080fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610ce257610ce2610cb9565b92915050565b60006020808352835160808285015280518060a086015260005b81811015610d1e5782810184015186820160c001528301610d02565b50600060c08287010152918501516001600160a01b0381166040860152916040860151606086810191909152909501516080850152505050601f91909101601f19160160c00190565b80820180821115610ce257610ce2610cb9565b6000816000190483118215151615610d9457610d94610cb9565b50029056fea2646970667358221220e0ea2019c5695e439e7780f0ae68aaa57f6a16b884970224f812dc8786b0446764736f6c63430008100033",
77
- "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80633e68680a1461003b5780635c911b291461006a575b600080fd5b61004e6100493660046102a5565b61007d565b6040516001600160a01b03909116815260200160405180910390f35b61004e6100783660046102a5565b610145565b60008083836040516020016100939291906102d8565b60405160208183030381529060405280519060200120905060006100d77f0000000000000000000000000000000000000000000000000000000000000000836101ee565b60405163485cc95560e01b81529091506001600160a01b0382169063485cc9559061010890889088906004016102d8565b600060405180830381600087803b15801561012257600080fd5b505af1158015610136573d6000803e3d6000fd5b50929450505050505b92915050565b600080838360405160200161015b9291906102d8565b60408051808303601f190181529082905280516020909101203060388301526f5af43d82803e903d91602b57fd5bf3ff60248301527f00000000000000000000000000000000000000000000000000000000000000006014830152733d602d80600a3d3981f3363d3d373d3d3d363d73825260588201526037600c82012060788201526055604390910120949350505050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b03811661013f5760405162461bcd60e51b8152602060048201526017602482015276115490cc4c4d8dce8818dc99585d194c8819985a5b1959604a1b604482015260640160405180910390fd5b80356001600160a01b03811681146102a057600080fd5b919050565b600080604083850312156102b857600080fd5b6102c183610289565b91506102cf60208401610289565b90509250929050565b6001600160a01b039283168152911660208201526040019056fea2646970667358221220bb79b4c0132ca24f88937fb278b04c69969e89aaf8b91a22adfda79722c30bff64736f6c63430008100033",
71
+ "bytecode": "0x60a060405234801561001057600080fd5b5060405161185a38038061185a83398101604081905261002f916100bf565b8383838360405161003f9061009a565b6001600160a01b039485168152928416602084015290831660408301529091166060820152608001604051809103906000f080158015610083573d6000803e3d6000fd5b506001600160a01b03166080525061011e92505050565b6114208061043a83390190565b6001600160a01b03811681146100bc57600080fd5b50565b600080600080608085870312156100d557600080fd5b84516100e0816100a7565b60208601519094506100f1816100a7565b6040860151909350610102816100a7565b6060860151909250610113816100a7565b939692955090935050565b6080516102fb61013f6000396000818160c2015261015901526102fb6000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063901b96e71461003b5780639ed9331814610064575b600080fd5b61004e610049366004610288565b610077565b60405161005b91906102b1565b60405180910390f35b61004e610072366004610288565b610126565b6000808260405160200161008b91906102b1565b60408051601f198184030181529082905280516020909101203060388301526f5af43d82803e903d91602b57fd5bf3ff60248301527f00000000000000000000000000000000000000000000000000000000000000006014830152733d602d80600a3d3981f3363d3d373d3d3d363d738252605882018190526037600c830120607883015260556043909201919091209091505b9392505050565b6000808260405160200161013a91906102b1565b604051602081830303815290604052805190602001209050600061017e7f0000000000000000000000000000000000000000000000000000000000000000836101e7565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de8906101ad9087906004016102b1565b600060405180830381600087803b1580156101c757600080fd5b505af11580156101db573d6000803e3d6000fd5b50929695505050505050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b0381166102825760405162461bcd60e51b8152602060048201526017602482015276115490cc4c4d8dce8818dc99585d194c8819985a5b1959604a1b604482015260640160405180910390fd5b92915050565b60006020828403121561029a57600080fd5b81356001600160a01b038116811461011f57600080fd5b6001600160a01b039190911681526020019056fea2646970667358221220cfa844f49b93c62e4584a4a5b444f64804aa59393ebf3ad00dcc897551aa2c7964736f6c634300081000336101206040523480156200001257600080fd5b506040516200142038038062001420833981016040819052620000359162000078565b6001600160a01b0393841660805291831660c052821660e052166101005261012c60a052620000e0565b6001600160a01b03811681146200007557600080fd5b50565b600080600080608085870312156200008f57600080fd5b84516200009c816200005f565b6020860151909450620000af816200005f565b6040860151909350620000c2816200005f565b6060860151909250620000d5816200005f565b939692955090935050565b60805160a05160c05160e0516101005161126f620001b1600039600081816101a60152818161049e015261057c015260008181610213015281816105cd015281816108860152610c7d015260008181610102015281816104cf015281816105ab015281816106ba0152818161074f0152818161079e0152818161084e015281816109ae01528181610a580152610c4501526000818161027a015281816104f101526105ef0152600081816102c3015281816107cb0152818161090601528181610b9a0152610cfd015261126f6000f3fe6080604052600436106100a65760003560e01c8063051ed8ef146100b25780630c577bdc146100f05780630cd865ec14610124578063130acf441461014657806377e9acd9146101745780637dc0d1d0146101945780638da5cb5b146101c857806394b918de146101ee578063a5e598fc14610201578063c3683d0a14610235578063c4d66de814610248578063f620732614610268578063f887ea40146102b157600080fd5b366100ad57005b600080fd5b3480156100be57600080fd5b506100da73471ece3750da237f93b8e339c536989b8978a43881565b6040516100e79190610f25565b60405180910390f35b3480156100fc57600080fd5b506100da7f000000000000000000000000000000000000000000000000000000000000000081565b34801561013057600080fd5b5061014461013f366004610f4e565b6102e5565b005b34801561015257600080fd5b50610166610161366004610f72565b61045e565b6040519081526020016100e7565b34801561018057600080fd5b5061014461018f366004610fa2565b610681565b3480156101a057600080fd5b506100da7f000000000000000000000000000000000000000000000000000000000000000081565b3480156101d457600080fd5b506000546100da906201000090046001600160a01b031681565b6101446101fc366004610fa2565b610a31565b34801561020d57600080fd5b506100da7f000000000000000000000000000000000000000000000000000000000000000081565b610144610243366004610fa2565b610af8565b34801561025457600080fd5b50610144610263366004610f4e565b610dfa565b34801561027457600080fd5b5061029c7f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff90911681526020016100e7565b3480156102bd57600080fd5b506100da7f000000000000000000000000000000000000000000000000000000000000000081565b6001600160a01b0381166103775760008054604051620100009091046001600160a01b03169047908381818185875af1925050503d8060008114610345576040519150601f19603f3d011682016040523d82523d6000602084013e61034a565b606091505b50509050806103735760405163e2a1cc9160e01b81524760048201526024015b60405180910390fd5b5050565b6000546040516370a0823160e01b81526001600160a01b038084169263a9059cbb92620100009091049091169083906370a08231906103ba903090600401610f25565b602060405180830381865afa1580156103d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103fb9190610fbb565b6040518363ffffffff1660e01b8152600401610418929190610fd4565b6020604051808303816000875af1158015610437573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103739190610fed565b50565b6000828173471ece3750da237f93b8e339c536989b8978a437196001600160a01b0385160161056557604051630757bc8160e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690630757bc819061051990859088907f0000000000000000000000000000000000000000000000000000000000000000907f00000000000000000000000000000000000000000000000000000000000000009060040161100f565b600060405180830381865afa158015610536573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261055e919081019061106b565b5091508190505b604051630757bc8160e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690630757bc81906106179085907f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000907f00000000000000000000000000000000000000000000000000000000000000009060040161100f565b600060405180830381865afa158015610634573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261065c919081019061106b565b509050606461066c82605f611153565b6106769190611172565b925050505b92915050565b600080546201000090046001600160a01b031633036106a15760006106ab565b67016345785d8a00005b6001600160401b0316905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016107049190610f25565b602060405180830381865afa158015610721573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107459190610fbb565b90506000610773827f000000000000000000000000000000000000000000000000000000000000000061045e565b90508084116107825780610784565b835b60405163095ea7b360e01b81529094506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906107f5907f0000000000000000000000000000000000000000000000000000000000000000908690600401610fd4565b6020604051808303816000875af1158015610814573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108389190610fed565b50604080516080810182526001600160601b03197f0000000000000000000000000000000000000000000000000000000000000000606090811b821660a084015261027160ec1b60b48401527f0000000000000000000000000000000000000000000000000000000000000000901b1660b7820152815180820360ab01815260cb820183528152600080546201000090046001600160a01b031660208301529181016108e48686611194565b815260200186905260405163b858183f60e01b81529091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b858183f9061093b9084906004016111a7565b6020604051808303816000875af115801561095a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097e9190610fbb565b506000546201000090046001600160a01b03163314610a2a5760405163a9059cbb60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906109e59033908890600401610fd4565b6020604051808303816000875af1158015610a04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a289190610fed565b505b5050505050565b478015610a415761037382610af8565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190610a8d903090600401610f25565b602060405180830381865afa158015610aaa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ace9190610fbb565b90508015610adf5761037382610681565b60405163701b93d160e11b815260040160405180910390fd5b600080546201000090046001600160a01b03163314610b3157610b1f48633b9aca00611226565b610b2c9062061a80611153565b610b34565b60005b9050476000610b578273471ece3750da237f93b8e339c536989b8978a43861045e565b9050808411610b665780610b68565b835b60405163095ea7b360e01b815290945073471ece3750da237f93b8e339c536989b8978a4389063095ea7b390610bc4907f0000000000000000000000000000000000000000000000000000000000000000908690600401610fd4565b6020604051808303816000875af1158015610be3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c079190610fed565b50604080516080810182527308e3d9c6ea1b446ff2771c6738a6d313712f148760631b60a082015261017760eb1b60b48201526001600160601b03197f0000000000000000000000000000000000000000000000000000000000000000606090811b821660b784015261027160ec1b60cb8401527f0000000000000000000000000000000000000000000000000000000000000000901b1660ce820152815180820360c201815260e2820183528152600080546201000090046001600160a01b03166020830152918101610cdb8686611194565b815260200186905260405163b858183f60e01b81529091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063b858183f90610d329084906004016111a7565b6020604051808303816000875af1158015610d51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d759190610fbb565b506000546201000090046001600160a01b03163314610a2a57604051600090339086908381818185875af1925050503d8060008114610dd0576040519150601f19603f3d011682016040523d82523d6000602084013e610dd5565b606091505b5050905080610a285760405163e2a1cc9160e01b81526004810186905260240161036a565b600054610100900460ff1615808015610e1a5750600054600160ff909116105b80610e345750303b158015610e34575060005460ff166001145b610e975760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161036a565b6000805460ff191660011790558015610eba576000805461ff0019166101001790555b6000805462010000600160b01b031916620100006001600160a01b038516021790558015610373576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6001600160a01b0391909116815260200190565b6001600160a01b038116811461045b57600080fd5b600060208284031215610f6057600080fd5b8135610f6b81610f39565b9392505050565b60008060408385031215610f8557600080fd5b823591506020830135610f9781610f39565b809150509250929050565b600060208284031215610fb457600080fd5b5035919050565b600060208284031215610fcd57600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b600060208284031215610fff57600080fd5b81518015158114610f6b57600080fd5b6001600160801b039490941684526001600160a01b0392831660208501529116604083015263ffffffff16606082015260800190565b634e487b7160e01b600052604160045260246000fd5b805161106681610f39565b919050565b6000806040838503121561107e57600080fd5b8251602080850151919350906001600160401b038082111561109f57600080fd5b818601915086601f8301126110b357600080fd5b8151818111156110c5576110c5611045565b8060051b604051601f19603f830116810181811085821117156110ea576110ea611045565b60405291825284820192508381018501918983111561110857600080fd5b938501935b8285101561112d5761111e8561105b565b8452938501939285019261110d565b8096505050505050509250929050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561116d5761116d61113d565b500290565b60008261118f57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561067b5761067b61113d565b60006020808352835160808285015280518060a086015260005b818110156111dd5782810184015186820160c0015283016111c1565b50600060c08287010152918501516001600160a01b0381166040860152916040860151606086810191909152909501516080850152505050601f91909101601f19160160c00190565b8082018082111561067b5761067b61113d56fea2646970667358221220ba1dccba0e8d51fbfd40d3cf5d797df82a47de3edf9b7e2205bd7bb17f7eb92864736f6c63430008100033",
72
+ "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063901b96e71461003b5780639ed9331814610064575b600080fd5b61004e610049366004610288565b610077565b60405161005b91906102b1565b60405180910390f35b61004e610072366004610288565b610126565b6000808260405160200161008b91906102b1565b60408051601f198184030181529082905280516020909101203060388301526f5af43d82803e903d91602b57fd5bf3ff60248301527f00000000000000000000000000000000000000000000000000000000000000006014830152733d602d80600a3d3981f3363d3d373d3d3d363d738252605882018190526037600c830120607883015260556043909201919091209091505b9392505050565b6000808260405160200161013a91906102b1565b604051602081830303815290604052805190602001209050600061017e7f0000000000000000000000000000000000000000000000000000000000000000836101e7565b60405163189acdbd60e31b81529091506001600160a01b0382169063c4d66de8906101ad9087906004016102b1565b600060405180830381600087803b1580156101c757600080fd5b505af11580156101db573d6000803e3d6000fd5b50929695505050505050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b0381166102825760405162461bcd60e51b8152602060048201526017602482015276115490cc4c4d8dce8818dc99585d194c8819985a5b1959604a1b604482015260640160405180910390fd5b92915050565b60006020828403121561029a57600080fd5b81356001600160a01b038116811461011f57600080fd5b6001600160a01b039190911681526020019056fea2646970667358221220cfa844f49b93c62e4584a4a5b444f64804aa59393ebf3ad00dcc897551aa2c7964736f6c63430008100033",
78
73
  "linkReferences": {},
79
74
  "deployedLinkReferences": {}
80
75
  }
@@ -0,0 +1,4 @@
1
+ {
2
+ "_format": "hh-sol-dbg-1",
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "IStaticOracle",
4
+ "sourceName": "contracts/utils/BuyGDClone.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "address",
10
+ "name": "tokenA",
11
+ "type": "address"
12
+ },
13
+ {
14
+ "internalType": "address",
15
+ "name": "tokenB",
16
+ "type": "address"
17
+ },
18
+ {
19
+ "internalType": "uint16",
20
+ "name": "cardinality",
21
+ "type": "uint16"
22
+ }
23
+ ],
24
+ "name": "prepareAllAvailablePoolsWithCardinality",
25
+ "outputs": [
26
+ {
27
+ "internalType": "address[]",
28
+ "name": "preparedPools",
29
+ "type": "address[]"
30
+ }
31
+ ],
32
+ "stateMutability": "nonpayable",
33
+ "type": "function"
34
+ },
35
+ {
36
+ "inputs": [
37
+ {
38
+ "internalType": "uint128",
39
+ "name": "baseAmount",
40
+ "type": "uint128"
41
+ },
42
+ {
43
+ "internalType": "address",
44
+ "name": "baseToken",
45
+ "type": "address"
46
+ },
47
+ {
48
+ "internalType": "address",
49
+ "name": "quoteToken",
50
+ "type": "address"
51
+ },
52
+ {
53
+ "internalType": "uint32",
54
+ "name": "period",
55
+ "type": "uint32"
56
+ }
57
+ ],
58
+ "name": "quoteAllAvailablePoolsWithTimePeriod",
59
+ "outputs": [
60
+ {
61
+ "internalType": "uint256",
62
+ "name": "quoteAmount",
63
+ "type": "uint256"
64
+ },
65
+ {
66
+ "internalType": "address[]",
67
+ "name": "queriedPools",
68
+ "type": "address[]"
69
+ }
70
+ ],
71
+ "stateMutability": "view",
72
+ "type": "function"
73
+ }
74
+ ],
75
+ "bytecode": "0x",
76
+ "deployedBytecode": "0x",
77
+ "linkReferences": {},
78
+ "deployedLinkReferences": {}
79
+ }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/477a426513f742b063a1272cb54d7c4c.json"
3
+ "buildInfo": "../../../build-info/a06ba67080fcf9812b1cc1a2062deb7e.json"
4
4
  }
@@ -93,7 +93,6 @@ contract Faucet is Initializable, UUPSUpgradeable, AccessControlUpgradeable {
93
93
  modifier onlyAuthorized(address toTop) {
94
94
  require(
95
95
  getIdentity().getWhitelistedRoot(toTop) != address(0) ||
96
- getIdentity().getWhitelistedRoot(msg.sender) != address(0) ||
97
96
  hasRole(RELAYER_ROLE, msg.sender),
98
97
  "not authorized"
99
98
  );
@@ -119,7 +119,6 @@ contract FuseFaucetV2 is Initializable {
119
119
  modifier onlyAuthorized(address toTop) {
120
120
  require(
121
121
  getIdentity().getWhitelistedRoot(toTop) != address(0) ||
122
- getIdentity().getWhitelistedRoot(msg.sender) != address(0) ||
123
122
  msg.sender == relayer,
124
123
  "not authorized"
125
124
  );
@@ -5,6 +5,38 @@ import "@openzeppelin/contracts-upgradeable/proxy/ClonesUpgradeable.sol";
5
5
  import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
6
6
  import "../Interfaces.sol";
7
7
 
8
+ //@mean-finance/uniswap-v3-oracle
9
+ interface IStaticOracle {
10
+ /// @notice Will increase observations for all existing pools for the given pair, so they start accruing information for twap calculations
11
+ /// @dev Will revert if there are no pools available for the pair and period combination
12
+ /// @param tokenA One of the pair's tokens
13
+ /// @param tokenB The other of the pair's tokens
14
+ /// @param cardinality The cardinality that will be guaranteed when quoting
15
+ /// @return preparedPools The pools that were prepared
16
+ function prepareAllAvailablePoolsWithCardinality(
17
+ address tokenA,
18
+ address tokenB,
19
+ uint16 cardinality
20
+ ) external returns (address[] memory preparedPools);
21
+
22
+ /// @notice Returns a quote, based on the given tokens and amount, by querying all of the pair's pools
23
+ /// @dev If some pools are not configured correctly for the given period, then they will be ignored
24
+ /// @dev Will revert if there are no pools available/configured for the pair and period combination
25
+ /// @param baseAmount Amount of token to be converted
26
+ /// @param baseToken Address of an ERC20 token contract used as the baseAmount denomination
27
+ /// @param quoteToken Address of an ERC20 token contract used as the quoteAmount denomination
28
+ /// @param period Number of seconds from which to calculate the TWAP
29
+ /// @return quoteAmount Amount of quoteToken received for baseAmount of baseToken
30
+ /// @return queriedPools The pools that were queried to calculate the quote
31
+ function quoteAllAvailablePoolsWithTimePeriod(
32
+ uint128 baseAmount,
33
+ address baseToken,
34
+ address quoteToken,
35
+ uint32 period
36
+ ) external view returns (uint256 quoteAmount, address[] memory queriedPools);
37
+ }
38
+
39
+ // @uniswap/v3-core
8
40
  interface ISwapRouter {
9
41
  struct ExactInputSingleParams {
10
42
  address tokenIn;
@@ -75,36 +107,75 @@ interface ISwapRouter {
75
107
  ) external payable returns (uint256 amountIn);
76
108
  }
77
109
 
110
+ /*
111
+ * @title BuyGDClone
112
+ * @notice This contract allows users to swap Celo or cUSD for GoodDollar (GD) tokens.
113
+ * @dev This contract is a clone of the BuyGD contract, which is used to buy GD tokens on the GoodDollar platform.
114
+ * @dev This contract uses the SwapRouter contract to perform the swaps.
115
+ */
78
116
  contract BuyGDClone is Initializable {
79
- error NOT_ALLOWED(address);
80
117
  error REFUND_FAILED(uint256);
118
+ error NO_BALANCE();
81
119
 
82
120
  ISwapRouter public immutable router;
83
121
  address public constant celo = 0x471EcE3750Da237f93B8E339c536989b8978a438;
122
+ uint32 public immutable twapPeriod;
84
123
  address public immutable cusd;
85
124
  address public immutable gd;
125
+ IStaticOracle public immutable oracle;
86
126
 
87
127
  address public owner;
88
- address public executer;
89
128
 
90
129
  receive() external payable {}
91
130
 
92
- constructor(ISwapRouter _router, address _cusd, address _gd) {
131
+ constructor(
132
+ ISwapRouter _router,
133
+ address _cusd,
134
+ address _gd,
135
+ IStaticOracle _oracle
136
+ ) {
93
137
  router = _router;
94
138
  cusd = _cusd;
95
139
  gd = _gd;
140
+ oracle = _oracle;
141
+ twapPeriod = 300; //5 minutes
96
142
  }
97
143
 
98
- function initialize(address _owner, address _executer) external initializer {
144
+ /**
145
+ * @notice Initializes the contract with the owner's address.
146
+ * @param _owner The address of the owner of the contract.
147
+ */
148
+ function initialize(address _owner) external initializer {
99
149
  owner = _owner;
100
- executer = _executer;
101
150
  }
102
151
 
103
- function swap(uint256 _minAmount) external {
152
+ /**
153
+ * @notice Swaps either Celo or cUSD for GD tokens.
154
+ * @dev If the contract has a balance of Celo, it will swap Celo for GD tokens.
155
+ * @dev If the contract has a balance of cUSD, it will swap cUSD for GD tokens.
156
+ * @param _minAmount The minimum amount of GD tokens to receive from the swap.
157
+ */
158
+ function swap(uint256 _minAmount) external payable {
159
+ uint256 balance = address(this).balance;
160
+ if (balance > 0) return swapCelo(_minAmount);
161
+
162
+ balance = ERC20(cusd).balanceOf(address(this));
163
+ if (balance > 0) return swapCusd(_minAmount);
164
+
165
+ revert NO_BALANCE();
166
+ }
167
+
168
+ /**
169
+ * @notice Swaps Celo for GD tokens.
170
+ * @param _minAmount The minimum amount of GD tokens to receive from the swap.
171
+ */
172
+ function swapCelo(uint256 _minAmount) public payable {
104
173
  uint256 gasCosts = msg.sender == owner ? 0 : (block.basefee + 1e9) * 400000;
105
- if (msg.sender != owner && msg.sender != executer)
106
- revert NOT_ALLOWED(msg.sender);
107
174
  uint256 balance = address(this).balance;
175
+
176
+ uint256 minByTwap = minAmountByTWAP(balance, celo);
177
+ _minAmount = _minAmount > minByTwap ? _minAmount : minByTwap;
178
+
108
179
  ERC20(celo).approve(address(router), balance);
109
180
  ISwapRouter.ExactInputParams memory params = ISwapRouter.ExactInputParams({
110
181
  path: abi.encodePacked(celo, uint24(3000), cusd, uint24(10000), gd),
@@ -119,11 +190,17 @@ contract BuyGDClone is Initializable {
119
190
  }
120
191
  }
121
192
 
122
- function swapCusd(uint256 _minAmount) external {
123
- uint256 gasCosts = msg.sender == executer ? 1e17 : 0;
124
- if (msg.sender != owner && msg.sender != executer)
125
- revert NOT_ALLOWED(msg.sender);
193
+ /**
194
+ * @notice Swaps cUSD for GD tokens.
195
+ * @param _minAmount The minimum amount of GD tokens to receive from the swap.
196
+ */
197
+ function swapCusd(uint256 _minAmount) public {
198
+ uint256 gasCosts = msg.sender != owner ? 1e17 : 0; //fixed 0.1$
126
199
  uint balance = ERC20(cusd).balanceOf(address(this));
200
+
201
+ uint256 minByTwap = minAmountByTWAP(balance, cusd);
202
+ _minAmount = _minAmount > minByTwap ? _minAmount : minByTwap;
203
+
127
204
  ERC20(cusd).approve(address(router), balance);
128
205
  ISwapRouter.ExactInputParams memory params = ISwapRouter.ExactInputParams({
129
206
  path: abi.encodePacked(cusd, uint24(10000), gd),
@@ -132,38 +209,99 @@ contract BuyGDClone is Initializable {
132
209
  amountOutMinimum: _minAmount
133
210
  });
134
211
  router.exactInput(params);
135
- if (msg.sender == executer) {
212
+ if (msg.sender != owner) {
136
213
  ERC20(cusd).transfer(msg.sender, gasCosts);
137
214
  }
138
215
  }
139
216
 
217
+ /**
218
+ * @notice Calculates the minimum amount of tokens that can be received for a given amount of base tokens,
219
+ * based on the time-weighted average price (TWAP) of the token pair over a specified period of time.
220
+ * @param baseAmount The amount of base tokens to swap.
221
+ * @param baseToken The address of the base token.
222
+ * @return minTwap The minimum amount of G$ expected to receive by twap
223
+ */
224
+ function minAmountByTWAP(
225
+ uint256 baseAmount,
226
+ address baseToken
227
+ ) public view returns (uint256 minTwap) {
228
+ uint128 toConvert = uint128(baseAmount);
229
+ uint256 quote;
230
+ if (baseToken == celo) {
231
+ (quote, ) = oracle.quoteAllAvailablePoolsWithTimePeriod(
232
+ toConvert,
233
+ baseToken,
234
+ cusd,
235
+ twapPeriod
236
+ );
237
+ toConvert = uint128(quote);
238
+ }
239
+ (quote, ) = oracle.quoteAllAvailablePoolsWithTimePeriod(
240
+ toConvert,
241
+ cusd,
242
+ gd,
243
+ twapPeriod
244
+ );
245
+ //minAmount should not be 5% under twap (ie we dont expect price movement > 5% in timePeriod)
246
+ return (quote * 95) / 100;
247
+ }
248
+
249
+ /**
250
+ * @notice Recovers tokens accidentally sent to the contract.
251
+ * @param token The address of the token to recover. Use address(0) to recover ETH.
252
+ */
140
253
  function recover(address token) external {
141
254
  if (token == address(0)) {
142
255
  (bool sent, ) = payable(owner).call{ value: address(this).balance }("");
143
256
  if (!sent) revert REFUND_FAILED(address(this).balance);
144
- } else ERC20(token).transfer(owner, ERC20(token).balanceOf(address(this)));
257
+ } else {
258
+ ERC20(token).transfer(owner, ERC20(token).balanceOf(address(this)));
259
+ }
145
260
  }
146
261
  }
147
262
 
263
+ /**
264
+ * @title BuyGDCloneFactory
265
+ * @notice Factory contract for creating clones of BuyGDClone contract
266
+ */
148
267
  contract BuyGDCloneFactory {
149
268
  address immutable impl;
150
269
 
151
- constructor(ISwapRouter _router, address _cusd, address _gd) {
152
- impl = address(new BuyGDClone(_router, _cusd, _gd));
270
+ /**
271
+ * @notice Initializes the BuyGDCloneFactory contract with the provided parameters.
272
+ * @param _router The address of the SwapRouter contract.
273
+ * @param _cusd The address of the cUSD token contract.
274
+ * @param _gd The address of the GD token contract.
275
+ * @param _oracle The address of the StaticOracle contract.
276
+ */
277
+ constructor(
278
+ ISwapRouter _router,
279
+ address _cusd,
280
+ address _gd,
281
+ IStaticOracle _oracle
282
+ ) {
283
+ impl = address(new BuyGDClone(_router, _cusd, _gd, _oracle));
153
284
  }
154
285
 
155
- function create(address owner, address executer) external returns (address) {
156
- bytes32 salt = keccak256(abi.encode(owner, executer));
286
+ /**
287
+ * @notice Creates a new clone of the BuyGDClone contract with the provided owner address.
288
+ * @param owner The address of the owner of the new BuyGDClone contract.
289
+ * @return The address of the new BuyGDClone contract.
290
+ */
291
+ function create(address owner) external returns (address) {
292
+ bytes32 salt = keccak256(abi.encode(owner));
157
293
  address clone = ClonesUpgradeable.cloneDeterministic(impl, salt);
158
- BuyGDClone(payable(clone)).initialize(owner, executer);
294
+ BuyGDClone(payable(clone)).initialize(owner);
159
295
  return clone;
160
296
  }
161
297
 
162
- function predict(
163
- address owner,
164
- address executer
165
- ) external view returns (address) {
166
- bytes32 salt = keccak256(abi.encode(owner, executer));
298
+ /**
299
+ * @notice Predicts the address of a new clone of the BuyGDClone contract with the provided owner address.
300
+ * @param owner The address of the owner of the new BuyGDClone contract.
301
+ * @return The predicted address of the new BuyGDClone contract.
302
+ */
303
+ function predict(address owner) external view returns (address) {
304
+ bytes32 salt = keccak256(abi.encode(owner));
167
305
 
168
306
  return
169
307
  ClonesUpgradeable.predictDeterministicAddress(impl, salt, address(this));
package/hardhat.config.ts CHANGED
@@ -37,8 +37,9 @@ const MAINNET_URL = "https://mainnet.infura.io/v3/" + infura_api;
37
37
 
38
38
  const goerli = {
39
39
  accounts: { mnemonic },
40
- url: "https://rpc.ankr.com/eth_goerli",
40
+ url: "https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161",
41
41
  gas: 3000000,
42
+ gasPrice: 2e9,
42
43
  chainId: 5
43
44
  };
44
45