@venusprotocol/venus-periphery 1.1.0 → 1.1.1-dev.1
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/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol/AggregatorV3Interface.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/access/Ownable.sol/Ownable.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/access/Ownable2Step.sol/Ownable2Step.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/interfaces/IERC5267.sol/IERC5267.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/security/ReentrancyGuard.sol/ReentrancyGuard.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol/IERC20Permit.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol/SafeERC20.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/Address.sol/Address.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/ShortStrings.sol/ShortStrings.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/StorageSlot.sol/StorageSlot.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/cryptography/ECDSA.sol/ECDSA.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/cryptography/EIP712.sol/EIP712.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol/ReentrancyGuardUpgradeable.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol/IERC20PermitUpgradeable.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol/SafeERC20Upgradeable.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +1 -1
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol/IAccessControlManagerV8.dbg.json +1 -1
- package/artifacts/@venusprotocol/oracle/contracts/interfaces/FeedRegistryInterface.sol/FeedRegistryInterface.dbg.json +1 -1
- package/artifacts/@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol/BoundValidatorInterface.dbg.json +1 -1
- package/artifacts/@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol/OracleInterface.dbg.json +1 -1
- package/artifacts/@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol/ResilientOracleInterface.dbg.json +1 -1
- package/artifacts/@venusprotocol/oracle/contracts/interfaces/PublicResolverInterface.sol/PublicResolverInterface.dbg.json +1 -1
- package/artifacts/@venusprotocol/oracle/contracts/interfaces/SIDRegistryInterface.sol/SIDRegistryInterface.dbg.json +1 -1
- package/artifacts/@venusprotocol/oracle/contracts/interfaces/VBep20Interface.sol/VBep20Interface.dbg.json +1 -1
- package/artifacts/@venusprotocol/venus-protocol/contracts/Utils/ReentrancyGuardTransient.sol/ReentrancyGuardTransient.dbg.json +1 -1
- package/artifacts/@venusprotocol/venus-protocol/contracts/Utils/TransientSlot.sol/TransientSlot.dbg.json +1 -1
- package/artifacts/build-info/1d48fac67b5d575e2af40eeb9f88b593.json +1 -0
- package/artifacts/contracts/Interfaces.sol/IComptroller.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IFlashLoanReceiver.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IProtocolShareReserve.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IVBNB.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IVToken.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IWBNB.dbg.json +1 -1
- package/artifacts/contracts/LeverageManager/ILeverageStrategiesManager.sol/ILeverageStrategiesManager.dbg.json +1 -1
- package/artifacts/contracts/LeverageManager/LeverageStrategiesManager.sol/LeverageStrategiesManager.dbg.json +1 -1
- package/artifacts/contracts/SwapHelper/SwapHelper.sol/SwapHelper.dbg.json +1 -1
- package/artifacts/contracts/test/MockTarget.sol/MockTarget.dbg.json +4 -0
- package/artifacts/contracts/test/MockTarget.sol/MockTarget.json +214 -0
- package/artifacts/hardhat-deploy/solc_0.8/openzeppelin/access/Ownable.sol/Ownable.dbg.json +1 -1
- package/artifacts/hardhat-deploy/solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol/IERC1822Proxiable.dbg.json +1 -1
- package/artifacts/hardhat-deploy/solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol/ERC1967Proxy.dbg.json +1 -1
- package/artifacts/hardhat-deploy/solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol/ERC1967Upgrade.dbg.json +1 -1
- package/artifacts/hardhat-deploy/solc_0.8/openzeppelin/proxy/Proxy.sol/Proxy.dbg.json +1 -1
- package/artifacts/hardhat-deploy/solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol/IBeacon.dbg.json +1 -1
- package/artifacts/hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.dbg.json +1 -1
- package/artifacts/hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.dbg.json +1 -1
- package/artifacts/hardhat-deploy/solc_0.8/openzeppelin/utils/Address.sol/Address.dbg.json +1 -1
- package/artifacts/hardhat-deploy/solc_0.8/openzeppelin/utils/Context.sol/Context.dbg.json +1 -1
- package/artifacts/hardhat-deploy/solc_0.8/openzeppelin/utils/StorageSlot.sol/StorageSlot.dbg.json +1 -1
- package/artifacts/hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol/OptimizedTransparentUpgradeableProxy.dbg.json +1 -1
- package/contracts/test/MockTarget.sol +99 -0
- package/dist/typechain/factories/MockTarget__factory.d.ts +70 -0
- package/dist/typechain/factories/MockTarget__factory.js +244 -0
- package/dist/typechain/index.d.ts +2 -0
- package/dist/typechain/index.js +3 -1
- package/package.json +1 -1
- package/typechain/MockTarget.d.ts +409 -0
- package/typechain/factories/MockTarget__factory.ts +256 -0
- package/typechain/index.ts +2 -0
- package/artifacts/build-info/0fe91e1246eb073e381d5b5d7b533467.json +0 -1
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_format": "hh-sol-artifact-1",
|
|
3
|
+
"contractName": "MockTarget",
|
|
4
|
+
"sourceName": "contracts/test/MockTarget.sol",
|
|
5
|
+
"abi": [
|
|
6
|
+
{
|
|
7
|
+
"inputs": [],
|
|
8
|
+
"stateMutability": "nonpayable",
|
|
9
|
+
"type": "constructor"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"inputs": [
|
|
13
|
+
{
|
|
14
|
+
"internalType": "string",
|
|
15
|
+
"name": "message",
|
|
16
|
+
"type": "string"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"name": "CustomError",
|
|
20
|
+
"type": "error"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"inputs": [],
|
|
24
|
+
"name": "ZeroValueNotAllowed",
|
|
25
|
+
"type": "error"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"anonymous": false,
|
|
29
|
+
"inputs": [
|
|
30
|
+
{
|
|
31
|
+
"indexed": false,
|
|
32
|
+
"internalType": "address",
|
|
33
|
+
"name": "caller",
|
|
34
|
+
"type": "address"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"name": "CallerRecorded",
|
|
38
|
+
"type": "event"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"anonymous": false,
|
|
42
|
+
"inputs": [
|
|
43
|
+
{
|
|
44
|
+
"indexed": false,
|
|
45
|
+
"internalType": "uint256",
|
|
46
|
+
"name": "newValue",
|
|
47
|
+
"type": "uint256"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"name": "ValueSet",
|
|
51
|
+
"type": "event"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"inputs": [],
|
|
55
|
+
"name": "alwaysReverts",
|
|
56
|
+
"outputs": [],
|
|
57
|
+
"stateMutability": "pure",
|
|
58
|
+
"type": "function"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"inputs": [
|
|
62
|
+
{
|
|
63
|
+
"internalType": "bytes",
|
|
64
|
+
"name": "data",
|
|
65
|
+
"type": "bytes"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"name": "callbackToCaller",
|
|
69
|
+
"outputs": [],
|
|
70
|
+
"stateMutability": "nonpayable",
|
|
71
|
+
"type": "function"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"inputs": [],
|
|
75
|
+
"name": "customRevertMessage",
|
|
76
|
+
"outputs": [
|
|
77
|
+
{
|
|
78
|
+
"internalType": "string",
|
|
79
|
+
"name": "",
|
|
80
|
+
"type": "string"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"stateMutability": "view",
|
|
84
|
+
"type": "function"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"inputs": [],
|
|
88
|
+
"name": "getValues",
|
|
89
|
+
"outputs": [
|
|
90
|
+
{
|
|
91
|
+
"internalType": "uint256",
|
|
92
|
+
"name": "",
|
|
93
|
+
"type": "uint256"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"internalType": "address",
|
|
97
|
+
"name": "",
|
|
98
|
+
"type": "address"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"stateMutability": "view",
|
|
102
|
+
"type": "function"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"inputs": [],
|
|
106
|
+
"name": "lastCaller",
|
|
107
|
+
"outputs": [
|
|
108
|
+
{
|
|
109
|
+
"internalType": "address",
|
|
110
|
+
"name": "",
|
|
111
|
+
"type": "address"
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"stateMutability": "view",
|
|
115
|
+
"type": "function"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"inputs": [],
|
|
119
|
+
"name": "payableFunction",
|
|
120
|
+
"outputs": [],
|
|
121
|
+
"stateMutability": "payable",
|
|
122
|
+
"type": "function"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"inputs": [
|
|
126
|
+
{
|
|
127
|
+
"internalType": "uint256",
|
|
128
|
+
"name": "_value",
|
|
129
|
+
"type": "uint256"
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
"name": "revertOnZero",
|
|
133
|
+
"outputs": [],
|
|
134
|
+
"stateMutability": "pure",
|
|
135
|
+
"type": "function"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"inputs": [],
|
|
139
|
+
"name": "revertWithRequire",
|
|
140
|
+
"outputs": [],
|
|
141
|
+
"stateMutability": "pure",
|
|
142
|
+
"type": "function"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"inputs": [
|
|
146
|
+
{
|
|
147
|
+
"internalType": "string",
|
|
148
|
+
"name": "message",
|
|
149
|
+
"type": "string"
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"name": "setCustomRevertMessage",
|
|
153
|
+
"outputs": [],
|
|
154
|
+
"stateMutability": "nonpayable",
|
|
155
|
+
"type": "function"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"inputs": [
|
|
159
|
+
{
|
|
160
|
+
"internalType": "bool",
|
|
161
|
+
"name": "_shouldFail",
|
|
162
|
+
"type": "bool"
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
"name": "setFailMode",
|
|
166
|
+
"outputs": [],
|
|
167
|
+
"stateMutability": "nonpayable",
|
|
168
|
+
"type": "function"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"inputs": [
|
|
172
|
+
{
|
|
173
|
+
"internalType": "uint256",
|
|
174
|
+
"name": "newValue",
|
|
175
|
+
"type": "uint256"
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"name": "setValue",
|
|
179
|
+
"outputs": [],
|
|
180
|
+
"stateMutability": "nonpayable",
|
|
181
|
+
"type": "function"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"inputs": [],
|
|
185
|
+
"name": "shouldFail",
|
|
186
|
+
"outputs": [
|
|
187
|
+
{
|
|
188
|
+
"internalType": "bool",
|
|
189
|
+
"name": "",
|
|
190
|
+
"type": "bool"
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
"stateMutability": "view",
|
|
194
|
+
"type": "function"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"inputs": [],
|
|
198
|
+
"name": "value",
|
|
199
|
+
"outputs": [
|
|
200
|
+
{
|
|
201
|
+
"internalType": "uint256",
|
|
202
|
+
"name": "",
|
|
203
|
+
"type": "uint256"
|
|
204
|
+
}
|
|
205
|
+
],
|
|
206
|
+
"stateMutability": "view",
|
|
207
|
+
"type": "function"
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
"bytecode": "0x608060405234801561000f575f5ffd5b506001805460ff60a01b1916905560408051808201909152601a81527f4d6f636b5461726765743a20666f72636564206661696c757265000000000000602082015260029061005e908261015d565b5061021c565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52602260045260245ffd5b6002810460018216806100a057607f821691505b6020821081036100b2576100b2610078565b50919050565b5f6100c66100c38381565b90565b92915050565b6100d5836100b8565b81545f1960089490940293841b1916921b91909117905550565b5f6100fb8184846100cc565b505050565b8181101561011a576101125f826100ef565b600101610100565b5050565b601f8211156100fb575f818152602090206020601f850104810160208510156101445750805b6101566020601f860104830182610100565b5050505050565b81516001600160401b0381111561017657610176610064565b610180825461008c565b61018b82828561011e565b6020601f8311600181146101bd575f84156101a65750858201515b5f19600886021c1981166002860217865550610214565b5f85815260208120601f198616915b828110156101ec57888501518255602094850194600190920191016101cc565b8683101561020757848901515f19601f89166008021c191682555b6001600288020188555050505b505050505050565b6109b7806102295f395ff3fe6080604052600436106100bf575f3560e01c8063552410771161007c57806388eea4ed1161005757806388eea4ed1461020d578063b4f5537d14610221578063ef420a3214610235578063fcd7688114610256575f5ffd5b80635524107714610189578063678d2204146101a857806374699601146101d5575f5ffd5b806319eb4a90146100c35780632113522a146100f457806330c27ebe146101205780633fa4f2451461014157806342651d50146101625780634a6a740714610181575b5f5ffd5b3480156100ce575f5ffd5b505f546001546001600160a01b03166040516100eb9291906104c3565b60405180910390f35b3480156100ff575f5ffd5b50600154610113906001600160a01b031681565b6040516100eb91906104e5565b34801561012b575f5ffd5b5061013f61013a366004610541565b610275565b005b34801561014c575f5ffd5b506101555f5481565b6040516100eb9190610586565b34801561016d575f5ffd5b5061013f61017c3660046105ab565b6102fd565b61013f345f55565b348015610194575f5ffd5b5061013f6101a33660046105ab565b610320565b3480156101b3575f5ffd5b506001546101c890600160a01b900460ff1681565b6040516100eb91906105d9565b3480156101e0575f5ffd5b5061013f6101ef3660046105fa565b60018054911515600160a01b0260ff60a01b19909216919091179055565b348015610218575f5ffd5b5061013f6103d6565b34801561022c575f5ffd5b5061013f6103ee565b348015610240575f5ffd5b50610249610407565b6040516100eb9190610654565b348015610261575f5ffd5b5061013f610270366004610541565b610493565b5f336001600160a01b03168383604051610290929190610682565b5f604051808303815f865af19150503d805f81146102c9576040519150601f19603f3d011682016040523d82523d5f602084013e6102ce565b606091505b50509050806102f85760405162461bcd60e51b81526004016102ef906106b6565b60405180910390fd5b505050565b805f0361031d5760405163273e150360e21b815260040160405180910390fd5b50565b600154600160a01b900460ff161561034e5760026040516346b7545f60e11b81526004016102ef919061077d565b5f819055600180546001600160a01b031916331790556040517f012c78e2b84325878b1bd9d250d772cfe5bda7722d795f45036fa5e1e6e303fc90610394908390610586565b60405180910390a17f04ef1d8200dd09c677fd42684f2df173719d9c32969c535355806f8d43c66a02336040516103cb91906104e5565b60405180910390a150565b60405162461bcd60e51b81526004016102ef906107c1565b6040516346b7545f60e11b81526004016102ef90610804565b60028054610414906106da565b80601f0160208091040260200160405190810160405280929190818152602001828054610440906106da565b801561048b5780601f106104625761010080835404028352916020019161048b565b820191905f5260205f20905b81548152906001019060200180831161046e57829003601f168201915b505050505081565b60026102f88284836108c2565b805b82525050565b5f6001600160a01b0382165b92915050565b6104a2816104a8565b604081016104d182856104a0565b6104de60208301846104ba565b9392505050565b602081016104b482846104ba565b5f5f83601f840112610506576105065f5ffd5b50813567ffffffffffffffff811115610520576105205f5ffd5b60208301915083600182028301111561053a5761053a5f5ffd5b9250929050565b5f5f60208385031215610555576105555f5ffd5b823567ffffffffffffffff81111561056e5761056e5f5ffd5b61057a858286016104f3565b92509250509250929050565b602081016104b482846104a0565b805b811461031d575f5ffd5b80356104b481610594565b5f602082840312156105be576105be5f5ffd5b5f6105c984846105a0565b949350505050565b8015156104a2565b602081016104b482846105d1565b801515610596565b80356104b4816105e7565b5f6020828403121561060d5761060d5f5ffd5b5f6105c984846105ef565b8281835e505f910152565b5f61062c825190565b808452602084019350610643818560208601610618565b601f01601f19169290920192915050565b602080825281016104de8184610623565b82818337505f910152565b5f61067c838584610665565b50500190565b5f6105c9828486610670565b600f81525f602082016e10d85b1b189858dac819985a5b1959608a1b815291505b5060200190565b602080825281016104b48161068e565b634e487b7160e01b5f52602260045260245ffd5b6002810460018216806106ee57607f821691505b602082108103610700576107006106c6565b50919050565b5f8154610712816106da565b808552602085019450600182168015610732576001811461074857610774565b60ff198316865260208215150286019350610774565b5f858152602090205f5b8381101561076e57815488820152600190910190602001610752565b87019450505b50505092915050565b602080825281016104de8184610706565b601a81525f602082017f4d6f636b5461726765743a2072657175697265206661696c6564000000000000815291506106af565b602080825281016104b48161078e565b601c81525f602082017f546869732066756e6374696f6e20616c77617973207265766572747300000000815291506106af565b602080825281016104b4816107d1565b634e487b7160e01b5f52604160045260245ffd5b5f6104b46108338381565b90565b61083f83610828565b81545f1960089490940293841b1916921b91909117905550565b5f6102f8818484610836565b8181101561087f576108775f82610859565b600101610865565b5050565b601f8211156102f8575f818152602090206020601f850104810160208510156108a95750805b6108bb6020601f860104830182610865565b5050505050565b8267ffffffffffffffff8111156108db576108db610814565b6108e582546106da565b6108f0828285610883565b5f601f831160018114610921575f841561090a5750858201355b5f19600886021c1981166002860217865550610978565b5f85815260208120601f198616915b828110156109505788850135825560209485019460019092019101610930565b8683101561096b575f19601f88166008021c19858a01351682555b6001600288020188555050505b5050505050505056fea2646970667358221220380509de16f54e6a4e873eb60b203ae46b5c3e222edd1aba2a1ef48b7ee82ef764736f6c634300081c0033",
|
|
211
|
+
"deployedBytecode": "0x6080604052600436106100bf575f3560e01c8063552410771161007c57806388eea4ed1161005757806388eea4ed1461020d578063b4f5537d14610221578063ef420a3214610235578063fcd7688114610256575f5ffd5b80635524107714610189578063678d2204146101a857806374699601146101d5575f5ffd5b806319eb4a90146100c35780632113522a146100f457806330c27ebe146101205780633fa4f2451461014157806342651d50146101625780634a6a740714610181575b5f5ffd5b3480156100ce575f5ffd5b505f546001546001600160a01b03166040516100eb9291906104c3565b60405180910390f35b3480156100ff575f5ffd5b50600154610113906001600160a01b031681565b6040516100eb91906104e5565b34801561012b575f5ffd5b5061013f61013a366004610541565b610275565b005b34801561014c575f5ffd5b506101555f5481565b6040516100eb9190610586565b34801561016d575f5ffd5b5061013f61017c3660046105ab565b6102fd565b61013f345f55565b348015610194575f5ffd5b5061013f6101a33660046105ab565b610320565b3480156101b3575f5ffd5b506001546101c890600160a01b900460ff1681565b6040516100eb91906105d9565b3480156101e0575f5ffd5b5061013f6101ef3660046105fa565b60018054911515600160a01b0260ff60a01b19909216919091179055565b348015610218575f5ffd5b5061013f6103d6565b34801561022c575f5ffd5b5061013f6103ee565b348015610240575f5ffd5b50610249610407565b6040516100eb9190610654565b348015610261575f5ffd5b5061013f610270366004610541565b610493565b5f336001600160a01b03168383604051610290929190610682565b5f604051808303815f865af19150503d805f81146102c9576040519150601f19603f3d011682016040523d82523d5f602084013e6102ce565b606091505b50509050806102f85760405162461bcd60e51b81526004016102ef906106b6565b60405180910390fd5b505050565b805f0361031d5760405163273e150360e21b815260040160405180910390fd5b50565b600154600160a01b900460ff161561034e5760026040516346b7545f60e11b81526004016102ef919061077d565b5f819055600180546001600160a01b031916331790556040517f012c78e2b84325878b1bd9d250d772cfe5bda7722d795f45036fa5e1e6e303fc90610394908390610586565b60405180910390a17f04ef1d8200dd09c677fd42684f2df173719d9c32969c535355806f8d43c66a02336040516103cb91906104e5565b60405180910390a150565b60405162461bcd60e51b81526004016102ef906107c1565b6040516346b7545f60e11b81526004016102ef90610804565b60028054610414906106da565b80601f0160208091040260200160405190810160405280929190818152602001828054610440906106da565b801561048b5780601f106104625761010080835404028352916020019161048b565b820191905f5260205f20905b81548152906001019060200180831161046e57829003601f168201915b505050505081565b60026102f88284836108c2565b805b82525050565b5f6001600160a01b0382165b92915050565b6104a2816104a8565b604081016104d182856104a0565b6104de60208301846104ba565b9392505050565b602081016104b482846104ba565b5f5f83601f840112610506576105065f5ffd5b50813567ffffffffffffffff811115610520576105205f5ffd5b60208301915083600182028301111561053a5761053a5f5ffd5b9250929050565b5f5f60208385031215610555576105555f5ffd5b823567ffffffffffffffff81111561056e5761056e5f5ffd5b61057a858286016104f3565b92509250509250929050565b602081016104b482846104a0565b805b811461031d575f5ffd5b80356104b481610594565b5f602082840312156105be576105be5f5ffd5b5f6105c984846105a0565b949350505050565b8015156104a2565b602081016104b482846105d1565b801515610596565b80356104b4816105e7565b5f6020828403121561060d5761060d5f5ffd5b5f6105c984846105ef565b8281835e505f910152565b5f61062c825190565b808452602084019350610643818560208601610618565b601f01601f19169290920192915050565b602080825281016104de8184610623565b82818337505f910152565b5f61067c838584610665565b50500190565b5f6105c9828486610670565b600f81525f602082016e10d85b1b189858dac819985a5b1959608a1b815291505b5060200190565b602080825281016104b48161068e565b634e487b7160e01b5f52602260045260245ffd5b6002810460018216806106ee57607f821691505b602082108103610700576107006106c6565b50919050565b5f8154610712816106da565b808552602085019450600182168015610732576001811461074857610774565b60ff198316865260208215150286019350610774565b5f858152602090205f5b8381101561076e57815488820152600190910190602001610752565b87019450505b50505092915050565b602080825281016104de8184610706565b601a81525f602082017f4d6f636b5461726765743a2072657175697265206661696c6564000000000000815291506106af565b602080825281016104b48161078e565b601c81525f602082017f546869732066756e6374696f6e20616c77617973207265766572747300000000815291506106af565b602080825281016104b4816107d1565b634e487b7160e01b5f52604160045260245ffd5b5f6104b46108338381565b90565b61083f83610828565b81545f1960089490940293841b1916921b91909117905550565b5f6102f8818484610836565b8181101561087f576108775f82610859565b600101610865565b5050565b601f8211156102f8575f818152602090206020601f850104810160208510156108a95750805b6108bb6020601f860104830182610865565b5050505050565b8267ffffffffffffffff8111156108db576108db610814565b6108e582546106da565b6108f0828285610883565b5f601f831160018114610921575f841561090a5750858201355b5f19600886021c1981166002860217865550610978565b5f85815260208120601f198616915b828110156109505788850135825560209485019460019092019101610930565b8683101561096b575f19601f88166008021c19858a01351682555b6001600288020188555050505b5050505050505056fea2646970667358221220380509de16f54e6a4e873eb60b203ae46b5c3e222edd1aba2a1ef48b7ee82ef764736f6c634300081c0033",
|
|
212
|
+
"linkReferences": {},
|
|
213
|
+
"deployedLinkReferences": {}
|
|
214
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BSD-3-Clause
|
|
2
|
+
pragma solidity 0.8.28;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @title MockTarget
|
|
6
|
+
* @notice Mock contract for testing genericCall functionality in SwapHelper
|
|
7
|
+
* @dev Provides various functions that can succeed or fail for testing error propagation
|
|
8
|
+
*/
|
|
9
|
+
contract MockTarget {
|
|
10
|
+
uint256 public value;
|
|
11
|
+
address public lastCaller;
|
|
12
|
+
bool public shouldFail;
|
|
13
|
+
string public customRevertMessage;
|
|
14
|
+
|
|
15
|
+
event ValueSet(uint256 newValue);
|
|
16
|
+
event CallerRecorded(address caller);
|
|
17
|
+
|
|
18
|
+
error CustomError(string message);
|
|
19
|
+
error ZeroValueNotAllowed();
|
|
20
|
+
|
|
21
|
+
constructor() {
|
|
22
|
+
shouldFail = false;
|
|
23
|
+
customRevertMessage = "MockTarget: forced failure";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @notice Sets a value and emits an event
|
|
28
|
+
* @param newValue The new value to set
|
|
29
|
+
*/
|
|
30
|
+
function setValue(uint256 newValue) external {
|
|
31
|
+
if (shouldFail) {
|
|
32
|
+
revert CustomError(customRevertMessage);
|
|
33
|
+
}
|
|
34
|
+
value = newValue;
|
|
35
|
+
lastCaller = msg.sender;
|
|
36
|
+
emit ValueSet(newValue);
|
|
37
|
+
emit CallerRecorded(msg.sender);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @notice A function that always reverts with a custom error
|
|
42
|
+
*/
|
|
43
|
+
function alwaysReverts() external pure {
|
|
44
|
+
revert CustomError("This function always reverts");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @notice A function that reverts with a require statement
|
|
49
|
+
*/
|
|
50
|
+
function revertWithRequire() external pure {
|
|
51
|
+
require(false, "MockTarget: require failed");
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @notice A function that reverts if value is zero
|
|
56
|
+
*/
|
|
57
|
+
function revertOnZero(uint256 _value) external pure {
|
|
58
|
+
if (_value == 0) {
|
|
59
|
+
revert ZeroValueNotAllowed();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @notice Configure the contract to fail on next call
|
|
65
|
+
*/
|
|
66
|
+
function setFailMode(bool _shouldFail) external {
|
|
67
|
+
shouldFail = _shouldFail;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @notice Set custom revert message
|
|
72
|
+
*/
|
|
73
|
+
function setCustomRevertMessage(string calldata message) external {
|
|
74
|
+
customRevertMessage = message;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @notice A function that returns data
|
|
79
|
+
*/
|
|
80
|
+
function getValues() external view returns (uint256, address) {
|
|
81
|
+
return (value, lastCaller);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @notice A payable function for testing
|
|
86
|
+
*/
|
|
87
|
+
function payableFunction() external payable {
|
|
88
|
+
value = msg.value;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @notice A function that performs a callback to the caller
|
|
93
|
+
* @dev Used for testing reentrancy scenarios
|
|
94
|
+
*/
|
|
95
|
+
function callbackToCaller(bytes calldata data) external {
|
|
96
|
+
(bool success, ) = msg.sender.call(data);
|
|
97
|
+
require(success, "Callback failed");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Signer, ContractFactory, Overrides } from "ethers";
|
|
2
|
+
import { Provider, TransactionRequest } from "@ethersproject/providers";
|
|
3
|
+
import type { MockTarget, MockTargetInterface } from "../MockTarget";
|
|
4
|
+
export declare class MockTarget__factory extends ContractFactory {
|
|
5
|
+
constructor(...args: [signer: Signer] | ConstructorParameters<typeof ContractFactory>);
|
|
6
|
+
deploy(overrides?: Overrides & {
|
|
7
|
+
from?: string | Promise<string>;
|
|
8
|
+
}): Promise<MockTarget>;
|
|
9
|
+
getDeployTransaction(overrides?: Overrides & {
|
|
10
|
+
from?: string | Promise<string>;
|
|
11
|
+
}): TransactionRequest;
|
|
12
|
+
attach(address: string): MockTarget;
|
|
13
|
+
connect(signer: Signer): MockTarget__factory;
|
|
14
|
+
static readonly bytecode = "0x608060405234801561000f575f5ffd5b506001805460ff60a01b1916905560408051808201909152601a81527f4d6f636b5461726765743a20666f72636564206661696c757265000000000000602082015260029061005e908261015d565b5061021c565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52602260045260245ffd5b6002810460018216806100a057607f821691505b6020821081036100b2576100b2610078565b50919050565b5f6100c66100c38381565b90565b92915050565b6100d5836100b8565b81545f1960089490940293841b1916921b91909117905550565b5f6100fb8184846100cc565b505050565b8181101561011a576101125f826100ef565b600101610100565b5050565b601f8211156100fb575f818152602090206020601f850104810160208510156101445750805b6101566020601f860104830182610100565b5050505050565b81516001600160401b0381111561017657610176610064565b610180825461008c565b61018b82828561011e565b6020601f8311600181146101bd575f84156101a65750858201515b5f19600886021c1981166002860217865550610214565b5f85815260208120601f198616915b828110156101ec57888501518255602094850194600190920191016101cc565b8683101561020757848901515f19601f89166008021c191682555b6001600288020188555050505b505050505050565b6109b7806102295f395ff3fe6080604052600436106100bf575f3560e01c8063552410771161007c57806388eea4ed1161005757806388eea4ed1461020d578063b4f5537d14610221578063ef420a3214610235578063fcd7688114610256575f5ffd5b80635524107714610189578063678d2204146101a857806374699601146101d5575f5ffd5b806319eb4a90146100c35780632113522a146100f457806330c27ebe146101205780633fa4f2451461014157806342651d50146101625780634a6a740714610181575b5f5ffd5b3480156100ce575f5ffd5b505f546001546001600160a01b03166040516100eb9291906104c3565b60405180910390f35b3480156100ff575f5ffd5b50600154610113906001600160a01b031681565b6040516100eb91906104e5565b34801561012b575f5ffd5b5061013f61013a366004610541565b610275565b005b34801561014c575f5ffd5b506101555f5481565b6040516100eb9190610586565b34801561016d575f5ffd5b5061013f61017c3660046105ab565b6102fd565b61013f345f55565b348015610194575f5ffd5b5061013f6101a33660046105ab565b610320565b3480156101b3575f5ffd5b506001546101c890600160a01b900460ff1681565b6040516100eb91906105d9565b3480156101e0575f5ffd5b5061013f6101ef3660046105fa565b60018054911515600160a01b0260ff60a01b19909216919091179055565b348015610218575f5ffd5b5061013f6103d6565b34801561022c575f5ffd5b5061013f6103ee565b348015610240575f5ffd5b50610249610407565b6040516100eb9190610654565b348015610261575f5ffd5b5061013f610270366004610541565b610493565b5f336001600160a01b03168383604051610290929190610682565b5f604051808303815f865af19150503d805f81146102c9576040519150601f19603f3d011682016040523d82523d5f602084013e6102ce565b606091505b50509050806102f85760405162461bcd60e51b81526004016102ef906106b6565b60405180910390fd5b505050565b805f0361031d5760405163273e150360e21b815260040160405180910390fd5b50565b600154600160a01b900460ff161561034e5760026040516346b7545f60e11b81526004016102ef919061077d565b5f819055600180546001600160a01b031916331790556040517f012c78e2b84325878b1bd9d250d772cfe5bda7722d795f45036fa5e1e6e303fc90610394908390610586565b60405180910390a17f04ef1d8200dd09c677fd42684f2df173719d9c32969c535355806f8d43c66a02336040516103cb91906104e5565b60405180910390a150565b60405162461bcd60e51b81526004016102ef906107c1565b6040516346b7545f60e11b81526004016102ef90610804565b60028054610414906106da565b80601f0160208091040260200160405190810160405280929190818152602001828054610440906106da565b801561048b5780601f106104625761010080835404028352916020019161048b565b820191905f5260205f20905b81548152906001019060200180831161046e57829003601f168201915b505050505081565b60026102f88284836108c2565b805b82525050565b5f6001600160a01b0382165b92915050565b6104a2816104a8565b604081016104d182856104a0565b6104de60208301846104ba565b9392505050565b602081016104b482846104ba565b5f5f83601f840112610506576105065f5ffd5b50813567ffffffffffffffff811115610520576105205f5ffd5b60208301915083600182028301111561053a5761053a5f5ffd5b9250929050565b5f5f60208385031215610555576105555f5ffd5b823567ffffffffffffffff81111561056e5761056e5f5ffd5b61057a858286016104f3565b92509250509250929050565b602081016104b482846104a0565b805b811461031d575f5ffd5b80356104b481610594565b5f602082840312156105be576105be5f5ffd5b5f6105c984846105a0565b949350505050565b8015156104a2565b602081016104b482846105d1565b801515610596565b80356104b4816105e7565b5f6020828403121561060d5761060d5f5ffd5b5f6105c984846105ef565b8281835e505f910152565b5f61062c825190565b808452602084019350610643818560208601610618565b601f01601f19169290920192915050565b602080825281016104de8184610623565b82818337505f910152565b5f61067c838584610665565b50500190565b5f6105c9828486610670565b600f81525f602082016e10d85b1b189858dac819985a5b1959608a1b815291505b5060200190565b602080825281016104b48161068e565b634e487b7160e01b5f52602260045260245ffd5b6002810460018216806106ee57607f821691505b602082108103610700576107006106c6565b50919050565b5f8154610712816106da565b808552602085019450600182168015610732576001811461074857610774565b60ff198316865260208215150286019350610774565b5f858152602090205f5b8381101561076e57815488820152600190910190602001610752565b87019450505b50505092915050565b602080825281016104de8184610706565b601a81525f602082017f4d6f636b5461726765743a2072657175697265206661696c6564000000000000815291506106af565b602080825281016104b48161078e565b601c81525f602082017f546869732066756e6374696f6e20616c77617973207265766572747300000000815291506106af565b602080825281016104b4816107d1565b634e487b7160e01b5f52604160045260245ffd5b5f6104b46108338381565b90565b61083f83610828565b81545f1960089490940293841b1916921b91909117905550565b5f6102f8818484610836565b8181101561087f576108775f82610859565b600101610865565b5050565b601f8211156102f8575f818152602090206020601f850104810160208510156108a95750805b6108bb6020601f860104830182610865565b5050505050565b8267ffffffffffffffff8111156108db576108db610814565b6108e582546106da565b6108f0828285610883565b5f601f831160018114610921575f841561090a5750858201355b5f19600886021c1981166002860217865550610978565b5f85815260208120601f198616915b828110156109505788850135825560209485019460019092019101610930565b8683101561096b575f19601f88166008021c19858a01351682555b6001600288020188555050505b5050505050505056fea2646970667358221220380509de16f54e6a4e873eb60b203ae46b5c3e222edd1aba2a1ef48b7ee82ef764736f6c634300081c0033";
|
|
15
|
+
static readonly abi: ({
|
|
16
|
+
inputs: never[];
|
|
17
|
+
stateMutability: string;
|
|
18
|
+
type: string;
|
|
19
|
+
name?: undefined;
|
|
20
|
+
anonymous?: undefined;
|
|
21
|
+
outputs?: undefined;
|
|
22
|
+
} | {
|
|
23
|
+
inputs: {
|
|
24
|
+
internalType: string;
|
|
25
|
+
name: string;
|
|
26
|
+
type: string;
|
|
27
|
+
}[];
|
|
28
|
+
name: string;
|
|
29
|
+
type: string;
|
|
30
|
+
stateMutability?: undefined;
|
|
31
|
+
anonymous?: undefined;
|
|
32
|
+
outputs?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
anonymous: boolean;
|
|
35
|
+
inputs: {
|
|
36
|
+
indexed: boolean;
|
|
37
|
+
internalType: string;
|
|
38
|
+
name: string;
|
|
39
|
+
type: string;
|
|
40
|
+
}[];
|
|
41
|
+
name: string;
|
|
42
|
+
type: string;
|
|
43
|
+
stateMutability?: undefined;
|
|
44
|
+
outputs?: undefined;
|
|
45
|
+
} | {
|
|
46
|
+
inputs: {
|
|
47
|
+
internalType: string;
|
|
48
|
+
name: string;
|
|
49
|
+
type: string;
|
|
50
|
+
}[];
|
|
51
|
+
name: string;
|
|
52
|
+
outputs: never[];
|
|
53
|
+
stateMutability: string;
|
|
54
|
+
type: string;
|
|
55
|
+
anonymous?: undefined;
|
|
56
|
+
} | {
|
|
57
|
+
inputs: never[];
|
|
58
|
+
name: string;
|
|
59
|
+
outputs: {
|
|
60
|
+
internalType: string;
|
|
61
|
+
name: string;
|
|
62
|
+
type: string;
|
|
63
|
+
}[];
|
|
64
|
+
stateMutability: string;
|
|
65
|
+
type: string;
|
|
66
|
+
anonymous?: undefined;
|
|
67
|
+
})[];
|
|
68
|
+
static createInterface(): MockTargetInterface;
|
|
69
|
+
static connect(address: string, signerOrProvider: Signer | Provider): MockTarget;
|
|
70
|
+
}
|