├── .gitignore
├── LICENSE
├── README.md
├── abi
├── blow.json
├── erc20.json
├── erc721.json
├── lend.json
├── meson.json
├── position.json
└── swap.json
├── config.py
├── exmple.py
├── main.py
└── requirements.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | test.txt
2 | venv
3 | __pycache__
4 | *.log
5 | *.txt
6 | !requirements.txt
7 | main_tmp*
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
B2奥德赛
2 |
3 | 网站B2NETWORK
4 |
5 |
6 |
7 |
8 | ## ⚡ 安装
9 | + 安装 [python](https://www.google.com/search?client=opera&q=how+install+python)
10 | + [下载项目](https://sites.northwestern.edu/researchcomputing/resources/downloading-from-github) 并解压
11 | + 安装依赖包:
12 | ```python
13 | pip install -r requirements.txt
14 | ```
15 |
16 | ## 💻 例子
17 | ```python
18 | from main import B2Network
19 | from web3 import Web3
20 | from eth_account import Account
21 | from config import my_file_name
22 | import requests
23 |
24 | # 创建evm钱包随机账户
25 | ac = Account().create()
26 | # 地址
27 | address = ac.address
28 | # 私钥
29 | pk = ac.key.hex()
30 | # 大号邀请码,换成自己的
31 | code = 'ASDDDDD'
32 |
33 | # 获取ip代理的链接,一次1个,文本格式,http协议, 填你自己的
34 | ip_get_url = ''
35 | proxy = requests.get(ip_get_url).text.strip()
36 | print(proxy)
37 | b2 = B2Network(pk=pk, invite_code=code, proxy=proxy)
38 | # 注册登陆
39 | b2.b2_login()
40 | # 获取我的信息
41 | my_invite_code = b2.get_user_info()['code']
42 |
43 | # 保存账户信息,格式 地址----私钥----自己的邀请码
44 | log_str = f'{address}----{pk}----{my_invite_code}'
45 | B2Network.write_file(my_file_name, log_str)
46 |
47 | # 用大号邀请码作为邀请人,绑定邀请关系
48 | b2.invite()
49 |
50 | # 领b2测试水龙头水,测试btc作为gas,需要代理
51 | b2.b2_faucet()
52 |
53 | # 合约领测试水,usdc(1000),usdt(1000),eth(1),必须先领测试btc水作为gas
54 | b2.contract_faucet('usdc')
55 | b2.contract_faucet('usdt')
56 | b2.contract_faucet('eth')
57 |
58 | # glowswap交换代币任务, 使用btc交换代币,coin只支持usdc,usdt, amount是btc的数量,主要不要超过钱包btc余额
59 | b2.b2_glow_swap(coin='usdc', amount=0.00001)
60 | # 添加流动性, 只能添加usdt-usdc稳定币池子,这里最好先领usdc水,我代码里面使用的是单边流动性,只需要钱包有usdc即可
61 | b2.b2_glow_add_lp()
62 | # 质押流动性,必须先完成添加流动性链上交互
63 | b2.b2_glow_stack()
64 |
65 | # layerbank 借贷, 抵押btc
66 | b2.lend_supply(amount=0.0001)
67 | # layerbank 借贷, 打开btc作为抵押物开关
68 | b2.lend_enter_market()
69 | # layerbank 借贷, 借usdc
70 | b2.lend_borrow(amount=0.01)
71 | # owlto 任务
72 | b2.owlto_bridge_to_sepolia()
73 | # b2.owlto_bridge_from_sepolia() # 需要钱包在sepolia测试网有至少0.01eth的水,这个链上调用可以成功,但是任务不成功,还不太明白为什么
74 |
75 | # shoebill借贷
76 | ## 获取shoebill水龙头测试水
77 | b2.get_shoebill_faucet('weth')
78 | b2.get_shoebill_faucet('stone')
79 | # shoebill抵押
80 | b2.shoebill_supply()
81 | # shoebill借出
82 | b2.shoebill_borrow()
83 |
84 | # dmain mint nft
85 | b2.demail_mint()
86 | #dmain 发邮件
87 | b2.send_mail()
88 |
89 | #==============分界线之前的是老的测试网,分界线后的是新的测试网=================
90 |
91 | # b2 layercraft 购买nft
92 | b2.layercraft_buy()
93 | # b2 layercraft 上架nft
94 | b2.layercraft_sale()
95 |
96 | #oooo不会,会的可以提pr
97 |
98 | # 其他。因为b2更换了测试网rpc,所以部分合约地址可能已经失效,需要自己去实际交互一下,然后替换config.py中的合约地址
99 |
100 | # 刷新奥德赛点数(积分有延迟到账)
101 | b2.claim_point()
102 | ```
103 | ## 📧 Contacts
104 | + 推特 - [@shawngmy](https://twitter.com/shawngmy)
105 | + tks for following,if u want get more info
106 |
--------------------------------------------------------------------------------
/abi/blow.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "inputs": [
4 | { "internalType": "address", "name": "_factory", "type": "address" },
5 | { "internalType": "address", "name": "_WETH9", "type": "address" }
6 | ],
7 | "stateMutability": "nonpayable",
8 | "type": "constructor"
9 | },
10 | {
11 | "inputs": [],
12 | "name": "WETH9",
13 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
14 | "stateMutability": "view",
15 | "type": "function"
16 | },
17 | {
18 | "inputs": [
19 | {
20 | "components": [
21 | { "internalType": "bytes", "name": "path", "type": "bytes" },
22 | { "internalType": "address", "name": "recipient", "type": "address" },
23 | { "internalType": "uint256", "name": "deadline", "type": "uint256" },
24 | { "internalType": "uint256", "name": "amountIn", "type": "uint256" },
25 | {
26 | "internalType": "uint256",
27 | "name": "amountOutMinimum",
28 | "type": "uint256"
29 | }
30 | ],
31 | "internalType": "struct ISwapRouter.ExactInputParams",
32 | "name": "params",
33 | "type": "tuple"
34 | }
35 | ],
36 | "name": "exactInput",
37 | "outputs": [
38 | { "internalType": "uint256", "name": "amountOut", "type": "uint256" }
39 | ],
40 | "stateMutability": "payable",
41 | "type": "function"
42 | },
43 | {
44 | "inputs": [
45 | {
46 | "components": [
47 | { "internalType": "address", "name": "tokenIn", "type": "address" },
48 | { "internalType": "address", "name": "tokenOut", "type": "address" },
49 | { "internalType": "uint24", "name": "fee", "type": "uint24" },
50 | { "internalType": "address", "name": "recipient", "type": "address" },
51 | { "internalType": "uint256", "name": "deadline", "type": "uint256" },
52 | { "internalType": "uint256", "name": "amountIn", "type": "uint256" },
53 | {
54 | "internalType": "uint256",
55 | "name": "amountOutMinimum",
56 | "type": "uint256"
57 | },
58 | {
59 | "internalType": "uint160",
60 | "name": "sqrtPriceLimitX96",
61 | "type": "uint160"
62 | }
63 | ],
64 | "internalType": "struct ISwapRouter.ExactInputSingleParams",
65 | "name": "params",
66 | "type": "tuple"
67 | }
68 | ],
69 | "name": "exactInputSingle",
70 | "outputs": [
71 | { "internalType": "uint256", "name": "amountOut", "type": "uint256" }
72 | ],
73 | "stateMutability": "payable",
74 | "type": "function"
75 | },
76 | {
77 | "inputs": [
78 | {
79 | "components": [
80 | { "internalType": "bytes", "name": "path", "type": "bytes" },
81 | { "internalType": "address", "name": "recipient", "type": "address" },
82 | { "internalType": "uint256", "name": "deadline", "type": "uint256" },
83 | { "internalType": "uint256", "name": "amountOut", "type": "uint256" },
84 | {
85 | "internalType": "uint256",
86 | "name": "amountInMaximum",
87 | "type": "uint256"
88 | }
89 | ],
90 | "internalType": "struct ISwapRouter.ExactOutputParams",
91 | "name": "params",
92 | "type": "tuple"
93 | }
94 | ],
95 | "name": "exactOutput",
96 | "outputs": [
97 | { "internalType": "uint256", "name": "amountIn", "type": "uint256" }
98 | ],
99 | "stateMutability": "payable",
100 | "type": "function"
101 | },
102 | {
103 | "inputs": [
104 | {
105 | "components": [
106 | { "internalType": "address", "name": "tokenIn", "type": "address" },
107 | { "internalType": "address", "name": "tokenOut", "type": "address" },
108 | { "internalType": "uint24", "name": "fee", "type": "uint24" },
109 | { "internalType": "address", "name": "recipient", "type": "address" },
110 | { "internalType": "uint256", "name": "deadline", "type": "uint256" },
111 | { "internalType": "uint256", "name": "amountOut", "type": "uint256" },
112 | {
113 | "internalType": "uint256",
114 | "name": "amountInMaximum",
115 | "type": "uint256"
116 | },
117 | {
118 | "internalType": "uint160",
119 | "name": "sqrtPriceLimitX96",
120 | "type": "uint160"
121 | }
122 | ],
123 | "internalType": "struct ISwapRouter.ExactOutputSingleParams",
124 | "name": "params",
125 | "type": "tuple"
126 | }
127 | ],
128 | "name": "exactOutputSingle",
129 | "outputs": [
130 | { "internalType": "uint256", "name": "amountIn", "type": "uint256" }
131 | ],
132 | "stateMutability": "payable",
133 | "type": "function"
134 | },
135 | {
136 | "inputs": [],
137 | "name": "factory",
138 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
139 | "stateMutability": "view",
140 | "type": "function"
141 | },
142 | {
143 | "inputs": [
144 | { "internalType": "bytes[]", "name": "data", "type": "bytes[]" }
145 | ],
146 | "name": "multicall",
147 | "outputs": [
148 | { "internalType": "bytes[]", "name": "results", "type": "bytes[]" }
149 | ],
150 | "stateMutability": "payable",
151 | "type": "function"
152 | },
153 | {
154 | "inputs": [],
155 | "name": "refundETH",
156 | "outputs": [],
157 | "stateMutability": "payable",
158 | "type": "function"
159 | },
160 | {
161 | "inputs": [
162 | { "internalType": "address", "name": "token", "type": "address" },
163 | { "internalType": "uint256", "name": "value", "type": "uint256" },
164 | { "internalType": "uint256", "name": "deadline", "type": "uint256" },
165 | { "internalType": "uint8", "name": "v", "type": "uint8" },
166 | { "internalType": "bytes32", "name": "r", "type": "bytes32" },
167 | { "internalType": "bytes32", "name": "s", "type": "bytes32" }
168 | ],
169 | "name": "selfPermit",
170 | "outputs": [],
171 | "stateMutability": "payable",
172 | "type": "function"
173 | },
174 | {
175 | "inputs": [
176 | { "internalType": "address", "name": "token", "type": "address" },
177 | { "internalType": "uint256", "name": "nonce", "type": "uint256" },
178 | { "internalType": "uint256", "name": "expiry", "type": "uint256" },
179 | { "internalType": "uint8", "name": "v", "type": "uint8" },
180 | { "internalType": "bytes32", "name": "r", "type": "bytes32" },
181 | { "internalType": "bytes32", "name": "s", "type": "bytes32" }
182 | ],
183 | "name": "selfPermitAllowed",
184 | "outputs": [],
185 | "stateMutability": "payable",
186 | "type": "function"
187 | },
188 | {
189 | "inputs": [
190 | { "internalType": "address", "name": "token", "type": "address" },
191 | { "internalType": "uint256", "name": "nonce", "type": "uint256" },
192 | { "internalType": "uint256", "name": "expiry", "type": "uint256" },
193 | { "internalType": "uint8", "name": "v", "type": "uint8" },
194 | { "internalType": "bytes32", "name": "r", "type": "bytes32" },
195 | { "internalType": "bytes32", "name": "s", "type": "bytes32" }
196 | ],
197 | "name": "selfPermitAllowedIfNecessary",
198 | "outputs": [],
199 | "stateMutability": "payable",
200 | "type": "function"
201 | },
202 | {
203 | "inputs": [
204 | { "internalType": "address", "name": "token", "type": "address" },
205 | { "internalType": "uint256", "name": "value", "type": "uint256" },
206 | { "internalType": "uint256", "name": "deadline", "type": "uint256" },
207 | { "internalType": "uint8", "name": "v", "type": "uint8" },
208 | { "internalType": "bytes32", "name": "r", "type": "bytes32" },
209 | { "internalType": "bytes32", "name": "s", "type": "bytes32" }
210 | ],
211 | "name": "selfPermitIfNecessary",
212 | "outputs": [],
213 | "stateMutability": "payable",
214 | "type": "function"
215 | },
216 | {
217 | "inputs": [
218 | { "internalType": "address", "name": "token", "type": "address" },
219 | { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" },
220 | { "internalType": "address", "name": "recipient", "type": "address" }
221 | ],
222 | "name": "sweepToken",
223 | "outputs": [],
224 | "stateMutability": "payable",
225 | "type": "function"
226 | },
227 | {
228 | "inputs": [
229 | { "internalType": "address", "name": "token", "type": "address" },
230 | { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" },
231 | { "internalType": "address", "name": "recipient", "type": "address" },
232 | { "internalType": "uint256", "name": "feeBips", "type": "uint256" },
233 | { "internalType": "address", "name": "feeRecipient", "type": "address" }
234 | ],
235 | "name": "sweepTokenWithFee",
236 | "outputs": [],
237 | "stateMutability": "payable",
238 | "type": "function"
239 | },
240 | {
241 | "inputs": [
242 | { "internalType": "int256", "name": "amount0Delta", "type": "int256" },
243 | { "internalType": "int256", "name": "amount1Delta", "type": "int256" },
244 | { "internalType": "bytes", "name": "_data", "type": "bytes" }
245 | ],
246 | "name": "uniswapV3SwapCallback",
247 | "outputs": [],
248 | "stateMutability": "nonpayable",
249 | "type": "function"
250 | },
251 | {
252 | "inputs": [
253 | { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" },
254 | { "internalType": "address", "name": "recipient", "type": "address" }
255 | ],
256 | "name": "unwrapWETH9",
257 | "outputs": [],
258 | "stateMutability": "payable",
259 | "type": "function"
260 | },
261 | {
262 | "inputs": [
263 | { "internalType": "uint256", "name": "amountMinimum", "type": "uint256" },
264 | { "internalType": "address", "name": "recipient", "type": "address" },
265 | { "internalType": "uint256", "name": "feeBips", "type": "uint256" },
266 | { "internalType": "address", "name": "feeRecipient", "type": "address" }
267 | ],
268 | "name": "unwrapWETH9WithFee",
269 | "outputs": [],
270 | "stateMutability": "payable",
271 | "type": "function"
272 | },
273 | { "stateMutability": "payable", "type": "receive" }
274 | ]
275 |
--------------------------------------------------------------------------------
/abi/erc20.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "inputs": [
4 | {
5 | "internalType": "string",
6 | "name": "_name",
7 | "type": "string"
8 | },
9 | {
10 | "internalType": "string",
11 | "name": "_symbol",
12 | "type": "string"
13 | },
14 | {
15 | "internalType": "uint256",
16 | "name": "_initialSupply",
17 | "type": "uint256"
18 | }
19 | ],
20 | "stateMutability": "nonpayable",
21 | "type": "constructor"
22 | },
23 | {
24 | "inputs": [
25 | {
26 | "internalType": "address",
27 | "name": "_user",
28 | "type": "address"
29 | }
30 | ],
31 | "name": "faucet",
32 | "outputs": [],
33 | "stateMutability": "nonpayable",
34 | "type": "function"
35 | },
36 | {
37 | "inputs": [
38 | {
39 | "internalType": "address",
40 | "name": "_user",
41 | "type": "address"
42 | },
43 | {
44 | "internalType": "amount",
45 | "name": "_amount",
46 | "type": "uint256"
47 | }
48 | ],
49 | "name": "mint",
50 | "outputs": [],
51 | "stateMutability": "nonpayable",
52 | "type": "function"
53 | },
54 | {
55 | "anonymous": false,
56 | "inputs": [
57 | {
58 | "indexed": true,
59 | "internalType": "address",
60 | "name": "owner",
61 | "type": "address"
62 | },
63 | {
64 | "indexed": true,
65 | "internalType": "address",
66 | "name": "spender",
67 | "type": "address"
68 | },
69 | {
70 | "indexed": false,
71 | "internalType": "uint256",
72 | "name": "value",
73 | "type": "uint256"
74 | }
75 | ],
76 | "name": "Approval",
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": false,
96 | "internalType": "uint256",
97 | "name": "value",
98 | "type": "uint256"
99 | }
100 | ],
101 | "name": "Transfer",
102 | "type": "event"
103 | },
104 | {
105 | "inputs": [
106 | {
107 | "internalType": "address",
108 | "name": "owner",
109 | "type": "address"
110 | },
111 | {
112 | "internalType": "address",
113 | "name": "spender",
114 | "type": "address"
115 | }
116 | ],
117 | "name": "allowance",
118 | "outputs": [
119 | {
120 | "internalType": "uint256",
121 | "name": "",
122 | "type": "uint256"
123 | }
124 | ],
125 | "stateMutability": "view",
126 | "type": "function"
127 | },
128 | {
129 | "inputs": [
130 | {
131 | "internalType": "address",
132 | "name": "spender",
133 | "type": "address"
134 | },
135 | {
136 | "internalType": "uint256",
137 | "name": "amount",
138 | "type": "uint256"
139 | }
140 | ],
141 | "name": "approve",
142 | "outputs": [
143 | {
144 | "internalType": "bool",
145 | "name": "",
146 | "type": "bool"
147 | }
148 | ],
149 | "stateMutability": "nonpayable",
150 | "type": "function"
151 | },
152 | {
153 | "inputs": [
154 | {
155 | "internalType": "address",
156 | "name": "account",
157 | "type": "address"
158 | }
159 | ],
160 | "name": "balanceOf",
161 | "outputs": [
162 | {
163 | "internalType": "uint256",
164 | "name": "",
165 | "type": "uint256"
166 | }
167 | ],
168 | "stateMutability": "view",
169 | "type": "function"
170 | },
171 | {
172 | "inputs": [],
173 | "name": "decimals",
174 | "outputs": [
175 | {
176 | "internalType": "uint8",
177 | "name": "",
178 | "type": "uint8"
179 | }
180 | ],
181 | "stateMutability": "view",
182 | "type": "function"
183 | },
184 | {
185 | "inputs": [
186 | {
187 | "internalType": "address",
188 | "name": "spender",
189 | "type": "address"
190 | },
191 | {
192 | "internalType": "uint256",
193 | "name": "subtractedValue",
194 | "type": "uint256"
195 | }
196 | ],
197 | "name": "decreaseAllowance",
198 | "outputs": [
199 | {
200 | "internalType": "bool",
201 | "name": "",
202 | "type": "bool"
203 | }
204 | ],
205 | "stateMutability": "nonpayable",
206 | "type": "function"
207 | },
208 | {
209 | "inputs": [
210 | {
211 | "internalType": "address",
212 | "name": "spender",
213 | "type": "address"
214 | },
215 | {
216 | "internalType": "uint256",
217 | "name": "addedValue",
218 | "type": "uint256"
219 | }
220 | ],
221 | "name": "increaseAllowance",
222 | "outputs": [
223 | {
224 | "internalType": "bool",
225 | "name": "",
226 | "type": "bool"
227 | }
228 | ],
229 | "stateMutability": "nonpayable",
230 | "type": "function"
231 | },
232 | {
233 | "inputs": [],
234 | "name": "name",
235 | "outputs": [
236 | {
237 | "internalType": "string",
238 | "name": "",
239 | "type": "string"
240 | }
241 | ],
242 | "stateMutability": "view",
243 | "type": "function"
244 | },
245 | {
246 | "inputs": [
247 | {
248 | "internalType": "uint8",
249 | "name": "decimals_",
250 | "type": "uint8"
251 | }
252 | ],
253 | "name": "setupDecimals",
254 | "outputs": [],
255 | "stateMutability": "nonpayable",
256 | "type": "function"
257 | },
258 | {
259 | "inputs": [],
260 | "name": "symbol",
261 | "outputs": [
262 | {
263 | "internalType": "string",
264 | "name": "",
265 | "type": "string"
266 | }
267 | ],
268 | "stateMutability": "view",
269 | "type": "function"
270 | },
271 | {
272 | "inputs": [],
273 | "name": "totalSupply",
274 | "outputs": [
275 | {
276 | "internalType": "uint256",
277 | "name": "",
278 | "type": "uint256"
279 | }
280 | ],
281 | "stateMutability": "view",
282 | "type": "function"
283 | },
284 | {
285 | "inputs": [
286 | {
287 | "internalType": "address",
288 | "name": "recipient",
289 | "type": "address"
290 | },
291 | {
292 | "internalType": "uint256",
293 | "name": "amount",
294 | "type": "uint256"
295 | }
296 | ],
297 | "name": "transfer",
298 | "outputs": [
299 | {
300 | "internalType": "bool",
301 | "name": "",
302 | "type": "bool"
303 | }
304 | ],
305 | "stateMutability": "nonpayable",
306 | "type": "function"
307 | },
308 | {
309 | "inputs": [
310 | {
311 | "internalType": "address",
312 | "name": "sender",
313 | "type": "address"
314 | },
315 | {
316 | "internalType": "address",
317 | "name": "recipient",
318 | "type": "address"
319 | },
320 | {
321 | "internalType": "uint256",
322 | "name": "amount",
323 | "type": "uint256"
324 | }
325 | ],
326 | "name": "transferFrom",
327 | "outputs": [
328 | {
329 | "internalType": "bool",
330 | "name": "",
331 | "type": "bool"
332 | }
333 | ],
334 | "stateMutability": "nonpayable",
335 | "type": "function"
336 | }
337 | ]
--------------------------------------------------------------------------------
/abi/erc721.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "anonymous": false,
4 | "inputs": [
5 | {
6 | "indexed": true,
7 | "internalType": "address",
8 | "name": "owner",
9 | "type": "address"
10 | },
11 | {
12 | "indexed": true,
13 | "internalType": "address",
14 | "name": "approved",
15 | "type": "address"
16 | },
17 | {
18 | "indexed": true,
19 | "internalType": "uint256",
20 | "name": "tokenId",
21 | "type": "uint256"
22 | }
23 | ],
24 | "name": "Approval",
25 | "type": "event"
26 | },
27 | {
28 | "anonymous": false,
29 | "inputs": [
30 | {
31 | "indexed": true,
32 | "internalType": "address",
33 | "name": "owner",
34 | "type": "address"
35 | },
36 | {
37 | "indexed": true,
38 | "internalType": "address",
39 | "name": "operator",
40 | "type": "address"
41 | },
42 | {
43 | "indexed": false,
44 | "internalType": "bool",
45 | "name": "approved",
46 | "type": "bool"
47 | }
48 | ],
49 | "name": "ApprovalForAll",
50 | "type": "event"
51 | },
52 | {
53 | "anonymous": false,
54 | "inputs": [
55 | {
56 | "indexed": true,
57 | "internalType": "address",
58 | "name": "from",
59 | "type": "address"
60 | },
61 | {
62 | "indexed": true,
63 | "internalType": "address",
64 | "name": "to",
65 | "type": "address"
66 | },
67 | {
68 | "indexed": true,
69 | "internalType": "uint256",
70 | "name": "tokenId",
71 | "type": "uint256"
72 | }
73 | ],
74 | "name": "Transfer",
75 | "type": "event"
76 | },
77 | {
78 | "inputs": [
79 | {
80 | "internalType": "address",
81 | "name": "to",
82 | "type": "address"
83 | },
84 | {
85 | "internalType": "uint256",
86 | "name": "tokenId",
87 | "type": "uint256"
88 | }
89 | ],
90 | "name": "approve",
91 | "outputs": [],
92 | "stateMutability": "nonpayable",
93 | "type": "function"
94 | },
95 | {
96 | "constant": true,
97 | "inputs": [],
98 | "name": "totalSupply",
99 | "outputs": [
100 | {
101 | "name": "",
102 | "type": "uint256"
103 | }
104 | ],
105 | "payable": false,
106 | "stateMutability": "view",
107 | "type": "function"
108 | },
109 | {
110 | "inputs": [
111 | {
112 | "internalType": "address",
113 | "name": "owner",
114 | "type": "address"
115 | }
116 | ],
117 | "name": "balanceOf",
118 | "outputs": [
119 | {
120 | "internalType": "uint256",
121 | "name": "balance",
122 | "type": "uint256"
123 | }
124 | ],
125 | "stateMutability": "view",
126 | "type": "function"
127 | },
128 | {
129 | "inputs": [
130 | {
131 | "internalType": "uint256",
132 | "name": "tokenId",
133 | "type": "uint256"
134 | }
135 | ],
136 | "name": "getApproved",
137 | "outputs": [
138 | {
139 | "internalType": "address",
140 | "name": "operator",
141 | "type": "address"
142 | }
143 | ],
144 | "stateMutability": "view",
145 | "type": "function"
146 | },
147 | {
148 | "inputs": [
149 | {
150 | "internalType": "address",
151 | "name": "owner",
152 | "type": "address"
153 | },
154 | {
155 | "internalType": "address",
156 | "name": "operator",
157 | "type": "address"
158 | }
159 | ],
160 | "name": "isApprovedForAll",
161 | "outputs": [
162 | {
163 | "internalType": "bool",
164 | "name": "",
165 | "type": "bool"
166 | }
167 | ],
168 | "stateMutability": "view",
169 | "type": "function"
170 | },
171 | {
172 | "inputs": [],
173 | "name": "name",
174 | "outputs": [
175 | {
176 | "internalType": "string",
177 | "name": "",
178 | "type": "string"
179 | }
180 | ],
181 | "stateMutability": "view",
182 | "type": "function"
183 | },
184 | {
185 | "inputs": [
186 | {
187 | "internalType": "uint256",
188 | "name": "tokenId",
189 | "type": "uint256"
190 | }
191 | ],
192 | "name": "ownerOf",
193 | "outputs": [
194 | {
195 | "internalType": "address",
196 | "name": "owner",
197 | "type": "address"
198 | }
199 | ],
200 | "stateMutability": "view",
201 | "type": "function"
202 | },
203 | {
204 | "inputs": [
205 | {
206 | "internalType": "address",
207 | "name": "from",
208 | "type": "address"
209 | },
210 | {
211 | "internalType": "address",
212 | "name": "to",
213 | "type": "address"
214 | },
215 | {
216 | "internalType": "uint256",
217 | "name": "tokenId",
218 | "type": "uint256"
219 | }
220 | ],
221 | "name": "safeTransferFrom",
222 | "outputs": [],
223 | "stateMutability": "nonpayable",
224 | "type": "function"
225 | },
226 | {
227 | "inputs": [
228 | {
229 | "internalType": "address",
230 | "name": "from",
231 | "type": "address"
232 | },
233 | {
234 | "internalType": "address",
235 | "name": "to",
236 | "type": "address"
237 | },
238 | {
239 | "internalType": "uint256",
240 | "name": "tokenId",
241 | "type": "uint256"
242 | },
243 | {
244 | "internalType": "bytes",
245 | "name": "data",
246 | "type": "bytes"
247 | }
248 | ],
249 | "name": "safeTransferFrom",
250 | "outputs": [],
251 | "stateMutability": "nonpayable",
252 | "type": "function"
253 | },
254 | {
255 | "inputs": [
256 | {
257 | "internalType": "address",
258 | "name": "operator",
259 | "type": "address"
260 | },
261 | {
262 | "internalType": "bool",
263 | "name": "_approved",
264 | "type": "bool"
265 | }
266 | ],
267 | "name": "setApprovalForAll",
268 | "outputs": [],
269 | "stateMutability": "nonpayable",
270 | "type": "function"
271 | },
272 | {
273 | "inputs": [
274 | {
275 | "internalType": "bytes4",
276 | "name": "interfaceId",
277 | "type": "bytes4"
278 | }
279 | ],
280 | "name": "supportsInterface",
281 | "outputs": [
282 | {
283 | "internalType": "bool",
284 | "name": "",
285 | "type": "bool"
286 | }
287 | ],
288 | "stateMutability": "view",
289 | "type": "function"
290 | },
291 | {
292 | "inputs": [],
293 | "name": "symbol",
294 | "outputs": [
295 | {
296 | "internalType": "string",
297 | "name": "",
298 | "type": "string"
299 | }
300 | ],
301 | "stateMutability": "view",
302 | "type": "function"
303 | },
304 | {
305 | "inputs": [
306 | {
307 | "internalType": "uint256",
308 | "name": "tokenId",
309 | "type": "uint256"
310 | }
311 | ],
312 | "name": "tokenURI",
313 | "outputs": [
314 | {
315 | "internalType": "string",
316 | "name": "",
317 | "type": "string"
318 | }
319 | ],
320 | "stateMutability": "view",
321 | "type": "function"
322 | },
323 | {
324 | "inputs": [
325 | {
326 | "internalType": "address",
327 | "name": "from",
328 | "type": "address"
329 | },
330 | {
331 | "internalType": "address",
332 | "name": "to",
333 | "type": "address"
334 | },
335 | {
336 | "internalType": "uint256",
337 | "name": "tokenId",
338 | "type": "uint256"
339 | }
340 | ],
341 | "name": "transferFrom",
342 | "outputs": [],
343 | "stateMutability": "nonpayable",
344 | "type": "function"
345 | }
346 | ]
--------------------------------------------------------------------------------
/abi/lend.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "inputs": [
4 | {
5 | "internalType": "contract ComptrollerInterface",
6 | "name": "comptroller_",
7 | "type": "address"
8 | },
9 | {
10 | "internalType": "contract InterestRateModel",
11 | "name": "interestRateModel_",
12 | "type": "address"
13 | },
14 | {
15 | "internalType": "uint256",
16 | "name": "initialExchangeRateMantissa_",
17 | "type": "uint256"
18 | },
19 | {
20 | "internalType": "contract IncentivesControllerInterface",
21 | "name": "incentivesController_",
22 | "type": "address"
23 | },
24 | {
25 | "internalType": "string",
26 | "name": "name_",
27 | "type": "string"
28 | },
29 | {
30 | "internalType": "string",
31 | "name": "symbol_",
32 | "type": "string"
33 | },
34 | {
35 | "internalType": "uint8",
36 | "name": "decimals_",
37 | "type": "uint8"
38 | },
39 | {
40 | "internalType": "address payable",
41 | "name": "admin_",
42 | "type": "address"
43 | }
44 | ],
45 | "payable": false,
46 | "stateMutability": "nonpayable",
47 | "type": "constructor"
48 | },
49 | {
50 | "anonymous": false,
51 | "inputs": [
52 | {
53 | "indexed": false,
54 | "internalType": "uint256",
55 | "name": "cashPrior",
56 | "type": "uint256"
57 | },
58 | {
59 | "indexed": false,
60 | "internalType": "uint256",
61 | "name": "interestAccumulated",
62 | "type": "uint256"
63 | },
64 | {
65 | "indexed": false,
66 | "internalType": "uint256",
67 | "name": "borrowIndex",
68 | "type": "uint256"
69 | },
70 | {
71 | "indexed": false,
72 | "internalType": "uint256",
73 | "name": "totalBorrows",
74 | "type": "uint256"
75 | }
76 | ],
77 | "name": "AccrueInterest",
78 | "type": "event"
79 | },
80 | {
81 | "anonymous": false,
82 | "inputs": [
83 | {
84 | "indexed": true,
85 | "internalType": "address",
86 | "name": "owner",
87 | "type": "address"
88 | },
89 | {
90 | "indexed": true,
91 | "internalType": "address",
92 | "name": "spender",
93 | "type": "address"
94 | },
95 | {
96 | "indexed": false,
97 | "internalType": "uint256",
98 | "name": "amount",
99 | "type": "uint256"
100 | }
101 | ],
102 | "name": "Approval",
103 | "type": "event"
104 | },
105 | {
106 | "anonymous": false,
107 | "inputs": [
108 | {
109 | "indexed": false,
110 | "internalType": "address",
111 | "name": "borrower",
112 | "type": "address"
113 | },
114 | {
115 | "indexed": false,
116 | "internalType": "uint256",
117 | "name": "borrowAmount",
118 | "type": "uint256"
119 | },
120 | {
121 | "indexed": false,
122 | "internalType": "uint256",
123 | "name": "accountBorrows",
124 | "type": "uint256"
125 | },
126 | {
127 | "indexed": false,
128 | "internalType": "uint256",
129 | "name": "totalBorrows",
130 | "type": "uint256"
131 | }
132 | ],
133 | "name": "Borrow",
134 | "type": "event"
135 | },
136 | {
137 | "inputs": [
138 | {
139 | "internalType": "address[]",
140 | "name": "token",
141 | "type": "address[]"
142 | }
143 | ],
144 | "name": "enterMarkets",
145 | "outputs": [],
146 | "stateMutability": "nonpayable",
147 | "type": "function"
148 | },
149 | {
150 | "inputs": [
151 | {
152 | "internalType": "address",
153 | "name": "token",
154 | "type": "address"
155 | }
156 | ],
157 | "name": "exitMarket",
158 | "outputs": [],
159 | "stateMutability": "nonpayable",
160 | "type": "function"
161 | },
162 | {
163 | "anonymous": false,
164 | "inputs": [
165 | {
166 | "indexed": false,
167 | "internalType": "uint256",
168 | "name": "error",
169 | "type": "uint256"
170 | },
171 | {
172 | "indexed": false,
173 | "internalType": "uint256",
174 | "name": "info",
175 | "type": "uint256"
176 | },
177 | {
178 | "indexed": false,
179 | "internalType": "uint256",
180 | "name": "detail",
181 | "type": "uint256"
182 | }
183 | ],
184 | "name": "Failure",
185 | "type": "event"
186 | },
187 | {
188 | "anonymous": false,
189 | "inputs": [
190 | {
191 | "indexed": false,
192 | "internalType": "address",
193 | "name": "liquidator",
194 | "type": "address"
195 | },
196 | {
197 | "indexed": false,
198 | "internalType": "address",
199 | "name": "borrower",
200 | "type": "address"
201 | },
202 | {
203 | "indexed": false,
204 | "internalType": "uint256",
205 | "name": "repayAmount",
206 | "type": "uint256"
207 | },
208 | {
209 | "indexed": false,
210 | "internalType": "address",
211 | "name": "bTokenCollateral",
212 | "type": "address"
213 | },
214 | {
215 | "indexed": false,
216 | "internalType": "uint256",
217 | "name": "seizeTokens",
218 | "type": "uint256"
219 | }
220 | ],
221 | "name": "LiquidateBorrow",
222 | "type": "event"
223 | },
224 | {
225 | "anonymous": false,
226 | "inputs": [
227 | {
228 | "indexed": false,
229 | "internalType": "address",
230 | "name": "minter",
231 | "type": "address"
232 | },
233 | {
234 | "indexed": false,
235 | "internalType": "uint256",
236 | "name": "mintAmount",
237 | "type": "uint256"
238 | },
239 | {
240 | "indexed": false,
241 | "internalType": "uint256",
242 | "name": "mintTokens",
243 | "type": "uint256"
244 | }
245 | ],
246 | "name": "Mint",
247 | "type": "event"
248 | },
249 | {
250 | "anonymous": false,
251 | "inputs": [
252 | {
253 | "indexed": false,
254 | "internalType": "address",
255 | "name": "oldAdmin",
256 | "type": "address"
257 | },
258 | {
259 | "indexed": false,
260 | "internalType": "address",
261 | "name": "newAdmin",
262 | "type": "address"
263 | }
264 | ],
265 | "name": "NewAdmin",
266 | "type": "event"
267 | },
268 | {
269 | "anonymous": false,
270 | "inputs": [
271 | {
272 | "indexed": false,
273 | "internalType": "contract ComptrollerInterface",
274 | "name": "oldComptroller",
275 | "type": "address"
276 | },
277 | {
278 | "indexed": false,
279 | "internalType": "contract ComptrollerInterface",
280 | "name": "newComptroller",
281 | "type": "address"
282 | }
283 | ],
284 | "name": "NewComptroller",
285 | "type": "event"
286 | },
287 | {
288 | "anonymous": false,
289 | "inputs": [
290 | {
291 | "indexed": false,
292 | "internalType": "contract IncentivesControllerInterface",
293 | "name": "oldIncentivesController",
294 | "type": "address"
295 | },
296 | {
297 | "indexed": false,
298 | "internalType": "contract IncentivesControllerInterface",
299 | "name": "newIncentivesController",
300 | "type": "address"
301 | }
302 | ],
303 | "name": "NewIncentivesController",
304 | "type": "event"
305 | },
306 | {
307 | "anonymous": false,
308 | "inputs": [
309 | {
310 | "indexed": false,
311 | "internalType": "contract InterestRateModel",
312 | "name": "oldInterestRateModel",
313 | "type": "address"
314 | },
315 | {
316 | "indexed": false,
317 | "internalType": "contract InterestRateModel",
318 | "name": "newInterestRateModel",
319 | "type": "address"
320 | }
321 | ],
322 | "name": "NewMarketInterestRateModel",
323 | "type": "event"
324 | },
325 | {
326 | "anonymous": false,
327 | "inputs": [
328 | {
329 | "indexed": false,
330 | "internalType": "address",
331 | "name": "oldPendingAdmin",
332 | "type": "address"
333 | },
334 | {
335 | "indexed": false,
336 | "internalType": "address",
337 | "name": "newPendingAdmin",
338 | "type": "address"
339 | }
340 | ],
341 | "name": "NewPendingAdmin",
342 | "type": "event"
343 | },
344 | {
345 | "anonymous": false,
346 | "inputs": [
347 | {
348 | "indexed": false,
349 | "internalType": "uint256",
350 | "name": "oldProtocolSeizeShareMantissa",
351 | "type": "uint256"
352 | },
353 | {
354 | "indexed": false,
355 | "internalType": "uint256",
356 | "name": "newProtocolSeizeShareMantissa",
357 | "type": "uint256"
358 | }
359 | ],
360 | "name": "NewProtocolSeizeShare",
361 | "type": "event"
362 | },
363 | {
364 | "anonymous": false,
365 | "inputs": [
366 | {
367 | "indexed": false,
368 | "internalType": "uint256",
369 | "name": "oldReserveFactorMantissa",
370 | "type": "uint256"
371 | },
372 | {
373 | "indexed": false,
374 | "internalType": "uint256",
375 | "name": "newReserveFactorMantissa",
376 | "type": "uint256"
377 | }
378 | ],
379 | "name": "NewReserveFactor",
380 | "type": "event"
381 | },
382 | {
383 | "anonymous": false,
384 | "inputs": [
385 | {
386 | "indexed": false,
387 | "internalType": "address",
388 | "name": "redeemer",
389 | "type": "address"
390 | },
391 | {
392 | "indexed": false,
393 | "internalType": "uint256",
394 | "name": "redeemAmount",
395 | "type": "uint256"
396 | },
397 | {
398 | "indexed": false,
399 | "internalType": "uint256",
400 | "name": "redeebTokens",
401 | "type": "uint256"
402 | }
403 | ],
404 | "name": "Redeem",
405 | "type": "event"
406 | },
407 | {
408 | "anonymous": false,
409 | "inputs": [
410 | {
411 | "indexed": false,
412 | "internalType": "address",
413 | "name": "payer",
414 | "type": "address"
415 | },
416 | {
417 | "indexed": false,
418 | "internalType": "address",
419 | "name": "borrower",
420 | "type": "address"
421 | },
422 | {
423 | "indexed": false,
424 | "internalType": "uint256",
425 | "name": "repayAmount",
426 | "type": "uint256"
427 | },
428 | {
429 | "indexed": false,
430 | "internalType": "uint256",
431 | "name": "accountBorrows",
432 | "type": "uint256"
433 | },
434 | {
435 | "indexed": false,
436 | "internalType": "uint256",
437 | "name": "totalBorrows",
438 | "type": "uint256"
439 | }
440 | ],
441 | "name": "RepayBorrow",
442 | "type": "event"
443 | },
444 | {
445 | "anonymous": false,
446 | "inputs": [
447 | {
448 | "indexed": false,
449 | "internalType": "address",
450 | "name": "benefactor",
451 | "type": "address"
452 | },
453 | {
454 | "indexed": false,
455 | "internalType": "uint256",
456 | "name": "addAmount",
457 | "type": "uint256"
458 | },
459 | {
460 | "indexed": false,
461 | "internalType": "uint256",
462 | "name": "newTotalReserves",
463 | "type": "uint256"
464 | }
465 | ],
466 | "name": "ReservesAdded",
467 | "type": "event"
468 | },
469 | {
470 | "anonymous": false,
471 | "inputs": [
472 | {
473 | "indexed": false,
474 | "internalType": "address",
475 | "name": "admin",
476 | "type": "address"
477 | },
478 | {
479 | "indexed": false,
480 | "internalType": "uint256",
481 | "name": "reduceAmount",
482 | "type": "uint256"
483 | },
484 | {
485 | "indexed": false,
486 | "internalType": "uint256",
487 | "name": "newTotalReserves",
488 | "type": "uint256"
489 | }
490 | ],
491 | "name": "ReservesReduced",
492 | "type": "event"
493 | },
494 | {
495 | "anonymous": false,
496 | "inputs": [
497 | {
498 | "indexed": true,
499 | "internalType": "address",
500 | "name": "from",
501 | "type": "address"
502 | },
503 | {
504 | "indexed": true,
505 | "internalType": "address",
506 | "name": "to",
507 | "type": "address"
508 | },
509 | {
510 | "indexed": false,
511 | "internalType": "uint256",
512 | "name": "amount",
513 | "type": "uint256"
514 | }
515 | ],
516 | "name": "Transfer",
517 | "type": "event"
518 | },
519 | {
520 | "payable": true,
521 | "stateMutability": "payable",
522 | "type": "fallback"
523 | },
524 | {
525 | "constant": false,
526 | "inputs": [],
527 | "name": "_acceptAdmin",
528 | "outputs": [
529 | {
530 | "internalType": "uint256",
531 | "name": "",
532 | "type": "uint256"
533 | }
534 | ],
535 | "payable": false,
536 | "stateMutability": "nonpayable",
537 | "type": "function"
538 | },
539 | {
540 | "constant": false,
541 | "inputs": [],
542 | "name": "_addReserves",
543 | "outputs": [
544 | {
545 | "internalType": "uint256",
546 | "name": "",
547 | "type": "uint256"
548 | }
549 | ],
550 | "payable": true,
551 | "stateMutability": "payable",
552 | "type": "function"
553 | },
554 | {
555 | "constant": false,
556 | "inputs": [
557 | {
558 | "internalType": "uint256",
559 | "name": "reduceAmount",
560 | "type": "uint256"
561 | }
562 | ],
563 | "name": "_reduceReserves",
564 | "outputs": [
565 | {
566 | "internalType": "uint256",
567 | "name": "",
568 | "type": "uint256"
569 | }
570 | ],
571 | "payable": false,
572 | "stateMutability": "nonpayable",
573 | "type": "function"
574 | },
575 | {
576 | "constant": false,
577 | "inputs": [
578 | {
579 | "internalType": "contract ComptrollerInterface",
580 | "name": "newComptroller",
581 | "type": "address"
582 | }
583 | ],
584 | "name": "_setComptroller",
585 | "outputs": [
586 | {
587 | "internalType": "uint256",
588 | "name": "",
589 | "type": "uint256"
590 | }
591 | ],
592 | "payable": false,
593 | "stateMutability": "nonpayable",
594 | "type": "function"
595 | },
596 | {
597 | "constant": false,
598 | "inputs": [
599 | {
600 | "internalType": "contract IncentivesControllerInterface",
601 | "name": "newIncentivesController",
602 | "type": "address"
603 | }
604 | ],
605 | "name": "_setIncentivesController",
606 | "outputs": [
607 | {
608 | "internalType": "uint256",
609 | "name": "",
610 | "type": "uint256"
611 | }
612 | ],
613 | "payable": false,
614 | "stateMutability": "nonpayable",
615 | "type": "function"
616 | },
617 | {
618 | "constant": false,
619 | "inputs": [
620 | {
621 | "internalType": "contract InterestRateModel",
622 | "name": "newInterestRateModel",
623 | "type": "address"
624 | }
625 | ],
626 | "name": "_setInterestRateModel",
627 | "outputs": [
628 | {
629 | "internalType": "uint256",
630 | "name": "",
631 | "type": "uint256"
632 | }
633 | ],
634 | "payable": false,
635 | "stateMutability": "nonpayable",
636 | "type": "function"
637 | },
638 | {
639 | "constant": false,
640 | "inputs": [
641 | {
642 | "internalType": "address payable",
643 | "name": "newPendingAdmin",
644 | "type": "address"
645 | }
646 | ],
647 | "name": "_setPendingAdmin",
648 | "outputs": [
649 | {
650 | "internalType": "uint256",
651 | "name": "",
652 | "type": "uint256"
653 | }
654 | ],
655 | "payable": false,
656 | "stateMutability": "nonpayable",
657 | "type": "function"
658 | },
659 | {
660 | "constant": false,
661 | "inputs": [
662 | {
663 | "internalType": "uint256",
664 | "name": "newProtocolSeizeShareMantissa",
665 | "type": "uint256"
666 | }
667 | ],
668 | "name": "_setProtocolSeizeShare",
669 | "outputs": [
670 | {
671 | "internalType": "uint256",
672 | "name": "",
673 | "type": "uint256"
674 | }
675 | ],
676 | "payable": false,
677 | "stateMutability": "nonpayable",
678 | "type": "function"
679 | },
680 | {
681 | "constant": false,
682 | "inputs": [
683 | {
684 | "internalType": "uint256",
685 | "name": "newReserveFactorMantissa",
686 | "type": "uint256"
687 | }
688 | ],
689 | "name": "_setReserveFactor",
690 | "outputs": [
691 | {
692 | "internalType": "uint256",
693 | "name": "",
694 | "type": "uint256"
695 | }
696 | ],
697 | "payable": false,
698 | "stateMutability": "nonpayable",
699 | "type": "function"
700 | },
701 | {
702 | "constant": true,
703 | "inputs": [],
704 | "name": "accrualBlockTimestamp",
705 | "outputs": [
706 | {
707 | "internalType": "uint256",
708 | "name": "",
709 | "type": "uint256"
710 | }
711 | ],
712 | "payable": false,
713 | "stateMutability": "view",
714 | "type": "function"
715 | },
716 | {
717 | "constant": false,
718 | "inputs": [],
719 | "name": "accrueInterest",
720 | "outputs": [
721 | {
722 | "internalType": "uint256",
723 | "name": "",
724 | "type": "uint256"
725 | }
726 | ],
727 | "payable": false,
728 | "stateMutability": "nonpayable",
729 | "type": "function"
730 | },
731 | {
732 | "constant": true,
733 | "inputs": [],
734 | "name": "admin",
735 | "outputs": [
736 | {
737 | "internalType": "address payable",
738 | "name": "",
739 | "type": "address"
740 | }
741 | ],
742 | "payable": false,
743 | "stateMutability": "view",
744 | "type": "function"
745 | },
746 | {
747 | "constant": true,
748 | "inputs": [
749 | {
750 | "internalType": "address",
751 | "name": "owner",
752 | "type": "address"
753 | },
754 | {
755 | "internalType": "address",
756 | "name": "spender",
757 | "type": "address"
758 | }
759 | ],
760 | "name": "allowance",
761 | "outputs": [
762 | {
763 | "internalType": "uint256",
764 | "name": "",
765 | "type": "uint256"
766 | }
767 | ],
768 | "payable": false,
769 | "stateMutability": "view",
770 | "type": "function"
771 | },
772 | {
773 | "constant": false,
774 | "inputs": [
775 | {
776 | "internalType": "address",
777 | "name": "spender",
778 | "type": "address"
779 | },
780 | {
781 | "internalType": "uint256",
782 | "name": "amount",
783 | "type": "uint256"
784 | }
785 | ],
786 | "name": "approve",
787 | "outputs": [
788 | {
789 | "internalType": "bool",
790 | "name": "",
791 | "type": "bool"
792 | }
793 | ],
794 | "payable": false,
795 | "stateMutability": "nonpayable",
796 | "type": "function"
797 | },
798 | {
799 | "constant": true,
800 | "inputs": [
801 | {
802 | "internalType": "address",
803 | "name": "owner",
804 | "type": "address"
805 | }
806 | ],
807 | "name": "balanceOf",
808 | "outputs": [
809 | {
810 | "internalType": "uint256",
811 | "name": "",
812 | "type": "uint256"
813 | }
814 | ],
815 | "payable": false,
816 | "stateMutability": "view",
817 | "type": "function"
818 | },
819 | {
820 | "constant": false,
821 | "inputs": [
822 | {
823 | "internalType": "address",
824 | "name": "owner",
825 | "type": "address"
826 | }
827 | ],
828 | "name": "balanceOfUnderlying",
829 | "outputs": [
830 | {
831 | "internalType": "uint256",
832 | "name": "",
833 | "type": "uint256"
834 | }
835 | ],
836 | "payable": false,
837 | "stateMutability": "nonpayable",
838 | "type": "function"
839 | },
840 | {
841 | "constant": false,
842 | "inputs": [
843 | {
844 | "internalType": "address",
845 | "name": "adddress",
846 | "type": "address"
847 | },
848 | {
849 | "internalType": "uint256",
850 | "name": "borrowAmount",
851 | "type": "uint256"
852 | }
853 | ],
854 | "name": "borrow",
855 | "outputs": [
856 | {
857 | "internalType": "uint256",
858 | "name": "",
859 | "type": "uint256"
860 | }
861 | ],
862 | "payable": false,
863 | "stateMutability": "nonpayable",
864 | "type": "function"
865 | },
866 | {
867 | "constant": false,
868 | "inputs": [
869 | {
870 | "internalType": "address",
871 | "name": "adddress",
872 | "type": "address"
873 | },
874 | {
875 | "internalType": "uint256",
876 | "name": "supplyAmount",
877 | "type": "uint256"
878 | }
879 | ],
880 | "name": "supply",
881 | "outputs": [
882 | {
883 | "internalType": "uint256",
884 | "name": "",
885 | "type": "uint256"
886 | }
887 | ],
888 | "payable": true,
889 | "type": "function"
890 | },
891 | {
892 | "constant": false,
893 | "inputs": [
894 | {
895 | "internalType": "address",
896 | "name": "account",
897 | "type": "address"
898 | }
899 | ],
900 | "name": "borrowBalanceCurrent",
901 | "outputs": [
902 | {
903 | "internalType": "uint256",
904 | "name": "",
905 | "type": "uint256"
906 | }
907 | ],
908 | "payable": false,
909 | "stateMutability": "nonpayable",
910 | "type": "function"
911 | },
912 | {
913 | "constant": true,
914 | "inputs": [
915 | {
916 | "internalType": "address",
917 | "name": "account",
918 | "type": "address"
919 | }
920 | ],
921 | "name": "borrowBalanceStored",
922 | "outputs": [
923 | {
924 | "internalType": "uint256",
925 | "name": "",
926 | "type": "uint256"
927 | }
928 | ],
929 | "payable": false,
930 | "stateMutability": "view",
931 | "type": "function"
932 | },
933 | {
934 | "constant": true,
935 | "inputs": [],
936 | "name": "borrowIndex",
937 | "outputs": [
938 | {
939 | "internalType": "uint256",
940 | "name": "",
941 | "type": "uint256"
942 | }
943 | ],
944 | "payable": false,
945 | "stateMutability": "view",
946 | "type": "function"
947 | },
948 | {
949 | "constant": true,
950 | "inputs": [],
951 | "name": "borrowRatePerTimestamp",
952 | "outputs": [
953 | {
954 | "internalType": "uint256",
955 | "name": "",
956 | "type": "uint256"
957 | }
958 | ],
959 | "payable": false,
960 | "stateMutability": "view",
961 | "type": "function"
962 | },
963 | {
964 | "constant": true,
965 | "inputs": [],
966 | "name": "comptroller",
967 | "outputs": [
968 | {
969 | "internalType": "contract ComptrollerInterface",
970 | "name": "",
971 | "type": "address"
972 | }
973 | ],
974 | "payable": false,
975 | "stateMutability": "view",
976 | "type": "function"
977 | },
978 | {
979 | "constant": true,
980 | "inputs": [],
981 | "name": "decimals",
982 | "outputs": [
983 | {
984 | "internalType": "uint8",
985 | "name": "",
986 | "type": "uint8"
987 | }
988 | ],
989 | "payable": false,
990 | "stateMutability": "view",
991 | "type": "function"
992 | },
993 | {
994 | "constant": false,
995 | "inputs": [],
996 | "name": "exchangeRateCurrent",
997 | "outputs": [
998 | {
999 | "internalType": "uint256",
1000 | "name": "",
1001 | "type": "uint256"
1002 | }
1003 | ],
1004 | "payable": false,
1005 | "stateMutability": "nonpayable",
1006 | "type": "function"
1007 | },
1008 | {
1009 | "constant": true,
1010 | "inputs": [],
1011 | "name": "exchangeRateStored",
1012 | "outputs": [
1013 | {
1014 | "internalType": "uint256",
1015 | "name": "",
1016 | "type": "uint256"
1017 | }
1018 | ],
1019 | "payable": false,
1020 | "stateMutability": "view",
1021 | "type": "function"
1022 | },
1023 | {
1024 | "constant": true,
1025 | "inputs": [
1026 | {
1027 | "internalType": "address",
1028 | "name": "account",
1029 | "type": "address"
1030 | }
1031 | ],
1032 | "name": "getAccountSnapshot",
1033 | "outputs": [
1034 | {
1035 | "internalType": "uint256",
1036 | "name": "",
1037 | "type": "uint256"
1038 | },
1039 | {
1040 | "internalType": "uint256",
1041 | "name": "",
1042 | "type": "uint256"
1043 | },
1044 | {
1045 | "internalType": "uint256",
1046 | "name": "",
1047 | "type": "uint256"
1048 | },
1049 | {
1050 | "internalType": "uint256",
1051 | "name": "",
1052 | "type": "uint256"
1053 | }
1054 | ],
1055 | "payable": false,
1056 | "stateMutability": "view",
1057 | "type": "function"
1058 | },
1059 | {
1060 | "constant": true,
1061 | "inputs": [],
1062 | "name": "getCash",
1063 | "outputs": [
1064 | {
1065 | "internalType": "uint256",
1066 | "name": "",
1067 | "type": "uint256"
1068 | }
1069 | ],
1070 | "payable": false,
1071 | "stateMutability": "view",
1072 | "type": "function"
1073 | },
1074 | {
1075 | "constant": true,
1076 | "inputs": [],
1077 | "name": "incentivesController",
1078 | "outputs": [
1079 | {
1080 | "internalType": "contract IncentivesControllerInterface",
1081 | "name": "",
1082 | "type": "address"
1083 | }
1084 | ],
1085 | "payable": false,
1086 | "stateMutability": "view",
1087 | "type": "function"
1088 | },
1089 | {
1090 | "constant": false,
1091 | "inputs": [
1092 | {
1093 | "internalType": "contract ComptrollerInterface",
1094 | "name": "comptroller_",
1095 | "type": "address"
1096 | },
1097 | {
1098 | "internalType": "contract InterestRateModel",
1099 | "name": "interestRateModel_",
1100 | "type": "address"
1101 | },
1102 | {
1103 | "internalType": "uint256",
1104 | "name": "initialExchangeRateMantissa_",
1105 | "type": "uint256"
1106 | },
1107 | {
1108 | "internalType": "contract IncentivesControllerInterface",
1109 | "name": "incentivesController_",
1110 | "type": "address"
1111 | },
1112 | {
1113 | "internalType": "string",
1114 | "name": "name_",
1115 | "type": "string"
1116 | },
1117 | {
1118 | "internalType": "string",
1119 | "name": "symbol_",
1120 | "type": "string"
1121 | },
1122 | {
1123 | "internalType": "uint8",
1124 | "name": "decimals_",
1125 | "type": "uint8"
1126 | }
1127 | ],
1128 | "name": "initialize",
1129 | "outputs": [],
1130 | "payable": false,
1131 | "stateMutability": "nonpayable",
1132 | "type": "function"
1133 | },
1134 | {
1135 | "constant": true,
1136 | "inputs": [],
1137 | "name": "interestRateModel",
1138 | "outputs": [
1139 | {
1140 | "internalType": "contract InterestRateModel",
1141 | "name": "",
1142 | "type": "address"
1143 | }
1144 | ],
1145 | "payable": false,
1146 | "stateMutability": "view",
1147 | "type": "function"
1148 | },
1149 | {
1150 | "constant": true,
1151 | "inputs": [],
1152 | "name": "isBToken",
1153 | "outputs": [
1154 | {
1155 | "internalType": "bool",
1156 | "name": "",
1157 | "type": "bool"
1158 | }
1159 | ],
1160 | "payable": false,
1161 | "stateMutability": "view",
1162 | "type": "function"
1163 | },
1164 | {
1165 | "constant": false,
1166 | "inputs": [
1167 | {
1168 | "internalType": "address",
1169 | "name": "borrower",
1170 | "type": "address"
1171 | },
1172 | {
1173 | "internalType": "contract BToken",
1174 | "name": "bTokenCollateral",
1175 | "type": "address"
1176 | }
1177 | ],
1178 | "name": "liquidateBorrow",
1179 | "outputs": [],
1180 | "payable": true,
1181 | "stateMutability": "payable",
1182 | "type": "function"
1183 | },
1184 | {
1185 | "constant": false,
1186 | "inputs": [],
1187 | "name": "mint",
1188 | "outputs": [],
1189 | "payable": true,
1190 | "stateMutability": "payable",
1191 | "type": "function"
1192 | },
1193 | {
1194 | "constant": true,
1195 | "inputs": [],
1196 | "name": "name",
1197 | "outputs": [
1198 | {
1199 | "internalType": "string",
1200 | "name": "",
1201 | "type": "string"
1202 | }
1203 | ],
1204 | "payable": false,
1205 | "stateMutability": "view",
1206 | "type": "function"
1207 | },
1208 | {
1209 | "constant": true,
1210 | "inputs": [],
1211 | "name": "pendingAdmin",
1212 | "outputs": [
1213 | {
1214 | "internalType": "address payable",
1215 | "name": "",
1216 | "type": "address"
1217 | }
1218 | ],
1219 | "payable": false,
1220 | "stateMutability": "view",
1221 | "type": "function"
1222 | },
1223 | {
1224 | "constant": true,
1225 | "inputs": [],
1226 | "name": "protocolSeizeShareMantissa",
1227 | "outputs": [
1228 | {
1229 | "internalType": "uint256",
1230 | "name": "",
1231 | "type": "uint256"
1232 | }
1233 | ],
1234 | "payable": false,
1235 | "stateMutability": "view",
1236 | "type": "function"
1237 | },
1238 | {
1239 | "constant": false,
1240 | "inputs": [
1241 | {
1242 | "internalType": "uint256",
1243 | "name": "redeebTokens",
1244 | "type": "uint256"
1245 | }
1246 | ],
1247 | "name": "redeem",
1248 | "outputs": [
1249 | {
1250 | "internalType": "uint256",
1251 | "name": "",
1252 | "type": "uint256"
1253 | }
1254 | ],
1255 | "payable": false,
1256 | "stateMutability": "nonpayable",
1257 | "type": "function"
1258 | },
1259 | {
1260 | "constant": false,
1261 | "inputs": [
1262 | {
1263 | "internalType": "uint256",
1264 | "name": "redeemAmount",
1265 | "type": "uint256"
1266 | }
1267 | ],
1268 | "name": "redeemUnderlying",
1269 | "outputs": [
1270 | {
1271 | "internalType": "uint256",
1272 | "name": "",
1273 | "type": "uint256"
1274 | }
1275 | ],
1276 | "payable": false,
1277 | "stateMutability": "nonpayable",
1278 | "type": "function"
1279 | },
1280 | {
1281 | "constant": false,
1282 | "inputs": [],
1283 | "name": "repayBorrow",
1284 | "outputs": [],
1285 | "payable": true,
1286 | "stateMutability": "payable",
1287 | "type": "function"
1288 | },
1289 | {
1290 | "constant": false,
1291 | "inputs": [
1292 | {
1293 | "internalType": "address",
1294 | "name": "borrower",
1295 | "type": "address"
1296 | }
1297 | ],
1298 | "name": "repayBorrowBehalf",
1299 | "outputs": [],
1300 | "payable": true,
1301 | "stateMutability": "payable",
1302 | "type": "function"
1303 | },
1304 | {
1305 | "constant": true,
1306 | "inputs": [],
1307 | "name": "reserveFactorMantissa",
1308 | "outputs": [
1309 | {
1310 | "internalType": "uint256",
1311 | "name": "",
1312 | "type": "uint256"
1313 | }
1314 | ],
1315 | "payable": false,
1316 | "stateMutability": "view",
1317 | "type": "function"
1318 | },
1319 | {
1320 | "constant": false,
1321 | "inputs": [
1322 | {
1323 | "internalType": "address",
1324 | "name": "liquidator",
1325 | "type": "address"
1326 | },
1327 | {
1328 | "internalType": "address",
1329 | "name": "borrower",
1330 | "type": "address"
1331 | },
1332 | {
1333 | "internalType": "uint256",
1334 | "name": "seizeTokens",
1335 | "type": "uint256"
1336 | }
1337 | ],
1338 | "name": "seize",
1339 | "outputs": [
1340 | {
1341 | "internalType": "uint256",
1342 | "name": "",
1343 | "type": "uint256"
1344 | }
1345 | ],
1346 | "payable": false,
1347 | "stateMutability": "nonpayable",
1348 | "type": "function"
1349 | },
1350 | {
1351 | "constant": true,
1352 | "inputs": [],
1353 | "name": "supplyRatePerTimestamp",
1354 | "outputs": [
1355 | {
1356 | "internalType": "uint256",
1357 | "name": "",
1358 | "type": "uint256"
1359 | }
1360 | ],
1361 | "payable": false,
1362 | "stateMutability": "view",
1363 | "type": "function"
1364 | },
1365 | {
1366 | "constant": true,
1367 | "inputs": [],
1368 | "name": "symbol",
1369 | "outputs": [
1370 | {
1371 | "internalType": "string",
1372 | "name": "",
1373 | "type": "string"
1374 | }
1375 | ],
1376 | "payable": false,
1377 | "stateMutability": "view",
1378 | "type": "function"
1379 | },
1380 | {
1381 | "constant": true,
1382 | "inputs": [],
1383 | "name": "totalBorrows",
1384 | "outputs": [
1385 | {
1386 | "internalType": "uint256",
1387 | "name": "",
1388 | "type": "uint256"
1389 | }
1390 | ],
1391 | "payable": false,
1392 | "stateMutability": "view",
1393 | "type": "function"
1394 | },
1395 | {
1396 | "constant": false,
1397 | "inputs": [],
1398 | "name": "totalBorrowsCurrent",
1399 | "outputs": [
1400 | {
1401 | "internalType": "uint256",
1402 | "name": "",
1403 | "type": "uint256"
1404 | }
1405 | ],
1406 | "payable": false,
1407 | "stateMutability": "nonpayable",
1408 | "type": "function"
1409 | },
1410 | {
1411 | "constant": true,
1412 | "inputs": [],
1413 | "name": "totalReserves",
1414 | "outputs": [
1415 | {
1416 | "internalType": "uint256",
1417 | "name": "",
1418 | "type": "uint256"
1419 | }
1420 | ],
1421 | "payable": false,
1422 | "stateMutability": "view",
1423 | "type": "function"
1424 | },
1425 | {
1426 | "constant": true,
1427 | "inputs": [],
1428 | "name": "totalSupply",
1429 | "outputs": [
1430 | {
1431 | "internalType": "uint256",
1432 | "name": "",
1433 | "type": "uint256"
1434 | }
1435 | ],
1436 | "payable": false,
1437 | "stateMutability": "view",
1438 | "type": "function"
1439 | },
1440 | {
1441 | "constant": false,
1442 | "inputs": [
1443 | {
1444 | "internalType": "address",
1445 | "name": "dst",
1446 | "type": "address"
1447 | },
1448 | {
1449 | "internalType": "uint256",
1450 | "name": "amount",
1451 | "type": "uint256"
1452 | }
1453 | ],
1454 | "name": "transfer",
1455 | "outputs": [
1456 | {
1457 | "internalType": "bool",
1458 | "name": "",
1459 | "type": "bool"
1460 | }
1461 | ],
1462 | "payable": false,
1463 | "stateMutability": "nonpayable",
1464 | "type": "function"
1465 | },
1466 | {
1467 | "constant": false,
1468 | "inputs": [
1469 | {
1470 | "internalType": "address",
1471 | "name": "src",
1472 | "type": "address"
1473 | },
1474 | {
1475 | "internalType": "address",
1476 | "name": "dst",
1477 | "type": "address"
1478 | },
1479 | {
1480 | "internalType": "uint256",
1481 | "name": "amount",
1482 | "type": "uint256"
1483 | }
1484 | ],
1485 | "name": "transferFrom",
1486 | "outputs": [
1487 | {
1488 | "internalType": "bool",
1489 | "name": "",
1490 | "type": "bool"
1491 | }
1492 | ],
1493 | "payable": false,
1494 | "stateMutability": "nonpayable",
1495 | "type": "function"
1496 | }
1497 | ]
--------------------------------------------------------------------------------
/abi/meson.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "inputs":[
4 | {
5 | "internalType":"address",
6 | "name":"premiumManager",
7 | "type":"address"
8 | }
9 | ],
10 | "stateMutability":"nonpayable",
11 | "type":"constructor"
12 | },
13 | {
14 | "anonymous":false,
15 | "inputs":[
16 | {
17 | "indexed":true,
18 | "internalType":"address",
19 | "name":"prevOwner",
20 | "type":"address"
21 | },
22 | {
23 | "indexed":true,
24 | "internalType":"address",
25 | "name":"newOwner",
26 | "type":"address"
27 | }
28 | ],
29 | "name":"OwnerTransferred",
30 | "type":"event"
31 | },
32 | {
33 | "anonymous":false,
34 | "inputs":[
35 | {
36 | "indexed":true,
37 | "internalType":"uint40",
38 | "name":"poolIndex",
39 | "type":"uint40"
40 | },
41 | {
42 | "indexed":false,
43 | "internalType":"address",
44 | "name":"addr",
45 | "type":"address"
46 | }
47 | ],
48 | "name":"PoolAuthorizedAddrAdded",
49 | "type":"event"
50 | },
51 | {
52 | "anonymous":false,
53 | "inputs":[
54 | {
55 | "indexed":true,
56 | "internalType":"uint40",
57 | "name":"poolIndex",
58 | "type":"uint40"
59 | },
60 | {
61 | "indexed":false,
62 | "internalType":"address",
63 | "name":"addr",
64 | "type":"address"
65 | }
66 | ],
67 | "name":"PoolAuthorizedAddrRemoved",
68 | "type":"event"
69 | },
70 | {
71 | "anonymous":false,
72 | "inputs":[
73 | {
74 | "indexed":true,
75 | "internalType":"uint48",
76 | "name":"poolTokenIndex",
77 | "type":"uint48"
78 | },
79 | {
80 | "indexed":false,
81 | "internalType":"uint256",
82 | "name":"amount",
83 | "type":"uint256"
84 | }
85 | ],
86 | "name":"PoolDeposited",
87 | "type":"event"
88 | },
89 | {
90 | "anonymous":false,
91 | "inputs":[
92 | {
93 | "indexed":true,
94 | "internalType":"uint40",
95 | "name":"poolIndex",
96 | "type":"uint40"
97 | },
98 | {
99 | "indexed":false,
100 | "internalType":"address",
101 | "name":"prevOwner",
102 | "type":"address"
103 | },
104 | {
105 | "indexed":false,
106 | "internalType":"address",
107 | "name":"newOwner",
108 | "type":"address"
109 | }
110 | ],
111 | "name":"PoolOwnerTransferred",
112 | "type":"event"
113 | },
114 | {
115 | "anonymous":false,
116 | "inputs":[
117 | {
118 | "indexed":true,
119 | "internalType":"uint40",
120 | "name":"poolIndex",
121 | "type":"uint40"
122 | },
123 | {
124 | "indexed":false,
125 | "internalType":"address",
126 | "name":"owner",
127 | "type":"address"
128 | }
129 | ],
130 | "name":"PoolRegistered",
131 | "type":"event"
132 | },
133 | {
134 | "anonymous":false,
135 | "inputs":[
136 | {
137 | "indexed":true,
138 | "internalType":"uint48",
139 | "name":"poolTokenIndex",
140 | "type":"uint48"
141 | },
142 | {
143 | "indexed":false,
144 | "internalType":"uint256",
145 | "name":"amount",
146 | "type":"uint256"
147 | }
148 | ],
149 | "name":"PoolWithdrawn",
150 | "type":"event"
151 | },
152 | {
153 | "anonymous":false,
154 | "inputs":[
155 | {
156 | "indexed":true,
157 | "internalType":"address",
158 | "name":"prevPremiumManager",
159 | "type":"address"
160 | },
161 | {
162 | "indexed":true,
163 | "internalType":"address",
164 | "name":"newPremiumManager",
165 | "type":"address"
166 | }
167 | ],
168 | "name":"PremiumManagerTransferred",
169 | "type":"event"
170 | },
171 | {
172 | "anonymous":false,
173 | "inputs":[
174 | {
175 | "indexed":true,
176 | "internalType":"uint256",
177 | "name":"encodedSwap",
178 | "type":"uint256"
179 | }
180 | ],
181 | "name":"SwapBonded",
182 | "type":"event"
183 | },
184 | {
185 | "anonymous":false,
186 | "inputs":[
187 | {
188 | "indexed":true,
189 | "internalType":"uint256",
190 | "name":"encodedSwap",
191 | "type":"uint256"
192 | }
193 | ],
194 | "name":"SwapCancelled",
195 | "type":"event"
196 | },
197 | {
198 | "anonymous":false,
199 | "inputs":[
200 | {
201 | "indexed":true,
202 | "internalType":"uint256",
203 | "name":"encodedSwap",
204 | "type":"uint256"
205 | }
206 | ],
207 | "name":"SwapExecuted",
208 | "type":"event"
209 | },
210 | {
211 | "anonymous":false,
212 | "inputs":[
213 | {
214 | "indexed":true,
215 | "internalType":"uint256",
216 | "name":"encodedSwap",
217 | "type":"uint256"
218 | }
219 | ],
220 | "name":"SwapLocked",
221 | "type":"event"
222 | },
223 | {
224 | "anonymous":false,
225 | "inputs":[
226 | {
227 | "indexed":true,
228 | "internalType":"uint256",
229 | "name":"encodedSwap",
230 | "type":"uint256"
231 | }
232 | ],
233 | "name":"SwapPosted",
234 | "type":"event"
235 | },
236 | {
237 | "anonymous":false,
238 | "inputs":[
239 | {
240 | "indexed":true,
241 | "internalType":"uint256",
242 | "name":"encodedSwap",
243 | "type":"uint256"
244 | }
245 | ],
246 | "name":"SwapReleased",
247 | "type":"event"
248 | },
249 | {
250 | "anonymous":false,
251 | "inputs":[
252 | {
253 | "indexed":true,
254 | "internalType":"uint256",
255 | "name":"encodedSwap",
256 | "type":"uint256"
257 | }
258 | ],
259 | "name":"SwapUnlocked",
260 | "type":"event"
261 | },
262 | {
263 | "inputs":[
264 | {
265 | "internalType":"address",
266 | "name":"addr",
267 | "type":"address"
268 | }
269 | ],
270 | "name":"addAuthorizedAddr",
271 | "outputs":[
272 |
273 | ],
274 | "stateMutability":"nonpayable",
275 | "type":"function"
276 | },
277 | {
278 | "inputs":[
279 | {
280 | "internalType":"address[]",
281 | "name":"tokens",
282 | "type":"address[]"
283 | },
284 | {
285 | "internalType":"uint8[]",
286 | "name":"indexes",
287 | "type":"uint8[]"
288 | }
289 | ],
290 | "name":"addMultipleSupportedTokens",
291 | "outputs":[
292 |
293 | ],
294 | "stateMutability":"nonpayable",
295 | "type":"function"
296 | },
297 | {
298 | "inputs":[
299 | {
300 | "internalType":"address",
301 | "name":"token",
302 | "type":"address"
303 | },
304 | {
305 | "internalType":"uint8",
306 | "name":"index",
307 | "type":"uint8"
308 | }
309 | ],
310 | "name":"addSupportToken",
311 | "outputs":[
312 |
313 | ],
314 | "stateMutability":"nonpayable",
315 | "type":"function"
316 | },
317 | {
318 | "inputs":[
319 | {
320 | "internalType":"uint256",
321 | "name":"encodedSwap",
322 | "type":"uint256"
323 | },
324 | {
325 | "internalType":"uint40",
326 | "name":"poolIndex",
327 | "type":"uint40"
328 | }
329 | ],
330 | "name":"bondSwap",
331 | "outputs":[
332 |
333 | ],
334 | "stateMutability":"nonpayable",
335 | "type":"function"
336 | },
337 | {
338 | "inputs":[
339 | {
340 | "internalType":"uint256",
341 | "name":"encodedSwap",
342 | "type":"uint256"
343 | }
344 | ],
345 | "name":"cancelSwap",
346 | "outputs":[
347 |
348 | ],
349 | "stateMutability":"nonpayable",
350 | "type":"function"
351 | },
352 | {
353 | "inputs":[
354 | {
355 | "internalType":"uint256",
356 | "name":"encodedSwap",
357 | "type":"uint256"
358 | },
359 | {
360 | "internalType":"address",
361 | "name":"recipient",
362 | "type":"address"
363 | },
364 | {
365 | "internalType":"bytes32",
366 | "name":"r",
367 | "type":"bytes32"
368 | },
369 | {
370 | "internalType":"bytes32",
371 | "name":"yParityAndS",
372 | "type":"bytes32"
373 | }
374 | ],
375 | "name":"cancelSwapTo",
376 | "outputs":[
377 |
378 | ],
379 | "stateMutability":"nonpayable",
380 | "type":"function"
381 | },
382 | {
383 | "inputs":[
384 | {
385 | "internalType":"uint256",
386 | "name":"amount",
387 | "type":"uint256"
388 | },
389 | {
390 | "internalType":"uint48",
391 | "name":"poolTokenIndex",
392 | "type":"uint48"
393 | }
394 | ],
395 | "name":"deposit",
396 | "outputs":[
397 |
398 | ],
399 | "stateMutability":"payable",
400 | "type":"function"
401 | },
402 | {
403 | "inputs":[
404 | {
405 | "internalType":"uint256",
406 | "name":"amount",
407 | "type":"uint256"
408 | },
409 | {
410 | "internalType":"uint48",
411 | "name":"poolTokenIndex",
412 | "type":"uint48"
413 | }
414 | ],
415 | "name":"depositAndRegister",
416 | "outputs":[
417 |
418 | ],
419 | "stateMutability":"payable",
420 | "type":"function"
421 | },
422 | {
423 | "inputs":[
424 | {
425 | "internalType":"uint256",
426 | "name":"encodedSwap",
427 | "type":"uint256"
428 | },
429 | {
430 | "internalType":"bytes32",
431 | "name":"r",
432 | "type":"bytes32"
433 | },
434 | {
435 | "internalType":"bytes32",
436 | "name":"yParityAndS",
437 | "type":"bytes32"
438 | },
439 | {
440 | "internalType":"address",
441 | "name":"initiator",
442 | "type":"address"
443 | },
444 | {
445 | "internalType":"address",
446 | "name":"recipient",
447 | "type":"address"
448 | }
449 | ],
450 | "name":"directExecuteSwap",
451 | "outputs":[
452 |
453 | ],
454 | "stateMutability":"nonpayable",
455 | "type":"function"
456 | },
457 | {
458 | "inputs":[
459 | {
460 | "internalType":"uint256",
461 | "name":"encodedSwap",
462 | "type":"uint256"
463 | },
464 | {
465 | "internalType":"bytes32",
466 | "name":"r",
467 | "type":"bytes32"
468 | },
469 | {
470 | "internalType":"bytes32",
471 | "name":"yParityAndS",
472 | "type":"bytes32"
473 | },
474 | {
475 | "internalType":"address",
476 | "name":"initiator",
477 | "type":"address"
478 | },
479 | {
480 | "internalType":"address",
481 | "name":"recipient",
482 | "type":"address"
483 | }
484 | ],
485 | "name":"directRelease",
486 | "outputs":[
487 |
488 | ],
489 | "stateMutability":"nonpayable",
490 | "type":"function"
491 | },
492 | {
493 | "inputs":[
494 | {
495 | "internalType":"uint256",
496 | "name":"encodedSwap",
497 | "type":"uint256"
498 | },
499 | {
500 | "internalType":"address",
501 | "name":"recipient",
502 | "type":"address"
503 | },
504 | {
505 | "internalType":"bytes32",
506 | "name":"r",
507 | "type":"bytes32"
508 | },
509 | {
510 | "internalType":"bytes32",
511 | "name":"yParityAndS",
512 | "type":"bytes32"
513 | }
514 | ],
515 | "name":"directSwap",
516 | "outputs":[
517 |
518 | ],
519 | "stateMutability":"nonpayable",
520 | "type":"function"
521 | },
522 | {
523 | "inputs":[
524 | {
525 | "internalType":"uint256",
526 | "name":"encodedSwap",
527 | "type":"uint256"
528 | },
529 | {
530 | "internalType":"bytes32",
531 | "name":"r",
532 | "type":"bytes32"
533 | },
534 | {
535 | "internalType":"bytes32",
536 | "name":"yParityAndS",
537 | "type":"bytes32"
538 | },
539 | {
540 | "internalType":"address",
541 | "name":"recipient",
542 | "type":"address"
543 | },
544 | {
545 | "internalType":"bool",
546 | "name":"depositToPool",
547 | "type":"bool"
548 | }
549 | ],
550 | "name":"executeSwap",
551 | "outputs":[
552 |
553 | ],
554 | "stateMutability":"nonpayable",
555 | "type":"function"
556 | },
557 | {
558 | "inputs":[
559 | {
560 | "internalType":"uint256",
561 | "name":"encodedSwap",
562 | "type":"uint256"
563 | },
564 | {
565 | "internalType":"address",
566 | "name":"initiator",
567 | "type":"address"
568 | }
569 | ],
570 | "name":"getLockedSwap",
571 | "outputs":[
572 | {
573 | "internalType":"address",
574 | "name":"poolOwner",
575 | "type":"address"
576 | },
577 | {
578 | "internalType":"uint40",
579 | "name":"until",
580 | "type":"uint40"
581 | }
582 | ],
583 | "stateMutability":"view",
584 | "type":"function"
585 | },
586 | {
587 | "inputs":[
588 | {
589 | "internalType":"uint256",
590 | "name":"encodedSwap",
591 | "type":"uint256"
592 | }
593 | ],
594 | "name":"getPostedSwap",
595 | "outputs":[
596 | {
597 | "internalType":"address",
598 | "name":"initiator",
599 | "type":"address"
600 | },
601 | {
602 | "internalType":"address",
603 | "name":"poolOwner",
604 | "type":"address"
605 | },
606 | {
607 | "internalType":"bool",
608 | "name":"exist",
609 | "type":"bool"
610 | }
611 | ],
612 | "stateMutability":"view",
613 | "type":"function"
614 | },
615 | {
616 | "inputs":[
617 |
618 | ],
619 | "name":"getShortCoinType",
620 | "outputs":[
621 | {
622 | "internalType":"bytes2",
623 | "name":"",
624 | "type":"bytes2"
625 | }
626 | ],
627 | "stateMutability":"pure",
628 | "type":"function"
629 | },
630 | {
631 | "inputs":[
632 |
633 | ],
634 | "name":"getSupportedTokens",
635 | "outputs":[
636 | {
637 | "internalType":"address[]",
638 | "name":"tokens",
639 | "type":"address[]"
640 | },
641 | {
642 | "internalType":"uint8[]",
643 | "name":"indexes",
644 | "type":"uint8[]"
645 | }
646 | ],
647 | "stateMutability":"view",
648 | "type":"function"
649 | },
650 | {
651 | "inputs":[
652 | {
653 | "internalType":"address",
654 | "name":"",
655 | "type":"address"
656 | }
657 | ],
658 | "name":"indexOfToken",
659 | "outputs":[
660 | {
661 | "internalType":"uint8",
662 | "name":"",
663 | "type":"uint8"
664 | }
665 | ],
666 | "stateMutability":"view",
667 | "type":"function"
668 | },
669 | {
670 | "inputs":[
671 | {
672 | "internalType":"uint256",
673 | "name":"encodedSwap",
674 | "type":"uint256"
675 | },
676 | {
677 | "internalType":"bytes32",
678 | "name":"r",
679 | "type":"bytes32"
680 | },
681 | {
682 | "internalType":"bytes32",
683 | "name":"yParityAndS",
684 | "type":"bytes32"
685 | },
686 | {
687 | "internalType":"address",
688 | "name":"initiator",
689 | "type":"address"
690 | }
691 | ],
692 | "name":"lock",
693 | "outputs":[
694 |
695 | ],
696 | "stateMutability":"nonpayable",
697 | "type":"function"
698 | },
699 | {
700 | "inputs":[
701 | {
702 | "internalType":"uint256",
703 | "name":"encodedSwap",
704 | "type":"uint256"
705 | },
706 | {
707 | "internalType":"address",
708 | "name":"initiator",
709 | "type":"address"
710 | }
711 | ],
712 | "name":"lockSwap",
713 | "outputs":[
714 |
715 | ],
716 | "stateMutability":"nonpayable",
717 | "type":"function"
718 | },
719 | {
720 | "inputs":[
721 | {
722 | "internalType":"uint40",
723 | "name":"",
724 | "type":"uint40"
725 | }
726 | ],
727 | "name":"ownerOfPool",
728 | "outputs":[
729 | {
730 | "internalType":"address",
731 | "name":"",
732 | "type":"address"
733 | }
734 | ],
735 | "stateMutability":"view",
736 | "type":"function"
737 | },
738 | {
739 | "inputs":[
740 | {
741 | "internalType":"address",
742 | "name":"",
743 | "type":"address"
744 | }
745 | ],
746 | "name":"poolOfAuthorizedAddr",
747 | "outputs":[
748 | {
749 | "internalType":"uint40",
750 | "name":"",
751 | "type":"uint40"
752 | }
753 | ],
754 | "stateMutability":"view",
755 | "type":"function"
756 | },
757 | {
758 | "inputs":[
759 | {
760 | "internalType":"address",
761 | "name":"token",
762 | "type":"address"
763 | },
764 | {
765 | "internalType":"address",
766 | "name":"addr",
767 | "type":"address"
768 | }
769 | ],
770 | "name":"poolTokenBalance",
771 | "outputs":[
772 | {
773 | "internalType":"uint256",
774 | "name":"",
775 | "type":"uint256"
776 | }
777 | ],
778 | "stateMutability":"view",
779 | "type":"function"
780 | },
781 | {
782 | "inputs":[
783 | {
784 | "internalType":"uint256",
785 | "name":"encodedSwap",
786 | "type":"uint256"
787 | },
788 | {
789 | "internalType":"bytes32",
790 | "name":"r",
791 | "type":"bytes32"
792 | },
793 | {
794 | "internalType":"bytes32",
795 | "name":"yParityAndS",
796 | "type":"bytes32"
797 | },
798 | {
799 | "internalType":"uint200",
800 | "name":"postingValue",
801 | "type":"uint200"
802 | }
803 | ],
804 | "name":"postSwap",
805 | "outputs":[
806 |
807 | ],
808 | "stateMutability":"nonpayable",
809 | "type":"function"
810 | },
811 | {
812 | "inputs":[
813 | {
814 | "internalType":"uint256",
815 | "name":"encodedSwap",
816 | "type":"uint256"
817 | },
818 | {
819 | "internalType":"uint200",
820 | "name":"postingValue",
821 | "type":"uint200"
822 | },
823 | {
824 | "internalType":"address",
825 | "name":"contractAddress",
826 | "type":"address"
827 | }
828 | ],
829 | "name":"postSwapFromContract",
830 | "outputs":[
831 |
832 | ],
833 | "stateMutability":"payable",
834 | "type":"function"
835 | },
836 | {
837 | "inputs":[
838 | {
839 | "internalType":"uint256",
840 | "name":"encodedSwap",
841 | "type":"uint256"
842 | },
843 | {
844 | "internalType":"uint200",
845 | "name":"postingValue",
846 | "type":"uint200"
847 | }
848 | ],
849 | "name":"postSwapFromInitiator",
850 | "outputs":[
851 |
852 | ],
853 | "stateMutability":"payable",
854 | "type":"function"
855 | },
856 | {
857 | "inputs":[
858 | {
859 | "internalType":"uint256",
860 | "name":"encodedSwap",
861 | "type":"uint256"
862 | },
863 | {
864 | "internalType":"bytes32",
865 | "name":"r",
866 | "type":"bytes32"
867 | },
868 | {
869 | "internalType":"bytes32",
870 | "name":"yParityAndS",
871 | "type":"bytes32"
872 | },
873 | {
874 | "internalType":"address",
875 | "name":"initiator",
876 | "type":"address"
877 | },
878 | {
879 | "internalType":"address",
880 | "name":"recipient",
881 | "type":"address"
882 | }
883 | ],
884 | "name":"release",
885 | "outputs":[
886 |
887 | ],
888 | "stateMutability":"nonpayable",
889 | "type":"function"
890 | },
891 | {
892 | "inputs":[
893 | {
894 | "internalType":"address",
895 | "name":"addr",
896 | "type":"address"
897 | }
898 | ],
899 | "name":"removeAuthorizedAddr",
900 | "outputs":[
901 |
902 | ],
903 | "stateMutability":"nonpayable",
904 | "type":"function"
905 | },
906 | {
907 | "inputs":[
908 | {
909 | "internalType":"uint8",
910 | "name":"index",
911 | "type":"uint8"
912 | }
913 | ],
914 | "name":"removeSupportToken",
915 | "outputs":[
916 |
917 | ],
918 | "stateMutability":"nonpayable",
919 | "type":"function"
920 | },
921 | {
922 | "inputs":[
923 | {
924 | "internalType":"uint8",
925 | "name":"tokenIndex",
926 | "type":"uint8"
927 | }
928 | ],
929 | "name":"serviceFeeCollected",
930 | "outputs":[
931 | {
932 | "internalType":"uint256",
933 | "name":"",
934 | "type":"uint256"
935 | }
936 | ],
937 | "stateMutability":"view",
938 | "type":"function"
939 | },
940 | {
941 | "inputs":[
942 | {
943 | "internalType":"uint256",
944 | "name":"encodedSwap",
945 | "type":"uint256"
946 | }
947 | ],
948 | "name":"simpleExecuteSwap",
949 | "outputs":[
950 |
951 | ],
952 | "stateMutability":"nonpayable",
953 | "type":"function"
954 | },
955 | {
956 | "inputs":[
957 | {
958 | "internalType":"uint256",
959 | "name":"encodedSwap",
960 | "type":"uint256"
961 | },
962 | {
963 | "internalType":"address",
964 | "name":"recipient",
965 | "type":"address"
966 | }
967 | ],
968 | "name":"simpleRelease",
969 | "outputs":[
970 |
971 | ],
972 | "stateMutability":"nonpayable",
973 | "type":"function"
974 | },
975 | {
976 | "inputs":[
977 | {
978 | "internalType":"uint8",
979 | "name":"",
980 | "type":"uint8"
981 | }
982 | ],
983 | "name":"tokenForIndex",
984 | "outputs":[
985 | {
986 | "internalType":"address",
987 | "name":"",
988 | "type":"address"
989 | }
990 | ],
991 | "stateMutability":"view",
992 | "type":"function"
993 | },
994 | {
995 | "inputs":[
996 | {
997 | "internalType":"address",
998 | "name":"newOwner",
999 | "type":"address"
1000 | }
1001 | ],
1002 | "name":"transferOwnership",
1003 | "outputs":[
1004 |
1005 | ],
1006 | "stateMutability":"nonpayable",
1007 | "type":"function"
1008 | },
1009 | {
1010 | "inputs":[
1011 | {
1012 | "internalType":"address",
1013 | "name":"addr",
1014 | "type":"address"
1015 | }
1016 | ],
1017 | "name":"transferPoolOwner",
1018 | "outputs":[
1019 |
1020 | ],
1021 | "stateMutability":"nonpayable",
1022 | "type":"function"
1023 | },
1024 | {
1025 | "inputs":[
1026 | {
1027 | "internalType":"address",
1028 | "name":"newPremiumManager",
1029 | "type":"address"
1030 | }
1031 | ],
1032 | "name":"transferPremiumManager",
1033 | "outputs":[
1034 |
1035 | ],
1036 | "stateMutability":"nonpayable",
1037 | "type":"function"
1038 | },
1039 | {
1040 | "inputs":[
1041 | {
1042 | "internalType":"uint256",
1043 | "name":"encodedSwap",
1044 | "type":"uint256"
1045 | },
1046 | {
1047 | "internalType":"address",
1048 | "name":"initiator",
1049 | "type":"address"
1050 | }
1051 | ],
1052 | "name":"unlock",
1053 | "outputs":[
1054 |
1055 | ],
1056 | "stateMutability":"nonpayable",
1057 | "type":"function"
1058 | },
1059 | {
1060 | "inputs":[
1061 | {
1062 | "internalType":"uint256",
1063 | "name":"amount",
1064 | "type":"uint256"
1065 | },
1066 | {
1067 | "internalType":"uint48",
1068 | "name":"poolTokenIndex",
1069 | "type":"uint48"
1070 | }
1071 | ],
1072 | "name":"withdraw",
1073 | "outputs":[
1074 |
1075 | ],
1076 | "stateMutability":"nonpayable",
1077 | "type":"function"
1078 | },
1079 | {
1080 | "inputs":[
1081 | {
1082 | "internalType":"uint8",
1083 | "name":"tokenIndex",
1084 | "type":"uint8"
1085 | },
1086 | {
1087 | "internalType":"uint256",
1088 | "name":"amount",
1089 | "type":"uint256"
1090 | },
1091 | {
1092 | "internalType":"uint40",
1093 | "name":"toPoolIndex",
1094 | "type":"uint40"
1095 | }
1096 | ],
1097 | "name":"withdrawServiceFee",
1098 | "outputs":[
1099 |
1100 | ],
1101 | "stateMutability":"nonpayable",
1102 | "type":"function"
1103 | }
1104 | ]
--------------------------------------------------------------------------------
/abi/position.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "inputs": [
4 | {
5 | "internalType": "address",
6 | "name": "_factory",
7 | "type": "address"
8 | },
9 | {
10 | "internalType": "address",
11 | "name": "_WETH9",
12 | "type": "address"
13 | },
14 | {
15 | "internalType": "address",
16 | "name": "_tokenDescriptor_",
17 | "type": "address"
18 | }
19 | ],
20 | "stateMutability": "nonpayable",
21 | "type": "constructor"
22 | },
23 | {
24 | "anonymous": false,
25 | "inputs": [
26 | {
27 | "indexed": true,
28 | "internalType": "address",
29 | "name": "owner",
30 | "type": "address"
31 | },
32 | {
33 | "indexed": true,
34 | "internalType": "address",
35 | "name": "approved",
36 | "type": "address"
37 | },
38 | {
39 | "indexed": true,
40 | "internalType": "uint256",
41 | "name": "tokenId",
42 | "type": "uint256"
43 | }
44 | ],
45 | "name": "Approval",
46 | "type": "event"
47 | },
48 | {
49 | "anonymous": false,
50 | "inputs": [
51 | {
52 | "indexed": true,
53 | "internalType": "address",
54 | "name": "owner",
55 | "type": "address"
56 | },
57 | {
58 | "indexed": true,
59 | "internalType": "address",
60 | "name": "operator",
61 | "type": "address"
62 | },
63 | {
64 | "indexed": false,
65 | "internalType": "bool",
66 | "name": "approved",
67 | "type": "bool"
68 | }
69 | ],
70 | "name": "ApprovalForAll",
71 | "type": "event"
72 | },
73 | {
74 | "anonymous": false,
75 | "inputs": [
76 | {
77 | "indexed": true,
78 | "internalType": "uint256",
79 | "name": "tokenId",
80 | "type": "uint256"
81 | },
82 | {
83 | "indexed": false,
84 | "internalType": "address",
85 | "name": "recipient",
86 | "type": "address"
87 | },
88 | {
89 | "indexed": false,
90 | "internalType": "uint256",
91 | "name": "amount0",
92 | "type": "uint256"
93 | },
94 | {
95 | "indexed": false,
96 | "internalType": "uint256",
97 | "name": "amount1",
98 | "type": "uint256"
99 | }
100 | ],
101 | "name": "Collect",
102 | "type": "event"
103 | },
104 | {
105 | "anonymous": false,
106 | "inputs": [
107 | {
108 | "indexed": true,
109 | "internalType": "uint256",
110 | "name": "tokenId",
111 | "type": "uint256"
112 | },
113 | {
114 | "indexed": false,
115 | "internalType": "uint128",
116 | "name": "liquidity",
117 | "type": "uint128"
118 | },
119 | {
120 | "indexed": false,
121 | "internalType": "uint256",
122 | "name": "amount0",
123 | "type": "uint256"
124 | },
125 | {
126 | "indexed": false,
127 | "internalType": "uint256",
128 | "name": "amount1",
129 | "type": "uint256"
130 | }
131 | ],
132 | "name": "DecreaseLiquidity",
133 | "type": "event"
134 | },
135 | {
136 | "anonymous": false,
137 | "inputs": [
138 | {
139 | "indexed": true,
140 | "internalType": "uint256",
141 | "name": "tokenId",
142 | "type": "uint256"
143 | },
144 | {
145 | "indexed": false,
146 | "internalType": "uint128",
147 | "name": "liquidity",
148 | "type": "uint128"
149 | },
150 | {
151 | "indexed": false,
152 | "internalType": "uint256",
153 | "name": "amount0",
154 | "type": "uint256"
155 | },
156 | {
157 | "indexed": false,
158 | "internalType": "uint256",
159 | "name": "amount1",
160 | "type": "uint256"
161 | }
162 | ],
163 | "name": "IncreaseLiquidity",
164 | "type": "event"
165 | },
166 | {
167 | "anonymous": false,
168 | "inputs": [
169 | {
170 | "indexed": true,
171 | "internalType": "address",
172 | "name": "from",
173 | "type": "address"
174 | },
175 | {
176 | "indexed": true,
177 | "internalType": "address",
178 | "name": "to",
179 | "type": "address"
180 | },
181 | {
182 | "indexed": true,
183 | "internalType": "uint256",
184 | "name": "tokenId",
185 | "type": "uint256"
186 | }
187 | ],
188 | "name": "Transfer",
189 | "type": "event"
190 | },
191 | {
192 | "inputs": [],
193 | "name": "DOMAIN_SEPARATOR",
194 | "outputs": [
195 | {
196 | "internalType": "bytes32",
197 | "name": "",
198 | "type": "bytes32"
199 | }
200 | ],
201 | "stateMutability": "view",
202 | "type": "function"
203 | },
204 | {
205 | "inputs": [],
206 | "name": "PERMIT_TYPEHASH",
207 | "outputs": [
208 | {
209 | "internalType": "bytes32",
210 | "name": "",
211 | "type": "bytes32"
212 | }
213 | ],
214 | "stateMutability": "view",
215 | "type": "function"
216 | },
217 | {
218 | "inputs": [],
219 | "name": "WETH9",
220 | "outputs": [
221 | {
222 | "internalType": "address",
223 | "name": "",
224 | "type": "address"
225 | }
226 | ],
227 | "stateMutability": "view",
228 | "type": "function"
229 | },
230 | {
231 | "inputs": [
232 | {
233 | "internalType": "address",
234 | "name": "to",
235 | "type": "address"
236 | },
237 | {
238 | "internalType": "uint256",
239 | "name": "tokenId",
240 | "type": "uint256"
241 | }
242 | ],
243 | "name": "approve",
244 | "outputs": [],
245 | "stateMutability": "nonpayable",
246 | "type": "function"
247 | },
248 | {
249 | "inputs": [
250 | {
251 | "internalType": "address",
252 | "name": "owner",
253 | "type": "address"
254 | }
255 | ],
256 | "name": "balanceOf",
257 | "outputs": [
258 | {
259 | "internalType": "uint256",
260 | "name": "",
261 | "type": "uint256"
262 | }
263 | ],
264 | "stateMutability": "view",
265 | "type": "function"
266 | },
267 | {
268 | "inputs": [],
269 | "name": "baseURI",
270 | "outputs": [
271 | {
272 | "internalType": "string",
273 | "name": "",
274 | "type": "string"
275 | }
276 | ],
277 | "stateMutability": "pure",
278 | "type": "function"
279 | },
280 | {
281 | "inputs": [
282 | {
283 | "internalType": "uint256",
284 | "name": "tokenId",
285 | "type": "uint256"
286 | }
287 | ],
288 | "name": "burn",
289 | "outputs": [],
290 | "stateMutability": "payable",
291 | "type": "function"
292 | },
293 | {
294 | "inputs": [
295 | {
296 | "components": [
297 | {
298 | "internalType": "uint256",
299 | "name": "tokenId",
300 | "type": "uint256"
301 | },
302 | {
303 | "internalType": "address",
304 | "name": "recipient",
305 | "type": "address"
306 | },
307 | {
308 | "internalType": "uint128",
309 | "name": "amount0Max",
310 | "type": "uint128"
311 | },
312 | {
313 | "internalType": "uint128",
314 | "name": "amount1Max",
315 | "type": "uint128"
316 | }
317 | ],
318 | "internalType": "struct INonfungiblePositionManager.CollectParams",
319 | "name": "params",
320 | "type": "tuple"
321 | }
322 | ],
323 | "name": "collect",
324 | "outputs": [
325 | {
326 | "internalType": "uint256",
327 | "name": "amount0",
328 | "type": "uint256"
329 | },
330 | {
331 | "internalType": "uint256",
332 | "name": "amount1",
333 | "type": "uint256"
334 | }
335 | ],
336 | "stateMutability": "payable",
337 | "type": "function"
338 | },
339 | {
340 | "inputs": [
341 | {
342 | "internalType": "address",
343 | "name": "token0",
344 | "type": "address"
345 | },
346 | {
347 | "internalType": "address",
348 | "name": "token1",
349 | "type": "address"
350 | },
351 | {
352 | "internalType": "uint24",
353 | "name": "fee",
354 | "type": "uint24"
355 | },
356 | {
357 | "internalType": "uint160",
358 | "name": "sqrtPriceX96",
359 | "type": "uint160"
360 | }
361 | ],
362 | "name": "createAndInitializePoolIfNecessary",
363 | "outputs": [
364 | {
365 | "internalType": "address",
366 | "name": "pool",
367 | "type": "address"
368 | }
369 | ],
370 | "stateMutability": "payable",
371 | "type": "function"
372 | },
373 | {
374 | "inputs": [
375 | {
376 | "components": [
377 | {
378 | "internalType": "uint256",
379 | "name": "tokenId",
380 | "type": "uint256"
381 | },
382 | {
383 | "internalType": "uint128",
384 | "name": "liquidity",
385 | "type": "uint128"
386 | },
387 | {
388 | "internalType": "uint256",
389 | "name": "amount0Min",
390 | "type": "uint256"
391 | },
392 | {
393 | "internalType": "uint256",
394 | "name": "amount1Min",
395 | "type": "uint256"
396 | },
397 | {
398 | "internalType": "uint256",
399 | "name": "deadline",
400 | "type": "uint256"
401 | }
402 | ],
403 | "internalType": "struct INonfungiblePositionManager.DecreaseLiquidityParams",
404 | "name": "params",
405 | "type": "tuple"
406 | }
407 | ],
408 | "name": "decreaseLiquidity",
409 | "outputs": [
410 | {
411 | "internalType": "uint256",
412 | "name": "amount0",
413 | "type": "uint256"
414 | },
415 | {
416 | "internalType": "uint256",
417 | "name": "amount1",
418 | "type": "uint256"
419 | }
420 | ],
421 | "stateMutability": "payable",
422 | "type": "function"
423 | },
424 | {
425 | "inputs": [],
426 | "name": "factory",
427 | "outputs": [
428 | {
429 | "internalType": "address",
430 | "name": "",
431 | "type": "address"
432 | }
433 | ],
434 | "stateMutability": "view",
435 | "type": "function"
436 | },
437 | {
438 | "inputs": [
439 | {
440 | "internalType": "uint256",
441 | "name": "tokenId",
442 | "type": "uint256"
443 | }
444 | ],
445 | "name": "getApproved",
446 | "outputs": [
447 | {
448 | "internalType": "address",
449 | "name": "",
450 | "type": "address"
451 | }
452 | ],
453 | "stateMutability": "view",
454 | "type": "function"
455 | },
456 | {
457 | "inputs": [
458 | {
459 | "components": [
460 | {
461 | "internalType": "uint256",
462 | "name": "tokenId",
463 | "type": "uint256"
464 | },
465 | {
466 | "internalType": "uint256",
467 | "name": "amount0Desired",
468 | "type": "uint256"
469 | },
470 | {
471 | "internalType": "uint256",
472 | "name": "amount1Desired",
473 | "type": "uint256"
474 | },
475 | {
476 | "internalType": "uint256",
477 | "name": "amount0Min",
478 | "type": "uint256"
479 | },
480 | {
481 | "internalType": "uint256",
482 | "name": "amount1Min",
483 | "type": "uint256"
484 | },
485 | {
486 | "internalType": "uint256",
487 | "name": "deadline",
488 | "type": "uint256"
489 | }
490 | ],
491 | "internalType": "struct INonfungiblePositionManager.IncreaseLiquidityParams",
492 | "name": "params",
493 | "type": "tuple"
494 | }
495 | ],
496 | "name": "increaseLiquidity",
497 | "outputs": [
498 | {
499 | "internalType": "uint128",
500 | "name": "liquidity",
501 | "type": "uint128"
502 | },
503 | {
504 | "internalType": "uint256",
505 | "name": "amount0",
506 | "type": "uint256"
507 | },
508 | {
509 | "internalType": "uint256",
510 | "name": "amount1",
511 | "type": "uint256"
512 | }
513 | ],
514 | "stateMutability": "payable",
515 | "type": "function"
516 | },
517 | {
518 | "inputs": [
519 | {
520 | "internalType": "address",
521 | "name": "owner",
522 | "type": "address"
523 | },
524 | {
525 | "internalType": "address",
526 | "name": "operator",
527 | "type": "address"
528 | }
529 | ],
530 | "name": "isApprovedForAll",
531 | "outputs": [
532 | {
533 | "internalType": "bool",
534 | "name": "",
535 | "type": "bool"
536 | }
537 | ],
538 | "stateMutability": "view",
539 | "type": "function"
540 | },
541 | {
542 | "inputs": [
543 | {
544 | "components": [
545 | {
546 | "internalType": "address",
547 | "name": "token0",
548 | "type": "address"
549 | },
550 | {
551 | "internalType": "address",
552 | "name": "token1",
553 | "type": "address"
554 | },
555 | {
556 | "internalType": "uint24",
557 | "name": "fee",
558 | "type": "uint24"
559 | },
560 | {
561 | "internalType": "int24",
562 | "name": "tickLower",
563 | "type": "int24"
564 | },
565 | {
566 | "internalType": "int24",
567 | "name": "tickUpper",
568 | "type": "int24"
569 | },
570 | {
571 | "internalType": "uint256",
572 | "name": "amount0Desired",
573 | "type": "uint256"
574 | },
575 | {
576 | "internalType": "uint256",
577 | "name": "amount1Desired",
578 | "type": "uint256"
579 | },
580 | {
581 | "internalType": "uint256",
582 | "name": "amount0Min",
583 | "type": "uint256"
584 | },
585 | {
586 | "internalType": "uint256",
587 | "name": "amount1Min",
588 | "type": "uint256"
589 | },
590 | {
591 | "internalType": "address",
592 | "name": "recipient",
593 | "type": "address"
594 | },
595 | {
596 | "internalType": "uint256",
597 | "name": "deadline",
598 | "type": "uint256"
599 | }
600 | ],
601 | "internalType": "struct INonfungiblePositionManager.MintParams",
602 | "name": "params",
603 | "type": "tuple"
604 | }
605 | ],
606 | "name": "mint",
607 | "outputs": [
608 | {
609 | "internalType": "uint256",
610 | "name": "tokenId",
611 | "type": "uint256"
612 | },
613 | {
614 | "internalType": "uint128",
615 | "name": "liquidity",
616 | "type": "uint128"
617 | },
618 | {
619 | "internalType": "uint256",
620 | "name": "amount0",
621 | "type": "uint256"
622 | },
623 | {
624 | "internalType": "uint256",
625 | "name": "amount1",
626 | "type": "uint256"
627 | }
628 | ],
629 | "stateMutability": "payable",
630 | "type": "function"
631 | },
632 | {
633 | "inputs": [
634 | {
635 | "internalType": "bytes[]",
636 | "name": "data",
637 | "type": "bytes[]"
638 | }
639 | ],
640 | "name": "multicall",
641 | "outputs": [
642 | {
643 | "internalType": "bytes[]",
644 | "name": "results",
645 | "type": "bytes[]"
646 | }
647 | ],
648 | "stateMutability": "payable",
649 | "type": "function"
650 | },
651 | {
652 | "inputs": [],
653 | "name": "name",
654 | "outputs": [
655 | {
656 | "internalType": "string",
657 | "name": "",
658 | "type": "string"
659 | }
660 | ],
661 | "stateMutability": "view",
662 | "type": "function"
663 | },
664 | {
665 | "inputs": [
666 | {
667 | "internalType": "uint256",
668 | "name": "tokenId",
669 | "type": "uint256"
670 | }
671 | ],
672 | "name": "ownerOf",
673 | "outputs": [
674 | {
675 | "internalType": "address",
676 | "name": "",
677 | "type": "address"
678 | }
679 | ],
680 | "stateMutability": "view",
681 | "type": "function"
682 | },
683 | {
684 | "inputs": [
685 | {
686 | "internalType": "address",
687 | "name": "spender",
688 | "type": "address"
689 | },
690 | {
691 | "internalType": "uint256",
692 | "name": "tokenId",
693 | "type": "uint256"
694 | },
695 | {
696 | "internalType": "uint256",
697 | "name": "deadline",
698 | "type": "uint256"
699 | },
700 | {
701 | "internalType": "uint8",
702 | "name": "v",
703 | "type": "uint8"
704 | },
705 | {
706 | "internalType": "bytes32",
707 | "name": "r",
708 | "type": "bytes32"
709 | },
710 | {
711 | "internalType": "bytes32",
712 | "name": "s",
713 | "type": "bytes32"
714 | }
715 | ],
716 | "name": "permit",
717 | "outputs": [],
718 | "stateMutability": "payable",
719 | "type": "function"
720 | },
721 | {
722 | "inputs": [
723 | {
724 | "internalType": "uint256",
725 | "name": "tokenId",
726 | "type": "uint256"
727 | }
728 | ],
729 | "name": "positions",
730 | "outputs": [
731 | {
732 | "internalType": "uint96",
733 | "name": "nonce",
734 | "type": "uint96"
735 | },
736 | {
737 | "internalType": "address",
738 | "name": "operator",
739 | "type": "address"
740 | },
741 | {
742 | "internalType": "address",
743 | "name": "token0",
744 | "type": "address"
745 | },
746 | {
747 | "internalType": "address",
748 | "name": "token1",
749 | "type": "address"
750 | },
751 | {
752 | "internalType": "uint24",
753 | "name": "fee",
754 | "type": "uint24"
755 | },
756 | {
757 | "internalType": "int24",
758 | "name": "tickLower",
759 | "type": "int24"
760 | },
761 | {
762 | "internalType": "int24",
763 | "name": "tickUpper",
764 | "type": "int24"
765 | },
766 | {
767 | "internalType": "uint128",
768 | "name": "liquidity",
769 | "type": "uint128"
770 | },
771 | {
772 | "internalType": "uint256",
773 | "name": "feeGrowthInside0LastX128",
774 | "type": "uint256"
775 | },
776 | {
777 | "internalType": "uint256",
778 | "name": "feeGrowthInside1LastX128",
779 | "type": "uint256"
780 | },
781 | {
782 | "internalType": "uint128",
783 | "name": "tokensOwed0",
784 | "type": "uint128"
785 | },
786 | {
787 | "internalType": "uint128",
788 | "name": "tokensOwed1",
789 | "type": "uint128"
790 | }
791 | ],
792 | "stateMutability": "view",
793 | "type": "function"
794 | },
795 | {
796 | "inputs": [],
797 | "name": "refundETH",
798 | "outputs": [],
799 | "stateMutability": "payable",
800 | "type": "function"
801 | },
802 | {
803 | "inputs": [
804 | {
805 | "internalType": "address",
806 | "name": "from",
807 | "type": "address"
808 | },
809 | {
810 | "internalType": "address",
811 | "name": "to",
812 | "type": "address"
813 | },
814 | {
815 | "internalType": "uint256",
816 | "name": "tokenId",
817 | "type": "uint256"
818 | }
819 | ],
820 | "name": "safeTransferFrom",
821 | "outputs": [],
822 | "stateMutability": "nonpayable",
823 | "type": "function"
824 | },
825 | {
826 | "inputs": [
827 | {
828 | "internalType": "address",
829 | "name": "from",
830 | "type": "address"
831 | },
832 | {
833 | "internalType": "address",
834 | "name": "to",
835 | "type": "address"
836 | },
837 | {
838 | "internalType": "uint256",
839 | "name": "tokenId",
840 | "type": "uint256"
841 | },
842 | {
843 | "internalType": "bytes",
844 | "name": "_data",
845 | "type": "bytes"
846 | }
847 | ],
848 | "name": "safeTransferFrom",
849 | "outputs": [],
850 | "stateMutability": "nonpayable",
851 | "type": "function"
852 | },
853 | {
854 | "inputs": [
855 | {
856 | "internalType": "address",
857 | "name": "token",
858 | "type": "address"
859 | },
860 | {
861 | "internalType": "uint256",
862 | "name": "value",
863 | "type": "uint256"
864 | },
865 | {
866 | "internalType": "uint256",
867 | "name": "deadline",
868 | "type": "uint256"
869 | },
870 | {
871 | "internalType": "uint8",
872 | "name": "v",
873 | "type": "uint8"
874 | },
875 | {
876 | "internalType": "bytes32",
877 | "name": "r",
878 | "type": "bytes32"
879 | },
880 | {
881 | "internalType": "bytes32",
882 | "name": "s",
883 | "type": "bytes32"
884 | }
885 | ],
886 | "name": "selfPermit",
887 | "outputs": [],
888 | "stateMutability": "payable",
889 | "type": "function"
890 | },
891 | {
892 | "inputs": [
893 | {
894 | "internalType": "address",
895 | "name": "token",
896 | "type": "address"
897 | },
898 | {
899 | "internalType": "uint256",
900 | "name": "nonce",
901 | "type": "uint256"
902 | },
903 | {
904 | "internalType": "uint256",
905 | "name": "expiry",
906 | "type": "uint256"
907 | },
908 | {
909 | "internalType": "uint8",
910 | "name": "v",
911 | "type": "uint8"
912 | },
913 | {
914 | "internalType": "bytes32",
915 | "name": "r",
916 | "type": "bytes32"
917 | },
918 | {
919 | "internalType": "bytes32",
920 | "name": "s",
921 | "type": "bytes32"
922 | }
923 | ],
924 | "name": "selfPermitAllowed",
925 | "outputs": [],
926 | "stateMutability": "payable",
927 | "type": "function"
928 | },
929 | {
930 | "inputs": [
931 | {
932 | "internalType": "address",
933 | "name": "token",
934 | "type": "address"
935 | },
936 | {
937 | "internalType": "uint256",
938 | "name": "nonce",
939 | "type": "uint256"
940 | },
941 | {
942 | "internalType": "uint256",
943 | "name": "expiry",
944 | "type": "uint256"
945 | },
946 | {
947 | "internalType": "uint8",
948 | "name": "v",
949 | "type": "uint8"
950 | },
951 | {
952 | "internalType": "bytes32",
953 | "name": "r",
954 | "type": "bytes32"
955 | },
956 | {
957 | "internalType": "bytes32",
958 | "name": "s",
959 | "type": "bytes32"
960 | }
961 | ],
962 | "name": "selfPermitAllowedIfNecessary",
963 | "outputs": [],
964 | "stateMutability": "payable",
965 | "type": "function"
966 | },
967 | {
968 | "inputs": [
969 | {
970 | "internalType": "address",
971 | "name": "token",
972 | "type": "address"
973 | },
974 | {
975 | "internalType": "uint256",
976 | "name": "value",
977 | "type": "uint256"
978 | },
979 | {
980 | "internalType": "uint256",
981 | "name": "deadline",
982 | "type": "uint256"
983 | },
984 | {
985 | "internalType": "uint8",
986 | "name": "v",
987 | "type": "uint8"
988 | },
989 | {
990 | "internalType": "bytes32",
991 | "name": "r",
992 | "type": "bytes32"
993 | },
994 | {
995 | "internalType": "bytes32",
996 | "name": "s",
997 | "type": "bytes32"
998 | }
999 | ],
1000 | "name": "selfPermitIfNecessary",
1001 | "outputs": [],
1002 | "stateMutability": "payable",
1003 | "type": "function"
1004 | },
1005 | {
1006 | "inputs": [
1007 | {
1008 | "internalType": "address",
1009 | "name": "operator",
1010 | "type": "address"
1011 | },
1012 | {
1013 | "internalType": "bool",
1014 | "name": "approved",
1015 | "type": "bool"
1016 | }
1017 | ],
1018 | "name": "setApprovalForAll",
1019 | "outputs": [],
1020 | "stateMutability": "nonpayable",
1021 | "type": "function"
1022 | },
1023 | {
1024 | "inputs": [
1025 | {
1026 | "internalType": "bytes4",
1027 | "name": "interfaceId",
1028 | "type": "bytes4"
1029 | }
1030 | ],
1031 | "name": "supportsInterface",
1032 | "outputs": [
1033 | {
1034 | "internalType": "bool",
1035 | "name": "",
1036 | "type": "bool"
1037 | }
1038 | ],
1039 | "stateMutability": "view",
1040 | "type": "function"
1041 | },
1042 | {
1043 | "inputs": [
1044 | {
1045 | "internalType": "address",
1046 | "name": "token",
1047 | "type": "address"
1048 | },
1049 | {
1050 | "internalType": "uint256",
1051 | "name": "amountMinimum",
1052 | "type": "uint256"
1053 | },
1054 | {
1055 | "internalType": "address",
1056 | "name": "recipient",
1057 | "type": "address"
1058 | }
1059 | ],
1060 | "name": "sweepToken",
1061 | "outputs": [],
1062 | "stateMutability": "payable",
1063 | "type": "function"
1064 | },
1065 | {
1066 | "inputs": [],
1067 | "name": "symbol",
1068 | "outputs": [
1069 | {
1070 | "internalType": "string",
1071 | "name": "",
1072 | "type": "string"
1073 | }
1074 | ],
1075 | "stateMutability": "view",
1076 | "type": "function"
1077 | },
1078 | {
1079 | "inputs": [
1080 | {
1081 | "internalType": "uint256",
1082 | "name": "index",
1083 | "type": "uint256"
1084 | }
1085 | ],
1086 | "name": "tokenByIndex",
1087 | "outputs": [
1088 | {
1089 | "internalType": "uint256",
1090 | "name": "",
1091 | "type": "uint256"
1092 | }
1093 | ],
1094 | "stateMutability": "view",
1095 | "type": "function"
1096 | },
1097 | {
1098 | "inputs": [
1099 | {
1100 | "internalType": "address",
1101 | "name": "owner",
1102 | "type": "address"
1103 | },
1104 | {
1105 | "internalType": "uint256",
1106 | "name": "index",
1107 | "type": "uint256"
1108 | }
1109 | ],
1110 | "name": "tokenOfOwnerByIndex",
1111 | "outputs": [
1112 | {
1113 | "internalType": "uint256",
1114 | "name": "",
1115 | "type": "uint256"
1116 | }
1117 | ],
1118 | "stateMutability": "view",
1119 | "type": "function"
1120 | },
1121 | {
1122 | "inputs": [
1123 | {
1124 | "internalType": "uint256",
1125 | "name": "tokenId",
1126 | "type": "uint256"
1127 | }
1128 | ],
1129 | "name": "tokenURI",
1130 | "outputs": [
1131 | {
1132 | "internalType": "string",
1133 | "name": "",
1134 | "type": "string"
1135 | }
1136 | ],
1137 | "stateMutability": "view",
1138 | "type": "function"
1139 | },
1140 | {
1141 | "inputs": [],
1142 | "name": "totalSupply",
1143 | "outputs": [
1144 | {
1145 | "internalType": "uint256",
1146 | "name": "",
1147 | "type": "uint256"
1148 | }
1149 | ],
1150 | "stateMutability": "view",
1151 | "type": "function"
1152 | },
1153 | {
1154 | "inputs": [
1155 | {
1156 | "internalType": "address",
1157 | "name": "from",
1158 | "type": "address"
1159 | },
1160 | {
1161 | "internalType": "address",
1162 | "name": "to",
1163 | "type": "address"
1164 | },
1165 | {
1166 | "internalType": "uint256",
1167 | "name": "tokenId",
1168 | "type": "uint256"
1169 | }
1170 | ],
1171 | "name": "transferFrom",
1172 | "outputs": [],
1173 | "stateMutability": "nonpayable",
1174 | "type": "function"
1175 | },
1176 | {
1177 | "inputs": [
1178 | {
1179 | "internalType": "uint256",
1180 | "name": "amount0Owed",
1181 | "type": "uint256"
1182 | },
1183 | {
1184 | "internalType": "uint256",
1185 | "name": "amount1Owed",
1186 | "type": "uint256"
1187 | },
1188 | {
1189 | "internalType": "bytes",
1190 | "name": "data",
1191 | "type": "bytes"
1192 | }
1193 | ],
1194 | "name": "uniswapV3MintCallback",
1195 | "outputs": [],
1196 | "stateMutability": "nonpayable",
1197 | "type": "function"
1198 | },
1199 | {
1200 | "inputs": [
1201 | {
1202 | "internalType": "uint256",
1203 | "name": "amountMinimum",
1204 | "type": "uint256"
1205 | },
1206 | {
1207 | "internalType": "address",
1208 | "name": "recipient",
1209 | "type": "address"
1210 | }
1211 | ],
1212 | "name": "unwrapWETH9",
1213 | "outputs": [],
1214 | "stateMutability": "payable",
1215 | "type": "function"
1216 | },
1217 | {
1218 | "stateMutability": "payable",
1219 | "type": "receive"
1220 | }
1221 | ]
--------------------------------------------------------------------------------
/abi/swap.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "inputs": [],
4 | "name": "WETH",
5 | "outputs": [
6 | {
7 | "internalType": "address",
8 | "name": "",
9 | "type": "address"
10 | }
11 | ],
12 | "stateMutability": "pure",
13 | "type": "function"
14 | },
15 | {
16 | "inputs": [
17 | {
18 | "internalType": "address",
19 | "name": "tokenA",
20 | "type": "address"
21 | },
22 | {
23 | "internalType": "address",
24 | "name": "tokenB",
25 | "type": "address"
26 | },
27 | {
28 | "internalType": "uint256",
29 | "name": "amountADesired",
30 | "type": "uint256"
31 | },
32 | {
33 | "internalType": "uint256",
34 | "name": "amountBDesired",
35 | "type": "uint256"
36 | },
37 | {
38 | "internalType": "uint256",
39 | "name": "amountAMin",
40 | "type": "uint256"
41 | },
42 | {
43 | "internalType": "uint256",
44 | "name": "amountBMin",
45 | "type": "uint256"
46 | },
47 | {
48 | "internalType": "address",
49 | "name": "to",
50 | "type": "address"
51 | },
52 | {
53 | "internalType": "uint256",
54 | "name": "deadline",
55 | "type": "uint256"
56 | }
57 | ],
58 | "name": "addLiquidity",
59 | "outputs": [
60 | {
61 | "internalType": "uint256",
62 | "name": "amountA",
63 | "type": "uint256"
64 | },
65 | {
66 | "internalType": "uint256",
67 | "name": "amountB",
68 | "type": "uint256"
69 | },
70 | {
71 | "internalType": "uint256",
72 | "name": "liquidity",
73 | "type": "uint256"
74 | }
75 | ],
76 | "stateMutability": "nonpayable",
77 | "type": "function"
78 | },
79 | {
80 | "inputs": [
81 | {
82 | "internalType": "address",
83 | "name": "token",
84 | "type": "address"
85 | },
86 | {
87 | "internalType": "uint256",
88 | "name": "amountTokenDesired",
89 | "type": "uint256"
90 | },
91 | {
92 | "internalType": "uint256",
93 | "name": "amountTokenMin",
94 | "type": "uint256"
95 | },
96 | {
97 | "internalType": "uint256",
98 | "name": "amountETHMin",
99 | "type": "uint256"
100 | },
101 | {
102 | "internalType": "address",
103 | "name": "to",
104 | "type": "address"
105 | },
106 | {
107 | "internalType": "uint256",
108 | "name": "deadline",
109 | "type": "uint256"
110 | }
111 | ],
112 | "name": "addLiquidityETH",
113 | "outputs": [
114 | {
115 | "internalType": "uint256",
116 | "name": "amountToken",
117 | "type": "uint256"
118 | },
119 | {
120 | "internalType": "uint256",
121 | "name": "amountETH",
122 | "type": "uint256"
123 | },
124 | {
125 | "internalType": "uint256",
126 | "name": "liquidity",
127 | "type": "uint256"
128 | }
129 | ],
130 | "stateMutability": "payable",
131 | "type": "function"
132 | },
133 | {
134 | "inputs": [],
135 | "name": "factory",
136 | "outputs": [
137 | {
138 | "internalType": "address",
139 | "name": "",
140 | "type": "address"
141 | }
142 | ],
143 | "stateMutability": "pure",
144 | "type": "function"
145 | },
146 | {
147 | "inputs": [
148 | {
149 | "internalType": "uint256",
150 | "name": "amountOut",
151 | "type": "uint256"
152 | },
153 | {
154 | "internalType": "uint256",
155 | "name": "reserveIn",
156 | "type": "uint256"
157 | },
158 | {
159 | "internalType": "uint256",
160 | "name": "reserveOut",
161 | "type": "uint256"
162 | }
163 | ],
164 | "name": "getAmountIn",
165 | "outputs": [
166 | {
167 | "internalType": "uint256",
168 | "name": "amountIn",
169 | "type": "uint256"
170 | }
171 | ],
172 | "stateMutability": "pure",
173 | "type": "function"
174 | },
175 | {
176 | "inputs": [
177 | {
178 | "internalType": "uint256",
179 | "name": "amountIn",
180 | "type": "uint256"
181 | },
182 | {
183 | "internalType": "uint256",
184 | "name": "reserveIn",
185 | "type": "uint256"
186 | },
187 | {
188 | "internalType": "uint256",
189 | "name": "reserveOut",
190 | "type": "uint256"
191 | }
192 | ],
193 | "name": "getAmountOut",
194 | "outputs": [
195 | {
196 | "internalType": "uint256",
197 | "name": "amountOut",
198 | "type": "uint256"
199 | }
200 | ],
201 | "stateMutability": "pure",
202 | "type": "function"
203 | },
204 | {
205 | "inputs": [
206 | {
207 | "internalType": "uint256",
208 | "name": "amountOut",
209 | "type": "uint256"
210 | },
211 | {
212 | "internalType": "address[]",
213 | "name": "path",
214 | "type": "address[]"
215 | }
216 | ],
217 | "name": "getAmountsIn",
218 | "outputs": [
219 | {
220 | "internalType": "uint256[]",
221 | "name": "amounts",
222 | "type": "uint256[]"
223 | }
224 | ],
225 | "stateMutability": "view",
226 | "type": "function"
227 | },
228 | {
229 | "inputs": [
230 | {
231 | "internalType": "uint256",
232 | "name": "amountIn",
233 | "type": "uint256"
234 | },
235 | {
236 | "internalType": "address[]",
237 | "name": "path",
238 | "type": "address[]"
239 | }
240 | ],
241 | "name": "getAmountsOut",
242 | "outputs": [
243 | {
244 | "internalType": "uint256[]",
245 | "name": "amounts",
246 | "type": "uint256[]"
247 | }
248 | ],
249 | "stateMutability": "view",
250 | "type": "function"
251 | },
252 | {
253 | "inputs": [
254 | {
255 | "internalType": "uint256",
256 | "name": "amountA",
257 | "type": "uint256"
258 | },
259 | {
260 | "internalType": "uint256",
261 | "name": "reserveA",
262 | "type": "uint256"
263 | },
264 | {
265 | "internalType": "uint256",
266 | "name": "reserveB",
267 | "type": "uint256"
268 | }
269 | ],
270 | "name": "quote",
271 | "outputs": [
272 | {
273 | "internalType": "uint256",
274 | "name": "amountB",
275 | "type": "uint256"
276 | }
277 | ],
278 | "stateMutability": "pure",
279 | "type": "function"
280 | },
281 | {
282 | "inputs": [
283 | {
284 | "internalType": "address",
285 | "name": "tokenA",
286 | "type": "address"
287 | },
288 | {
289 | "internalType": "address",
290 | "name": "tokenB",
291 | "type": "address"
292 | },
293 | {
294 | "internalType": "uint256",
295 | "name": "liquidity",
296 | "type": "uint256"
297 | },
298 | {
299 | "internalType": "uint256",
300 | "name": "amountAMin",
301 | "type": "uint256"
302 | },
303 | {
304 | "internalType": "uint256",
305 | "name": "amountBMin",
306 | "type": "uint256"
307 | },
308 | {
309 | "internalType": "address",
310 | "name": "to",
311 | "type": "address"
312 | },
313 | {
314 | "internalType": "uint256",
315 | "name": "deadline",
316 | "type": "uint256"
317 | }
318 | ],
319 | "name": "removeLiquidity",
320 | "outputs": [
321 | {
322 | "internalType": "uint256",
323 | "name": "amountA",
324 | "type": "uint256"
325 | },
326 | {
327 | "internalType": "uint256",
328 | "name": "amountB",
329 | "type": "uint256"
330 | }
331 | ],
332 | "stateMutability": "nonpayable",
333 | "type": "function"
334 | },
335 | {
336 | "inputs": [
337 | {
338 | "internalType": "address",
339 | "name": "token",
340 | "type": "address"
341 | },
342 | {
343 | "internalType": "uint256",
344 | "name": "liquidity",
345 | "type": "uint256"
346 | },
347 | {
348 | "internalType": "uint256",
349 | "name": "amountTokenMin",
350 | "type": "uint256"
351 | },
352 | {
353 | "internalType": "uint256",
354 | "name": "amountETHMin",
355 | "type": "uint256"
356 | },
357 | {
358 | "internalType": "address",
359 | "name": "to",
360 | "type": "address"
361 | },
362 | {
363 | "internalType": "uint256",
364 | "name": "deadline",
365 | "type": "uint256"
366 | }
367 | ],
368 | "name": "removeLiquidityETH",
369 | "outputs": [
370 | {
371 | "internalType": "uint256",
372 | "name": "amountToken",
373 | "type": "uint256"
374 | },
375 | {
376 | "internalType": "uint256",
377 | "name": "amountETH",
378 | "type": "uint256"
379 | }
380 | ],
381 | "stateMutability": "nonpayable",
382 | "type": "function"
383 | },
384 | {
385 | "inputs": [
386 | {
387 | "internalType": "address",
388 | "name": "token",
389 | "type": "address"
390 | },
391 | {
392 | "internalType": "uint256",
393 | "name": "liquidity",
394 | "type": "uint256"
395 | },
396 | {
397 | "internalType": "uint256",
398 | "name": "amountTokenMin",
399 | "type": "uint256"
400 | },
401 | {
402 | "internalType": "uint256",
403 | "name": "amountETHMin",
404 | "type": "uint256"
405 | },
406 | {
407 | "internalType": "address",
408 | "name": "to",
409 | "type": "address"
410 | },
411 | {
412 | "internalType": "uint256",
413 | "name": "deadline",
414 | "type": "uint256"
415 | }
416 | ],
417 | "name": "removeLiquidityETHSupportingFeeOnTransferTokens",
418 | "outputs": [
419 | {
420 | "internalType": "uint256",
421 | "name": "amountETH",
422 | "type": "uint256"
423 | }
424 | ],
425 | "stateMutability": "nonpayable",
426 | "type": "function"
427 | },
428 | {
429 | "inputs": [
430 | {
431 | "internalType": "address",
432 | "name": "token",
433 | "type": "address"
434 | },
435 | {
436 | "internalType": "uint256",
437 | "name": "liquidity",
438 | "type": "uint256"
439 | },
440 | {
441 | "internalType": "uint256",
442 | "name": "amountTokenMin",
443 | "type": "uint256"
444 | },
445 | {
446 | "internalType": "uint256",
447 | "name": "amountETHMin",
448 | "type": "uint256"
449 | },
450 | {
451 | "internalType": "address",
452 | "name": "to",
453 | "type": "address"
454 | },
455 | {
456 | "internalType": "uint256",
457 | "name": "deadline",
458 | "type": "uint256"
459 | },
460 | {
461 | "internalType": "bool",
462 | "name": "approveMax",
463 | "type": "bool"
464 | },
465 | {
466 | "internalType": "uint8",
467 | "name": "v",
468 | "type": "uint8"
469 | },
470 | {
471 | "internalType": "bytes32",
472 | "name": "r",
473 | "type": "bytes32"
474 | },
475 | {
476 | "internalType": "bytes32",
477 | "name": "s",
478 | "type": "bytes32"
479 | }
480 | ],
481 | "name": "removeLiquidityETHWithPermit",
482 | "outputs": [
483 | {
484 | "internalType": "uint256",
485 | "name": "amountToken",
486 | "type": "uint256"
487 | },
488 | {
489 | "internalType": "uint256",
490 | "name": "amountETH",
491 | "type": "uint256"
492 | }
493 | ],
494 | "stateMutability": "nonpayable",
495 | "type": "function"
496 | },
497 | {
498 | "inputs": [
499 | {
500 | "internalType": "address",
501 | "name": "token",
502 | "type": "address"
503 | },
504 | {
505 | "internalType": "uint256",
506 | "name": "liquidity",
507 | "type": "uint256"
508 | },
509 | {
510 | "internalType": "uint256",
511 | "name": "amountTokenMin",
512 | "type": "uint256"
513 | },
514 | {
515 | "internalType": "uint256",
516 | "name": "amountETHMin",
517 | "type": "uint256"
518 | },
519 | {
520 | "internalType": "address",
521 | "name": "to",
522 | "type": "address"
523 | },
524 | {
525 | "internalType": "uint256",
526 | "name": "deadline",
527 | "type": "uint256"
528 | },
529 | {
530 | "internalType": "bool",
531 | "name": "approveMax",
532 | "type": "bool"
533 | },
534 | {
535 | "internalType": "uint8",
536 | "name": "v",
537 | "type": "uint8"
538 | },
539 | {
540 | "internalType": "bytes32",
541 | "name": "r",
542 | "type": "bytes32"
543 | },
544 | {
545 | "internalType": "bytes32",
546 | "name": "s",
547 | "type": "bytes32"
548 | }
549 | ],
550 | "name": "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",
551 | "outputs": [
552 | {
553 | "internalType": "uint256",
554 | "name": "amountETH",
555 | "type": "uint256"
556 | }
557 | ],
558 | "stateMutability": "nonpayable",
559 | "type": "function"
560 | },
561 | {
562 | "inputs": [
563 | {
564 | "internalType": "address",
565 | "name": "tokenA",
566 | "type": "address"
567 | },
568 | {
569 | "internalType": "address",
570 | "name": "tokenB",
571 | "type": "address"
572 | },
573 | {
574 | "internalType": "uint256",
575 | "name": "liquidity",
576 | "type": "uint256"
577 | },
578 | {
579 | "internalType": "uint256",
580 | "name": "amountAMin",
581 | "type": "uint256"
582 | },
583 | {
584 | "internalType": "uint256",
585 | "name": "amountBMin",
586 | "type": "uint256"
587 | },
588 | {
589 | "internalType": "address",
590 | "name": "to",
591 | "type": "address"
592 | },
593 | {
594 | "internalType": "uint256",
595 | "name": "deadline",
596 | "type": "uint256"
597 | },
598 | {
599 | "internalType": "bool",
600 | "name": "approveMax",
601 | "type": "bool"
602 | },
603 | {
604 | "internalType": "uint8",
605 | "name": "v",
606 | "type": "uint8"
607 | },
608 | {
609 | "internalType": "bytes32",
610 | "name": "r",
611 | "type": "bytes32"
612 | },
613 | {
614 | "internalType": "bytes32",
615 | "name": "s",
616 | "type": "bytes32"
617 | }
618 | ],
619 | "name": "removeLiquidityWithPermit",
620 | "outputs": [
621 | {
622 | "internalType": "uint256",
623 | "name": "amountA",
624 | "type": "uint256"
625 | },
626 | {
627 | "internalType": "uint256",
628 | "name": "amountB",
629 | "type": "uint256"
630 | }
631 | ],
632 | "stateMutability": "nonpayable",
633 | "type": "function"
634 | },
635 | {
636 | "inputs": [
637 | {
638 | "internalType": "uint256",
639 | "name": "amountOut",
640 | "type": "uint256"
641 | },
642 | {
643 | "internalType": "address[]",
644 | "name": "path",
645 | "type": "address[]"
646 | },
647 | {
648 | "internalType": "address",
649 | "name": "to",
650 | "type": "address"
651 | },
652 | {
653 | "internalType": "uint256",
654 | "name": "deadline",
655 | "type": "uint256"
656 | }
657 | ],
658 | "name": "swapETHForExactTokens",
659 | "outputs": [
660 | {
661 | "internalType": "uint256[]",
662 | "name": "amounts",
663 | "type": "uint256[]"
664 | }
665 | ],
666 | "stateMutability": "payable",
667 | "type": "function"
668 | },
669 | {
670 | "inputs": [
671 | {
672 | "internalType": "uint256",
673 | "name": "amountOutMin",
674 | "type": "uint256"
675 | },
676 | {
677 | "internalType": "address[]",
678 | "name": "path",
679 | "type": "address[]"
680 | },
681 | {
682 | "internalType": "address",
683 | "name": "to",
684 | "type": "address"
685 | },
686 | {
687 | "internalType": "uint256",
688 | "name": "deadline",
689 | "type": "uint256"
690 | }
691 | ],
692 | "name": "swapExactETHForTokens",
693 | "outputs": [
694 | {
695 | "internalType": "uint256[]",
696 | "name": "amounts",
697 | "type": "uint256[]"
698 | }
699 | ],
700 | "stateMutability": "payable",
701 | "type": "function"
702 | },
703 | {
704 | "inputs": [
705 | {
706 | "internalType": "uint256",
707 | "name": "amountOutMin",
708 | "type": "uint256"
709 | },
710 | {
711 | "internalType": "address[]",
712 | "name": "path",
713 | "type": "address[]"
714 | },
715 | {
716 | "internalType": "address",
717 | "name": "to",
718 | "type": "address"
719 | },
720 | {
721 | "internalType": "uint256",
722 | "name": "deadline",
723 | "type": "uint256"
724 | }
725 | ],
726 | "name": "swapExactETHForTokensSupportingFeeOnTransferTokens",
727 | "outputs": [],
728 | "stateMutability": "payable",
729 | "type": "function"
730 | },
731 | {
732 | "inputs": [
733 | {
734 | "internalType": "uint256",
735 | "name": "amountIn",
736 | "type": "uint256"
737 | },
738 | {
739 | "internalType": "uint256",
740 | "name": "amountOutMin",
741 | "type": "uint256"
742 | },
743 | {
744 | "internalType": "address[]",
745 | "name": "path",
746 | "type": "address[]"
747 | },
748 | {
749 | "internalType": "address",
750 | "name": "to",
751 | "type": "address"
752 | },
753 | {
754 | "internalType": "uint256",
755 | "name": "deadline",
756 | "type": "uint256"
757 | }
758 | ],
759 | "name": "swapExactTokensForETH",
760 | "outputs": [
761 | {
762 | "internalType": "uint256[]",
763 | "name": "amounts",
764 | "type": "uint256[]"
765 | }
766 | ],
767 | "stateMutability": "nonpayable",
768 | "type": "function"
769 | },
770 | {
771 | "inputs": [
772 | {
773 | "internalType": "uint256",
774 | "name": "amountIn",
775 | "type": "uint256"
776 | },
777 | {
778 | "internalType": "uint256",
779 | "name": "amountOutMin",
780 | "type": "uint256"
781 | },
782 | {
783 | "internalType": "address[]",
784 | "name": "path",
785 | "type": "address[]"
786 | },
787 | {
788 | "internalType": "address",
789 | "name": "to",
790 | "type": "address"
791 | },
792 | {
793 | "internalType": "uint256",
794 | "name": "deadline",
795 | "type": "uint256"
796 | }
797 | ],
798 | "name": "swapExactTokensForETHSupportingFeeOnTransferTokens",
799 | "outputs": [],
800 | "stateMutability": "nonpayable",
801 | "type": "function"
802 | },
803 | {
804 | "inputs": [
805 | {
806 | "internalType": "uint256",
807 | "name": "amountIn",
808 | "type": "uint256"
809 | },
810 | {
811 | "internalType": "uint256",
812 | "name": "amountOutMin",
813 | "type": "uint256"
814 | },
815 | {
816 | "internalType": "address[]",
817 | "name": "path",
818 | "type": "address[]"
819 | },
820 | {
821 | "internalType": "address",
822 | "name": "to",
823 | "type": "address"
824 | },
825 | {
826 | "internalType": "uint256",
827 | "name": "deadline",
828 | "type": "uint256"
829 | }
830 | ],
831 | "name": "swapExactTokensForTokens",
832 | "outputs": [
833 | {
834 | "internalType": "uint256[]",
835 | "name": "amounts",
836 | "type": "uint256[]"
837 | }
838 | ],
839 | "stateMutability": "nonpayable",
840 | "type": "function"
841 | },
842 | {
843 | "inputs": [
844 | {
845 | "internalType": "uint256",
846 | "name": "amountIn",
847 | "type": "uint256"
848 | },
849 | {
850 | "internalType": "uint256",
851 | "name": "amountOutMin",
852 | "type": "uint256"
853 | },
854 | {
855 | "internalType": "address[]",
856 | "name": "path",
857 | "type": "address[]"
858 | },
859 | {
860 | "internalType": "address",
861 | "name": "to",
862 | "type": "address"
863 | },
864 | {
865 | "internalType": "uint256",
866 | "name": "deadline",
867 | "type": "uint256"
868 | }
869 | ],
870 | "name": "swapExactTokensForTokensSupportingFeeOnTransferTokens",
871 | "outputs": [],
872 | "stateMutability": "nonpayable",
873 | "type": "function"
874 | },
875 | {
876 | "inputs": [
877 | {
878 | "internalType": "uint256",
879 | "name": "amountOut",
880 | "type": "uint256"
881 | },
882 | {
883 | "internalType": "uint256",
884 | "name": "amountInMax",
885 | "type": "uint256"
886 | },
887 | {
888 | "internalType": "address[]",
889 | "name": "path",
890 | "type": "address[]"
891 | },
892 | {
893 | "internalType": "address",
894 | "name": "to",
895 | "type": "address"
896 | },
897 | {
898 | "internalType": "uint256",
899 | "name": "deadline",
900 | "type": "uint256"
901 | }
902 | ],
903 | "name": "swapTokensForExactETH",
904 | "outputs": [
905 | {
906 | "internalType": "uint256[]",
907 | "name": "amounts",
908 | "type": "uint256[]"
909 | }
910 | ],
911 | "stateMutability": "nonpayable",
912 | "type": "function"
913 | },
914 | {
915 | "inputs": [
916 | {
917 | "internalType": "uint256",
918 | "name": "amountOut",
919 | "type": "uint256"
920 | },
921 | {
922 | "internalType": "uint256",
923 | "name": "amountInMax",
924 | "type": "uint256"
925 | },
926 | {
927 | "internalType": "address[]",
928 | "name": "path",
929 | "type": "address[]"
930 | },
931 | {
932 | "internalType": "address",
933 | "name": "to",
934 | "type": "address"
935 | },
936 | {
937 | "internalType": "uint256",
938 | "name": "deadline",
939 | "type": "uint256"
940 | }
941 | ],
942 | "name": "swapTokensForExactTokens",
943 | "outputs": [
944 | {
945 | "internalType": "uint256[]",
946 | "name": "amounts",
947 | "type": "uint256[]"
948 | }
949 | ],
950 | "stateMutability": "nonpayable",
951 | "type": "function"
952 | }
953 | ]
--------------------------------------------------------------------------------
/config.py:
--------------------------------------------------------------------------------
1 | from web3 import Web3
2 |
3 | goerli_weth_address = Web3.to_checksum_address('0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6')
4 | goerli_usdc_address = Web3.to_checksum_address('0x07865c6E87B9F70255377e024ace6630C1Eaa37F')
5 | goerli_meson_contract_address = Web3.to_checksum_address('0x0d12d15b26a32e72A3330B2ac9016A22b1410CB6')
6 | b2_meson_contract_address = Web3.to_checksum_address('0x0d12d15b26a32e72A3330B2ac9016A22b1410CB6')
7 | goerli_symbiosis_contract_address = Web3.to_checksum_address('0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D')
8 | b2_testnet_blow_contract_address = Web3.to_checksum_address('0x6B7aB2622BfE00d62b4C787C2b3D29b021219b88')
9 | b2_testnet_wbtc_address = Web3.to_checksum_address('0x720114819c30558f8c5807ab76a5030febb6caae')
10 | b2_testnet_eth_address = Web3.to_checksum_address('0x457abccdfdc6fa256f8c50ab617b4e68677ed309')
11 | b2_testnet_usdc_address = Web3.to_checksum_address('0x6125bd1b49822ea3a052d2edbd7ceb965f5c3edd')
12 | b2_testnet_usdt_address = Web3.to_checksum_address('0x17459858c5bad5e97e48eb831fa8b1096964b0d7')
13 | b2_testnet_blow_lp_contract_address = Web3.to_checksum_address('0x0C467640b1d4D990927109c5CA6e13a6c9B65Adb')
14 | b2_stable_coin_lp_contract_address = Web3.to_checksum_address('0x71e5bDa7fE44827D69B10b18bbdf6a1ce8c61d90')
15 | b2_lend_core = Web3.to_checksum_address('0xaD89Db5244ef8c318Ee9F6a83839bDe441308fFF')
16 | b2_lend_btc_market = Web3.to_checksum_address('0x87a074cD89DB1664cA4C16289a651bC9395f6282')
17 | b2_lend_borrow_usdc = Web3.to_checksum_address('0xE42572850BefB5859475d773646b5741DD478Db9')
18 | owlto_sepolia_bridge = Web3.to_checksum_address('0x5e809A85Aa182A9921EDD10a4163745bb3e36284')
19 | shoebill_faucet_weth = Web3.to_checksum_address('0xAd0856F1A517dF866FAF69563105c7C073C44446')
20 | shoebill_faucet_stone = Web3.to_checksum_address('0xB762B8dA36B59f7dF9aeE066a364c08aac746DbF')
21 | shoebill_supply = Web3.to_checksum_address('0x80E81348D9386Eb4d10c2A32A7458638cD3308dF')
22 | shoebill_borrow = Web3.to_checksum_address('0xE103F874B2D144C5B327FA3d57069Bb19c0779e2')
23 | oooo_bridge = Web3.to_checksum_address('0x7EcF9dadDF7EE01D850150cB360C824CfA322D8D')
24 | dmain_send = Web3.to_checksum_address('0x64812F1212f6276068A0726f4695a6637DA3E4F8')
25 | dmain_nft = Web3.to_checksum_address('0xD4276Edd50813aD26C1c493b66Ee2dFDD3B45230')
26 | layercraft_nft_contract_address = Web3.to_checksum_address('0xc6aa5857fb7ff7f0a2b9f72d38b744aca251fb80')
27 | layercraft_market = Web3.to_checksum_address('0x547396018c41Cb7211A8f685515A9a3Aa7eb3e87')
28 | layercraft_wbtc_address = Web3.to_checksum_address('0x0d4Fa73d08Cd92BB27688d8929C1C8faa38aA2A8')
29 |
30 | # 保存账户链接
31 | my_file_name = 'account.txt'
32 |
--------------------------------------------------------------------------------
/exmple.py:
--------------------------------------------------------------------------------
1 |
2 | from main import B2Network
3 | from web3 import Web3
4 | from eth_account import Account
5 | from config import my_file_name
6 | import requests
7 |
8 | # 创建evm钱包随机账户
9 | ac = Account().create()
10 | # 地址
11 | address = ac.address
12 | # 私钥
13 | pk = ac.key.hex()
14 | # 大号邀请码,换成自己的
15 | code = 'ASDDDDD'
16 |
17 | # 获取ip代理的链接,一次1个,文本格式,http协议, 填你自己的
18 | ip_get_url = ''
19 | proxy = requests.get(ip_get_url).text.strip()
20 | print(proxy)
21 |
22 | b2 = B2Network(pk=pk, invite_code=code, proxy=proxy)
23 | # 注册登陆
24 | b2.b2_login()
25 | # 获取我的信息
26 | my_invite_code = b2.get_user_info()['code']
27 |
28 | # 保存账户信息,格式 地址----私钥----自己的邀请码
29 | log_str = f'{address}----{pk}----{my_invite_code}'
30 | B2Network.write_file(my_file_name, log_str)
31 |
32 | # 用大号邀请码作为邀请人,绑定邀请关系
33 | b2.invite()
34 |
35 | # 领b2测试水龙头水,测试btc作为gas,需要代理
36 | b2.b2_faucet()
37 |
38 | # 合约领测试水,usdc(1000),usdt(1000),eth(1),必须先领测试btc水作为gas
39 | b2.contract_faucet('usdc')
40 | b2.contract_faucet('usdt')
41 | b2.contract_faucet('eth')
42 |
43 | # glowswap交换代币任务, 使用btc交换代币,coin只支持usdc,usdt, amount是btc的数量,主要不要超过钱包btc余额
44 | b2.b2_glow_swap(coin='usdc', amount=0.00001)
45 | # 添加流动性, 只能添加usdt-usdc稳定币池子,这里最好先领usdc水,我代码里面使用的是单边流动性,只需要钱包有usdc即可
46 | b2.b2_glow_add_lp()
47 | # 质押流动性,必须先完成添加流动性链上交互
48 | b2.b2_glow_stack()
49 |
50 | # layerbank 借贷, 抵押btc
51 | b2.lend_supply(amount=0.0001)
52 | # layerbank 借贷, 打开btc作为抵押物开关
53 | b2.lend_enter_market()
54 | # layerbank 借贷, 借usdc
55 | b2.lend_borrow(amount=0.01)
56 |
57 | # owlto 任务
58 | b2.owlto_bridge_to_sepolia()
59 | # b2.owlto_bridge_from_sepolia() # 这个链上调用可以成功,但是任务不成功,还不太明白为什么
60 |
61 | # shoebill借贷
62 | ## 获取shoebill水龙头测试水
63 | b2.get_shoebill_faucet('weth')
64 | b2.get_shoebill_faucet('stone')
65 | # shoebill抵押
66 | b2.shoebill_supply()
67 | # shoebill借出
68 | b2.shoebill_borrow()
69 |
70 | # dmain mint nft
71 | b2.demail_mint()
72 | #dmain 发邮件
73 | b2.send_mail()
74 |
75 | #==============分界线之前的是老的测试网,分界线后的是新的测试网=================
76 |
77 |
78 | # b2 layercraft 购买nft
79 | b2.layercraft_buy()
80 | # b2 layercraft 上架nft
81 | b2.layercraft_sale()
82 |
83 | # 刷新奥德赛点数(积分有延迟到账)
84 | b2.claim_point()
85 |
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/main.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | import json
3 | import sys
4 | import random
5 | import time
6 | from typing import Union
7 |
8 | import requests
9 | from eth_account import Account
10 | from eth_typing import Address, ChecksumAddress
11 | from faker import Faker
12 | # from requests import Response
13 | from web3 import Web3
14 | from config import *
15 | from eth_account import Account
16 | from eth_account.messages import encode_defunct
17 | from eth_abi import encode
18 | from loguru import logger
19 | from functools import cached_property
20 | from hashlib import sha256
21 |
22 |
23 |
24 | logger.remove()
25 | logger.add('my.log', format='{time:YYYY-MM-DD HH:mm:ss:SSS} | {level} | {message}')
26 | logger.add(sys.stdout, format='{time:YYYY-MM-DD HH:mm:ss:SSS} | {level} | {message}')
27 |
28 | class B2Network():
29 |
30 | def __init__(self, pk: str, b2_endpoint='https://habitat-rpc.bsquared.network/', proxy='', gas_scala=1, invite_code='') -> None:
31 | self.pk = pk
32 | self.b2w3 = Web3(Web3.HTTPProvider(b2_endpoint, request_kwargs={"proxies": {"http": proxy, "https": proxy}}))
33 | self.spw3 = Web3(Web3.HTTPProvider('https://gateway.tenderly.co/public/sepolia', request_kwargs={"proxies": {"http": proxy, "https": proxy}}))
34 | self.proxy = {'http:': proxy, 'https': proxy}
35 | self.gas_scala = gas_scala
36 | self.b2_explorer = 'https://habitat-explorer.bsquared.network/tx/{}'
37 | self.account = Account.from_key(pk)
38 | self.session = requests.session()
39 | self.b2_login_str = 'login#{}#{}'
40 | self.access_token = ''
41 | self.invite_code = invite_code
42 |
43 |
44 | def add_log(self, log_str, tx_hash=''):
45 | log_str = f'{self.account.address[:32]}******************** ' + log_str
46 |
47 | if tx_hash and isinstance(tx_hash, str):
48 | log_str += f' | {self.b2_explorer.format(tx_hash)}'
49 | logger.debug(log_str)
50 |
51 | def b2_faucet(self):
52 | url = f'https://task-openapi.bsquared.network/v1/faucet?is_aa=false&to_address={self.account.address}'
53 | res = requests.get(url=url, proxies=self.proxy, timeout=30).json()
54 | if res['code'] == "0":
55 | self.add_log(f'领水成功, {json.dumps(res)}')
56 | return True
57 | raise Exception(f'b2领水错误,原因: {res["message"]}')
58 |
59 | def approve_token(self, spender: Union[Address, ChecksumAddress], amount: int, approve_token_address: Union[Address, ChecksumAddress], gas=0) -> str:
60 | """
61 | 授权代币
62 | :param spender: 授权给哪个地址
63 | :param amount: 授权金额
64 | :param approve_token_address: 需要授权的代币地址
65 | :return: hash
66 | """
67 |
68 | approve_contract = self.b2w3.eth.contract(address=approve_token_address, abi=self.load_abi('erc20'))
69 | allowance_balance = approve_contract.functions.allowance(self.account.address, spender).call()
70 | if allowance_balance > amount: # 如果已授权额度已经大于当前要授权额度,则跳过授权
71 | return ''
72 | txn = approve_contract.functions.approve(spender, amount)
73 | return self._make_tx(txn=txn, gas=gas)
74 |
75 | def b2_login(self):
76 | ts = int(time.time())
77 | if self.access_token:
78 | return self.access_token
79 | text=self.b2_login_str.format(ts, self.account.address.lower())
80 | msghash = encode_defunct(text=text)
81 | sign = Account.sign_message(msghash, self.pk)
82 |
83 | url = 'https://task-api.bsquared.network/v2/user/access-token'
84 | payload = {
85 | 'timestamp': ts,
86 | 'signer': self.account.address,
87 | 'signature': str(sign.signature.hex()).replace('0x', '0x00')+self.account.address[2:]
88 | }
89 | headers = {
90 | 'Accept': 'application/json',
91 | 'Content-Type': 'application/json;charset=UTF-8',
92 | 'Origin': 'https://task.bsquared.network',
93 | 'Referer': 'https://task.bsquared.network',
94 | 'User-Agent': Faker().chrome()
95 | }
96 | res = self.session.post(url=url, json=payload, timeout=30, proxies=self.proxy, headers=headers)
97 |
98 | res = res.json()
99 | if res['code']:
100 | raise Exception(f'登录b2失败,错误原因:{res["msg"]}')
101 |
102 | self.access_token = res['data']['access_token']
103 | self.add_log(f'登陆成功, access_token: {self.access_token}')
104 | return self.access_token
105 |
106 | def b2_glow_swap(self, coin, amount=0.000015):
107 | swap_amount = Web3.to_wei(amount, 'ether')
108 | contract = self.b2w3.eth.contract(address=b2_testnet_blow_contract_address, abi=self.load_abi('blow'))
109 | if coin == 'usdc':
110 | swap_path = (b2_testnet_wbtc_address+b2_testnet_usdc_address).replace('0x', '0009c4')[6:]
111 | else:
112 | swap_path = (b2_testnet_wbtc_address+b2_testnet_usdt_address).replace('0x', '000064')[6:]
113 | args = [[
114 | Web3.to_bytes(hexstr=swap_path),
115 | self.account.address,
116 | int(time.time()+2*3600),
117 | swap_amount,
118 | 0
119 | ]]
120 | txn = contract.encodeABI(fn_name='exactInput', args=args)
121 | tx_hash = self._make_tx(txn, swap_amount, True, b2_testnet_blow_contract_address)
122 | self.add_log(f'b2swap 兑换 {coin} 成功', tx_hash)
123 |
124 | def b2_glow_add_lp(self, usdc_amount=300):
125 | usdt_amount = 0
126 | usdc_amount = int(usdc_amount*1e6)
127 |
128 | self.approve_token(b2_testnet_blow_lp_contract_address, usdc_amount, b2_testnet_usdc_address, 170000)
129 | contract = self.b2w3.eth.contract(address=b2_testnet_blow_lp_contract_address, abi=self.load_abi('position'))
130 |
131 | fee = 100
132 | usdt_amount_min = int(usdt_amount*(1-0.001))
133 | usdc_amount_min = int(usdc_amount*(1-0.001))
134 | txn = contract.encodeABI(fn_name='mint', args=[(
135 | b2_testnet_usdt_address,
136 | b2_testnet_usdc_address,
137 | fee,
138 | 379,
139 | 419,
140 | usdt_amount,
141 | usdc_amount,
142 | usdt_amount_min,
143 | usdc_amount_min,
144 | self.account.address,
145 | int(time.time()+1800)
146 | )])
147 |
148 | tx_hash = self._make_tx(txn=txn, is_data=True, spender=b2_testnet_blow_lp_contract_address)
149 | self.add_log('添加流动性成功!', tx_hash)
150 |
151 | def b2_glow_stack(self):
152 | contract = self.b2w3.eth.contract(address=b2_testnet_blow_lp_contract_address, abi=self.load_abi('position'))
153 | lp_nft_num = contract.functions.balanceOf(self.account.address).call()
154 | if not lp_nft_num:
155 | self.add_log('未发现流动性')
156 | return
157 |
158 | for i in range(lp_nft_num):
159 | token_id = contract.functions.tokenOfOwnerByIndex(self.account.address, i).call()
160 | if not token_id:
161 | continue
162 | data = '0xfc6f7865'+encode(['uint256', 'address', 'uint256', 'uint256'], [
163 | int(token_id),
164 | self.account.address,
165 | 340282366920938463463374607431768211455, # 0xffff....
166 | 340282366920938463463374607431768211455 # 0xffff....
167 | ]).hex()
168 | hex_data = self.b2w3.eth.call({'to': b2_testnet_blow_lp_contract_address, 'data': data, 'from': self.account.address}).hex()
169 | data_list = self.b2w3.codec.decode(["uint256", "uint256"], bytes.fromhex(hex_data[2:]))
170 | if data_list[1]:
171 | continue
172 |
173 | txn = contract.functions.safeTransferFrom(self.account.address, b2_stable_coin_lp_contract_address, token_id)
174 | tx_hash = self._make_tx(txn=txn, gas=250000)
175 | self.add_log('stack 成功', tx_hash, True)
176 |
177 |
178 | def invite(self):
179 | u_info = self.get_user_info()
180 | if u_info['inviter'] or not self.invite_code:
181 | self.add_log('已经存在邀请人或邀请码为空,跳过')
182 | return
183 | url='https://task-api.bsquared.network/v2/user/inviter'
184 | payload = {
185 | 'code': self.invite_code
186 | }
187 | res = requests.post(url=url, json=payload, proxies=self.proxy, timeout=30, headers=self.get_auth_header()).json()
188 | if res['code']:
189 | raise Exception(f'用户填写邀请码{self.invite_code}失败, 原因:{res["msg"]}')
190 |
191 | return self.add_log(f'被邀请成功,邀请人邀请码:{self.invite_code}')
192 |
193 | def contract_faucet(self, coin_type):
194 | contract_map = {
195 | 'usdc': b2_testnet_usdc_address,
196 | 'eth': b2_testnet_eth_address,
197 | 'usdt': b2_testnet_usdt_address
198 | }
199 | if not contract_map.get(coin_type):
200 | raise Exception('水龙头只支持,usdc,eth,usdt 这三种测试代币类型')
201 | contract = self.b2w3.eth.contract(address=contract_map[coin_type], abi=self.load_abi('erc20'))
202 | txn = contract.functions.faucet(self.account.address)
203 | tx_hash = self._make_tx(txn=txn, gas=350000)
204 | self.add_log(f'领取测试代币{coin_type}成功!', tx_hash)
205 |
206 | def get_user_info(self):
207 | url='https://task-api.bsquared.network/v2/user/profile'
208 | res = requests.get(url=url, proxies=self.proxy, timeout=30, headers=self.get_auth_header()).json()
209 | if res['code']:
210 | raise Exception(f'用户信息获取失败, 原因:{res["msg"]}')
211 | self.add_log(f'用户信息获取成功, {json.dumps(res)}')
212 | # {
213 | # "code": 0,
214 | # "msg": "success",
215 | # "data": {
216 | # "user_id": "3d8a6xxxxxxxxxxe6bf0xxxb",
217 | # "twitter": "",
218 | # "code": "aass",
219 | # "inviter": "",
220 | # "medals": 0,
221 | # "referrals": 0,
222 | # "register_timestamp": 17077656413,
223 | # "points": 67,
224 | # "medals_rank": 1,
225 | # "referrals_rank": 0,
226 | # "points_rank": 5056,
227 | # "addresses": [
228 | # {
229 | # "address": "0x91FhghfhjhxkC0a41f801729D22daFffff",
230 | # "sca_address": "0xd25jfjv81A57eb9vn5424B43yyyhdfhc",
231 | # "network": 0,
232 | # "address_type": 0
233 | # }
234 | # ]
235 | # }
236 | # }
237 | return res['data']
238 |
239 |
240 |
241 | def claim_point(self):
242 | task_tpyes = {
243 | # glowswap 任务
244 | 'https://task-glowswap.bsquared.network/task/refresh': [
245 | "glowswap_deposit",
246 | "glowswap_swap",
247 | "glowswap_add_liquidity"
248 | ],
249 | # 社交账号任务
250 | # 'https://task-media.bsquared.network/task/refresh': [
251 | # "discord",
252 | # "twitter",
253 | # "telegram",
254 | # ],
255 | # 从btc测试网跨测试btc任务
256 | # 'https://task-bridge.bsquared.network/task/refresh': [
257 | # "deposit",
258 | # ],
259 | # meson 来回跨稳定币任务
260 | # 'https://task-meson.bsquared.network/task/refresh': [
261 | # "meson_gas_station",
262 | # "meson_withdraw",
263 | # "meson_deposit",
264 | # ]
265 | # layerbank借贷任务
266 | 'https://task-layerbank.bsquared.network/task/refresh': [
267 | 'layerbank_supply',
268 | 'layerbank_borrow',
269 | ],
270 | # owlto
271 | 'https://task-meson.bsquared.network/task/refresh': [
272 | 'owlto_deposit',
273 | 'owlto_withdraw'
274 | ],
275 | # shoebill
276 | 'https://task-meson.bsquared.network/task/refresh': [
277 | 'shoebill_supply',
278 | 'shoebill_borrow'
279 | ]
280 | }
281 | for task_url in task_tpyes.keys():
282 | for task_type in task_tpyes[task_url]:
283 | url = task_url + '?type=' + task_type
284 | headers = self.get_auth_header()
285 | res = requests.get(url=url, proxies=self.proxy, timeout=30, headers=headers).json()
286 | self.add_log(f'刷新任务 {task_type}, {json.dumps(res)}')
287 |
288 | def get_auth_header(self):
289 | access_token = self.b2_login()
290 |
291 | return {
292 | 'Accept': 'application/json',
293 | 'Accept-Encoding': 'gzip, deflate, br',
294 | 'Accept-Language': 'en-US;',
295 | 'Authorization': 'Bearer ' + access_token,
296 | 'Content-Type': 'application/json;charset=UTF-8',
297 | 'Origin': 'https://task.bsquared.network',
298 | 'Referer': 'https://task.bsquared.network/',
299 | 'User-Agent': Faker().chrome()
300 | }
301 |
302 | def lend_supply(self, amount=0.0005):
303 | contract = self.b2w3.eth.contract(address=b2_lend_core, abi=self.load_abi('lend'))
304 | amount = Web3.to_wei(amount, 'ether')
305 | txn = contract.functions.supply(b2_lend_btc_market, amount)
306 | tx_hash = self._make_tx(txn=txn, eth_amount=amount, gas=150000)
307 | self.add_log('抵押btc成功', tx_hash)
308 |
309 | def lend_enter_market(self):
310 | contract = self.b2w3.eth.contract(address=b2_lend_core, abi=self.load_abi('lend'))
311 | txn = contract.functions.enterMarkets([b2_lend_btc_market])
312 | tx_hash = self._make_tx(txn=txn, gas=150000)
313 | self.add_log('打开btc抵押物开关成功', tx_hash)
314 |
315 |
316 | def lend_borrow(self, amount=0.01):
317 | contract = self.b2w3.eth.contract(address=b2_lend_core, abi=self.load_abi('lend'))
318 | amount = int(amount * 1e6)
319 | txn = contract.functions.borrow(b2_lend_borrow_usdc, amount)
320 | tx_hash = self._make_tx(txn=txn, gas=400000)
321 | self.add_log('借usdc成功', tx_hash)
322 |
323 | def get_shoebill_faucet(self, coin='weth'):
324 | coin_map = {
325 | 'weth': shoebill_faucet_weth,
326 | 'stone': shoebill_faucet_stone
327 | }
328 | coin_contract = coin_map.get(coin)
329 | if not coin_contract:
330 | self.add_log('coin 必须是 weth,stone 其中之一')
331 | return
332 |
333 | contract = self.b2w3.eth.contract(address=coin_contract, abi=self.load_abi('erc20'))
334 | tx = contract.functions.mint(self.account.address, Web3.to_wei(1, 'ether'))
335 | tx_hash = self._make_tx(txn=tx, gas=100000)
336 | self.add_log(f'获取 shoebill 水 {coin} 成功', tx_hash)
337 |
338 | def shoebill_supply(self, coin='weth'):
339 | coin_map = {
340 | 'weth': shoebill_faucet_weth,
341 | 'stone': shoebill_faucet_stone
342 | }
343 | coin_contract = coin_map.get(coin)
344 | if not coin_contract:
345 | self.add_log('抵押 coin 必须是 weth,stone 其中之一')
346 | return
347 | amount = Web3.to_wei(random.uniform(0.03, 0.09), 'ether')
348 | self.approve_token(shoebill_supply, Web3.to_wei(1, 'ether'), coin_contract, gas=100000)
349 | data = '0xa0712d68' + encode(['uint256'], [amount]).hex()
350 | tx_hash = self._make_tx(txn=data, is_data=1, spender=shoebill_supply, gas=1000000)
351 | self.add_log(f'shoebill 抵押 {coin} 成功', tx_hash)
352 |
353 | def shoebill_borrow(self, coin='stone'):
354 | coin_map = {
355 | 'weth': shoebill_faucet_weth,
356 | 'stone': shoebill_faucet_stone
357 | }
358 | coin_contract = coin_map.get(coin)
359 | if not coin_contract:
360 | self.add_log('借出 coin 必须是 weth,stone 其中之一')
361 | return
362 | amount = Web3.to_wei(random.uniform(0.001, 0.0015), 'ether')
363 | data = '0xc5ebeaec' + encode(['uint256'], [amount]).hex()
364 | tx_hash = self._make_tx(txn=data, is_data=1, spender=shoebill_borrow, gas=1000000)
365 | self.add_log(f'shoebill 借出 {coin} 成功', tx_hash)
366 |
367 |
368 | def _make_tx(self, txn, eth_amount=0, is_data=False, spender=None, gas=0, gas_price=0, use_sepolia=False):
369 | if use_sepolia:
370 | self.b2w3 = self.spw3
371 | if is_data:
372 | tx = {
373 | 'chainId': self.b2w3.eth.chain_id,
374 | 'value': int(eth_amount),
375 | 'gas': 0,
376 | 'nonce': self.b2w3.eth.get_transaction_count(self.account.address),
377 | 'gasPrice': gas_price if gas_price else int(self.b2w3.eth.gas_price * self.gas_scala),
378 | 'data': txn,
379 | 'to': spender,
380 | 'from': self.account.address
381 | }
382 | else:
383 | tx = txn.build_transaction({
384 | 'gas': 0,
385 | 'value': int(eth_amount),
386 | 'gasPrice': gas_price if gas_price else int(self.b2w3.eth.gas_price * self.gas_scala),
387 | 'nonce': self.b2w3.eth.get_transaction_count(self.account.address)
388 | })
389 | # print(tx)
390 |
391 | tx.update({
392 | 'gas': gas if gas else self.b2w3.eth.estimate_gas(tx)
393 | })
394 | signed_txn = self.account.sign_transaction(tx)
395 | order_hash = self.b2w3.eth.send_raw_transaction(signed_txn.rawTransaction)
396 | try:
397 | self.b2w3.eth.wait_for_transaction_receipt(order_hash)
398 | except Exception as e:
399 | if 'is not in the chain after 120 seconds' in f'{e}':
400 | pass
401 | return order_hash.hex()
402 |
403 | def owlto_bridge_to_sepolia(self):
404 | amount = Web3.to_wei(random.uniform(0.01, 0.016), 'ether')
405 | weth_contract = self.b2w3.eth.contract(address=b2_testnet_eth_address, abi=self.load_abi('erc20'))
406 | # w_amount = weth_contract.functions.balanceOf(self.account.address).call()
407 | # exit()
408 | tx = weth_contract.functions.transfer(owlto_sepolia_bridge, amount)
409 | tx_hash = self._make_tx(txn=tx, gas=50000)
410 | self.add_log(f'跨链 eth 到 sepolia', tx_hash)
411 | if self.post_owlto_request(tx_hash, amount, 5008):
412 | self.add_log('b2跨链成功')
413 |
414 | def post_owlto_request(self, tx_hash, amount, ext):
415 | payload = {
416 | 'address': self.account.address,
417 | 'chainid': self.b2w3.eth.chain_id,
418 | 'nonce': self.b2w3.eth.get_transaction_count(self.account.address) -1,
419 | 'tx_hash': tx_hash,
420 | 'agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36',
421 | 'sign': str(self.account.address) + 'owlto',
422 | 'input_amount': int(amount - Web3.to_wei('0.005', 'ether')),
423 | 'transation_amount': int(amount + ext),
424 | 'wallet': 'MetaMask'
425 | }
426 | print(payload)
427 | res = requests.post(url='https://owlto.finance/api/config/tx-action', json=payload).json()
428 | if res['code'] >0:
429 | self.add_log(f'请求owlto失败,原因:{res["msg"]}')
430 | return False
431 |
432 | return True
433 |
434 |
435 | def owlto_bridge_from_sepolia(self):
436 | # 使用sepolia节点作为provider
437 | self.b2w3 = self.spw3
438 | if not self.b2w3.eth.get_balance(self.account.address):
439 | self.add_log('sepolia eth 余额不足')
440 | return False
441 | amount = Web3.to_wei(random.uniform(0.01, 0.016), 'ether')
442 | data = Web3.to_bytes(hexstr='0x')
443 | tx_hash = self._make_tx(txn=data, eth_amount=amount, is_data=1, spender=owlto_sepolia_bridge)
444 | self.add_log('跨 eth 到 b2 成功', tx_hash)
445 | if self.post_owlto_request(tx_hash, amount, 5033):
446 | self.add_log('sepolia跨链成功')
447 |
448 |
449 | def demail_mint(self, username):
450 | mint_nft_abi = [{
451 | "inputs": [
452 | {
453 | "internalType": "address",
454 | "name": "nft_owner",
455 | "type": "address"
456 | },
457 | {
458 | "internalType": "string",
459 | "name": "nft_name",
460 | "type": "string"
461 | }
462 | ],
463 | "name": "MintNFT",
464 | "outputs": [
465 |
466 | ],
467 | "stateMutability": "payable",
468 | "type": "function"
469 | }]
470 |
471 | contract = self.b2w3.eth.contract(address=Web3.to_checksum_address(dmain_nft),
472 | abi=mint_nft_abi)
473 | txn = contract.encodeABI(fn_name='MintNFT', args=(
474 | Web3.to_checksum_address(self.account.address),
475 | username
476 | ))
477 |
478 | tx_hash = self._make_tx(txn=txn, is_data=True, spender=dmain_nft)
479 | self.add_log('mint dmail nft 成功', tx_hash)
480 |
481 | def send_mail(self, username):
482 | send_mail_abi = [{
483 | "inputs": [
484 | {
485 | "internalType": "string",
486 | "name": "to",
487 | "type": "string"
488 | },
489 | {
490 | "internalType": "string",
491 | "name": "path",
492 | "type": "string"
493 | }
494 | ],
495 | "name": "send_mail",
496 | "outputs": [
497 |
498 | ],
499 | "stateMutability": "payable",
500 | "type": "function"
501 | }]
502 |
503 | path = self.account.address.lower() + '@dmail.ai'
504 | sha256_hash = sha256()
505 | sha256_hash.update(path.encode('utf-8'))
506 | # 获取哈希值的十六进制表示
507 | path = sha256_hash.hexdigest()
508 |
509 | sha256_hash.update(str(username + '@dmail.ai').encode('utf-8'))
510 | to = sha256_hash.hexdigest()
511 | contract = self.b2w3.eth.contract(address=Web3.to_checksum_address(dmain_send),
512 | abi=send_mail_abi)
513 | txn = contract.encodeABI(fn_name='send_mail', args=(
514 | to,
515 | path
516 | ))
517 |
518 | tx_hash = self._make_tx(txn=txn, is_data=True, spender=dmain_send)
519 | self.add_log('发送 dmail 邮件 成功', tx_hash)
520 |
521 | # 获取地板价
522 | def layercraft_market_floor_item(self):
523 | url = 'https://prod-api.layercraft.co/subgraphs/name/b2-nft-market-pre'
524 | payload = {
525 | 'query': 'query ($pid: String!, $nid: String!, $orderBy: String!, $orderDirection: String!, $skip: Int = 0, $first: Int = 10, $keywords: String) {\n nfts(\n orderBy: $orderBy\n orderDirection: $orderDirection\n skip: $skip\n first: $first\n where: {isTradable: true, project: $pid, collection: $nid}\n ) {\n id\n tokenId\n nftType\n count\n otherId\n metadataUrl\n currentAskPrice\n currentSeller\n updatedAt\n collection {\n name\n id\n nftType\n }\n }\n totalCount: nfts(where: {isTradable: true, project: $pid, collection: $nid}) {\n id\n }\n}',
526 | 'variables': {
527 | 'first': 8,
528 | 'nid': layercraft_nft_contract_address,
529 | 'orderBy': 'currentAskPrice',
530 | 'orderDirection': 'asc',
531 | 'pid': "1",
532 | 'skip': 0
533 | }
534 | }
535 |
536 | res = requests.post(url=url, json=payload)
537 | res = res.json()
538 | return res['data']['nfts'][0]
539 |
540 | # 我的nft
541 | def layercraft_my_nft(self):
542 | url = f'https://habitat-backend.bsquared.network/api/v2/addresses/{self.account.address}/nft/collections?type='
543 | res = requests.post(url=url)
544 | res = res.json()
545 | if not res.get('items'):
546 | self.add_log('没有发现账户存在nft')
547 | return
548 |
549 | nfts = res['items'][0]['token_instances']
550 | nft_ids = [item['id'] for item in nfts]
551 |
552 | url = 'https://prod-api.layercraft.co/subgraphs/name/b2-nft-market-pre'
553 | payload = {
554 | 'query': "query ($tokenIds: [String], $nft: String, $owner: String) {\n unlistedNFTs: nfts(\n where: {tokenId_in: $tokenIds, collection: $nft, isTradable: false}\n orderBy: updatedAt\n orderDirection: desc\n ) {\n id\n tokenId\n metadataUrl\n nftType\n otherId\n currentAskPrice\n updatedAt\n isTradable\n collection {\n name\n description\n id\n }\n }\n listedNFTs: nfts(\n where: {currentSeller: $owner, isTradable: true}\n orderBy: updatedAt\n orderDirection: desc\n ) {\n id\n tokenId\n metadataUrl\n nftType\n otherId\n currentAskPrice\n updatedAt\n isTradable\n collection {\n name\n description\n id\n }\n }\n listed1155NFTs: nft1155Orders(\n where: {seller: $owner, count_gt: \"0\", status: \"selling\", collection_: {active: true}}\n ) {\n nft {\n id\n tokenId\n metadataUrl\n nftType\n otherId\n currentAskPrice\n updatedAt\n isTradable\n collection {\n name\n description\n id\n }\n }\n }\n}",
555 | 'variables': {
556 | 'nft': layercraft_nft_contract_address,
557 | 'owner': self.account.address,
558 | 'tokenIds': nft_ids
559 | }
560 | }
561 | res = requests.post(url=url, json=payload)
562 | res = res.json()
563 | unlist_id = res['data']['unlistedNFTs'][0]['tokenId']
564 | return unlist_id
565 |
566 | # 购买
567 | def layercraft_buy(self):
568 | floor_item = self.layercraft_market_floor_item()
569 | price = floor_item['currentAskPrice']
570 | id = floor_item['tokenId']
571 |
572 | if self.b2w3.eth.get_balance(self.account.address) < Web3.to_wei(price, 'ether'):
573 | self.add_log(f'余额不足,当前地板价为: {price} btc')
574 | return False
575 |
576 |
577 | tx = '0x0262d0c3' + encode(['address', 'uint256'], [layercraft_nft_contract_address, id]).hex()
578 | tx_hash = self._make_tx(txn=tx, is_data=True, spender=layercraft_market, eth_amount=Web3.to_wei(price))
579 | self.add_log('购买nft成功', tx_hash)
580 |
581 | # 上架
582 | def layercraft_sale(self):
583 | unlist_nftid = self.layercraft_my_nft()
584 | if not unlist_nftid:
585 | self.add_log('账户不存在未上架的nft')
586 | return
587 | # 授权
588 | self.nft_approve(layercraft_nft_contract_address, layercraft_market, unlist_nftid)
589 |
590 | floor_item = self.layercraft_market_floor_item()
591 | price = floor_item['currentAskPrice'] - 0.0001 # 取地板价-0.0001 作为售价
592 |
593 | list_tx = '0xdcbb63e6' + encode(['address','uint256','address','uint256'], [
594 | layercraft_nft_contract_address, # nft
595 | unlist_nftid,
596 | layercraft_wbtc_address, # wbtc
597 | Web3.to_wei(price, 'ether')
598 | ]).hex()
599 |
600 | tx_hash = self._make_tx(txn=list_tx, is_data=True, spender=layercraft_market)
601 | self.add_log('上架nft成功', tx_hash)
602 |
603 | def nft_approve(self, nft_address, spender, nft_id):
604 | nft_contact = self.b2w3.eth.contract(address=nft_address, abi=self.load_abi('erc721'))
605 | approve_tx = nft_contact.functions.approve(spender, nft_id)
606 | tx_hash = self._make_tx(approve_tx)
607 | self.add_log('nft 授权成功', tx_hash)
608 |
609 | def load_abi(self, abi_name):
610 | with open(f'./abi/{abi_name}.json', 'r') as f:
611 | json_data = json.load(f)
612 | return json_data
613 |
614 | @staticmethod
615 | def write_file(file_name, log_str):
616 | with open(file=file_name, mode='a+') as f:
617 | f.write(f'{log_str}\n')
618 |
619 | @staticmethod
620 | def iter_file(file_name):
621 | with open(file=file_name, encoding='utf-8') as f:
622 | for line in f.readlines():
623 | yield line.strip()
624 |
625 | if __name__ == '__main__':
626 | pass
627 |
628 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | loguru>=0.7.0
2 | requests>=2.31.0
3 | Faker>=18.13.0
4 | web3>=6.5.0
5 | aiofiles>=23.2.1
6 | aiohttp>=3.8.4
7 | py-solc-x>=2.0.2
--------------------------------------------------------------------------------