@gooddollar/goodprotocol 2.0.5-beta.1 → 2.0.5-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/abis/OneTimePaymentsV2.min.json +1 -0
- package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
- package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
- package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
- package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
- package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
- package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
- package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
- package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
- package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
- package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
- package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
- package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
- package/artifacts/contracts/token/FeesFormula.sol/IFeesFormula.dbg.json +1 -1
- package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +2 -2
- package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
- package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
- package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
- package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +4 -0
- package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.json +316 -0
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
- package/contracts/token/superfluid/SuperGoodDollar.sol +16 -22
- package/contracts/utils/OneTimePaymentsV2.sol +172 -0
- package/hardhat.config.ts +11 -1
- package/package.json +3 -3
- package/releases/deploy-settings.json +6 -0
- package/releases/deployment.json +18 -2
- package/scripts/multichain-deploy/1_basicdao-deploy.ts +34 -94
- package/scripts/multichain-deploy/2b_otp-deploy.ts +4 -4
- package/scripts/multichain-deploy/helpers.ts +4 -4
- package/truffle-config.js +6 -0
- package/types/OneTimePaymentsV2.ts +456 -0
- package/types/factories/OneTimePaymentsV2__factory.ts +369 -0
- package/types/factories/SuperGoodDollar__factory.ts +1 -1
- package/types/hardhat.d.ts +9 -0
- package/types/index.ts +2 -0
- package/yarn.lock +360 -249
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_format": "hh-sol-artifact-1",
|
|
3
|
+
"contractName": "OneTimePaymentsV2",
|
|
4
|
+
"sourceName": "contracts/utils/OneTimePaymentsV2.sol",
|
|
5
|
+
"abi": [
|
|
6
|
+
{
|
|
7
|
+
"inputs": [
|
|
8
|
+
{
|
|
9
|
+
"internalType": "contract INameService",
|
|
10
|
+
"name": "_ns",
|
|
11
|
+
"type": "address"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"stateMutability": "nonpayable",
|
|
15
|
+
"type": "constructor"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"anonymous": false,
|
|
19
|
+
"inputs": [
|
|
20
|
+
{
|
|
21
|
+
"indexed": true,
|
|
22
|
+
"internalType": "address",
|
|
23
|
+
"name": "from",
|
|
24
|
+
"type": "address"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"indexed": false,
|
|
28
|
+
"internalType": "address",
|
|
29
|
+
"name": "paymentId",
|
|
30
|
+
"type": "address"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"indexed": false,
|
|
34
|
+
"internalType": "uint256",
|
|
35
|
+
"name": "amount",
|
|
36
|
+
"type": "uint256"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"indexed": false,
|
|
40
|
+
"internalType": "address",
|
|
41
|
+
"name": "asset",
|
|
42
|
+
"type": "address"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"name": "PaymentCancel",
|
|
46
|
+
"type": "event"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"anonymous": false,
|
|
50
|
+
"inputs": [
|
|
51
|
+
{
|
|
52
|
+
"indexed": true,
|
|
53
|
+
"internalType": "address",
|
|
54
|
+
"name": "from",
|
|
55
|
+
"type": "address"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"indexed": false,
|
|
59
|
+
"internalType": "address",
|
|
60
|
+
"name": "paymentId",
|
|
61
|
+
"type": "address"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"indexed": false,
|
|
65
|
+
"internalType": "uint256",
|
|
66
|
+
"name": "amount",
|
|
67
|
+
"type": "uint256"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"indexed": false,
|
|
71
|
+
"internalType": "address",
|
|
72
|
+
"name": "asset",
|
|
73
|
+
"type": "address"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"name": "PaymentDeposit",
|
|
77
|
+
"type": "event"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"anonymous": false,
|
|
81
|
+
"inputs": [
|
|
82
|
+
{
|
|
83
|
+
"indexed": true,
|
|
84
|
+
"internalType": "address",
|
|
85
|
+
"name": "from",
|
|
86
|
+
"type": "address"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"indexed": true,
|
|
90
|
+
"internalType": "address",
|
|
91
|
+
"name": "to",
|
|
92
|
+
"type": "address"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"indexed": true,
|
|
96
|
+
"internalType": "address",
|
|
97
|
+
"name": "paymentId",
|
|
98
|
+
"type": "address"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"indexed": false,
|
|
102
|
+
"internalType": "uint256",
|
|
103
|
+
"name": "amount",
|
|
104
|
+
"type": "uint256"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"indexed": false,
|
|
108
|
+
"internalType": "address",
|
|
109
|
+
"name": "asset",
|
|
110
|
+
"type": "address"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"name": "PaymentWithdraw",
|
|
114
|
+
"type": "event"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"inputs": [],
|
|
118
|
+
"name": "avatar",
|
|
119
|
+
"outputs": [
|
|
120
|
+
{
|
|
121
|
+
"internalType": "address",
|
|
122
|
+
"name": "",
|
|
123
|
+
"type": "address"
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"stateMutability": "view",
|
|
127
|
+
"type": "function"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"inputs": [
|
|
131
|
+
{
|
|
132
|
+
"internalType": "address",
|
|
133
|
+
"name": "paymentId",
|
|
134
|
+
"type": "address"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"name": "cancel",
|
|
138
|
+
"outputs": [],
|
|
139
|
+
"stateMutability": "nonpayable",
|
|
140
|
+
"type": "function"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"inputs": [],
|
|
144
|
+
"name": "dao",
|
|
145
|
+
"outputs": [
|
|
146
|
+
{
|
|
147
|
+
"internalType": "contract Controller",
|
|
148
|
+
"name": "",
|
|
149
|
+
"type": "address"
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"stateMutability": "view",
|
|
153
|
+
"type": "function"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"inputs": [
|
|
157
|
+
{
|
|
158
|
+
"internalType": "address",
|
|
159
|
+
"name": "paymentId",
|
|
160
|
+
"type": "address"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"internalType": "address",
|
|
164
|
+
"name": "asset",
|
|
165
|
+
"type": "address"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"internalType": "uint256",
|
|
169
|
+
"name": "value",
|
|
170
|
+
"type": "uint256"
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
"name": "depositAsset",
|
|
174
|
+
"outputs": [],
|
|
175
|
+
"stateMutability": "payable",
|
|
176
|
+
"type": "function"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"inputs": [
|
|
180
|
+
{
|
|
181
|
+
"internalType": "address",
|
|
182
|
+
"name": "paymentId",
|
|
183
|
+
"type": "address"
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
"name": "hasPayment",
|
|
187
|
+
"outputs": [
|
|
188
|
+
{
|
|
189
|
+
"internalType": "bool",
|
|
190
|
+
"name": "",
|
|
191
|
+
"type": "bool"
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
"stateMutability": "view",
|
|
195
|
+
"type": "function"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"inputs": [],
|
|
199
|
+
"name": "nameService",
|
|
200
|
+
"outputs": [
|
|
201
|
+
{
|
|
202
|
+
"internalType": "contract INameService",
|
|
203
|
+
"name": "",
|
|
204
|
+
"type": "address"
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
"stateMutability": "view",
|
|
208
|
+
"type": "function"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"inputs": [],
|
|
212
|
+
"name": "nativeToken",
|
|
213
|
+
"outputs": [
|
|
214
|
+
{
|
|
215
|
+
"internalType": "contract IGoodDollar",
|
|
216
|
+
"name": "",
|
|
217
|
+
"type": "address"
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
"stateMutability": "view",
|
|
221
|
+
"type": "function"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"inputs": [
|
|
225
|
+
{
|
|
226
|
+
"internalType": "address",
|
|
227
|
+
"name": "sender",
|
|
228
|
+
"type": "address"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"internalType": "uint256",
|
|
232
|
+
"name": "value",
|
|
233
|
+
"type": "uint256"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"internalType": "bytes",
|
|
237
|
+
"name": "data",
|
|
238
|
+
"type": "bytes"
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
"name": "onTokenTransfer",
|
|
242
|
+
"outputs": [
|
|
243
|
+
{
|
|
244
|
+
"internalType": "bool",
|
|
245
|
+
"name": "",
|
|
246
|
+
"type": "bool"
|
|
247
|
+
}
|
|
248
|
+
],
|
|
249
|
+
"stateMutability": "nonpayable",
|
|
250
|
+
"type": "function"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"inputs": [
|
|
254
|
+
{
|
|
255
|
+
"internalType": "address",
|
|
256
|
+
"name": "",
|
|
257
|
+
"type": "address"
|
|
258
|
+
}
|
|
259
|
+
],
|
|
260
|
+
"name": "payments",
|
|
261
|
+
"outputs": [
|
|
262
|
+
{
|
|
263
|
+
"internalType": "bool",
|
|
264
|
+
"name": "hasPayment",
|
|
265
|
+
"type": "bool"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"internalType": "uint256",
|
|
269
|
+
"name": "paymentAmount",
|
|
270
|
+
"type": "uint256"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"internalType": "address",
|
|
274
|
+
"name": "paymentSender",
|
|
275
|
+
"type": "address"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"internalType": "address",
|
|
279
|
+
"name": "asset",
|
|
280
|
+
"type": "address"
|
|
281
|
+
}
|
|
282
|
+
],
|
|
283
|
+
"stateMutability": "view",
|
|
284
|
+
"type": "function"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"inputs": [],
|
|
288
|
+
"name": "updateAvatar",
|
|
289
|
+
"outputs": [],
|
|
290
|
+
"stateMutability": "nonpayable",
|
|
291
|
+
"type": "function"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"inputs": [
|
|
295
|
+
{
|
|
296
|
+
"internalType": "address",
|
|
297
|
+
"name": "paymentId",
|
|
298
|
+
"type": "address"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"internalType": "bytes",
|
|
302
|
+
"name": "signature",
|
|
303
|
+
"type": "bytes"
|
|
304
|
+
}
|
|
305
|
+
],
|
|
306
|
+
"name": "withdraw",
|
|
307
|
+
"outputs": [],
|
|
308
|
+
"stateMutability": "nonpayable",
|
|
309
|
+
"type": "function"
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
"bytecode": "0x60806040523480156200001157600080fd5b506040516200130f3803806200130f8339810160408190526200003491620001b1565b6200003f8162000046565b50620001d8565b600280546001600160a01b0319166001600160a01b0383161790556200006b6200006e565b50565b60025460405163bf40fac160e01b815260206004820152600a60248201526921a7a72a2927a62622a960b11b60448201526001600160a01b039091169063bf40fac190606401602060405180830381865afa158015620000d2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000f89190620001b1565b600080546001600160a01b0319166001600160a01b0392909216918217905560408051632d77bef360e11b81529051635aef7de6916004808201926020929091908290030181865afa15801562000153573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001799190620001b1565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03811681146200006b57600080fd5b600060208284031215620001c457600080fd5b8151620001d1816200019b565b9392505050565b61112780620001e86000396000f3fe60806040526004361061008c5760003560e01c80631b3c90a8146100915780633e6326fc146100a85780634162169f146100e55780634bb78b14146101055780634c33fe94146101255780635aef7de61461014557806399fa169a146101655780639ea7811614610178578063a4c0ed36146101c1578063e1758bd8146101e1578063e2982c21146101f6575b600080fd5b34801561009d57600080fd5b506100a661027a565b005b3480156100b457600080fd5b506002546100c8906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100f157600080fd5b506000546100c8906001600160a01b031681565b34801561011157600080fd5b506100a6610120366004610e77565b6103a1565b34801561013157600080fd5b506100a6610140366004610f3a565b61049f565b34801561015157600080fd5b506001546100c8906001600160a01b031681565b6100a6610173366004610f5e565b610587565b34801561018457600080fd5b506101b1610193366004610f3a565b6001600160a01b031660009081526035602052604090205460ff1690565b60405190151581526020016100dc565b3480156101cd57600080fd5b506101b16101dc366004610f9f565b610784565b3480156101ed57600080fd5b506100c86108eb565b34801561020257600080fd5b50610249610211366004610f3a565b603560205260009081526040902080546001820154600283015460039093015460ff9092169290916001600160a01b03918216911684565b60408051941515855260208501939093526001600160a01b03918216928401929092521660608201526080016100dc565b60025460405163bf40fac160e01b815260206004820152600a60248201526921a7a72a2927a62622a960b11b60448201526001600160a01b039091169063bf40fac190606401602060405180830381865afa1580156102dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103019190611027565b600080546001600160a01b0319166001600160a01b0392909216918217905560408051632d77bef360e11b81529051635aef7de6916004808201926020929091908290030181865afa15801561035b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061037f9190611027565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006103ad3383610978565b9050826001600160a01b0316816001600160a01b0316146104105760405162461bcd60e51b815260206004820152601860248201527714da59db985d1d5c99481a5cc81b9bdd0818dbdc9c9958dd60421b60448201526064015b60405180910390fd5b6001600160a01b038084166000908152603560205260409020600181015460028201546003909201549092918216911661044b868483610a07565b604080518481526001600160a01b038381166020830152808916923392918616917fc75e7bc3dc5e0d16e3df9df2689b6a26e490567bd567066ce9cdacc19507124a910160405180910390a4505050505050565b6001600160a01b0381811660009081526035602052604090206002015416331461050b5760405162461bcd60e51b815260206004820152601d60248201527f43616e206f6e6c792062652063616c6c65642062792063726561746f720000006044820152606401610407565b6001600160a01b038082166000908152603560205260409020600181015460039091015490911661053d838383610a07565b336001600160a01b03167f277bedca6530994c2b7997a918461bf3c20dc35ad66561a387316ddcbeb5343884848460405161057a93929190611044565b60405180910390a2505050565b6001600160a01b03831660009081526035602052604090205460ff16156105c05760405162461bcd60e51b815260040161040790611067565b6001600160a01b0382161561068e576040516323b872dd60e01b8152336004820152306024820152604481018290526001600160a01b038316906323b872dd906064016020604051808303816000875af1158015610622573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106469190611099565b6106895760405162461bcd60e51b8152602060048201526014602482015273185cdcd95d0819195c1bdcda5d0819985a5b195960621b6044820152606401610407565b6106d9565b600034116106d65760405162461bcd60e51b81526020600482015260156024820152741b985d1a5d994819195c1bdcda5d0819985a5b1959605a1b6044820152606401610407565b50345b6040805160808101825260018082526020808301858152338486018181526001600160a01b03898116606088019081528b821660009081526035909652948890209651875460ff191690151517875592519486019490945592516002850180546001600160a01b031990811692841692909217905591516003909401805490921693169290921790915590516000805160206110d28339815191529061057a90869085908790611044565b60008061079383850185610f3a565b6001600160a01b03811660009081526035602052604090205490915060ff16156107cf5760405162461bcd60e51b815260040161040790611067565b6107d76108eb565b6001600160a01b0316336001600160a01b03161461082f5760405162461bcd60e51b81526020600482015260156024820152744f6e6c792063616c6c61626c65206279207468697360581b6044820152606401610407565b60408051608081018252600180825260208083018981526001600160a01b038b811685870181815233606088018181528a851660009081526035909752958990209751885460ff191690151517885593519587019590955593516002860180546001600160a01b0319908116928416929092179055925160039095018054909316941693909317905591516000805160206110d2833981519152916108d79185918a91611044565b60405180910390a250600195945050505050565b60025460405163bf40fac160e01b815260206004820152600a60248201526923a7a7a22227a62620a960b11b60448201526000916001600160a01b03169063bf40fac190606401602060405180830381865afa15801561094f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109739190611027565b905090565b60408051606084901b6001600160601b031916602080830191909152825160148184030181526034830184528051908201207b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b6054840152607080840191909152835180840390910181526090909201909252805191012060009060006109fe8285610be1565b95945050505050565b6001600160a01b03831660009081526035602052604090205460ff16610a665760405162461bcd60e51b81526020600482015260146024820152737061796d656e744964206e6f7420696e2075736560601b6044820152606401610407565b6001600160a01b038084166000908152603560205260409020805460ff191690558116610b2457604051600090339084908381818185875af1925050503d8060008114610acf576040519150601f19603f3d011682016040523d82523d6000602084013e610ad4565b606091505b5050905080610b1e5760405162461bcd60e51b81526020600482015260166024820152751dda5d1a191c985dc81b985d1a5d994819985a5b195960521b6044820152606401610407565b50505050565b60405163a9059cbb60e01b8152336004820152602481018390526001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610b71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b959190611099565b610bdc5760405162461bcd60e51b81526020600482015260186024820152771dda5d1a191c985dc81d1c985b9cd9995c8819985a5b195960421b6044820152606401610407565b505050565b6000806000610bf08585610c05565b91509150610bfd81610c4a565b509392505050565b6000808251604103610c3b5760208301516040840151606085015160001a610c2f87828585610d92565b94509450505050610c43565b506000905060025b9250929050565b6000816004811115610c5e57610c5e6110bb565b03610c665750565b6001816004811115610c7a57610c7a6110bb565b03610cc25760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606401610407565b6002816004811115610cd657610cd66110bb565b03610d235760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610407565b6003816004811115610d3757610d376110bb565b03610d8f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610407565b50565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03831115610dbf5750600090506003610e43565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610e13573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610e3c57600060019250925050610e43565b9150600090505b94509492505050565b6001600160a01b0381168114610d8f57600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610e8a57600080fd5b8235610e9581610e4c565b915060208301356001600160401b0380821115610eb157600080fd5b818501915085601f830112610ec557600080fd5b813581811115610ed757610ed7610e61565b604051601f8201601f19908116603f01168101908382118183101715610eff57610eff610e61565b81604052828152886020848701011115610f1857600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600060208284031215610f4c57600080fd5b8135610f5781610e4c565b9392505050565b600080600060608486031215610f7357600080fd5b8335610f7e81610e4c565b92506020840135610f8e81610e4c565b929592945050506040919091013590565b60008060008060608587031215610fb557600080fd5b8435610fc081610e4c565b93506020850135925060408501356001600160401b0380821115610fe357600080fd5b818701915087601f830112610ff757600080fd5b81358181111561100657600080fd5b88602082850101111561101857600080fd5b95989497505060200194505050565b60006020828403121561103957600080fd5b8151610f5781610e4c565b6001600160a01b0393841681526020810192909252909116604082015260600190565b6020808252601890820152777061796d656e74496420616c726561647920696e2075736560401b604082015260600190565b6000602082840312156110ab57600080fd5b81518015158114610f5757600080fd5b634e487b7160e01b600052602160045260246000fdfe7573720b06c06bb7eb7077bf04c865302461f8648509da8867240cdb54e5a4b4a2646970667358221220f2d171df4e8536208cf4bc80c78626125d130c8b7b26efa38ceafd122cf7870764736f6c63430008100033",
|
|
313
|
+
"deployedBytecode": "0x60806040526004361061008c5760003560e01c80631b3c90a8146100915780633e6326fc146100a85780634162169f146100e55780634bb78b14146101055780634c33fe94146101255780635aef7de61461014557806399fa169a146101655780639ea7811614610178578063a4c0ed36146101c1578063e1758bd8146101e1578063e2982c21146101f6575b600080fd5b34801561009d57600080fd5b506100a661027a565b005b3480156100b457600080fd5b506002546100c8906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100f157600080fd5b506000546100c8906001600160a01b031681565b34801561011157600080fd5b506100a6610120366004610e77565b6103a1565b34801561013157600080fd5b506100a6610140366004610f3a565b61049f565b34801561015157600080fd5b506001546100c8906001600160a01b031681565b6100a6610173366004610f5e565b610587565b34801561018457600080fd5b506101b1610193366004610f3a565b6001600160a01b031660009081526035602052604090205460ff1690565b60405190151581526020016100dc565b3480156101cd57600080fd5b506101b16101dc366004610f9f565b610784565b3480156101ed57600080fd5b506100c86108eb565b34801561020257600080fd5b50610249610211366004610f3a565b603560205260009081526040902080546001820154600283015460039093015460ff9092169290916001600160a01b03918216911684565b60408051941515855260208501939093526001600160a01b03918216928401929092521660608201526080016100dc565b60025460405163bf40fac160e01b815260206004820152600a60248201526921a7a72a2927a62622a960b11b60448201526001600160a01b039091169063bf40fac190606401602060405180830381865afa1580156102dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103019190611027565b600080546001600160a01b0319166001600160a01b0392909216918217905560408051632d77bef360e11b81529051635aef7de6916004808201926020929091908290030181865afa15801561035b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061037f9190611027565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006103ad3383610978565b9050826001600160a01b0316816001600160a01b0316146104105760405162461bcd60e51b815260206004820152601860248201527714da59db985d1d5c99481a5cc81b9bdd0818dbdc9c9958dd60421b60448201526064015b60405180910390fd5b6001600160a01b038084166000908152603560205260409020600181015460028201546003909201549092918216911661044b868483610a07565b604080518481526001600160a01b038381166020830152808916923392918616917fc75e7bc3dc5e0d16e3df9df2689b6a26e490567bd567066ce9cdacc19507124a910160405180910390a4505050505050565b6001600160a01b0381811660009081526035602052604090206002015416331461050b5760405162461bcd60e51b815260206004820152601d60248201527f43616e206f6e6c792062652063616c6c65642062792063726561746f720000006044820152606401610407565b6001600160a01b038082166000908152603560205260409020600181015460039091015490911661053d838383610a07565b336001600160a01b03167f277bedca6530994c2b7997a918461bf3c20dc35ad66561a387316ddcbeb5343884848460405161057a93929190611044565b60405180910390a2505050565b6001600160a01b03831660009081526035602052604090205460ff16156105c05760405162461bcd60e51b815260040161040790611067565b6001600160a01b0382161561068e576040516323b872dd60e01b8152336004820152306024820152604481018290526001600160a01b038316906323b872dd906064016020604051808303816000875af1158015610622573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106469190611099565b6106895760405162461bcd60e51b8152602060048201526014602482015273185cdcd95d0819195c1bdcda5d0819985a5b195960621b6044820152606401610407565b6106d9565b600034116106d65760405162461bcd60e51b81526020600482015260156024820152741b985d1a5d994819195c1bdcda5d0819985a5b1959605a1b6044820152606401610407565b50345b6040805160808101825260018082526020808301858152338486018181526001600160a01b03898116606088019081528b821660009081526035909652948890209651875460ff191690151517875592519486019490945592516002850180546001600160a01b031990811692841692909217905591516003909401805490921693169290921790915590516000805160206110d28339815191529061057a90869085908790611044565b60008061079383850185610f3a565b6001600160a01b03811660009081526035602052604090205490915060ff16156107cf5760405162461bcd60e51b815260040161040790611067565b6107d76108eb565b6001600160a01b0316336001600160a01b03161461082f5760405162461bcd60e51b81526020600482015260156024820152744f6e6c792063616c6c61626c65206279207468697360581b6044820152606401610407565b60408051608081018252600180825260208083018981526001600160a01b038b811685870181815233606088018181528a851660009081526035909752958990209751885460ff191690151517885593519587019590955593516002860180546001600160a01b0319908116928416929092179055925160039095018054909316941693909317905591516000805160206110d2833981519152916108d79185918a91611044565b60405180910390a250600195945050505050565b60025460405163bf40fac160e01b815260206004820152600a60248201526923a7a7a22227a62620a960b11b60448201526000916001600160a01b03169063bf40fac190606401602060405180830381865afa15801561094f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109739190611027565b905090565b60408051606084901b6001600160601b031916602080830191909152825160148184030181526034830184528051908201207b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b6054840152607080840191909152835180840390910181526090909201909252805191012060009060006109fe8285610be1565b95945050505050565b6001600160a01b03831660009081526035602052604090205460ff16610a665760405162461bcd60e51b81526020600482015260146024820152737061796d656e744964206e6f7420696e2075736560601b6044820152606401610407565b6001600160a01b038084166000908152603560205260409020805460ff191690558116610b2457604051600090339084908381818185875af1925050503d8060008114610acf576040519150601f19603f3d011682016040523d82523d6000602084013e610ad4565b606091505b5050905080610b1e5760405162461bcd60e51b81526020600482015260166024820152751dda5d1a191c985dc81b985d1a5d994819985a5b195960521b6044820152606401610407565b50505050565b60405163a9059cbb60e01b8152336004820152602481018390526001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015610b71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b959190611099565b610bdc5760405162461bcd60e51b81526020600482015260186024820152771dda5d1a191c985dc81d1c985b9cd9995c8819985a5b195960421b6044820152606401610407565b505050565b6000806000610bf08585610c05565b91509150610bfd81610c4a565b509392505050565b6000808251604103610c3b5760208301516040840151606085015160001a610c2f87828585610d92565b94509450505050610c43565b506000905060025b9250929050565b6000816004811115610c5e57610c5e6110bb565b03610c665750565b6001816004811115610c7a57610c7a6110bb565b03610cc25760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606401610407565b6002816004811115610cd657610cd66110bb565b03610d235760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610407565b6003816004811115610d3757610d376110bb565b03610d8f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610407565b50565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03831115610dbf5750600090506003610e43565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610e13573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610e3c57600060019250925050610e43565b9150600090505b94509492505050565b6001600160a01b0381168114610d8f57600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610e8a57600080fd5b8235610e9581610e4c565b915060208301356001600160401b0380821115610eb157600080fd5b818501915085601f830112610ec557600080fd5b813581811115610ed757610ed7610e61565b604051601f8201601f19908116603f01168101908382118183101715610eff57610eff610e61565b81604052828152886020848701011115610f1857600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600060208284031215610f4c57600080fd5b8135610f5781610e4c565b9392505050565b600080600060608486031215610f7357600080fd5b8335610f7e81610e4c565b92506020840135610f8e81610e4c565b929592945050506040919091013590565b60008060008060608587031215610fb557600080fd5b8435610fc081610e4c565b93506020850135925060408501356001600160401b0380821115610fe357600080fd5b818701915087601f830112610ff757600080fd5b81358181111561100657600080fd5b88602082850101111561101857600080fd5b95989497505060200194505050565b60006020828403121561103957600080fd5b8151610f5781610e4c565b6001600160a01b0393841681526020810192909252909116604082015260600190565b6020808252601890820152777061796d656e74496420616c726561647920696e2075736560401b604082015260600190565b6000602082840312156110ab57600080fd5b81518015158114610f5757600080fd5b634e487b7160e01b600052602160045260246000fdfe7573720b06c06bb7eb7077bf04c865302461f8648509da8867240cdb54e5a4b4a2646970667358221220f2d171df4e8536208cf4bc80c78626125d130c8b7b26efa38ceafd122cf7870764736f6c63430008100033",
|
|
314
|
+
"linkReferences": {},
|
|
315
|
+
"deployedLinkReferences": {}
|
|
316
|
+
}
|
|
@@ -123,10 +123,10 @@ contract SuperGoodDollar is
|
|
|
123
123
|
|
|
124
124
|
/// override Superfluid agreement function in order to make it pausable
|
|
125
125
|
/// that is, no new streams can be started when the contract is paused
|
|
126
|
-
function createAgreement(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
{
|
|
126
|
+
function createAgreement(
|
|
127
|
+
bytes32 id,
|
|
128
|
+
bytes32[] calldata data
|
|
129
|
+
) public override(ISuperfluidToken, SuperfluidToken) {
|
|
130
130
|
require(!paused(), "Pausable: createAgreement while paused");
|
|
131
131
|
// otherwise the wrapper of SuperToken.createAgreement does the actual job
|
|
132
132
|
super.createAgreement(id, data);
|
|
@@ -236,12 +236,10 @@ contract SuperGoodDollar is
|
|
|
236
236
|
return res;
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
function transfer(
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
returns (bool)
|
|
244
|
-
{
|
|
239
|
+
function transfer(
|
|
240
|
+
address to,
|
|
241
|
+
uint256 amount
|
|
242
|
+
) public virtual override(ERC677, SuperToken) returns (bool) {
|
|
245
243
|
return _transferFrom(msg.sender, msg.sender, to, amount);
|
|
246
244
|
}
|
|
247
245
|
|
|
@@ -301,12 +299,10 @@ contract SuperGoodDollar is
|
|
|
301
299
|
* @param to the address that will receive the minted tokens
|
|
302
300
|
* @param amount the amount of tokens to mint
|
|
303
301
|
*/
|
|
304
|
-
function mint(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
returns (bool)
|
|
309
|
-
{
|
|
302
|
+
function mint(
|
|
303
|
+
address to,
|
|
304
|
+
uint256 amount
|
|
305
|
+
) public override(IGoodDollarCustom) onlyMinter returns (bool) {
|
|
310
306
|
require(!paused(), "Pausable: token transfer while paused");
|
|
311
307
|
|
|
312
308
|
if (cap > 0) {
|
|
@@ -319,7 +315,7 @@ contract SuperGoodDollar is
|
|
|
319
315
|
msg.sender,
|
|
320
316
|
to,
|
|
321
317
|
amount,
|
|
322
|
-
false
|
|
318
|
+
false /* requireReceptionAck */,
|
|
323
319
|
new bytes(0),
|
|
324
320
|
new bytes(0)
|
|
325
321
|
);
|
|
@@ -344,11 +340,9 @@ contract SuperGoodDollar is
|
|
|
344
340
|
* @dev Gets the current transaction fees
|
|
345
341
|
* @return fee senderPays that represents the current transaction fees and bool true if sender pays the fee or receiver
|
|
346
342
|
*/
|
|
347
|
-
function getFees(
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
returns (uint256 fee, bool senderPays)
|
|
351
|
-
{
|
|
343
|
+
function getFees(
|
|
344
|
+
uint256 amount
|
|
345
|
+
) public view returns (uint256 fee, bool senderPays) {
|
|
352
346
|
return formula.getTxFees(amount, address(0), address(0));
|
|
353
347
|
}
|
|
354
348
|
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity >=0.8.0;
|
|
3
|
+
|
|
4
|
+
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
|
|
5
|
+
|
|
6
|
+
import "../Interfaces.sol";
|
|
7
|
+
import "./DAOContract.sol";
|
|
8
|
+
import "../utils/NameService.sol";
|
|
9
|
+
|
|
10
|
+
/* @title One Time payment scheme
|
|
11
|
+
* Scheme that allows address to deposit tokens for any address to withdraw
|
|
12
|
+
*/
|
|
13
|
+
contract OneTimePaymentsV2 is DAOContract {
|
|
14
|
+
struct Payment {
|
|
15
|
+
bool hasPayment;
|
|
16
|
+
uint256 paymentAmount;
|
|
17
|
+
address paymentSender;
|
|
18
|
+
address asset;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
mapping(address => Payment) public payments;
|
|
22
|
+
|
|
23
|
+
event PaymentDeposit(
|
|
24
|
+
address indexed from,
|
|
25
|
+
address paymentId,
|
|
26
|
+
uint256 amount,
|
|
27
|
+
address asset
|
|
28
|
+
);
|
|
29
|
+
event PaymentCancel(
|
|
30
|
+
address indexed from,
|
|
31
|
+
address paymentId,
|
|
32
|
+
uint256 amount,
|
|
33
|
+
address asset
|
|
34
|
+
);
|
|
35
|
+
event PaymentWithdraw(
|
|
36
|
+
address indexed from,
|
|
37
|
+
address indexed to,
|
|
38
|
+
address indexed paymentId,
|
|
39
|
+
uint256 amount,
|
|
40
|
+
address asset
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
/* @dev Constructor
|
|
44
|
+
* @param _avatar The avatar of the DAO
|
|
45
|
+
* @param _identity The identity contract
|
|
46
|
+
* @param _gasLimit The gas limit
|
|
47
|
+
*/
|
|
48
|
+
constructor(INameService _ns) {
|
|
49
|
+
setDAO(_ns);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function depositAsset(
|
|
53
|
+
address paymentId,
|
|
54
|
+
address asset,
|
|
55
|
+
uint value
|
|
56
|
+
) external payable {
|
|
57
|
+
require(!payments[paymentId].hasPayment, "paymentId already in use");
|
|
58
|
+
if (asset != address(0)) {
|
|
59
|
+
require(
|
|
60
|
+
ERC20(asset).transferFrom(msg.sender, address(this), value),
|
|
61
|
+
"asset deposit failed"
|
|
62
|
+
);
|
|
63
|
+
} else {
|
|
64
|
+
require(msg.value > 0, "native deposit failed");
|
|
65
|
+
value = msg.value;
|
|
66
|
+
}
|
|
67
|
+
payments[paymentId] = Payment(true, value, msg.sender, asset);
|
|
68
|
+
|
|
69
|
+
emit PaymentDeposit(msg.sender, paymentId, value, asset);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* @dev ERC677 on token transfer function. When transferAndCall is called on this contract,
|
|
73
|
+
* this function is called, depositing the payment amount under the hash of the given bytes.
|
|
74
|
+
* Reverts if hash is already in use. Can only be called by token contract.
|
|
75
|
+
* @param sender the address of the sender
|
|
76
|
+
* @param value the amount to deposit
|
|
77
|
+
* @param data The given paymentId which should be a fresh address of a wallet
|
|
78
|
+
*/
|
|
79
|
+
function onTokenTransfer(
|
|
80
|
+
address sender,
|
|
81
|
+
uint256 value,
|
|
82
|
+
bytes calldata data
|
|
83
|
+
) external returns (bool) {
|
|
84
|
+
address paymentId = abi.decode(data, (address));
|
|
85
|
+
|
|
86
|
+
require(!payments[paymentId].hasPayment, "paymentId already in use");
|
|
87
|
+
require(msg.sender == address(nativeToken()), "Only callable by this");
|
|
88
|
+
|
|
89
|
+
payments[paymentId] = Payment(true, value, sender, msg.sender);
|
|
90
|
+
|
|
91
|
+
emit PaymentDeposit(sender, paymentId, value, msg.sender);
|
|
92
|
+
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* @dev Withdrawal function.
|
|
97
|
+
* allows the sender that proves ownership of paymentId to withdraw
|
|
98
|
+
* @param paymentId the address of the public key that the
|
|
99
|
+
* rightful receiver of the payment knows the private key to
|
|
100
|
+
* @param signature the signature of a the message containing the msg.sender address signed
|
|
101
|
+
* with the private key.
|
|
102
|
+
*/
|
|
103
|
+
function withdraw(address paymentId, bytes memory signature) public {
|
|
104
|
+
address signer = signerOfAddress(msg.sender, signature);
|
|
105
|
+
require(signer == paymentId, "Signature is not correct");
|
|
106
|
+
|
|
107
|
+
uint256 value = payments[paymentId].paymentAmount;
|
|
108
|
+
address sender = payments[paymentId].paymentSender;
|
|
109
|
+
address asset = payments[paymentId].asset;
|
|
110
|
+
_withdraw(paymentId, value, asset);
|
|
111
|
+
emit PaymentWithdraw(sender, msg.sender, paymentId, value, asset);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* @dev Cancel function
|
|
115
|
+
* allows only creator of payment to cancel
|
|
116
|
+
* @param paymentId The paymentId of the payment to cancelæ
|
|
117
|
+
*/
|
|
118
|
+
function cancel(address paymentId) public {
|
|
119
|
+
require(
|
|
120
|
+
payments[paymentId].paymentSender == msg.sender,
|
|
121
|
+
"Can only be called by creator"
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
uint256 value = payments[paymentId].paymentAmount;
|
|
125
|
+
address asset = payments[paymentId].asset;
|
|
126
|
+
|
|
127
|
+
_withdraw(paymentId, value, asset);
|
|
128
|
+
emit PaymentCancel(msg.sender, paymentId, value, asset);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* @dev Internal withdraw function
|
|
132
|
+
* @param paymentId the paymentId of the payment
|
|
133
|
+
* @param value the amopunt in the payment
|
|
134
|
+
*/
|
|
135
|
+
function _withdraw(address paymentId, uint256 value, address asset) internal {
|
|
136
|
+
require(payments[paymentId].hasPayment, "paymentId not in use");
|
|
137
|
+
|
|
138
|
+
payments[paymentId].hasPayment = false;
|
|
139
|
+
|
|
140
|
+
if (asset == address(0)) {
|
|
141
|
+
(bool success, ) = payable(msg.sender).call{ value: value }("");
|
|
142
|
+
require(success, "withdraw native failed");
|
|
143
|
+
} else {
|
|
144
|
+
require(
|
|
145
|
+
ERC20(asset).transfer(msg.sender, value),
|
|
146
|
+
"withdraw transfer failed"
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* @dev function to check if a payment hash is in use
|
|
152
|
+
* @param paymentId the given paymentId
|
|
153
|
+
*/
|
|
154
|
+
function hasPayment(address paymentId) public view returns (bool) {
|
|
155
|
+
return payments[paymentId].hasPayment;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* @dev gives the signer address of the signature and the message
|
|
159
|
+
* @param message the plain-text message that is signed by the signature
|
|
160
|
+
* @param signature the signature of the plain-text message
|
|
161
|
+
*/
|
|
162
|
+
function signerOfAddress(
|
|
163
|
+
address message,
|
|
164
|
+
bytes memory signature
|
|
165
|
+
) internal pure returns (address) {
|
|
166
|
+
bytes32 signedMessage = ECDSA.toEthSignedMessageHash(
|
|
167
|
+
keccak256(abi.encodePacked(message))
|
|
168
|
+
);
|
|
169
|
+
address signer = ECDSA.recover(signedMessage, signature);
|
|
170
|
+
return signer;
|
|
171
|
+
}
|
|
172
|
+
}
|