├── script ├── address.txt ├── claim_success.txt └── batch_claim.py ├── .gitignore ├── requirements.txt ├── config ├── other_config.py ├── address_config.py ├── WETH.sol └── abi_config.py ├── utils.py ├── README.md ├── bera_tools.py └── LICENSE /script/address.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /script/claim_success.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /test/ 2 | /address.txt 3 | /bera_claim_success.txt 4 | /example/example.py 5 | /private_run/ 6 | /ym_bera.py 7 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /config/other_config.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Time :2024/2/18 22:35 3 | # Author :ym 4 | # File :other_config.py 5 | emoji_list = ['😀', '😃', '😄', '😁', '😆', '😅', '🤣', '😂', '🥲', '😋', '😛', '😝', '😜', '🤪', '🤨', '🧐', '🤓', '😎', '😕', '🙁', '😣', 6 | '😖', '😫', '😩', '🥺', '😢', '😭', '😤', '😠', '😡', '🤬', '🤯', '😳', '🥵', '🥶', '😱', '😨', '😰', '😥', '😓', '🤗', '😧', 7 | '😮', '😲', '😴', '🤤', '😪', '🥱', '🤢', '🤮', '🤧', '🥴', '😷', '🤒', '🤕', '🤑', '🤠', '😈', '👿', '👹', '👺', '🤡', '💩', 8 | '👻', '💀', '️☠️', '👽', '👾', '🤖', '🎃', ] 9 | -------------------------------------------------------------------------------- /config/address_config.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Time :2024/1/21 00:19 3 | # Author :ym 4 | # File :address_config.py 5 | from web3 import Web3 6 | 7 | w3 = Web3() 8 | bex_swap_address = w3.to_checksum_address('0x0d5862FDbdd12490f9b4De54c236cff63B038074') 9 | bend_address = w3.to_checksum_address('0x9261b5891d3556e829579964B38fe706D0A2D04a') 10 | honey_swap_address = w3.to_checksum_address('0x09ec711b81cD27A6466EC40960F2f8D85BB129D9') 11 | weth_address = w3.to_checksum_address('0x8239FBb3e3D0C2cDFd7888D8aF7701240Ac4DcA4') 12 | honey_address = w3.to_checksum_address('0x7EeCA4205fF31f947EdBd49195a7A88E6A91161B') 13 | usdc_address = w3.to_checksum_address('0x6581e59A1C8dA66eD0D313a0d4029DcE2F746Cc5') 14 | usdc_pool_address = w3.to_checksum_address('0x36Af4FBAb8ebE58b4EfFE0D5d72CeFfc6eFc650A') 15 | usdc_pool_liquidity_address = w3.to_checksum_address('0x5479FbDef04302D2DEEF0Cc78f7D503d81fDFCC9') 16 | weth_pool_liquidity_address = w3.to_checksum_address('0x101f52c804C1C02c0A1D33442ecA30ecb6fB2434') 17 | bex_approve_liquidity_address = w3.to_checksum_address('0x0000000000000000000000000000000000696969') 18 | weth_pool_address = w3.to_checksum_address('0xD3C962F3F36484439A41d0E970cF6581dDf0a9A1') 19 | zero_address = w3.to_checksum_address('0x0000000000000000000000000000000000000000') 20 | wbear_address = w3.to_checksum_address('0x5806E416dA447b267cEA759358cF22Cc41FAE80F') 21 | wbtc_address = w3.to_checksum_address('0x9DAD8A1F64692adeB74ACa26129e0F16897fF4BB') 22 | bend_borrows_address = w3.to_checksum_address('0xfb618D1e361C362adDE4E148A4Dc85465a0A4A22') 23 | bend_pool_address = w3.to_checksum_address('0x40C33CcbF44F554E1Bf8379BE1a5151Ab0F80f65') 24 | ooga_booga_address = w3.to_checksum_address('0x6553444CaA1d4FA329aa9872008ca70AE6131925') 25 | bera_name_address = w3.to_checksum_address('0x8D20B92B4163140F413AA52A4106fF9490bf2122') 26 | -------------------------------------------------------------------------------- /config/WETH.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.18; 2 | 3 | contract WETH9 { 4 | string public name = "Wrapped Ether"; 5 | string public symbol = "WETH"; 6 | uint8 public decimals = 18; 7 | 8 | event Approval(address indexed src, address indexed guy, uint wad); 9 | event Transfer(address indexed src, address indexed dst, uint wad); 10 | event Deposit(address indexed dst, uint wad); 11 | event Withdrawal(address indexed src, uint wad); 12 | 13 | mapping(address => uint) public balanceOf; 14 | mapping(address => mapping(address => uint)) public allowance; 15 | 16 | function() public payable { 17 | deposit(); 18 | } 19 | 20 | function deposit() public payable { 21 | balanceOf[msg.sender] += msg.value; 22 | Deposit(msg.sender, msg.value); 23 | } 24 | 25 | function withdraw(uint wad) public { 26 | require(balanceOf[msg.sender] >= wad); 27 | balanceOf[msg.sender] -= wad; 28 | msg.sender.transfer(wad); 29 | Withdrawal(msg.sender, wad); 30 | } 31 | 32 | function totalSupply() public view returns (uint) { 33 | return this.balance; 34 | } 35 | 36 | function approve(address guy, uint wad) public returns (bool) { 37 | allowance[msg.sender][guy] = wad; 38 | Approval(msg.sender, guy, wad); 39 | return true; 40 | } 41 | 42 | function transfer(address dst, uint wad) public returns (bool) { 43 | return transferFrom(msg.sender, dst, wad); 44 | } 45 | 46 | function transferFrom(address src, address dst, uint wad) 47 | public 48 | returns (bool) 49 | { 50 | require(balanceOf[src] >= wad); 51 | 52 | if (src != msg.sender && allowance[src][msg.sender] != uint(- 1)) { 53 | require(allowance[src][msg.sender] >= wad); 54 | allowance[src][msg.sender] -= wad; 55 | } 56 | 57 | balanceOf[src] -= wad; 58 | balanceOf[dst] += wad; 59 | 60 | Transfer(src, dst, wad); 61 | 62 | return true; 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /utils.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Time :2024/1/19 21:38 3 | # Author :ym 4 | # File :utils.py 5 | import time 6 | from typing import Union 7 | 8 | import requests 9 | from loguru import logger 10 | 11 | 12 | def get_yescaptcha_google_token(yes_captcha_client_key: str) -> Union[bool, str]: 13 | json_data = {"clientKey": yes_captcha_client_key, 14 | "task": {"websiteURL": "https://artio.faucet.berachain.com/", 15 | "websiteKey": "6LfOA04pAAAAAL9ttkwIz40hC63_7IsaU2MgcwVH", 16 | "type": "RecaptchaV3TaskProxylessM1S7", "pageAction": "submit"}, "softID": 109} 17 | response = requests.post(url='https://api.yescaptcha.com/createTask', json=json_data).json() 18 | if response['errorId'] != 0: 19 | raise ValueError(response) 20 | task_id = response['taskId'] 21 | time.sleep(5) 22 | for _ in range(30): 23 | data = {"clientKey": yes_captcha_client_key, "taskId": task_id} 24 | response = requests.post(url='https://api.yescaptcha.com/getTaskResult', json=data).json() 25 | if response['status'] == 'ready': 26 | return response['solution']['gRecaptchaResponse'] 27 | else: 28 | time.sleep(2) 29 | logger.warning(response) 30 | return False 31 | 32 | 33 | def get_no_captcha_google_token(no_captcha_api_token: str) -> Union[bool, str]: 34 | headers = {'User-Token': no_captcha_api_token, 'Content-Type': 'application/json', 'Developer-Id': 'UTtF29'} 35 | json_data = {'sitekey': "6LfOA04pAAAAAL9ttkwIz40hC63_7IsaU2MgcwVH", 36 | 'referer': 'https://artio.faucet.berachain.com/', 'size': 'invisible', 'title': 'Berachain Faucet', 37 | 'action': 'submit', 'internal': False} 38 | response = requests.post(url='http://api.nocaptcha.io/api/wanda/recaptcha/universal', headers=headers, 39 | json=json_data).json() 40 | if response.get('status') == 1: 41 | if response.get('msg') == '验证成功': 42 | return response['data']['token'] 43 | logger.warning(response) 44 | return False 45 | 46 | 47 | def get_2captcha_google_token(captcha_key: str) -> Union[bool, str]: 48 | params = {'key': captcha_key, 'method': 'userrecaptcha', 'version': 'v3', 'action': 'submit', 'min_score': 0.5, 49 | 'googlekey': '6LfOA04pAAAAAL9ttkwIz40hC63_7IsaU2MgcwVH', 'pageurl': 'https://artio.faucet.berachain.com/', 50 | 'json': 1} 51 | response = requests.get(f'https://2captcha.com/in.php?', params=params).json() 52 | if response['status'] != 1: 53 | raise ValueError(response) 54 | task_id = response['request'] 55 | for _ in range(60): 56 | response = requests.get(f'https://2captcha.com/res.php?key={captcha_key}&action=get&id={task_id}&json=1').json() 57 | if response['status'] == 1: 58 | return response['request'] 59 | else: 60 | time.sleep(3) 61 | return False 62 | 63 | 64 | if __name__ == '__main__': 65 | # print(get_no_captcha_google_token('')) 66 | print(get_2captcha_google_token('')) 67 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BeraChainTools 2 | 3 | BeraChainTools 一个为 BeraChain 生态系统设计的工具集,旨在帮助用户轻松地进行各种交互和操作。 4 | 5 | ### 安装依赖 6 | 7 | 在开始使用 BeraChainTools 之前,请确保安装了所有必要的依赖。 8 | 9 | 执行以下命令以安装依赖: 10 | 11 | ``` 12 | pip install -r requirements.txt 13 | ``` 14 | 15 | ### Examples 16 | 17 | - bera目前验证更改为 CloudflareTurnstile,目前支持 yecaptcha 和 2captcha 解码 18 | - 如果你还没有 YesCaptcha 账号,请先在这里注册:[yescaptcha注册链接](https://yescaptcha.com/i/0vVEgw)。 19 | - 如果你还没有 2captcha 账号,请先在这里注册:[2captcha注册链接](https://cn.2captcha.com/?from=9389597)。 20 | - 如果你还没有 ez-captcha 21 | 账号,请先在这里注册:[ez-captcha注册链接](https://dashboard.ez-captcha.com/#/register?inviteCode=djnhuqvHuQJ)。 22 | 23 | Example 1 - 领水: 24 | 25 | ```python 26 | from eth_account import Account 27 | from loguru import logger 28 | 29 | from bera_tools import BeraChainTools 30 | 31 | account = Account.create() 32 | logger.debug(f'address:{account.address}') 33 | logger.debug(f'key:{account.key.hex()}') 34 | # TODO 填写你的 YesCaptcha client key 或者2Captcha API Key 或者 ez-captcha ClientKey 35 | client_key = '00000000000000' 36 | # 使用yescaptcha solver googlev3 37 | bera = BeraChainTools(private_key=account.key, client_key=client_key,solver_provider='yescaptcha',rpc_url='https://rpc.ankr.com/berachain_testnet') 38 | # 使用2captcha solver googlev3 39 | # bera = BeraChainTools(private_key=account.key, client_key=client_key,solver_provider='2captcha',rpc_url='https://rpc.ankr.com/berachain_testnet') 40 | # 使用ez-captcha solver googlev3 41 | # bera = BeraChainTools(private_key=account.key, client_key=client_key,solver_provider='ez-captcha',rpc_url='https://rpc.ankr.com/berachain_testnet') 42 | 43 | # 不使用代理 44 | result = bera.claim_bera() 45 | # 使用代理 46 | # result = bera.claim_bera(proxies={'http':"http://127.0.0.1:8888","https":"http://127.0.0.1:8888"}) 47 | logger.debug(result.text) 48 | ``` 49 | 50 | Example 2 - Bex 交互: 51 | 52 | ```python 53 | 54 | from eth_account import Account 55 | from loguru import logger 56 | 57 | from bera_tools import BeraChainTools 58 | from config.address_config import ( 59 | usdc_address, wbear_address, weth_address, bex_approve_liquidity_address, 60 | usdc_pool_liquidity_address, weth_pool_liquidity_address 61 | ) 62 | 63 | account = Account.from_key('xxxxxxxxxxxx') 64 | bera = BeraChainTools(private_key=account.key, rpc_url='https://rpc.ankr.com/berachain_testnet') 65 | 66 | # bex 使用bera交换usdc 67 | bera_balance = bera.w3.eth.get_balance(account.address) 68 | result = bera.bex_swap(int(bera_balance * 0.2), wbear_address, usdc_address) 69 | logger.debug(result) 70 | # bex 使用usdc交换weth 71 | usdc_balance = bera.usdc_contract.functions.balanceOf(account.address).call() 72 | result = bera.bex_swap(int(usdc_balance * 0.2), usdc_address, weth_address) 73 | logger.debug(result) 74 | 75 | # 授权usdc 76 | approve_result = bera.approve_token(bex_approve_liquidity_address, int("0x" + "f" * 64, 16), usdc_address) 77 | logger.debug(approve_result) 78 | # bex 增加 usdc 流动性 79 | usdc_balance = bera.usdc_contract.functions.balanceOf(account.address).call() 80 | result = bera.bex_add_liquidity(int(usdc_balance * 0.5), usdc_pool_liquidity_address, usdc_address) 81 | logger.debug(result) 82 | 83 | # 授权weth 84 | approve_result = bera.approve_token(bex_approve_liquidity_address, int("0x" + "f" * 64, 16), weth_address) 85 | logger.debug(approve_result) 86 | # bex 增加 weth 流动性 87 | weth_balance = bera.weth_contract.functions.balanceOf(account.address).call() 88 | result = bera.bex_add_liquidity(int(weth_balance * 0.5), weth_pool_liquidity_address, weth_address) 89 | logger.debug(result) 90 | 91 | ``` 92 | 93 | Example 3 - Honey 交互: 94 | 95 | ```python 96 | 97 | from eth_account import Account 98 | from loguru import logger 99 | 100 | from bera_tools import BeraChainTools 101 | from config.address_config import honey_swap_address, usdc_address, honey_address 102 | 103 | account = Account.from_key('xxxxxxxxxxxx') 104 | bera = BeraChainTools(private_key=account.key, rpc_url='https://rpc.ankr.com/berachain_testnet') 105 | 106 | # 授权usdc 107 | approve_result = bera.approve_token(honey_swap_address, int("0x" + "f" * 64, 16), usdc_address) 108 | logger.debug(approve_result) 109 | # 使用usdc mint honey 110 | usdc_balance = bera.usdc_contract.functions.balanceOf(account.address).call() 111 | result = bera.honey_mint(int(usdc_balance * 0.5)) 112 | logger.debug(result) 113 | 114 | # 授权honey 115 | approve_result = bera.approve_token(honey_swap_address, int("0x" + "f" * 64, 16), honey_address) 116 | logger.debug(approve_result) 117 | # 赎回 118 | honey_balance = bera.honey_contract.functions.balanceOf(account.address).call() 119 | result = bera.honey_redeem(int(honey_balance * 0.5)) 120 | logger.debug(result) 121 | 122 | ``` 123 | 124 | Example 4 - Bend 交互: 125 | 126 | ```python 127 | 128 | from eth_account import Account 129 | from loguru import logger 130 | 131 | from bera_tools import BeraChainTools 132 | from config.address_config import bend_address, weth_address, honey_address, bend_pool_address 133 | 134 | account = Account.from_key('xxxxxxxxxxxx') 135 | bera = BeraChainTools(private_key=account.key, rpc_url='https://rpc.ankr.com/berachain_testnet') 136 | 137 | # 授权 138 | approve_result = bera.approve_token(bend_address, int("0x" + "f" * 64, 16), weth_address) 139 | logger.debug(approve_result) 140 | # deposit 141 | weth_balance = bera.weth_contract.functions.balanceOf(account.address).call() 142 | result = bera.bend_deposit(int(weth_balance), weth_address) 143 | logger.debug(result) 144 | 145 | # borrow 146 | balance = bera.bend_contract.functions.getUserAccountData(account.address).call()[2] 147 | logger.debug(balance) 148 | result = bera.bend_borrow(int(balance * 0.8 * 1e10), honey_address) 149 | logger.debug(result) 150 | 151 | # 授权 152 | approve_result = bera.approve_token(bend_address, int("0x" + "f" * 64, 16), honey_address) 153 | logger.debug(approve_result) 154 | # 查询数量 155 | call_result = bera.bend_borrows_contract.functions.getUserReservesData(bend_pool_address, bera.account.address).call() 156 | repay_amount = call_result[0][0][4] 157 | logger.debug(repay_amount) 158 | # repay 159 | result = bera.bend_repay(int(repay_amount * 0.9), honey_address) 160 | logger.debug(result) 161 | 162 | ``` 163 | 164 | Example 5 - 0xhoneyjar 交互: 165 | 166 | ```python 167 | 168 | from eth_account import Account 169 | from loguru import logger 170 | 171 | from bera_tools import BeraChainTools 172 | from config.address_config import ooga_booga_address, honey_address 173 | 174 | account = Account.from_key('xxxxxxxxxxxx') 175 | bera = BeraChainTools(private_key=account.key, rpc_url='https://rpc.ankr.com/berachain_testnet') 176 | 177 | 178 | # https://faucet.0xhoneyjar.xyz/mint 179 | # 授权 180 | approve_result = bera.approve_token(ooga_booga_address, int("0x" + "f" * 64, 16), honey_address) 181 | logger.debug(approve_result) 182 | # 花费4.2 honey mint 183 | result = bera.honey_jar_mint() 184 | logger.debug(result) 185 | 186 | ``` 187 | 188 | Example 6 - 部署合约: 189 | 190 | ```python 191 | 192 | from eth_account import Account 193 | from loguru import logger 194 | from solcx import install_solc 195 | 196 | from bera_tools import BeraChainTools 197 | from config.address_config import ooga_booga_address, honey_address 198 | 199 | account = Account.from_key('xxxxxxxxxxxx') 200 | bera = BeraChainTools(private_key=account.key, rpc_url='https://rpc.ankr.com/berachain_testnet') 201 | 202 | # 安装0.4.18 版本编译器 203 | install_solc('0.4.18') 204 | # 读取sol文件 205 | with open('config/WETH.sol', 'r') as f: 206 | code = f.read() 207 | # 部署合约 208 | result = bera.deploy_contract(code, '0.4.18') 209 | logger.debug(result) 210 | 211 | ``` 212 | 213 | Example 7 - 域名注册: 214 | 215 | ```python 216 | 217 | from eth_account import Account 218 | from loguru import logger 219 | 220 | from bera_tools import BeraChainTools 221 | 222 | account = Account.from_key('xxxxxxxxxxxx') 223 | bera = BeraChainTools(private_key=account.key, rpc_url='https://rpc.ankr.com/berachain_testnet') 224 | result = bera.create_bera_name() 225 | logger.debug(result) 226 | 227 | ``` 228 | 229 | ### BeraChain 领水 230 | 231 | 支持创建地址领水或指定地址领水 232 | 233 | - **访问链接**:[BeraChain领水](https://artio.faucet.berachain.com/) 234 | - **状态**:已完成 235 | 236 | ### bex 交互 237 | 238 | 支持代币交换和增加流动性 239 | 240 | - **访问链接**:[bex交互](https://artio.bex.berachain.com/swap) 241 | - **状态**:已完成 242 | 243 | ### honey 交互 244 | 245 | 支持mint和redeem 246 | 247 | - **访问链接**:[honey交互](https://artio.honey.berachain.com) 248 | - **状态**:已完成 249 | 250 | ### bend 交互 251 | 252 | 用于与 BeraChain 的 bend 服务交互。 253 | 254 | - **访问链接**:[bend交互](https://artio.bend.berachain.com/) 255 | - **状态**:已完成 256 | 257 | ### beranames 交互 258 | 259 | 用于与 BeraChain 的 beranames 服务交互。 260 | 261 | - **访问链接**:[beranames交互](https://www.beranames.com) 262 | - **状态**:已完成 263 | 264 | ### berps 交互 265 | 266 | 用于与 BeraChain 的 berps 服务交互。 267 | 268 | - **访问链接**:[berps交互](https://artio.berps.berachain.com/) 269 | - **状态**:进行中 270 | 271 | ### station 交互 272 | 273 | 用于与 BeraChain 的 station 服务交互。 274 | 275 | - **访问链接**:[station交互](https://artio.station.berachain.com/) 276 | - **状态**:待完成 277 | 278 | --- 279 | 280 | ### galxe 任务 281 | 282 | 请访问作者 283 | [Fooyao](https://github.com/Fooyao) 284 | 285 | - **Github项目地址**:[galxe](https://github.com/Fooyao/galxe_bind_twitter/tree/main) 286 | 287 | --- 288 | 289 | 290 | 感谢使用 291 | BeraChainTools!如有任何问题或建议,请随时通过 [GitHub Issues](https://github.com/ymmmmmmmm/BeraChainTools/issues) 提交。 292 | 293 | 如果您认可和喜欢 BeraChainTools 的功能和使用体验,我非常欢迎您给项目点个 star。您的 star 是对我的工作的认可和支持,也是我不断改进和提升 294 | BeraChainTools 的动力!谢谢您的支持! 295 | 296 | 297 | 298 | 299 | -------------------------------------------------------------------------------- /script/batch_claim.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Time :2024/1/25 03:15 3 | # Author :ym 4 | # File :batch_claim.py 5 | import asyncio 6 | import json 7 | from typing import Union 8 | 9 | import aiofiles 10 | import aiohttp 11 | from eth_typing import ChecksumAddress, Address 12 | from faker import Faker 13 | from loguru import logger 14 | 15 | fake = Faker() 16 | 17 | 18 | async def get_2captcha_google_token(session: aiohttp.ClientSession) -> Union[bool, str]: 19 | params = {'key': client_key, 'method': 'userrecaptcha', 'version': 'v3', 'action': 'submit', 'min_score': 0.5, 20 | 'googlekey': '6LfOA04pAAAAAL9ttkwIz40hC63_7IsaU2MgcwVH', 'pageurl': 'https://artio.faucet.berachain.com/', 21 | 'json': 1} 22 | async with session.get('https://2captcha.com/in.php?', params=params) as response: 23 | response_json = await response.json() 24 | # logger.debug(response_json) 25 | if response_json['status'] != 1: 26 | logger.warning(response_json) 27 | return False 28 | task_id = response_json['request'] 29 | for _ in range(120): 30 | async with session.get( 31 | f'https://2captcha.com/res.php?key={client_key}&action=get&id={task_id}&json=1') as response: 32 | response_json = await response.json() 33 | if response_json['status'] == 1: 34 | return response_json['request'] 35 | else: 36 | await asyncio.sleep(1) 37 | return False 38 | 39 | 40 | async def get_2captcha_turnstile_token(session: aiohttp.ClientSession) -> Union[bool, str]: 41 | params = {'key': client_key, 'method': 'turnstile', 42 | 'sitekey': '0x4AAAAAAARdAuciFArKhVwt', 43 | 'pageurl': 'https://artio.faucet.berachain.com/', 44 | 'json': 1} 45 | async with session.get('https://2captcha.com/in.php?', params=params) as response: 46 | response_json = await response.json() 47 | # logger.debug(response_json) 48 | if response_json['status'] != 1: 49 | logger.warning(response_json) 50 | return False 51 | task_id = response_json['request'] 52 | for _ in range(120): 53 | async with session.get( 54 | f'https://2captcha.com/res.php?key={client_key}&action=get&id={task_id}&json=1') as response: 55 | response_json = await response.json() 56 | if response_json['status'] == 1: 57 | return response_json['request'] 58 | else: 59 | await asyncio.sleep(1) 60 | return False 61 | 62 | 63 | async def get_yescaptcha_google_token(session: aiohttp.ClientSession) -> Union[bool, str]: 64 | json_data = {"clientKey": client_key, 65 | "task": {"websiteURL": "https://artio.faucet.berachain.com/", 66 | "websiteKey": "6LfOA04pAAAAAL9ttkwIz40hC63_7IsaU2MgcwVH", 67 | "type": "RecaptchaV3TaskProxylessM1S7", "pageAction": "submit"}, "softID": 109} 68 | async with session.post('https://api.yescaptcha.com/createTask', json=json_data) as response: 69 | response_json = await response.json() 70 | if response_json['errorId'] != 0: 71 | logger.warning(response_json) 72 | return False 73 | task_id = response_json['taskId'] 74 | for _ in range(120): 75 | data = {"clientKey": client_key, "taskId": task_id} 76 | async with session.post('https://api.yescaptcha.com/getTaskResult', json=data) as response: 77 | response_json = await response.json() 78 | if response_json['status'] == 'ready': 79 | return response_json['solution']['gRecaptchaResponse'] 80 | else: 81 | await asyncio.sleep(1) 82 | return False 83 | 84 | 85 | async def get_yescaptcha_turnstile_token(session: aiohttp.ClientSession) -> Union[bool, str]: 86 | json_data = {"clientKey": client_key, 87 | "task": {"websiteURL": "https://artio.faucet.berachain.com/", 88 | "websiteKey": "0x4AAAAAAARdAuciFArKhVwt", 89 | "type": "TurnstileTaskProxylessM1"}, "softID": 109} 90 | async with session.post('https://api.yescaptcha.com/createTask', json=json_data) as response: 91 | response_json = await response.json() 92 | if response_json['errorId'] != 0: 93 | logger.warning(response_json) 94 | return False 95 | task_id = response_json['taskId'] 96 | for _ in range(120): 97 | data = {"clientKey": client_key, "taskId": task_id} 98 | async with session.post('https://api.yescaptcha.com/getTaskResult', json=data) as response: 99 | response_json = await response.json() 100 | if response_json['status'] == 'ready': 101 | return response_json['solution']['token'] 102 | else: 103 | await asyncio.sleep(1) 104 | return False 105 | 106 | 107 | async def get_ez_captcha_google_token(session: aiohttp.ClientSession) -> Union[bool, str]: 108 | json_data = { 109 | "clientKey": client_key, "task": {"websiteURL": "https://artio.faucet.berachain.com/", 110 | "websiteKey": "6LfOA04pAAAAAL9ttkwIz40hC63_7IsaU2MgcwVH", 111 | "type": "ReCaptchaV3TaskProxyless"}, "appId": "34119"} 112 | async with session.post('https://api.ez-captcha.com/createTask', json=json_data) as response: 113 | response_json = await response.json() 114 | if response_json['errorId'] != 0: 115 | logger.warning(response_json) 116 | return False 117 | task_id = response_json['taskId'] 118 | for _ in range(120): 119 | data = {"clientKey": client_key, "taskId": task_id} 120 | async with session.post('https://api.ez-captcha.com/getTaskResult', json=data) as response: 121 | response_json = await response.json() 122 | if response_json['status'] == 'ready': 123 | return response_json['solution']['gRecaptchaResponse'] 124 | else: 125 | await asyncio.sleep(1) 126 | return False 127 | 128 | 129 | async def get_ip(session: aiohttp.ClientSession) -> str: 130 | async with session.get(get_ip_url) as response: 131 | response_text = await response.text() 132 | # proxy 格式 : 'http://user:password@ip:port' or 'http://ip:port' 133 | return f'http://{response_text.strip()}' 134 | 135 | 136 | async def write_to_file(address: Union[Address, ChecksumAddress]): 137 | async with aiofiles.open('claim_success.txt', 'a+') as f: 138 | await f.write(f'{address}\n') 139 | 140 | 141 | async def read_to_file(file_path: str): 142 | async with aiofiles.open('./claim_success.txt', 'r') as success_file: 143 | claim_success = await success_file.read() 144 | 145 | async with aiofiles.open(file_path, 'r') as file: 146 | lines = await file.readlines() 147 | claim_list = [_address.strip() for _address in lines if _address.strip() not in claim_success] 148 | 149 | return claim_list 150 | 151 | 152 | async def claim_faucet(address: Union[Address, ChecksumAddress], google_token: str, session: aiohttp.ClientSession): 153 | user_agent = fake.chrome() 154 | headers = {'authority': 'artio-80085-ts-faucet-api-2.berachain.com', 'accept': '*/*', 155 | 'accept-language': 'zh-CN,zh;q=0.9', 'authorization': f'Bearer {google_token}', 156 | 'cache-control': 'no-cache', 'content-type': 'text/plain;charset=UTF-8', 157 | 'origin': 'https://artio.faucet.berachain.com', 'pragma': 'no-cache', 158 | 'referer': 'https://artio.faucet.berachain.com/', 'user-agent': user_agent} 159 | params = {'address': address} 160 | proxies = await get_ip(session) 161 | async with session.post('https://artio-80085-faucet-api-cf.berachain.com/api/claim', headers=headers, 162 | data=json.dumps(params), params=params, proxy=proxies) as response: 163 | response_text = await response.text() 164 | if 'try again' not in response_text and 'message":"' in response_text: 165 | logger.success(response_text) 166 | await write_to_file(address) 167 | elif 'Txhash' in response_text: 168 | logger.success(response_text) 169 | await write_to_file(address) 170 | else: 171 | logger.warning(response_text.replace('\n', '')) 172 | 173 | 174 | def get_solver_provider(): 175 | provider_dict = {'yescaptcha': get_yescaptcha_turnstile_token, '2captcha': get_2captcha_turnstile_token} 176 | if solver_provider not in list(provider_dict.keys()): 177 | raise ValueError("solver_provider must be 'yescaptcha'") 178 | return provider_dict[solver_provider] 179 | 180 | 181 | async def claim(address: Union[Address, ChecksumAddress], session: aiohttp.ClientSession): 182 | try: 183 | google_token = await get_solver_provider()(session) 184 | if google_token: 185 | await claim_faucet(address, google_token, session) 186 | except Exception as e: 187 | logger.warning(f'{address}:{e}') 188 | 189 | 190 | async def run(file_path): 191 | sem = asyncio.Semaphore(max_concurrent) 192 | address_list = await read_to_file(file_path) 193 | async with aiohttp.ClientSession() as session: 194 | async def claim_wrapper(address): 195 | async with sem: 196 | await claim(address, session) 197 | 198 | await asyncio.gather(*[claim_wrapper(address) for address in address_list]) 199 | 200 | 201 | if __name__ == '__main__': 202 | """ 203 | 如果你不能完全的读懂代码,不建议直接运行本程序避免造成损失 204 | 运行时会读取当前文件夹下的claim_success.txt文本,跳过已经成功的地址 205 | 单进程性能会有瓶颈,大概一分钟能领1000左右,自行套多进程或复制多开 206 | """ 207 | # 验证平台key 208 | client_key = 'xxxxxxxxxxx' 209 | # 目前支持使用yescaptcha 2captcha 210 | solver_provider = 'yescaptcha' 211 | # 代理获取链接 设置一次提取一个 返回格式为text 212 | get_ip_url = 'http://127.0.0.1:8883/get_ip' 213 | # 并发数量 214 | max_concurrent = 128 215 | # 读取文件的路径 地址一行一个 216 | _file_path = './address.txt' 217 | asyncio.run(run(_file_path)) 218 | -------------------------------------------------------------------------------- /bera_tools.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Time :2024/1/22 00:36 3 | # Author :ym 4 | # File :bera_tools.py 5 | import json 6 | import random 7 | import time 8 | from typing import Union 9 | 10 | import requests 11 | from eth_account import Account 12 | from eth_typing import Address, ChecksumAddress 13 | from faker import Faker 14 | from requests import Response 15 | from solcx import compile_source, set_solc_version 16 | from web3 import Web3 17 | 18 | from config.abi_config import erc_20_abi, honey_abi, bex_abi, bend_abi, bend_borrows_abi, ooga_booga_abi, bera_name_abi 19 | from config.address_config import bex_swap_address, usdc_address, honey_address, honey_swap_address, \ 20 | bex_approve_liquidity_address, weth_address, bend_address, bend_borrows_address, wbear_address, zero_address, \ 21 | ooga_booga_address, bera_name_address 22 | from config.other_config import emoji_list 23 | 24 | 25 | class BeraChainTools(object): 26 | def __init__(self, private_key, client_key='', solver_provider='', rpc_url='https://artio.rpc.berachain.com/'): 27 | # if solver_provider not in ["yescaptcha", "2captcha", "ez-captcha", ""]: 28 | if solver_provider not in ["yescaptcha", "2captcha"]: 29 | raise ValueError("solver_provider must be 'yescaptcha' or '2captcha' or 'ez-captcha' ") 30 | self.solver_provider = solver_provider 31 | self.private_key = private_key 32 | self.client_key = client_key 33 | self.rpc_url = rpc_url 34 | self.fake = Faker() 35 | self.account = Account.from_key(self.private_key) 36 | self.session = requests.session() 37 | self.w3 = Web3(Web3.HTTPProvider(self.rpc_url)) 38 | self.bex_contract = self.w3.eth.contract(address=bex_swap_address, abi=bex_abi) 39 | self.honey_swap_contract = self.w3.eth.contract(address=honey_swap_address, abi=honey_abi) 40 | self.usdc_contract = self.w3.eth.contract(address=usdc_address, abi=erc_20_abi) 41 | self.weth_contract = self.w3.eth.contract(address=weth_address, abi=erc_20_abi) 42 | self.honey_contract = self.w3.eth.contract(address=honey_address, abi=erc_20_abi) 43 | self.bend_contract = self.w3.eth.contract(address=bend_address, abi=bend_abi) 44 | self.bend_borrows_contract = self.w3.eth.contract(address=bend_borrows_address, abi=bend_borrows_abi) 45 | self.ooga_booga_contract = self.w3.eth.contract(address=ooga_booga_address, abi=ooga_booga_abi) 46 | self.bera_name_contract = self.w3.eth.contract(address=bera_name_address, abi=bera_name_abi) 47 | 48 | def get_2captcha_google_token(self) -> Union[bool, str]: 49 | if self.client_key == '': 50 | raise ValueError('2captcha_client_key is null ') 51 | params = {'key': self.client_key, 'method': 'userrecaptcha', 'version': 'v3', 'action': 'submit', 52 | 'min_score': 0.5, 53 | 'googlekey': '6LfOA04pAAAAAL9ttkwIz40hC63_7IsaU2MgcwVH', 54 | 'pageurl': 'https://artio.faucet.berachain.com/', 55 | 'json': 1} 56 | response = requests.get(f'https://2captcha.com/in.php?', params=params).json() 57 | if response['status'] != 1: 58 | raise ValueError(response) 59 | task_id = response['request'] 60 | for _ in range(60): 61 | response = requests.get( 62 | f'https://2captcha.com/res.php?key={self.client_key}&action=get&id={task_id}&json=1').json() 63 | if response['status'] == 1: 64 | return response['request'] 65 | else: 66 | time.sleep(3) 67 | return False 68 | 69 | def get_2captcha_turnstile_token(self) -> Union[bool, str]: 70 | if self.client_key == '': 71 | raise ValueError('2captcha_client_key is null ') 72 | params = {'key': self.client_key, 'method': 'turnstile', 73 | 'sitekey': '0x4AAAAAAARdAuciFArKhVwt', 74 | 'pageurl': 'https://artio.faucet.berachain.com/', 75 | 'json': 1} 76 | response = requests.get(f'https://2captcha.com/in.php?', params=params).json() 77 | if response['status'] != 1: 78 | raise ValueError(response) 79 | task_id = response['request'] 80 | for _ in range(60): 81 | response = requests.get( 82 | f'https://2captcha.com/res.php?key={self.client_key}&action=get&id={task_id}&json=1').json() 83 | if response['status'] == 1: 84 | return response['request'] 85 | else: 86 | time.sleep(3) 87 | return False 88 | 89 | def get_yescaptcha_google_token(self) -> Union[bool, str]: 90 | if self.client_key == '': 91 | raise ValueError('yes_captcha_client_key is null ') 92 | json_data = {"clientKey": self.client_key, 93 | "task": {"websiteURL": "https://artio.faucet.berachain.com/", 94 | "websiteKey": "6LfOA04pAAAAAL9ttkwIz40hC63_7IsaU2MgcwVH", 95 | "type": "RecaptchaV3TaskProxylessM1S7", "pageAction": "submit"}, "softID": 109} 96 | response = self.session.post(url='https://api.yescaptcha.com/createTask', json=json_data).json() 97 | if response['errorId'] != 0: 98 | raise ValueError(response) 99 | task_id = response['taskId'] 100 | time.sleep(5) 101 | for _ in range(30): 102 | data = {"clientKey": self.client_key, "taskId": task_id} 103 | response = requests.post(url='https://api.yescaptcha.com/getTaskResult', json=data).json() 104 | if response['status'] == 'ready': 105 | return response['solution']['gRecaptchaResponse'] 106 | else: 107 | time.sleep(2) 108 | return False 109 | 110 | def get_yescaptcha_turnstile_token(self) -> Union[bool, str]: 111 | if self.client_key == '': 112 | raise ValueError('yes_captcha_client_key is null ') 113 | json_data = {"clientKey": self.client_key, 114 | "task": {"websiteURL": "https://artio.faucet.berachain.com/", 115 | "websiteKey": "0x4AAAAAAARdAuciFArKhVwt", 116 | "type": "TurnstileTaskProxylessM1"}, "softID": 109} 117 | response = self.session.post(url='https://api.yescaptcha.com/createTask', json=json_data).json() 118 | if response['errorId'] != 0: 119 | raise ValueError(response) 120 | task_id = response['taskId'] 121 | time.sleep(5) 122 | for _ in range(30): 123 | data = {"clientKey": self.client_key, "taskId": task_id} 124 | response = requests.post(url='https://api.yescaptcha.com/getTaskResult', json=data).json() 125 | if response['status'] == 'ready': 126 | return response['solution']['token'] 127 | else: 128 | time.sleep(2) 129 | return False 130 | 131 | def get_ez_captcha_google_token(self) -> Union[bool, str]: 132 | if self.client_key == '': 133 | raise ValueError('ez-captcha is null ') 134 | json_data = { 135 | "clientKey": self.client_key, 136 | "task": {"websiteURL": "https://artio.faucet.berachain.com/", 137 | "websiteKey": "6LfOA04pAAAAAL9ttkwIz40hC63_7IsaU2MgcwVH", 138 | "type": "ReCaptchaV3TaskProxyless", }, 'appId': '34119'} 139 | response = self.session.post(url='https://api.ez-captcha.com/createTask', json=json_data).json() 140 | if response['errorId'] != 0: 141 | raise ValueError(response) 142 | task_id = response['taskId'] 143 | time.sleep(5) 144 | for _ in range(30): 145 | data = {"clientKey": self.client_key, "taskId": task_id} 146 | response = requests.post(url='https://api.ez-captcha.com/getTaskResult', json=data).json() 147 | if response['status'] == 'ready': 148 | return response['solution']['gRecaptchaResponse'] 149 | else: 150 | time.sleep(2) 151 | return False 152 | 153 | def get_nonce(self): 154 | return self.w3.eth.get_transaction_count(self.account.address) 155 | 156 | def get_solver_provider(self): 157 | provider_dict = { 158 | # 'yescaptcha': self.get_yescaptcha_google_token, 159 | 'yescaptcha': self.get_yescaptcha_turnstile_token, 160 | '2captcha': self.get_2captcha_turnstile_token, 161 | 'ez-captcha': self.get_ez_captcha_google_token, 162 | } 163 | if self.solver_provider not in list(provider_dict.keys()): 164 | raise ValueError("solver_provider must be 'yescaptcha' or '2captcha' or 'ez-captcha' ") 165 | return provider_dict[self.solver_provider]() 166 | 167 | def claim_bera(self, proxies=None) -> Response: 168 | """ 169 | bera领水 170 | :param proxies: http代理 171 | :return: object 172 | """ 173 | google_token = self.get_solver_provider() 174 | if not google_token: 175 | raise ValueError('获取google token 出错') 176 | user_agent = self.fake.chrome() 177 | headers = {'authority': 'artio-80085-ts-faucet-api-2.berachain.com', 'accept': '*/*', 178 | 'accept-language': 'zh-CN,zh;q=0.9', 'authorization': f'Bearer {google_token}', 179 | 'cache-control': 'no-cache', 'content-type': 'text/plain;charset=UTF-8', 180 | 'origin': 'https://artio.faucet.berachain.com', 'pragma': 'no-cache', 181 | 'referer': 'https://artio.faucet.berachain.com/', 'user-agent': user_agent} 182 | # print(headers) 183 | params = {'address': self.account.address} 184 | # if proxies is not None: 185 | # proxies = {"http": f"http://{proxies}", "https": f"http://{proxies}"} 186 | response = requests.post('https://artio-80085-faucet-api-cf.berachain.com/api/claim', params=params, 187 | headers=headers, data=json.dumps(params), proxies=proxies) 188 | return response 189 | 190 | def approve_token(self, spender: Union[Address, ChecksumAddress], amount: int, 191 | approve_token_address: Union[Address, ChecksumAddress]) -> Union[bool, str]: 192 | """ 193 | 授权代币 194 | :param spender: 授权给哪个地址 195 | :param amount: 授权金额 196 | :param approve_token_address: 需要授权的代币地址 197 | :return: hash 198 | """ 199 | approve_contract = self.w3.eth.contract(address=approve_token_address, abi=erc_20_abi) 200 | 201 | allowance_balance = approve_contract.functions.allowance(self.account.address, spender).call() 202 | if allowance_balance < amount: 203 | txn = approve_contract.functions.approve(spender, amount).build_transaction( 204 | {'gas': 500000 + random.randint(1, 10000), 'gasPrice': int(self.w3.eth.gas_price * 1.15), 205 | 'nonce': self.get_nonce()}) 206 | signed_txn = self.w3.eth.account.sign_transaction(txn, private_key=self.private_key) 207 | order_hash = self.w3.eth.send_raw_transaction(signed_txn.rawTransaction) 208 | return order_hash.hex() 209 | return True 210 | 211 | def bex_swap(self, amount_in: int, asset_in_address: Union[Address, ChecksumAddress], 212 | asset_out_address: Union[Address, ChecksumAddress]) -> str: 213 | """ 214 | bex 交换 215 | :param amount_in: 输入数量 216 | :param asset_in_address: 输入 token 地址 217 | :param asset_out_address: 输出 token 地址 218 | :return: 219 | """ 220 | if asset_in_address == wbear_address: 221 | balance = self.w3.eth.get_balance(self.account.address) 222 | assert balance != 0 223 | assert balance >= amount_in 224 | else: 225 | asset_in_token_contract = self.w3.eth.contract(address=asset_in_address, abi=erc_20_abi) 226 | balance = asset_in_token_contract.functions.balanceOf(self.account.address).call() 227 | assert balance != 0 228 | assert balance >= amount_in 229 | allowance_balance = asset_in_token_contract.functions.allowance(self.account.address, 230 | bex_swap_address).call() 231 | if allowance_balance < amount_in: 232 | raise ValueError( 233 | f'需要授权\nplease run : \nbera.approve_token(bex_swap_address, int("0x" + "f" * 64, 16), "{asset_in_address}")') 234 | 235 | headers = {'authority': 'artio-80085-dex-router.berachain.com', 'accept': '*/*', 236 | 'accept-language': 'zh-CN,zh;q=0.9', 'cache-control': 'no-cache', 237 | 'origin': 'https://artio.bex.berachain.com', 'pragma': 'no-cache', 238 | 'referer': 'https://artio.bex.berachain.com/', 'user-agent': self.fake.chrome()} 239 | 240 | params = {'quoteAsset': asset_out_address, 'baseAsset': asset_in_address, 'amount': amount_in, 241 | 'swap_type': 'given_in'} 242 | 243 | response = self.session.get('https://artio-80085-dex-router.berachain.com/dex/route', params=params, 244 | headers=headers) 245 | assert response.status_code == 200 246 | swaps_list = response.json()['steps'] 247 | swaps = list() 248 | for index, info in enumerate(swaps_list): 249 | swaps.append(dict( 250 | poolId=self.w3.to_checksum_address(info['pool']), 251 | assetIn=self.w3.to_checksum_address(info['assetIn']), 252 | amountIn=int(info['amountIn']), 253 | assetOut=self.w3.to_checksum_address(info['assetOut']), 254 | amountOut=0 if index + 1 != len(swaps_list) else int(int(info['amountOut']) * 0.5), 255 | userData=b'')) 256 | if asset_in_address.lower() == wbear_address.lower(): 257 | swaps[0]['assetIn'] = zero_address 258 | 259 | txn = self.bex_contract.functions.batchSwap(kind=0, swaps=swaps, deadline=99999999).build_transaction( 260 | {'gas': 500000 + random.randint(1, 10000), 'value': amount_in if asset_in_address == wbear_address else 0, 261 | 'gasPrice': int(self.w3.eth.gas_price * 1.2), 'nonce': self.get_nonce()}) 262 | signed_txn = self.w3.eth.account.sign_transaction(txn, private_key=self.private_key) 263 | order_hash = self.w3.eth.send_raw_transaction(signed_txn.rawTransaction) 264 | return order_hash.hex() 265 | 266 | def bex_add_liquidity(self, amount_in: int, pool_address: Union[Address], asset_in_address: Union[Address]) -> str: 267 | """ 268 | bex 增加流动性 269 | :param amount_in: 输入数量 270 | :param pool_address: 交互的pool 地址 271 | :param asset_in_address: 需要加流动性的token地址 272 | :return: 273 | """ 274 | asset_in_token_contract = self.w3.eth.contract(address=asset_in_address, abi=erc_20_abi) 275 | token_balance = asset_in_token_contract.functions.balanceOf(self.account.address).call() 276 | assert token_balance != 0 277 | assert token_balance >= amount_in 278 | allowance_balance = asset_in_token_contract.functions.allowance(self.account.address, 279 | bex_approve_liquidity_address).call() 280 | if allowance_balance < amount_in: 281 | raise ValueError( 282 | f'需要授权\nplease run : \nbera.approve_token(bex_approve_liquidity_address, int("0x" + "f" * 64, 16), "{asset_in_address}")') 283 | txn = self.bex_contract.functions.addLiquidity(pool=pool_address, receiver=self.account.address, 284 | assetsIn=[asset_in_address], 285 | amountsIn=[amount_in]).build_transaction( 286 | {'gas': 500000 + random.randint(1, 10000), 'gasPrice': int(self.w3.eth.gas_price * 1.15), 287 | 'nonce': self.get_nonce()}) 288 | signed_txn = self.w3.eth.account.sign_transaction(txn, private_key=self.private_key) 289 | order_hash = self.w3.eth.send_raw_transaction(signed_txn.rawTransaction) 290 | return order_hash.hex() 291 | 292 | def honey_mint(self, amount_usdc_in: int) -> str: 293 | """ 294 | honey mint 295 | :param amount_usdc_in: 输入数量 296 | :return: 297 | """ 298 | usdc_balance = self.usdc_contract.functions.balanceOf(self.account.address).call() 299 | assert usdc_balance != 0 300 | assert usdc_balance >= amount_usdc_in 301 | allowance_balance = self.usdc_contract.functions.allowance(self.account.address, honey_swap_address).call() 302 | if allowance_balance < amount_usdc_in: 303 | raise ValueError( 304 | f'需要授权\nplease run : \nbera.approve_token(honey_swap_address, int("0x" + "f" * 64, 16), "{usdc_address}")') 305 | txn = self.honey_swap_contract.functions.mint(to=self.account.address, collateral=usdc_address, 306 | amount=amount_usdc_in, ).build_transaction( 307 | {'gas': 500000 + random.randint(1, 10000), 'gasPrice': int(self.w3.eth.gas_price * 1.15), 308 | 'nonce': self.get_nonce()}) 309 | signed_txn = self.w3.eth.account.sign_transaction(txn, private_key=self.private_key) 310 | order_hash = self.w3.eth.send_raw_transaction(signed_txn.rawTransaction) 311 | return order_hash.hex() 312 | 313 | def honey_redeem(self, amount_honey_in: int) -> str: 314 | """ 315 | honey redeem 316 | :param amount_honey_in: 输入数量 317 | :return: 318 | """ 319 | honey_balance = self.honey_contract.functions.balanceOf(self.account.address).call() 320 | assert honey_balance != 0 321 | assert honey_balance >= amount_honey_in 322 | allowance_balance = self.honey_contract.functions.allowance(self.account.address, honey_swap_address).call() 323 | if allowance_balance < amount_honey_in: 324 | raise ValueError( 325 | f'需要授权\nplease run : \nbera.approve_token(honey_swap_address, int("0x" + "f" * 64, 16), "{honey_address}")') 326 | 327 | txn = self.honey_swap_contract.functions.redeem(to=self.account.address, amount=amount_honey_in, 328 | collateral=usdc_address).build_transaction( 329 | {'gas': 500000 + random.randint(1, 10000), 'gasPrice': int(self.w3.eth.gas_price * 1.15), 330 | 'nonce': self.get_nonce()}) 331 | signed_txn = self.w3.eth.account.sign_transaction(txn, private_key=self.private_key) 332 | order_hash = self.w3.eth.send_raw_transaction(signed_txn.rawTransaction) 333 | return order_hash.hex() 334 | 335 | def bend_deposit(self, amount_in: int, amount_in_token_address: Union[Address]) -> str: 336 | """ 337 | bend deposit 338 | :param amount_in: 数量 339 | :param amount_in_token_address: 代币地址 340 | :return: 341 | """ 342 | amount_in_token_contract = self.w3.eth.contract(address=amount_in_token_address, abi=erc_20_abi) 343 | token_balance = amount_in_token_contract.functions.balanceOf(self.account.address).call() 344 | assert token_balance != 0 345 | assert token_balance >= amount_in 346 | allowance_balance = amount_in_token_contract.functions.allowance(self.account.address, 347 | bend_address).call() 348 | if allowance_balance < amount_in: 349 | raise ValueError( 350 | f'需要授权\nplease run : \nbera.approve_token(bend_address, int("0x" + "f" * 64, 16), "{amount_in_token_address}")') 351 | txn = self.bend_contract.functions.supply(asset=amount_in_token_address, amount=amount_in, 352 | onBehalfOf=self.account.address, referralCode=0).build_transaction( 353 | {'gas': 500000 + random.randint(1, 10000), 'gasPrice': int(self.w3.eth.gas_price * 1.15), 354 | 'nonce': self.get_nonce()}) 355 | signed_txn = self.w3.eth.account.sign_transaction(txn, private_key=self.private_key) 356 | order_hash = self.w3.eth.send_raw_transaction(signed_txn.rawTransaction) 357 | return order_hash.hex() 358 | 359 | def bend_borrow(self, amount_out: int, asset_token_address: Union[Address]) -> str: 360 | """ 361 | bend borrow 362 | :param amount_out: 数量 363 | :param asset_token_address: 借款代币地址 364 | :return: 365 | """ 366 | txn = self.bend_contract.functions.borrow(asset=asset_token_address, amount=amount_out, 367 | interestRateMode=2, referralCode=0, 368 | onBehalfOf=self.account.address).build_transaction( 369 | {'gas': 500000 + random.randint(1, 10000), 'gasPrice': int(self.w3.eth.gas_price * 1.15), 370 | 'nonce': self.get_nonce()}) 371 | signed_txn = self.w3.eth.account.sign_transaction(txn, private_key=self.private_key) 372 | order_hash = self.w3.eth.send_raw_transaction(signed_txn.rawTransaction) 373 | return order_hash.hex() 374 | 375 | def bend_repay(self, repay_amount: int, asset_token_address: Union[Address]) -> str: 376 | """ 377 | bend 还款 378 | :param repay_amount:还款数量 379 | :param asset_token_address: repay 代币地址 380 | :return: 381 | """ 382 | allowance_balance = self.honey_contract.functions.allowance(self.account.address, bend_address).call() 383 | if allowance_balance < repay_amount: 384 | raise ValueError( 385 | f'需要授权\nplease run : \nbera.approve_token(bend_address, int("0x" + "f" * 64, 16), "{honey_address}")') 386 | 387 | txn = self.bend_contract.functions.repay(asset=asset_token_address, amount=repay_amount, 388 | interestRateMode=2, onBehalfOf=self.account.address).build_transaction( 389 | {'gas': 500000 + random.randint(1, 10000), 'gasPrice': int(self.w3.eth.gas_price * 1.15), 390 | 'nonce': self.get_nonce()}) 391 | signed_txn = self.w3.eth.account.sign_transaction(txn, private_key=self.private_key) 392 | order_hash = self.w3.eth.send_raw_transaction(signed_txn.rawTransaction) 393 | return order_hash.hex() 394 | 395 | def honey_jar_mint(self): 396 | allowance_balance = self.honey_contract.functions.allowance(self.account.address, ooga_booga_address).call() 397 | if allowance_balance / 1e18 < 4.2: 398 | raise ValueError( 399 | f'需要授权\nplease run : \nbera.approve_token(ooga_booga_address, int("0x" + "f" * 64, 16), "{honey_address}")') 400 | has_mint = self.ooga_booga_contract.functions.hasMinted(self.account.address).call() 401 | if has_mint: 402 | return True 403 | signed_txn = self.w3.eth.account.sign_transaction( 404 | dict( 405 | chainId=80085, 406 | nonce=self.get_nonce(), 407 | gasPrice=int(self.w3.eth.gas_price * 1.15), 408 | gas=134500 + random.randint(1, 10000), 409 | to=self.w3.to_checksum_address(ooga_booga_address), 410 | data='0xa6f2ae3a', 411 | ), 412 | self.account.key) 413 | order_hash = self.w3.eth.send_raw_transaction(signed_txn.rawTransaction) 414 | return order_hash.hex() 415 | 416 | def deploy_contract(self, contract_source_code, solc_version): 417 | """ 418 | 部署合约 419 | 运行前需要安装你指定的版本 420 | from solcx import install_solc 421 | install_solc('0.4.18') 422 | :param contract_source_code: 合约代码 423 | :param solc_version: 编译器版本 424 | :return: 425 | """ 426 | "" 427 | set_solc_version(solc_version) 428 | compiled_sol = compile_source(contract_source_code) 429 | contract_id, contract_interface = compiled_sol.popitem() 430 | txn = dict( 431 | chainId=80085, 432 | gas=2000000, 433 | gasPrice=int(self.w3.eth.gas_price * 1.15), 434 | nonce=self.get_nonce(), 435 | data=contract_interface['bin']) 436 | # 签署交易 437 | signed_txn = self.w3.eth.account.sign_transaction(txn, private_key=self.private_key) 438 | order_hash = self.w3.eth.send_raw_transaction(signed_txn.rawTransaction) 439 | return order_hash.hex() 440 | 441 | def create_bera_name(self): 442 | random_str = ''.join(random.choice(emoji_list) for _ in range(random.randint(5, 20))) 443 | random_chars = list(random_str) 444 | random.shuffle(random_chars) 445 | shuffled_str = ''.join(random_chars) 446 | txn = self.bera_name_contract.functions.mintNative(chars=list(shuffled_str), duration=1, 447 | whois=self.account.address, 448 | metadataURI='https://beranames.com/api/metadata/69', 449 | to=self.account.address).build_transaction( 450 | {'gas': 2000000, 'gasPrice': int(self.w3.eth.gas_price * 1.15), 451 | 'nonce': self.get_nonce(), 'value': int(608614232209737)}) 452 | signed_txn = self.w3.eth.account.sign_transaction(txn, private_key=self.private_key) 453 | order_hash = self.w3.eth.send_raw_transaction(signed_txn.rawTransaction) 454 | return order_hash.hex() 455 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /config/abi_config.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Time :2024/1/20 23:28 3 | # Author :ym 4 | # File :abi_config.py 5 | bex_abi = [ 6 | { 7 | "inputs": [ 8 | { 9 | "internalType": "address", 10 | "name": "pool", 11 | "type": "address" 12 | }, 13 | { 14 | "internalType": "address", 15 | "name": "receiver", 16 | "type": "address" 17 | }, 18 | { 19 | "internalType": "address[]", 20 | "name": "assetsIn", 21 | "type": "address[]" 22 | }, 23 | { 24 | "internalType": "uint256[]", 25 | "name": "amountsIn", 26 | "type": "uint256[]" 27 | } 28 | ], 29 | "name": "addLiquidity", 30 | "outputs": [ 31 | { 32 | "internalType": "address[]", 33 | "name": "shares", 34 | "type": "address[]" 35 | }, 36 | { 37 | "internalType": "uint256[]", 38 | "name": "shareAmounts", 39 | "type": "uint256[]" 40 | }, 41 | { 42 | "internalType": "address[]", 43 | "name": "liquidity", 44 | "type": "address[]" 45 | }, 46 | { 47 | "internalType": "uint256[]", 48 | "name": "liquidityAmounts", 49 | "type": "uint256[]" 50 | } 51 | ], 52 | "stateMutability": "payable", 53 | "type": "function" 54 | }, 55 | { 56 | "inputs": [ 57 | { 58 | "internalType": "enum IERC20DexModule.SwapKind", 59 | "name": "kind", 60 | "type": "uint8" 61 | }, 62 | { 63 | "components": [ 64 | { 65 | "internalType": "address", 66 | "name": "poolId", 67 | "type": "address" 68 | }, 69 | { 70 | "internalType": "address", 71 | "name": "assetIn", 72 | "type": "address" 73 | }, 74 | { 75 | "internalType": "uint256", 76 | "name": "amountIn", 77 | "type": "uint256" 78 | }, 79 | { 80 | "internalType": "address", 81 | "name": "assetOut", 82 | "type": "address" 83 | }, 84 | { 85 | "internalType": "uint256", 86 | "name": "amountOut", 87 | "type": "uint256" 88 | }, 89 | { 90 | "internalType": "bytes", 91 | "name": "userData", 92 | "type": "bytes" 93 | } 94 | ], 95 | "internalType": "struct IERC20DexModule.BatchSwapStep[]", 96 | "name": "swaps", 97 | "type": "tuple[]" 98 | }, 99 | { 100 | "internalType": "uint256", 101 | "name": "deadline", 102 | "type": "uint256" 103 | } 104 | ], 105 | "name": "batchSwap", 106 | "outputs": [ 107 | { 108 | "internalType": "address[]", 109 | "name": "assets", 110 | "type": "address[]" 111 | }, 112 | { 113 | "internalType": "uint256[]", 114 | "name": "amounts", 115 | "type": "uint256[]" 116 | } 117 | ], 118 | "stateMutability": "payable", 119 | "type": "function" 120 | }, 121 | { 122 | "inputs": [ 123 | { 124 | "internalType": "string", 125 | "name": "name", 126 | "type": "string" 127 | }, 128 | { 129 | "internalType": "address[]", 130 | "name": "assetsIn", 131 | "type": "address[]" 132 | }, 133 | { 134 | "internalType": "uint256[]", 135 | "name": "amountsIn", 136 | "type": "uint256[]" 137 | }, 138 | { 139 | "internalType": "string", 140 | "name": "poolType", 141 | "type": "string" 142 | }, 143 | { 144 | "components": [ 145 | { 146 | "components": [ 147 | { 148 | "internalType": "address", 149 | "name": "asset", 150 | "type": "address" 151 | }, 152 | { 153 | "internalType": "uint256", 154 | "name": "weight", 155 | "type": "uint256" 156 | } 157 | ], 158 | "internalType": "struct IERC20DexModule.AssetWeight[]", 159 | "name": "weights", 160 | "type": "tuple[]" 161 | }, 162 | { 163 | "internalType": "uint256", 164 | "name": "swapFee", 165 | "type": "uint256" 166 | } 167 | ], 168 | "internalType": "struct IERC20DexModule.PoolOptions", 169 | "name": "options", 170 | "type": "tuple" 171 | } 172 | ], 173 | "name": "createPool", 174 | "outputs": [ 175 | { 176 | "internalType": "address", 177 | "name": "", 178 | "type": "address" 179 | } 180 | ], 181 | "stateMutability": "payable", 182 | "type": "function" 183 | }, 184 | { 185 | "inputs": [ 186 | { 187 | "internalType": "address", 188 | "name": "pool", 189 | "type": "address" 190 | }, 191 | { 192 | "internalType": "address", 193 | "name": "baseAsset", 194 | "type": "address" 195 | }, 196 | { 197 | "internalType": "address", 198 | "name": "quoteAsset", 199 | "type": "address" 200 | } 201 | ], 202 | "name": "getExchangeRate", 203 | "outputs": [ 204 | { 205 | "internalType": "uint256", 206 | "name": "", 207 | "type": "uint256" 208 | } 209 | ], 210 | "stateMutability": "view", 211 | "type": "function" 212 | }, 213 | { 214 | "inputs": [ 215 | { 216 | "internalType": "address", 217 | "name": "pool", 218 | "type": "address" 219 | } 220 | ], 221 | "name": "getLiquidity", 222 | "outputs": [ 223 | { 224 | "internalType": "address[]", 225 | "name": "asset", 226 | "type": "address[]" 227 | }, 228 | { 229 | "internalType": "uint256[]", 230 | "name": "amounts", 231 | "type": "uint256[]" 232 | } 233 | ], 234 | "stateMutability": "view", 235 | "type": "function" 236 | }, 237 | { 238 | "inputs": [ 239 | { 240 | "internalType": "address", 241 | "name": "pool", 242 | "type": "address" 243 | } 244 | ], 245 | "name": "getPoolName", 246 | "outputs": [ 247 | { 248 | "internalType": "string", 249 | "name": "", 250 | "type": "string" 251 | } 252 | ], 253 | "stateMutability": "view", 254 | "type": "function" 255 | }, 256 | { 257 | "inputs": [ 258 | { 259 | "internalType": "address", 260 | "name": "pool", 261 | "type": "address" 262 | } 263 | ], 264 | "name": "getPoolOptions", 265 | "outputs": [ 266 | { 267 | "components": [ 268 | { 269 | "components": [ 270 | { 271 | "internalType": "address", 272 | "name": "asset", 273 | "type": "address" 274 | }, 275 | { 276 | "internalType": "uint256", 277 | "name": "weight", 278 | "type": "uint256" 279 | } 280 | ], 281 | "internalType": "struct IERC20DexModule.AssetWeight[]", 282 | "name": "weights", 283 | "type": "tuple[]" 284 | }, 285 | { 286 | "internalType": "uint256", 287 | "name": "swapFee", 288 | "type": "uint256" 289 | } 290 | ], 291 | "internalType": "struct IERC20DexModule.PoolOptions", 292 | "name": "", 293 | "type": "tuple" 294 | } 295 | ], 296 | "stateMutability": "view", 297 | "type": "function" 298 | }, 299 | { 300 | "inputs": [ 301 | { 302 | "internalType": "address", 303 | "name": "pool", 304 | "type": "address" 305 | }, 306 | { 307 | "internalType": "address[]", 308 | "name": "assets", 309 | "type": "address[]" 310 | }, 311 | { 312 | "internalType": "uint256[]", 313 | "name": "amounts", 314 | "type": "uint256[]" 315 | } 316 | ], 317 | "name": "getPreviewAddLiquidityNoSwap", 318 | "outputs": [ 319 | { 320 | "internalType": "address[]", 321 | "name": "shares", 322 | "type": "address[]" 323 | }, 324 | { 325 | "internalType": "uint256[]", 326 | "name": "shareAmounts", 327 | "type": "uint256[]" 328 | }, 329 | { 330 | "internalType": "address[]", 331 | "name": "liqOut", 332 | "type": "address[]" 333 | }, 334 | { 335 | "internalType": "uint256[]", 336 | "name": "liquidityAmounts", 337 | "type": "uint256[]" 338 | } 339 | ], 340 | "stateMutability": "view", 341 | "type": "function" 342 | }, 343 | { 344 | "inputs": [ 345 | { 346 | "internalType": "address", 347 | "name": "pool", 348 | "type": "address" 349 | }, 350 | { 351 | "internalType": "address[]", 352 | "name": "liquidity", 353 | "type": "address[]" 354 | }, 355 | { 356 | "internalType": "uint256[]", 357 | "name": "amounts", 358 | "type": "uint256[]" 359 | } 360 | ], 361 | "name": "getPreviewAddLiquidityStaticPrice", 362 | "outputs": [ 363 | { 364 | "internalType": "address[]", 365 | "name": "shares", 366 | "type": "address[]" 367 | }, 368 | { 369 | "internalType": "uint256[]", 370 | "name": "shareAmounts", 371 | "type": "uint256[]" 372 | }, 373 | { 374 | "internalType": "address[]", 375 | "name": "liqOut", 376 | "type": "address[]" 377 | }, 378 | { 379 | "internalType": "uint256[]", 380 | "name": "liquidityAmounts", 381 | "type": "uint256[]" 382 | } 383 | ], 384 | "stateMutability": "view", 385 | "type": "function" 386 | }, 387 | { 388 | "inputs": [ 389 | { 390 | "internalType": "enum IERC20DexModule.SwapKind", 391 | "name": "kind", 392 | "type": "uint8" 393 | }, 394 | { 395 | "components": [ 396 | { 397 | "internalType": "address", 398 | "name": "poolId", 399 | "type": "address" 400 | }, 401 | { 402 | "internalType": "address", 403 | "name": "assetIn", 404 | "type": "address" 405 | }, 406 | { 407 | "internalType": "uint256", 408 | "name": "amountIn", 409 | "type": "uint256" 410 | }, 411 | { 412 | "internalType": "address", 413 | "name": "assetOut", 414 | "type": "address" 415 | }, 416 | { 417 | "internalType": "uint256", 418 | "name": "amountOut", 419 | "type": "uint256" 420 | }, 421 | { 422 | "internalType": "bytes", 423 | "name": "userData", 424 | "type": "bytes" 425 | } 426 | ], 427 | "internalType": "struct IERC20DexModule.BatchSwapStep[]", 428 | "name": "swaps", 429 | "type": "tuple[]" 430 | } 431 | ], 432 | "name": "getPreviewBatchSwap", 433 | "outputs": [ 434 | { 435 | "internalType": "address", 436 | "name": "asset", 437 | "type": "address" 438 | }, 439 | { 440 | "internalType": "uint256", 441 | "name": "amount", 442 | "type": "uint256" 443 | } 444 | ], 445 | "stateMutability": "view", 446 | "type": "function" 447 | }, 448 | { 449 | "inputs": [ 450 | { 451 | "internalType": "address", 452 | "name": "pool", 453 | "type": "address" 454 | }, 455 | { 456 | "internalType": "address", 457 | "name": "asset", 458 | "type": "address" 459 | }, 460 | { 461 | "internalType": "uint256", 462 | "name": "amount", 463 | "type": "uint256" 464 | } 465 | ], 466 | "name": "getPreviewBurnShares", 467 | "outputs": [ 468 | { 469 | "internalType": "address[]", 470 | "name": "assets", 471 | "type": "address[]" 472 | }, 473 | { 474 | "internalType": "uint256[]", 475 | "name": "amounts", 476 | "type": "uint256[]" 477 | } 478 | ], 479 | "stateMutability": "view", 480 | "type": "function" 481 | }, 482 | { 483 | "inputs": [ 484 | { 485 | "internalType": "address", 486 | "name": "pool", 487 | "type": "address" 488 | }, 489 | { 490 | "internalType": "address[]", 491 | "name": "assets", 492 | "type": "address[]" 493 | }, 494 | { 495 | "internalType": "uint256[]", 496 | "name": "amounts", 497 | "type": "uint256[]" 498 | } 499 | ], 500 | "name": "getPreviewSharesForLiquidity", 501 | "outputs": [ 502 | { 503 | "internalType": "address[]", 504 | "name": "shares", 505 | "type": "address[]" 506 | }, 507 | { 508 | "internalType": "uint256[]", 509 | "name": "shareAmounts", 510 | "type": "uint256[]" 511 | }, 512 | { 513 | "internalType": "address[]", 514 | "name": "liquidity", 515 | "type": "address[]" 516 | }, 517 | { 518 | "internalType": "uint256[]", 519 | "name": "liquidityAmounts", 520 | "type": "uint256[]" 521 | } 522 | ], 523 | "stateMutability": "view", 524 | "type": "function" 525 | }, 526 | { 527 | "inputs": [ 528 | { 529 | "internalType": "address", 530 | "name": "pool", 531 | "type": "address" 532 | }, 533 | { 534 | "internalType": "address", 535 | "name": "asset", 536 | "type": "address" 537 | }, 538 | { 539 | "internalType": "uint256", 540 | "name": "amount", 541 | "type": "uint256" 542 | } 543 | ], 544 | "name": "getPreviewSharesForSingleSidedLiquidityRequest", 545 | "outputs": [ 546 | { 547 | "internalType": "address[]", 548 | "name": "assets", 549 | "type": "address[]" 550 | }, 551 | { 552 | "internalType": "uint256[]", 553 | "name": "amounts", 554 | "type": "uint256[]" 555 | } 556 | ], 557 | "stateMutability": "view", 558 | "type": "function" 559 | }, 560 | { 561 | "inputs": [ 562 | { 563 | "internalType": "enum IERC20DexModule.SwapKind", 564 | "name": "kind", 565 | "type": "uint8" 566 | }, 567 | { 568 | "internalType": "address", 569 | "name": "pool", 570 | "type": "address" 571 | }, 572 | { 573 | "internalType": "address", 574 | "name": "baseAsset", 575 | "type": "address" 576 | }, 577 | { 578 | "internalType": "uint256", 579 | "name": "baseAssetAmount", 580 | "type": "uint256" 581 | }, 582 | { 583 | "internalType": "address", 584 | "name": "quoteAsset", 585 | "type": "address" 586 | } 587 | ], 588 | "name": "getPreviewSwapExact", 589 | "outputs": [ 590 | { 591 | "internalType": "address", 592 | "name": "asset", 593 | "type": "address" 594 | }, 595 | { 596 | "internalType": "uint256", 597 | "name": "amount", 598 | "type": "uint256" 599 | } 600 | ], 601 | "stateMutability": "view", 602 | "type": "function" 603 | }, 604 | { 605 | "inputs": [ 606 | { 607 | "internalType": "address", 608 | "name": "pool", 609 | "type": "address" 610 | }, 611 | { 612 | "internalType": "address", 613 | "name": "assetIn", 614 | "type": "address" 615 | }, 616 | { 617 | "internalType": "uint256", 618 | "name": "assetAmount", 619 | "type": "uint256" 620 | } 621 | ], 622 | "name": "getRemoveLiquidityExactAmountOut", 623 | "outputs": [ 624 | { 625 | "internalType": "address[]", 626 | "name": "assets", 627 | "type": "address[]" 628 | }, 629 | { 630 | "internalType": "uint256[]", 631 | "name": "amounts", 632 | "type": "uint256[]" 633 | } 634 | ], 635 | "stateMutability": "view", 636 | "type": "function" 637 | }, 638 | { 639 | "inputs": [ 640 | { 641 | "internalType": "address", 642 | "name": "pool", 643 | "type": "address" 644 | }, 645 | { 646 | "internalType": "address", 647 | "name": "assetOut", 648 | "type": "address" 649 | }, 650 | { 651 | "internalType": "uint256", 652 | "name": "sharesIn", 653 | "type": "uint256" 654 | } 655 | ], 656 | "name": "getRemoveLiquidityOneSideOut", 657 | "outputs": [ 658 | { 659 | "internalType": "address[]", 660 | "name": "assets", 661 | "type": "address[]" 662 | }, 663 | { 664 | "internalType": "uint256[]", 665 | "name": "amounts", 666 | "type": "uint256[]" 667 | } 668 | ], 669 | "stateMutability": "view", 670 | "type": "function" 671 | }, 672 | { 673 | "inputs": [ 674 | { 675 | "internalType": "address", 676 | "name": "pool", 677 | "type": "address" 678 | } 679 | ], 680 | "name": "getTotalShares", 681 | "outputs": [ 682 | { 683 | "internalType": "address[]", 684 | "name": "assets", 685 | "type": "address[]" 686 | }, 687 | { 688 | "internalType": "uint256[]", 689 | "name": "amounts", 690 | "type": "uint256[]" 691 | } 692 | ], 693 | "stateMutability": "view", 694 | "type": "function" 695 | }, 696 | { 697 | "inputs": [ 698 | { 699 | "internalType": "address", 700 | "name": "pool", 701 | "type": "address" 702 | }, 703 | { 704 | "internalType": "address", 705 | "name": "withdrawAddress", 706 | "type": "address" 707 | }, 708 | { 709 | "internalType": "address", 710 | "name": "assetIn", 711 | "type": "address" 712 | }, 713 | { 714 | "internalType": "uint256", 715 | "name": "amountIn", 716 | "type": "uint256" 717 | } 718 | ], 719 | "name": "removeLiquidityBurningShares", 720 | "outputs": [ 721 | { 722 | "internalType": "address[]", 723 | "name": "liquidity", 724 | "type": "address[]" 725 | }, 726 | { 727 | "internalType": "uint256[]", 728 | "name": "liquidityAmounts", 729 | "type": "uint256[]" 730 | } 731 | ], 732 | "stateMutability": "payable", 733 | "type": "function" 734 | }, 735 | { 736 | "inputs": [ 737 | { 738 | "internalType": "address", 739 | "name": "pool", 740 | "type": "address" 741 | }, 742 | { 743 | "internalType": "address", 744 | "name": "withdrawAddress", 745 | "type": "address" 746 | }, 747 | { 748 | "internalType": "address", 749 | "name": "assetOut", 750 | "type": "address" 751 | }, 752 | { 753 | "internalType": "uint256", 754 | "name": "amountOut", 755 | "type": "uint256" 756 | }, 757 | { 758 | "internalType": "address", 759 | "name": "sharesIn", 760 | "type": "address" 761 | }, 762 | { 763 | "internalType": "uint256", 764 | "name": "maxSharesIn", 765 | "type": "uint256" 766 | } 767 | ], 768 | "name": "removeLiquidityExactAmount", 769 | "outputs": [ 770 | { 771 | "internalType": "address[]", 772 | "name": "shares", 773 | "type": "address[]" 774 | }, 775 | { 776 | "internalType": "uint256[]", 777 | "name": "shareAmounts", 778 | "type": "uint256[]" 779 | }, 780 | { 781 | "internalType": "address[]", 782 | "name": "liquidity", 783 | "type": "address[]" 784 | }, 785 | { 786 | "internalType": "uint256[]", 787 | "name": "liquidityAmounts", 788 | "type": "uint256[]" 789 | } 790 | ], 791 | "stateMutability": "payable", 792 | "type": "function" 793 | }, 794 | { 795 | "inputs": [ 796 | { 797 | "internalType": "enum IERC20DexModule.SwapKind", 798 | "name": "kind", 799 | "type": "uint8" 800 | }, 801 | { 802 | "internalType": "address", 803 | "name": "poolId", 804 | "type": "address" 805 | }, 806 | { 807 | "internalType": "address", 808 | "name": "assetIn", 809 | "type": "address" 810 | }, 811 | { 812 | "internalType": "uint256", 813 | "name": "amountIn", 814 | "type": "uint256" 815 | }, 816 | { 817 | "internalType": "address", 818 | "name": "assetOut", 819 | "type": "address" 820 | }, 821 | { 822 | "internalType": "uint256", 823 | "name": "amountOut", 824 | "type": "uint256" 825 | }, 826 | { 827 | "internalType": "uint256", 828 | "name": "deadline", 829 | "type": "uint256" 830 | } 831 | ], 832 | "name": "swap", 833 | "outputs": [ 834 | { 835 | "internalType": "address[]", 836 | "name": "assets", 837 | "type": "address[]" 838 | }, 839 | { 840 | "internalType": "uint256[]", 841 | "name": "amounts", 842 | "type": "uint256[]" 843 | } 844 | ], 845 | "stateMutability": "payable", 846 | "type": "function" 847 | } 848 | ] 849 | 850 | erc_20_abi = [{"type": "event", "name": "Approval", "inputs": [{"indexed": True, "name": "owner", "type": "address"}, 851 | {"indexed": True, "name": "spender", "type": "address"}, 852 | {"indexed": False, "name": "value", "type": "uint256"}]}, 853 | {"type": "event", "name": "Transfer", "inputs": [{"indexed": True, "name": "from", "type": "address"}, 854 | {"indexed": True, "name": "to", "type": "address"}, 855 | {"indexed": False, "name": "value", "type": "uint256"}]}, 856 | {"type": "function", "name": "allowance", "stateMutability": "view", 857 | "inputs": [{"name": "owner", "type": "address"}, {"name": "spender", "type": "address"}], 858 | "outputs": [{"name": "", "type": "uint256"}]}, 859 | {"type": "function", "name": "approve", "stateMutability": "nonpayable", 860 | "inputs": [{"name": "spender", "type": "address"}, {"name": "amount", "type": "uint256"}], 861 | "outputs": [{"name": "", "type": "bool"}]}, 862 | {"type": "function", "name": "balanceOf", "stateMutability": "view", 863 | "inputs": [{"name": "account", "type": "address"}], "outputs": [{"name": "", "type": "uint256"}]}, 864 | {"type": "function", "name": "decimals", "stateMutability": "view", "inputs": [], 865 | "outputs": [{"name": "", "type": "uint8"}]}, 866 | {"type": "function", "name": "name", "stateMutability": "view", "inputs": [], 867 | "outputs": [{"name": "", "type": "bytes32"}]}, 868 | {"type": "function", "name": "symbol", "stateMutability": "view", "inputs": [], 869 | "outputs": [{"name": "", "type": "bytes32"}]}, 870 | {"type": "function", "name": "totalSupply", "stateMutability": "view", "inputs": [], 871 | "outputs": [{"name": "", "type": "uint256"}]}, 872 | {"type": "function", "name": "transfer", "stateMutability": "nonpayable", 873 | "inputs": [{"name": "recipient", "type": "address"}, {"name": "amount", "type": "uint256"}], 874 | "outputs": [{"name": "", "type": "bool"}]}, 875 | {"type": "function", "name": "transferFrom", "stateMutability": "nonpayable", 876 | "inputs": [{"name": "sender", "type": "address"}, {"name": "recipient", "type": "address"}, 877 | {"name": "amount", "type": "uint256"}], "outputs": [{"name": "", "type": "bool"}]}] 878 | 879 | honey_abi = [{"inputs": [{"internalType": "contract IERC20", "name": "_honey", "type": "address"}], 880 | "stateMutability": "nonpayable", "type": "constructor"}, {"inputs": [], "name": "erc20Module", 881 | "outputs": [ 882 | {"internalType": "contract IERC20Module", 883 | "name": "", "type": "address"}], 884 | "stateMutability": "view", "type": "function"}, 885 | {"inputs": [], "name": "getExchangable", "outputs": [{"components": [ 886 | {"internalType": "contract IERC20", "name": "collateral", "type": "address"}, 887 | {"internalType": "bool", "name": "enabled", "type": "bool"}, 888 | {"internalType": "uint256", "name": "mintRate", "type": "uint256"}, 889 | {"internalType": "uint256", "name": "redemptionRate", "type": "uint256"}], 890 | "internalType": "struct ERC20Honey.ERC20Exchangable[]", 891 | "name": "", "type": "tuple[]"}], 892 | "stateMutability": "nonpayable", "type": "function"}, {"inputs": [], "name": "honey", "outputs": [ 893 | {"internalType": "contract IERC20", "name": "", "type": "address"}], "stateMutability": "view", 894 | "type": "function"}, 895 | {"inputs": [], "name": "honeyModule", 896 | "outputs": [{"internalType": "contract IHoneyModule", "name": "", "type": "address"}], 897 | "stateMutability": "view", "type": "function"}, { 898 | "inputs": [{"internalType": "address", "name": "to", "type": "address"}, 899 | {"internalType": "contract IERC20", "name": "collateral", "type": "address"}, 900 | {"internalType": "uint256", "name": "amount", "type": "uint256"}], "name": "mint", 901 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], 902 | "stateMutability": "nonpayable", "type": "function"}, { 903 | "inputs": [{"internalType": "contract IERC20", "name": "collateral", "type": "address"}, 904 | {"internalType": "uint256", "name": "amount", "type": "uint256"}], "name": "previewMint", 905 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", 906 | "type": "function"}, { 907 | "inputs": [{"internalType": "contract IERC20", "name": "collateral", "type": "address"}, 908 | {"internalType": "uint256", "name": "amount", "type": "uint256"}], "name": "previewRedeem", 909 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", 910 | "type": "function"}, {"inputs": [{"internalType": "address", "name": "to", "type": "address"}, 911 | {"internalType": "uint256", "name": "amount", "type": "uint256"}, 912 | {"internalType": "contract IERC20", "name": "collateral", 913 | "type": "address"}], "name": "redeem", 914 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], 915 | "stateMutability": "nonpayable", "type": "function"}] 916 | 917 | bend_abi = [{"inputs": [{"internalType": "contract IPoolAddressesProvider", "name": "provider", "type": "address"}], 918 | "stateMutability": "nonpayable", "type": "constructor"}, {"anonymous": False, "inputs": [ 919 | {"indexed": True, "internalType": "address", "name": "reserve", "type": "address"}, 920 | {"indexed": True, "internalType": "address", "name": "backer", "type": "address"}, 921 | {"indexed": False, "internalType": "uint256", "name": "amount", "type": "uint256"}, 922 | {"indexed": False, "internalType": "uint256", "name": "fee", "type": "uint256"}], "name": "BackUnbacked", 923 | "type": "event"}, {"anonymous": False, 924 | "inputs": [{"indexed": True, 925 | "internalType": "address", 926 | "name": "reserve", 927 | "type": "address"}, 928 | {"indexed": False, 929 | "internalType": "address", 930 | "name": "user", 931 | "type": "address"}, 932 | {"indexed": True, 933 | "internalType": "address", 934 | "name": "onBehalfOf", 935 | "type": "address"}, 936 | {"indexed": False, 937 | "internalType": "uint256", 938 | "name": "amount", 939 | "type": "uint256"}, 940 | {"indexed": False, 941 | "internalType": "enum DataTypes.InterestRateMode", 942 | "name": "interestRateMode", 943 | "type": "uint8"}, 944 | {"indexed": False, 945 | "internalType": "uint256", 946 | "name": "borrowRate", 947 | "type": "uint256"}, 948 | {"indexed": True, 949 | "internalType": "uint16", 950 | "name": "referralCode", 951 | "type": "uint16"}], 952 | "name": "Borrow", 953 | "type": "event"}, 954 | {"anonymous": False, 955 | "inputs": [{"indexed": True, "internalType": "address", "name": "target", "type": "address"}, 956 | {"indexed": False, "internalType": "address", "name": "initiator", "type": "address"}, 957 | {"indexed": True, "internalType": "address", "name": "asset", "type": "address"}, 958 | {"indexed": False, "internalType": "uint256", "name": "amount", "type": "uint256"}, 959 | {"indexed": False, "internalType": "enum DataTypes.InterestRateMode", 960 | "name": "interestRateMode", "type": "uint8"}, 961 | {"indexed": False, "internalType": "uint256", "name": "premium", "type": "uint256"}, 962 | {"indexed": True, "internalType": "uint16", "name": "referralCode", "type": "uint16"}], 963 | "name": "FlashLoan", "type": "event"}, {"anonymous": False, "inputs": [ 964 | {"indexed": True, "internalType": "address", "name": "asset", "type": "address"}, 965 | {"indexed": False, "internalType": "uint256", "name": "totalDebt", "type": "uint256"}], 966 | "name": "IsolationModeTotalDebtUpdated", "type": "event"}, 967 | {"anonymous": False, 968 | "inputs": [{"indexed": True, "internalType": "address", "name": "collateralAsset", "type": "address"}, 969 | {"indexed": True, "internalType": "address", "name": "debtAsset", "type": "address"}, 970 | {"indexed": True, "internalType": "address", "name": "user", "type": "address"}, 971 | {"indexed": False, "internalType": "uint256", "name": "debtToCover", "type": "uint256"}, 972 | {"indexed": False, "internalType": "uint256", "name": "liquidatedCollateralAmount", 973 | "type": "uint256"}, 974 | {"indexed": False, "internalType": "address", "name": "liquidator", "type": "address"}, 975 | {"indexed": False, "internalType": "bool", "name": "receiveAToken", "type": "bool"}], 976 | "name": "LiquidationCall", "type": "event"}, {"anonymous": False, "inputs": [ 977 | {"indexed": True, "internalType": "address", "name": "reserve", "type": "address"}, 978 | {"indexed": False, "internalType": "address", "name": "user", "type": "address"}, 979 | {"indexed": True, "internalType": "address", "name": "onBehalfOf", "type": "address"}, 980 | {"indexed": False, "internalType": "uint256", "name": "amount", "type": "uint256"}, 981 | {"indexed": True, "internalType": "uint16", "name": "referralCode", "type": "uint16"}], "name": "MintUnbacked", 982 | "type": "event"}, {"anonymous": False, "inputs": [ 983 | {"indexed": True, "internalType": "address", "name": "reserve", "type": "address"}, 984 | {"indexed": False, "internalType": "uint256", "name": "amountMinted", "type": "uint256"}], 985 | "name": "MintedToTreasury", 986 | "type": "event"}, {"anonymous": False, 987 | "inputs": [ 988 | {"indexed": True, 989 | "internalType": "address", 990 | "name": "reserve", 991 | "type": "address"}, 992 | {"indexed": True, 993 | "internalType": "address", 994 | "name": "user", 995 | "type": "address"}], 996 | "name": "RebalanceStableBorrowRate", 997 | "type": "event"}, 998 | {"anonymous": False, 999 | "inputs": [{"indexed": True, "internalType": "address", "name": "reserve", "type": "address"}, 1000 | {"indexed": True, "internalType": "address", "name": "user", "type": "address"}, 1001 | {"indexed": True, "internalType": "address", "name": "repayer", "type": "address"}, 1002 | {"indexed": False, "internalType": "uint256", "name": "amount", "type": "uint256"}, 1003 | {"indexed": False, "internalType": "bool", "name": "useATokens", "type": "bool"}], 1004 | "name": "Repay", "type": "event"}, {"anonymous": False, "inputs": [ 1005 | {"indexed": True, "internalType": "address", "name": "reserve", "type": "address"}, 1006 | {"indexed": False, "internalType": "uint256", "name": "liquidityRate", "type": "uint256"}, 1007 | {"indexed": False, "internalType": "uint256", "name": "stableBorrowRate", "type": "uint256"}, 1008 | {"indexed": False, "internalType": "uint256", "name": "variableBorrowRate", "type": "uint256"}, 1009 | {"indexed": False, "internalType": "uint256", "name": "liquidityIndex", "type": "uint256"}, 1010 | {"indexed": False, "internalType": "uint256", "name": "variableBorrowIndex", "type": "uint256"}], 1011 | "name": "ReserveDataUpdated", "type": "event"}, {"anonymous": False, 1012 | "inputs": [ 1013 | {"indexed": True, 1014 | "internalType": "address", 1015 | "name": "reserve", 1016 | "type": "address"}, 1017 | {"indexed": True, 1018 | "internalType": "address", 1019 | "name": "user", 1020 | "type": "address"}], 1021 | "name": "ReserveUsedAsCollateralDisabled", 1022 | "type": "event"}, 1023 | {"anonymous": False, 1024 | "inputs": [{"indexed": True, "internalType": "address", "name": "reserve", "type": "address"}, 1025 | {"indexed": True, "internalType": "address", "name": "user", "type": "address"}], 1026 | "name": "ReserveUsedAsCollateralEnabled", "type": "event"}, {"anonymous": False, "inputs": [ 1027 | {"indexed": True, "internalType": "address", "name": "reserve", "type": "address"}, 1028 | {"indexed": False, "internalType": "address", "name": "user", "type": "address"}, 1029 | {"indexed": True, "internalType": "address", "name": "onBehalfOf", "type": "address"}, 1030 | {"indexed": False, "internalType": "uint256", "name": "amount", "type": "uint256"}, 1031 | {"indexed": True, "internalType": "uint16", "name": "referralCode", "type": "uint16"}], "name": "Supply", 1032 | "type": "event"}, {"anonymous": False, 1033 | "inputs": [ 1034 | {"indexed": True, 1035 | "internalType": "address", 1036 | "name": "reserve", 1037 | "type": "address"}, 1038 | {"indexed": True, 1039 | "internalType": "address", 1040 | "name": "user", 1041 | "type": "address"}, 1042 | {"indexed": False, 1043 | "internalType": "enum DataTypes.InterestRateMode", 1044 | "name": "interestRateMode", 1045 | "type": "uint8"}], 1046 | "name": "SwapBorrowRateMode", 1047 | "type": "event"}, 1048 | {"anonymous": False, 1049 | "inputs": [{"indexed": True, "internalType": "address", "name": "user", "type": "address"}, 1050 | {"indexed": False, "internalType": "uint8", "name": "categoryId", "type": "uint8"}], 1051 | "name": "UserEModeSet", "type": "event"}, {"anonymous": False, "inputs": [ 1052 | {"indexed": True, "internalType": "address", "name": "reserve", "type": "address"}, 1053 | {"indexed": True, "internalType": "address", "name": "user", "type": "address"}, 1054 | {"indexed": True, "internalType": "address", "name": "to", "type": "address"}, 1055 | {"indexed": False, "internalType": "uint256", "name": "amount", "type": "uint256"}], "name": "Withdraw", 1056 | "type": "event"}, {"inputs": [], "name": "ADDRESSES_PROVIDER", 1057 | "outputs": [{ 1058 | "internalType": "contract IPoolAddressesProvider", 1059 | "name": "", 1060 | "type": "address"}], 1061 | "stateMutability": "view", 1062 | "type": "function"}, 1063 | {"inputs": [], "name": "BRIDGE_PROTOCOL_FEE", 1064 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", 1065 | "type": "function"}, {"inputs": [], "name": "FLASHLOAN_PREMIUM_TOTAL", 1066 | "outputs": [{"internalType": "uint128", "name": "", "type": "uint128"}], 1067 | "stateMutability": "view", "type": "function"}, 1068 | {"inputs": [], "name": "FLASHLOAN_PREMIUM_TO_PROTOCOL", 1069 | "outputs": [{"internalType": "uint128", "name": "", "type": "uint128"}], "stateMutability": "view", 1070 | "type": "function"}, {"inputs": [], "name": "MAX_NUMBER_RESERVES", 1071 | "outputs": [{"internalType": "uint16", "name": "", "type": "uint16"}], 1072 | "stateMutability": "view", "type": "function"}, 1073 | {"inputs": [], "name": "MAX_STABLE_RATE_BORROW_SIZE_PERCENT", 1074 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", 1075 | "type": "function"}, {"inputs": [], "name": "POOL_REVISION", 1076 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], 1077 | "stateMutability": "view", "type": "function"}, { 1078 | "inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1079 | {"internalType": "uint256", "name": "amount", "type": "uint256"}, 1080 | {"internalType": "uint256", "name": "fee", "type": "uint256"}], "name": "backUnbacked", 1081 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], 1082 | "stateMutability": "nonpayable", "type": "function"}, { 1083 | "inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1084 | {"internalType": "uint256", "name": "amount", "type": "uint256"}, 1085 | {"internalType": "uint256", "name": "interestRateMode", "type": "uint256"}, 1086 | {"internalType": "uint16", "name": "referralCode", "type": "uint16"}, 1087 | {"internalType": "address", "name": "onBehalfOf", "type": "address"}], "name": "borrow", 1088 | "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 1089 | "inputs": [{"internalType": "uint8", "name": "id", "type": "uint8"}, { 1090 | "components": [{"internalType": "uint16", "name": "ltv", "type": "uint16"}, 1091 | {"internalType": "uint16", "name": "liquidationThreshold", "type": "uint16"}, 1092 | {"internalType": "uint16", "name": "liquidationBonus", "type": "uint16"}, 1093 | {"internalType": "address", "name": "priceSource", "type": "address"}, 1094 | {"internalType": "string", "name": "label", "type": "string"}], 1095 | "internalType": "struct DataTypes.EModeCategory", "name": "category", "type": "tuple"}], 1096 | "name": "configureEModeCategory", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 1097 | "inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1098 | {"internalType": "uint256", "name": "amount", "type": "uint256"}, 1099 | {"internalType": "address", "name": "onBehalfOf", "type": "address"}, 1100 | {"internalType": "uint16", "name": "referralCode", "type": "uint16"}], "name": "deposit", 1101 | "outputs": [], "stateMutability": "nonpayable", "type": "function"}, 1102 | {"inputs": [{"internalType": "address", "name": "asset", "type": "address"}], "name": "dropReserve", 1103 | "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 1104 | "inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1105 | {"internalType": "address", "name": "from", "type": "address"}, 1106 | {"internalType": "address", "name": "to", "type": "address"}, 1107 | {"internalType": "uint256", "name": "amount", "type": "uint256"}, 1108 | {"internalType": "uint256", "name": "balanceFromBefore", "type": "uint256"}, 1109 | {"internalType": "uint256", "name": "balanceToBefore", "type": "uint256"}], 1110 | "name": "finalizeTransfer", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 1111 | "inputs": [{"internalType": "address", "name": "receiverAddress", "type": "address"}, 1112 | {"internalType": "address[]", "name": "assets", "type": "address[]"}, 1113 | {"internalType": "uint256[]", "name": "amounts", "type": "uint256[]"}, 1114 | {"internalType": "uint256[]", "name": "interestRateModes", "type": "uint256[]"}, 1115 | {"internalType": "address", "name": "onBehalfOf", "type": "address"}, 1116 | {"internalType": "bytes", "name": "params", "type": "bytes"}, 1117 | {"internalType": "uint16", "name": "referralCode", "type": "uint16"}], "name": "flashLoan", 1118 | "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 1119 | "inputs": [{"internalType": "address", "name": "receiverAddress", "type": "address"}, 1120 | {"internalType": "address", "name": "asset", "type": "address"}, 1121 | {"internalType": "uint256", "name": "amount", "type": "uint256"}, 1122 | {"internalType": "bytes", "name": "params", "type": "bytes"}, 1123 | {"internalType": "uint16", "name": "referralCode", "type": "uint16"}], 1124 | "name": "flashLoanSimple", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, 1125 | {"inputs": [{"internalType": "address", "name": "asset", "type": "address"}], "name": "getConfiguration", 1126 | "outputs": [{"components": [{"internalType": "uint256", "name": "data", "type": "uint256"}], 1127 | "internalType": "struct DataTypes.ReserveConfigurationMap", "name": "", "type": "tuple"}], 1128 | "stateMutability": "view", "type": "function"}, 1129 | {"inputs": [{"internalType": "uint8", "name": "id", "type": "uint8"}], "name": "getEModeCategoryData", 1130 | "outputs": [{"components": [{"internalType": "uint16", "name": "ltv", "type": "uint16"}, 1131 | {"internalType": "uint16", "name": "liquidationThreshold", "type": "uint16"}, 1132 | {"internalType": "uint16", "name": "liquidationBonus", "type": "uint16"}, 1133 | {"internalType": "address", "name": "priceSource", "type": "address"}, 1134 | {"internalType": "string", "name": "label", "type": "string"}], 1135 | "internalType": "struct DataTypes.EModeCategory", "name": "", "type": "tuple"}], 1136 | "stateMutability": "view", "type": "function"}, 1137 | {"inputs": [{"internalType": "uint16", "name": "id", "type": "uint16"}], "name": "getReserveAddressById", 1138 | "outputs": [{"internalType": "address", "name": "", "type": "address"}], "stateMutability": "view", 1139 | "type": "function"}, 1140 | {"inputs": [{"internalType": "address", "name": "asset", "type": "address"}], "name": "getReserveData", 1141 | "outputs": [{"components": [ 1142 | {"components": [{"internalType": "uint256", "name": "data", "type": "uint256"}], 1143 | "internalType": "struct DataTypes.ReserveConfigurationMap", "name": "configuration", "type": "tuple"}, 1144 | {"internalType": "uint128", "name": "liquidityIndex", "type": "uint128"}, 1145 | {"internalType": "uint128", "name": "currentLiquidityRate", "type": "uint128"}, 1146 | {"internalType": "uint128", "name": "variableBorrowIndex", "type": "uint128"}, 1147 | {"internalType": "uint128", "name": "currentVariableBorrowRate", "type": "uint128"}, 1148 | {"internalType": "uint128", "name": "currentStableBorrowRate", "type": "uint128"}, 1149 | {"internalType": "uint40", "name": "lastUpdateTimestamp", "type": "uint40"}, 1150 | {"internalType": "uint16", "name": "id", "type": "uint16"}, 1151 | {"internalType": "address", "name": "aTokenAddress", "type": "address"}, 1152 | {"internalType": "address", "name": "stableDebtTokenAddress", "type": "address"}, 1153 | {"internalType": "address", "name": "variableDebtTokenAddress", "type": "address"}, 1154 | {"internalType": "address", "name": "interestRateStrategyAddress", "type": "address"}, 1155 | {"internalType": "uint128", "name": "accruedToTreasury", "type": "uint128"}, 1156 | {"internalType": "uint128", "name": "unbacked", "type": "uint128"}, 1157 | {"internalType": "uint128", "name": "isolationModeTotalDebt", "type": "uint128"}], 1158 | "internalType": "struct DataTypes.ReserveData", "name": "", "type": "tuple"}], 1159 | "stateMutability": "view", "type": "function"}, 1160 | {"inputs": [{"internalType": "address", "name": "asset", "type": "address"}], 1161 | "name": "getReserveNormalizedIncome", 1162 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", 1163 | "type": "function"}, {"inputs": [{"internalType": "address", "name": "asset", "type": "address"}], 1164 | "name": "getReserveNormalizedVariableDebt", 1165 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], 1166 | "stateMutability": "view", "type": "function"}, 1167 | {"inputs": [], "name": "getReservesList", 1168 | "outputs": [{"internalType": "address[]", "name": "", "type": "address[]"}], "stateMutability": "view", 1169 | "type": "function"}, 1170 | {"inputs": [{"internalType": "address", "name": "user", "type": "address"}], "name": "getUserAccountData", 1171 | "outputs": [{"internalType": "uint256", "name": "totalCollateralBase", "type": "uint256"}, 1172 | {"internalType": "uint256", "name": "totalDebtBase", "type": "uint256"}, 1173 | {"internalType": "uint256", "name": "availableBorrowsBase", "type": "uint256"}, 1174 | {"internalType": "uint256", "name": "currentLiquidationThreshold", "type": "uint256"}, 1175 | {"internalType": "uint256", "name": "ltv", "type": "uint256"}, 1176 | {"internalType": "uint256", "name": "healthFactor", "type": "uint256"}], 1177 | "stateMutability": "view", "type": "function"}, 1178 | {"inputs": [{"internalType": "address", "name": "user", "type": "address"}], "name": "getUserConfiguration", 1179 | "outputs": [{"components": [{"internalType": "uint256", "name": "data", "type": "uint256"}], 1180 | "internalType": "struct DataTypes.UserConfigurationMap", "name": "", "type": "tuple"}], 1181 | "stateMutability": "view", "type": "function"}, 1182 | {"inputs": [{"internalType": "address", "name": "user", "type": "address"}], "name": "getUserEMode", 1183 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", 1184 | "type": "function"}, {"inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1185 | {"internalType": "address", "name": "aTokenAddress", "type": "address"}, 1186 | {"internalType": "address", "name": "stableDebtAddress", 1187 | "type": "address"}, 1188 | {"internalType": "address", "name": "variableDebtAddress", 1189 | "type": "address"}, 1190 | {"internalType": "address", "name": "interestRateStrategyAddress", 1191 | "type": "address"}], "name": "initReserve", "outputs": [], 1192 | "stateMutability": "nonpayable", "type": "function"}, 1193 | {"inputs": [{"internalType": "contract IPoolAddressesProvider", "name": "provider", "type": "address"}], 1194 | "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 1195 | "inputs": [{"internalType": "address", "name": "collateralAsset", "type": "address"}, 1196 | {"internalType": "address", "name": "debtAsset", "type": "address"}, 1197 | {"internalType": "address", "name": "user", "type": "address"}, 1198 | {"internalType": "uint256", "name": "debtToCover", "type": "uint256"}, 1199 | {"internalType": "bool", "name": "receiveAToken", "type": "bool"}], 1200 | "name": "liquidationCall", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, 1201 | {"inputs": [{"internalType": "address[]", "name": "assets", "type": "address[]"}], "name": "mintToTreasury", 1202 | "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 1203 | "inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1204 | {"internalType": "uint256", "name": "amount", "type": "uint256"}, 1205 | {"internalType": "address", "name": "onBehalfOf", "type": "address"}, 1206 | {"internalType": "uint16", "name": "referralCode", "type": "uint16"}], 1207 | "name": "mintUnbacked", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 1208 | "inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1209 | {"internalType": "address", "name": "user", "type": "address"}], 1210 | "name": "rebalanceStableBorrowRate", "outputs": [], "stateMutability": "nonpayable", 1211 | "type": "function"}, {"inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1212 | {"internalType": "uint256", "name": "amount", "type": "uint256"}, 1213 | {"internalType": "uint256", "name": "interestRateMode", 1214 | "type": "uint256"}, 1215 | {"internalType": "address", "name": "onBehalfOf", "type": "address"}], 1216 | "name": "repay", 1217 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], 1218 | "stateMutability": "nonpayable", "type": "function"}, { 1219 | "inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1220 | {"internalType": "uint256", "name": "amount", "type": "uint256"}, 1221 | {"internalType": "uint256", "name": "interestRateMode", "type": "uint256"}], 1222 | "name": "repayWithATokens", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], 1223 | "stateMutability": "nonpayable", "type": "function"}, { 1224 | "inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1225 | {"internalType": "uint256", "name": "amount", "type": "uint256"}, 1226 | {"internalType": "uint256", "name": "interestRateMode", "type": "uint256"}, 1227 | {"internalType": "address", "name": "onBehalfOf", "type": "address"}, 1228 | {"internalType": "uint256", "name": "deadline", "type": "uint256"}, 1229 | {"internalType": "uint8", "name": "permitV", "type": "uint8"}, 1230 | {"internalType": "bytes32", "name": "permitR", "type": "bytes32"}, 1231 | {"internalType": "bytes32", "name": "permitS", "type": "bytes32"}], 1232 | "name": "repayWithPermit", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], 1233 | "stateMutability": "nonpayable", "type": "function"}, { 1234 | "inputs": [{"internalType": "address", "name": "token", "type": "address"}, 1235 | {"internalType": "address", "name": "to", "type": "address"}, 1236 | {"internalType": "uint256", "name": "amount", "type": "uint256"}], "name": "rescueTokens", 1237 | "outputs": [], "stateMutability": "nonpayable", "type": "function"}, 1238 | {"inputs": [{"internalType": "address", "name": "asset", "type": "address"}], 1239 | "name": "resetIsolationModeTotalDebt", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, 1240 | {"inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1241 | {"components": [{"internalType": "uint256", "name": "data", "type": "uint256"}], 1242 | "internalType": "struct DataTypes.ReserveConfigurationMap", "name": "configuration", 1243 | "type": "tuple"}], "name": "setConfiguration", "outputs": [], "stateMutability": "nonpayable", 1244 | "type": "function"}, {"inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1245 | {"internalType": "address", "name": "rateStrategyAddress", 1246 | "type": "address"}], "name": "setReserveInterestRateStrategyAddress", 1247 | "outputs": [], "stateMutability": "nonpayable", "type": "function"}, 1248 | {"inputs": [{"internalType": "uint8", "name": "categoryId", "type": "uint8"}], "name": "setUserEMode", 1249 | "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 1250 | "inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1251 | {"internalType": "bool", "name": "useAsCollateral", "type": "bool"}], 1252 | "name": "setUserUseReserveAsCollateral", "outputs": [], "stateMutability": "nonpayable", 1253 | "type": "function"}, {"inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1254 | {"internalType": "uint256", "name": "amount", "type": "uint256"}, 1255 | {"internalType": "address", "name": "onBehalfOf", "type": "address"}, 1256 | {"internalType": "uint16", "name": "referralCode", "type": "uint16"}], 1257 | "name": "supply", "outputs": [], "stateMutability": "nonpayable", 1258 | "type": "function"}, { 1259 | "inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1260 | {"internalType": "uint256", "name": "amount", "type": "uint256"}, 1261 | {"internalType": "address", "name": "onBehalfOf", "type": "address"}, 1262 | {"internalType": "uint16", "name": "referralCode", "type": "uint16"}, 1263 | {"internalType": "uint256", "name": "deadline", "type": "uint256"}, 1264 | {"internalType": "uint8", "name": "permitV", "type": "uint8"}, 1265 | {"internalType": "bytes32", "name": "permitR", "type": "bytes32"}, 1266 | {"internalType": "bytes32", "name": "permitS", "type": "bytes32"}], 1267 | "name": "supplyWithPermit", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 1268 | "inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1269 | {"internalType": "uint256", "name": "interestRateMode", "type": "uint256"}], 1270 | "name": "swapBorrowRateMode", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, 1271 | {"inputs": [{"internalType": "uint256", "name": "protocolFee", "type": "uint256"}], 1272 | "name": "updateBridgeProtocolFee", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 1273 | "inputs": [{"internalType": "uint128", "name": "flashLoanPremiumTotal", "type": "uint128"}, 1274 | {"internalType": "uint128", "name": "flashLoanPremiumToProtocol", "type": "uint128"}], 1275 | "name": "updateFlashloanPremiums", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, 1276 | {"inputs": [{"internalType": "address", "name": "asset", "type": "address"}, 1277 | {"internalType": "uint256", "name": "amount", "type": "uint256"}, 1278 | {"internalType": "address", "name": "to", "type": "address"}], "name": "withdraw", 1279 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "nonpayable", 1280 | "type": "function"}] 1281 | 1282 | bend_borrows_abi = [{"inputs": [ 1283 | {"internalType": "contract IEACAggregatorProxy", "name": "_networkBaseTokenPriceInUsdProxyAggregator", 1284 | "type": "address"}, 1285 | {"internalType": "contract IEACAggregatorProxy", "name": "_marketReferenceCurrencyPriceInUsdProxyAggregator", 1286 | "type": "address"}], "stateMutability": "nonpayable", "type": "constructor"}, 1287 | {"inputs": [], "name": "ETH_CURRENCY_UNIT", 1288 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", 1289 | "type": "function"}, {"inputs": [], "name": "MKR_ADDRESS", 1290 | "outputs": [{"internalType": "address", "name": "", "type": "address"}], 1291 | "stateMutability": "view", "type": "function"}, 1292 | {"inputs": [{"internalType": "bytes32", "name": "_bytes32", "type": "bytes32"}], 1293 | "name": "bytes32ToString", "outputs": [{"internalType": "string", "name": "", "type": "string"}], 1294 | "stateMutability": "pure", "type": "function"}, {"inputs": [ 1295 | {"internalType": "contract IPoolAddressesProvider", "name": "provider", "type": "address"}], 1296 | "name": "getReservesData", "outputs": [{ 1297 | "components": [ 1298 | { 1299 | "internalType": "address", 1300 | "name": "underlyingAsset", 1301 | "type": "address"}, 1302 | { 1303 | "internalType": "string", 1304 | "name": "name", 1305 | "type": "string"}, 1306 | { 1307 | "internalType": "string", 1308 | "name": "symbol", 1309 | "type": "string"}, 1310 | { 1311 | "internalType": "uint256", 1312 | "name": "decimals", 1313 | "type": "uint256"}, 1314 | { 1315 | "internalType": "uint256", 1316 | "name": "baseLTVasCollateral", 1317 | "type": "uint256"}, 1318 | { 1319 | "internalType": "uint256", 1320 | "name": "reserveLiquidationThreshold", 1321 | "type": "uint256"}, 1322 | { 1323 | "internalType": "uint256", 1324 | "name": "reserveLiquidationBonus", 1325 | "type": "uint256"}, 1326 | { 1327 | "internalType": "uint256", 1328 | "name": "reserveFactor", 1329 | "type": "uint256"}, 1330 | { 1331 | "internalType": "bool", 1332 | "name": "usageAsCollateralEnabled", 1333 | "type": "bool"}, 1334 | { 1335 | "internalType": "bool", 1336 | "name": "borrowingEnabled", 1337 | "type": "bool"}, 1338 | { 1339 | "internalType": "bool", 1340 | "name": "stableBorrowRateEnabled", 1341 | "type": "bool"}, 1342 | { 1343 | "internalType": "bool", 1344 | "name": "isActive", 1345 | "type": "bool"}, 1346 | { 1347 | "internalType": "bool", 1348 | "name": "isFrozen", 1349 | "type": "bool"}, 1350 | { 1351 | "internalType": "uint128", 1352 | "name": "liquidityIndex", 1353 | "type": "uint128"}, 1354 | { 1355 | "internalType": "uint128", 1356 | "name": "variableBorrowIndex", 1357 | "type": "uint128"}, 1358 | { 1359 | "internalType": "uint128", 1360 | "name": "liquidityRate", 1361 | "type": "uint128"}, 1362 | { 1363 | "internalType": "uint128", 1364 | "name": "variableBorrowRate", 1365 | "type": "uint128"}, 1366 | { 1367 | "internalType": "uint128", 1368 | "name": "stableBorrowRate", 1369 | "type": "uint128"}, 1370 | { 1371 | "internalType": "uint40", 1372 | "name": "lastUpdateTimestamp", 1373 | "type": "uint40"}, 1374 | { 1375 | "internalType": "address", 1376 | "name": "aTokenAddress", 1377 | "type": "address"}, 1378 | { 1379 | "internalType": "address", 1380 | "name": "stableDebtTokenAddress", 1381 | "type": "address"}, 1382 | { 1383 | "internalType": "address", 1384 | "name": "variableDebtTokenAddress", 1385 | "type": "address"}, 1386 | { 1387 | "internalType": "address", 1388 | "name": "interestRateStrategyAddress", 1389 | "type": "address"}, 1390 | { 1391 | "internalType": "uint256", 1392 | "name": "availableLiquidity", 1393 | "type": "uint256"}, 1394 | { 1395 | "internalType": "uint256", 1396 | "name": "totalPrincipalStableDebt", 1397 | "type": "uint256"}, 1398 | { 1399 | "internalType": "uint256", 1400 | "name": "averageStableRate", 1401 | "type": "uint256"}, 1402 | { 1403 | "internalType": "uint256", 1404 | "name": "stableDebtLastUpdateTimestamp", 1405 | "type": "uint256"}, 1406 | { 1407 | "internalType": "uint256", 1408 | "name": "totalScaledVariableDebt", 1409 | "type": "uint256"}, 1410 | { 1411 | "internalType": "uint256", 1412 | "name": "priceInMarketReferenceCurrency", 1413 | "type": "uint256"}, 1414 | { 1415 | "internalType": "address", 1416 | "name": "priceOracle", 1417 | "type": "address"}, 1418 | { 1419 | "internalType": "uint256", 1420 | "name": "variableRateSlope1", 1421 | "type": "uint256"}, 1422 | { 1423 | "internalType": "uint256", 1424 | "name": "variableRateSlope2", 1425 | "type": "uint256"}, 1426 | { 1427 | "internalType": "uint256", 1428 | "name": "stableRateSlope1", 1429 | "type": "uint256"}, 1430 | { 1431 | "internalType": "uint256", 1432 | "name": "stableRateSlope2", 1433 | "type": "uint256"}, 1434 | { 1435 | "internalType": "uint256", 1436 | "name": "baseStableBorrowRate", 1437 | "type": "uint256"}, 1438 | { 1439 | "internalType": "uint256", 1440 | "name": "baseVariableBorrowRate", 1441 | "type": "uint256"}, 1442 | { 1443 | "internalType": "uint256", 1444 | "name": "optimalUsageRatio", 1445 | "type": "uint256"}, 1446 | { 1447 | "internalType": "bool", 1448 | "name": "isPaused", 1449 | "type": "bool"}, 1450 | { 1451 | "internalType": "bool", 1452 | "name": "isSiloedBorrowing", 1453 | "type": "bool"}, 1454 | { 1455 | "internalType": "uint128", 1456 | "name": "accruedToTreasury", 1457 | "type": "uint128"}, 1458 | { 1459 | "internalType": "uint128", 1460 | "name": "unbacked", 1461 | "type": "uint128"}, 1462 | { 1463 | "internalType": "uint128", 1464 | "name": "isolationModeTotalDebt", 1465 | "type": "uint128"}, 1466 | { 1467 | "internalType": "bool", 1468 | "name": "flashLoanEnabled", 1469 | "type": "bool"}, 1470 | { 1471 | "internalType": "uint256", 1472 | "name": "debtCeiling", 1473 | "type": "uint256"}, 1474 | { 1475 | "internalType": "uint256", 1476 | "name": "debtCeilingDecimals", 1477 | "type": "uint256"}, 1478 | { 1479 | "internalType": "uint8", 1480 | "name": "eModeCategoryId", 1481 | "type": "uint8"}, 1482 | { 1483 | "internalType": "uint256", 1484 | "name": "borrowCap", 1485 | "type": "uint256"}, 1486 | { 1487 | "internalType": "uint256", 1488 | "name": "supplyCap", 1489 | "type": "uint256"}, 1490 | { 1491 | "internalType": "uint16", 1492 | "name": "eModeLtv", 1493 | "type": "uint16"}, 1494 | { 1495 | "internalType": "uint16", 1496 | "name": "eModeLiquidationThreshold", 1497 | "type": "uint16"}, 1498 | { 1499 | "internalType": "uint16", 1500 | "name": "eModeLiquidationBonus", 1501 | "type": "uint16"}, 1502 | { 1503 | "internalType": "address", 1504 | "name": "eModePriceSource", 1505 | "type": "address"}, 1506 | { 1507 | "internalType": "string", 1508 | "name": "eModeLabel", 1509 | "type": "string"}, 1510 | { 1511 | "internalType": "bool", 1512 | "name": "borrowableInIsolation", 1513 | "type": "bool"}], 1514 | "internalType": "struct IUiPoolDataProviderV3.AggregatedReserveData[]", 1515 | "name": "", 1516 | "type": "tuple[]"}, 1517 | { 1518 | "components": [ 1519 | { 1520 | "internalType": "uint256", 1521 | "name": "marketReferenceCurrencyUnit", 1522 | "type": "uint256"}, 1523 | { 1524 | "internalType": "int256", 1525 | "name": "marketReferenceCurrencyPriceInUsd", 1526 | "type": "int256"}, 1527 | { 1528 | "internalType": "int256", 1529 | "name": "networkBaseTokenPriceInUsd", 1530 | "type": "int256"}, 1531 | { 1532 | "internalType": "uint8", 1533 | "name": "networkBaseTokenPriceDecimals", 1534 | "type": "uint8"}], 1535 | "internalType": "struct IUiPoolDataProviderV3.BaseCurrencyInfo", 1536 | "name": "", 1537 | "type": "tuple"}], 1538 | "stateMutability": "view", "type": "function"}, { 1539 | "inputs": [ 1540 | {"internalType": "contract IPoolAddressesProvider", "name": "provider", "type": "address"}], 1541 | "name": "getReservesList", 1542 | "outputs": [{"internalType": "address[]", "name": "", "type": "address[]"}], 1543 | "stateMutability": "view", "type": "function"}, {"inputs": [ 1544 | {"internalType": "contract IPoolAddressesProvider", "name": "provider", "type": "address"}, 1545 | {"internalType": "address", "name": "user", "type": "address"}], "name": "getUserReservesData", "outputs": [{ 1546 | "components": [ 1547 | { 1548 | "internalType": "address", 1549 | "name": "underlyingAsset", 1550 | "type": "address"}, 1551 | { 1552 | "internalType": "uint256", 1553 | "name": "scaledATokenBalance", 1554 | "type": "uint256"}, 1555 | { 1556 | "internalType": "bool", 1557 | "name": "usageAsCollateralEnabledOnUser", 1558 | "type": "bool"}, 1559 | { 1560 | "internalType": "uint256", 1561 | "name": "stableBorrowRate", 1562 | "type": "uint256"}, 1563 | { 1564 | "internalType": "uint256", 1565 | "name": "scaledVariableDebt", 1566 | "type": "uint256"}, 1567 | { 1568 | "internalType": "uint256", 1569 | "name": "principalStableDebt", 1570 | "type": "uint256"}, 1571 | { 1572 | "internalType": "uint256", 1573 | "name": "stableBorrowLastUpdateTimestamp", 1574 | "type": "uint256"}], 1575 | "internalType": "struct IUiPoolDataProviderV3.UserReserveData[]", 1576 | "name": "", 1577 | "type": "tuple[]"}, 1578 | { 1579 | "internalType": "uint8", 1580 | "name": "", 1581 | "type": "uint8"}], 1582 | "stateMutability": "view", "type": "function"}, 1583 | {"inputs": [], "name": "marketReferenceCurrencyPriceInUsdProxyAggregator", 1584 | "outputs": [{"internalType": "contract IEACAggregatorProxy", "name": "", "type": "address"}], 1585 | "stateMutability": "view", "type": "function"}, 1586 | {"inputs": [], "name": "networkBaseTokenPriceInUsdProxyAggregator", 1587 | "outputs": [{"internalType": "contract IEACAggregatorProxy", "name": "", "type": "address"}], 1588 | "stateMutability": "view", "type": "function"}] 1589 | 1590 | ooga_booga_abi = [ 1591 | { 1592 | "inputs": [ 1593 | { 1594 | "internalType": "bytes32", 1595 | "name": "allowlist_", 1596 | "type": "bytes32" 1597 | }, 1598 | { 1599 | "internalType": "string", 1600 | "name": "name_", 1601 | "type": "string" 1602 | }, 1603 | { 1604 | "internalType": "string", 1605 | "name": "symbol_", 1606 | "type": "string" 1607 | }, 1608 | { 1609 | "internalType": "contract IERC20", 1610 | "name": "paymentToken_", 1611 | "type": "address" 1612 | }, 1613 | { 1614 | "components": [ 1615 | { 1616 | "internalType": "uint256", 1617 | "name": "native", 1618 | "type": "uint256" 1619 | }, 1620 | { 1621 | "internalType": "uint256", 1622 | "name": "erc20", 1623 | "type": "uint256" 1624 | } 1625 | ], 1626 | "internalType": "struct Ticket.MintCost", 1627 | "name": "mintCost_", 1628 | "type": "tuple" 1629 | } 1630 | ], 1631 | "stateMutability": "nonpayable", 1632 | "type": "constructor" 1633 | }, 1634 | { 1635 | "inputs": [], 1636 | "name": "AccountBalanceOverflow", 1637 | "type": "error" 1638 | }, 1639 | { 1640 | "inputs": [], 1641 | "name": "AlreadyClaimed", 1642 | "type": "error" 1643 | }, 1644 | { 1645 | "inputs": [], 1646 | "name": "BalanceQueryForZeroAddress", 1647 | "type": "error" 1648 | }, 1649 | { 1650 | "inputs": [], 1651 | "name": "InvalidProof", 1652 | "type": "error" 1653 | }, 1654 | { 1655 | "inputs": [], 1656 | "name": "NotOwnerNorApproved", 1657 | "type": "error" 1658 | }, 1659 | { 1660 | "inputs": [ 1661 | { 1662 | "internalType": "address", 1663 | "name": "owner", 1664 | "type": "address" 1665 | } 1666 | ], 1667 | "name": "OwnableInvalidOwner", 1668 | "type": "error" 1669 | }, 1670 | { 1671 | "inputs": [ 1672 | { 1673 | "internalType": "address", 1674 | "name": "account", 1675 | "type": "address" 1676 | } 1677 | ], 1678 | "name": "OwnableUnauthorizedAccount", 1679 | "type": "error" 1680 | }, 1681 | { 1682 | "inputs": [], 1683 | "name": "TokenAlreadyExists", 1684 | "type": "error" 1685 | }, 1686 | { 1687 | "inputs": [], 1688 | "name": "TokenDoesNotExist", 1689 | "type": "error" 1690 | }, 1691 | { 1692 | "inputs": [], 1693 | "name": "TransferFromIncorrectOwner", 1694 | "type": "error" 1695 | }, 1696 | { 1697 | "inputs": [], 1698 | "name": "TransferToNonERC721ReceiverImplementer", 1699 | "type": "error" 1700 | }, 1701 | { 1702 | "inputs": [], 1703 | "name": "TransferToZeroAddress", 1704 | "type": "error" 1705 | }, 1706 | { 1707 | "inputs": [], 1708 | "name": "URIQueryForNonexistentToken", 1709 | "type": "error" 1710 | }, 1711 | { 1712 | "anonymous": False, 1713 | "inputs": [ 1714 | { 1715 | "indexed": True, 1716 | "internalType": "address", 1717 | "name": "owner", 1718 | "type": "address" 1719 | }, 1720 | { 1721 | "indexed": True, 1722 | "internalType": "address", 1723 | "name": "account", 1724 | "type": "address" 1725 | }, 1726 | { 1727 | "indexed": True, 1728 | "internalType": "uint256", 1729 | "name": "id", 1730 | "type": "uint256" 1731 | } 1732 | ], 1733 | "name": "Approval", 1734 | "type": "event" 1735 | }, 1736 | { 1737 | "anonymous": False, 1738 | "inputs": [ 1739 | { 1740 | "indexed": True, 1741 | "internalType": "address", 1742 | "name": "owner", 1743 | "type": "address" 1744 | }, 1745 | { 1746 | "indexed": True, 1747 | "internalType": "address", 1748 | "name": "operator", 1749 | "type": "address" 1750 | }, 1751 | { 1752 | "indexed": False, 1753 | "internalType": "bool", 1754 | "name": "isApproved", 1755 | "type": "bool" 1756 | } 1757 | ], 1758 | "name": "ApprovalForAll", 1759 | "type": "event" 1760 | }, 1761 | { 1762 | "anonymous": False, 1763 | "inputs": [ 1764 | { 1765 | "indexed": False, 1766 | "internalType": "string", 1767 | "name": "uri", 1768 | "type": "string" 1769 | } 1770 | ], 1771 | "name": "BaseURISet", 1772 | "type": "event" 1773 | }, 1774 | { 1775 | "anonymous": False, 1776 | "inputs": [ 1777 | { 1778 | "indexed": True, 1779 | "internalType": "address", 1780 | "name": "user", 1781 | "type": "address" 1782 | }, 1783 | { 1784 | "indexed": False, 1785 | "internalType": "bytes32", 1786 | "name": "root", 1787 | "type": "bytes32" 1788 | }, 1789 | { 1790 | "indexed": False, 1791 | "internalType": "uint256", 1792 | "name": "index", 1793 | "type": "uint256" 1794 | } 1795 | ], 1796 | "name": "Claimed", 1797 | "type": "event" 1798 | }, 1799 | { 1800 | "anonymous": False, 1801 | "inputs": [ 1802 | { 1803 | "indexed": True, 1804 | "internalType": "address", 1805 | "name": "previousOwner", 1806 | "type": "address" 1807 | }, 1808 | { 1809 | "indexed": True, 1810 | "internalType": "address", 1811 | "name": "newOwner", 1812 | "type": "address" 1813 | } 1814 | ], 1815 | "name": "OwnershipTransferred", 1816 | "type": "event" 1817 | }, 1818 | { 1819 | "anonymous": False, 1820 | "inputs": [ 1821 | { 1822 | "indexed": False, 1823 | "internalType": "bool", 1824 | "name": "generated", 1825 | "type": "bool" 1826 | } 1827 | ], 1828 | "name": "SetGenerated", 1829 | "type": "event" 1830 | }, 1831 | { 1832 | "anonymous": False, 1833 | "inputs": [ 1834 | { 1835 | "indexed": True, 1836 | "internalType": "address", 1837 | "name": "from", 1838 | "type": "address" 1839 | }, 1840 | { 1841 | "indexed": True, 1842 | "internalType": "address", 1843 | "name": "to", 1844 | "type": "address" 1845 | }, 1846 | { 1847 | "indexed": True, 1848 | "internalType": "uint256", 1849 | "name": "id", 1850 | "type": "uint256" 1851 | } 1852 | ], 1853 | "name": "Transfer", 1854 | "type": "event" 1855 | }, 1856 | { 1857 | "inputs": [], 1858 | "name": "allowlist", 1859 | "outputs": [ 1860 | { 1861 | "internalType": "bytes32", 1862 | "name": "", 1863 | "type": "bytes32" 1864 | } 1865 | ], 1866 | "stateMutability": "view", 1867 | "type": "function" 1868 | }, 1869 | { 1870 | "inputs": [ 1871 | { 1872 | "internalType": "address", 1873 | "name": "account", 1874 | "type": "address" 1875 | }, 1876 | { 1877 | "internalType": "uint256", 1878 | "name": "id", 1879 | "type": "uint256" 1880 | } 1881 | ], 1882 | "name": "approve", 1883 | "outputs": [], 1884 | "stateMutability": "payable", 1885 | "type": "function" 1886 | }, 1887 | { 1888 | "inputs": [ 1889 | { 1890 | "internalType": "address", 1891 | "name": "owner", 1892 | "type": "address" 1893 | } 1894 | ], 1895 | "name": "balanceOf", 1896 | "outputs": [ 1897 | { 1898 | "internalType": "uint256", 1899 | "name": "result", 1900 | "type": "uint256" 1901 | } 1902 | ], 1903 | "stateMutability": "view", 1904 | "type": "function" 1905 | }, 1906 | { 1907 | "inputs": [], 1908 | "name": "buy", 1909 | "outputs": [], 1910 | "stateMutability": "payable", 1911 | "type": "function" 1912 | }, 1913 | { 1914 | "inputs": [ 1915 | { 1916 | "internalType": "uint256", 1917 | "name": "index_", 1918 | "type": "uint256" 1919 | }, 1920 | { 1921 | "internalType": "bytes32[]", 1922 | "name": "proof_", 1923 | "type": "bytes32[]" 1924 | } 1925 | ], 1926 | "name": "claim", 1927 | "outputs": [], 1928 | "stateMutability": "payable", 1929 | "type": "function" 1930 | }, 1931 | { 1932 | "inputs": [], 1933 | "name": "claimAmount", 1934 | "outputs": [ 1935 | { 1936 | "internalType": "uint256", 1937 | "name": "", 1938 | "type": "uint256" 1939 | } 1940 | ], 1941 | "stateMutability": "view", 1942 | "type": "function" 1943 | }, 1944 | { 1945 | "inputs": [ 1946 | { 1947 | "internalType": "uint256", 1948 | "name": "index_", 1949 | "type": "uint256" 1950 | } 1951 | ], 1952 | "name": "claimed", 1953 | "outputs": [ 1954 | { 1955 | "internalType": "bool", 1956 | "name": "", 1957 | "type": "bool" 1958 | } 1959 | ], 1960 | "stateMutability": "view", 1961 | "type": "function" 1962 | }, 1963 | { 1964 | "inputs": [ 1965 | { 1966 | "internalType": "uint256", 1967 | "name": "id", 1968 | "type": "uint256" 1969 | } 1970 | ], 1971 | "name": "getApproved", 1972 | "outputs": [ 1973 | { 1974 | "internalType": "address", 1975 | "name": "result", 1976 | "type": "address" 1977 | } 1978 | ], 1979 | "stateMutability": "view", 1980 | "type": "function" 1981 | }, 1982 | { 1983 | "inputs": [ 1984 | { 1985 | "internalType": "address", 1986 | "name": "", 1987 | "type": "address" 1988 | } 1989 | ], 1990 | "name": "hasMinted", 1991 | "outputs": [ 1992 | { 1993 | "internalType": "bool", 1994 | "name": "", 1995 | "type": "bool" 1996 | } 1997 | ], 1998 | "stateMutability": "view", 1999 | "type": "function" 2000 | }, 2001 | { 2002 | "inputs": [ 2003 | { 2004 | "internalType": "address", 2005 | "name": "owner", 2006 | "type": "address" 2007 | }, 2008 | { 2009 | "internalType": "address", 2010 | "name": "operator", 2011 | "type": "address" 2012 | } 2013 | ], 2014 | "name": "isApprovedForAll", 2015 | "outputs": [ 2016 | { 2017 | "internalType": "bool", 2018 | "name": "result", 2019 | "type": "bool" 2020 | } 2021 | ], 2022 | "stateMutability": "view", 2023 | "type": "function" 2024 | }, 2025 | { 2026 | "inputs": [], 2027 | "name": "isGenerated", 2028 | "outputs": [ 2029 | { 2030 | "internalType": "bool", 2031 | "name": "", 2032 | "type": "bool" 2033 | } 2034 | ], 2035 | "stateMutability": "view", 2036 | "type": "function" 2037 | }, 2038 | { 2039 | "inputs": [], 2040 | "name": "mintCost", 2041 | "outputs": [ 2042 | { 2043 | "internalType": "uint256", 2044 | "name": "native", 2045 | "type": "uint256" 2046 | }, 2047 | { 2048 | "internalType": "uint256", 2049 | "name": "erc20", 2050 | "type": "uint256" 2051 | } 2052 | ], 2053 | "stateMutability": "view", 2054 | "type": "function" 2055 | }, 2056 | { 2057 | "inputs": [], 2058 | "name": "name", 2059 | "outputs": [ 2060 | { 2061 | "internalType": "string", 2062 | "name": "", 2063 | "type": "string" 2064 | } 2065 | ], 2066 | "stateMutability": "view", 2067 | "type": "function" 2068 | }, 2069 | { 2070 | "inputs": [], 2071 | "name": "owner", 2072 | "outputs": [ 2073 | { 2074 | "internalType": "address", 2075 | "name": "", 2076 | "type": "address" 2077 | } 2078 | ], 2079 | "stateMutability": "view", 2080 | "type": "function" 2081 | }, 2082 | { 2083 | "inputs": [ 2084 | { 2085 | "internalType": "uint256", 2086 | "name": "id", 2087 | "type": "uint256" 2088 | } 2089 | ], 2090 | "name": "ownerOf", 2091 | "outputs": [ 2092 | { 2093 | "internalType": "address", 2094 | "name": "result", 2095 | "type": "address" 2096 | } 2097 | ], 2098 | "stateMutability": "view", 2099 | "type": "function" 2100 | }, 2101 | { 2102 | "inputs": [], 2103 | "name": "paymentToken", 2104 | "outputs": [ 2105 | { 2106 | "internalType": "contract IERC20", 2107 | "name": "", 2108 | "type": "address" 2109 | } 2110 | ], 2111 | "stateMutability": "view", 2112 | "type": "function" 2113 | }, 2114 | { 2115 | "inputs": [], 2116 | "name": "realOwner", 2117 | "outputs": [ 2118 | { 2119 | "internalType": "address", 2120 | "name": "", 2121 | "type": "address" 2122 | } 2123 | ], 2124 | "stateMutability": "view", 2125 | "type": "function" 2126 | }, 2127 | { 2128 | "inputs": [], 2129 | "name": "renounceOwnership", 2130 | "outputs": [], 2131 | "stateMutability": "nonpayable", 2132 | "type": "function" 2133 | }, 2134 | { 2135 | "inputs": [ 2136 | { 2137 | "internalType": "address", 2138 | "name": "from", 2139 | "type": "address" 2140 | }, 2141 | { 2142 | "internalType": "address", 2143 | "name": "to", 2144 | "type": "address" 2145 | }, 2146 | { 2147 | "internalType": "uint256", 2148 | "name": "id", 2149 | "type": "uint256" 2150 | } 2151 | ], 2152 | "name": "safeTransferFrom", 2153 | "outputs": [], 2154 | "stateMutability": "payable", 2155 | "type": "function" 2156 | }, 2157 | { 2158 | "inputs": [ 2159 | { 2160 | "internalType": "address", 2161 | "name": "from", 2162 | "type": "address" 2163 | }, 2164 | { 2165 | "internalType": "address", 2166 | "name": "to", 2167 | "type": "address" 2168 | }, 2169 | { 2170 | "internalType": "uint256", 2171 | "name": "id", 2172 | "type": "uint256" 2173 | }, 2174 | { 2175 | "internalType": "bytes", 2176 | "name": "data", 2177 | "type": "bytes" 2178 | } 2179 | ], 2180 | "name": "safeTransferFrom", 2181 | "outputs": [], 2182 | "stateMutability": "payable", 2183 | "type": "function" 2184 | }, 2185 | { 2186 | "inputs": [ 2187 | { 2188 | "internalType": "bytes32", 2189 | "name": "allowlist_", 2190 | "type": "bytes32" 2191 | } 2192 | ], 2193 | "name": "setAllowList", 2194 | "outputs": [], 2195 | "stateMutability": "nonpayable", 2196 | "type": "function" 2197 | }, 2198 | { 2199 | "inputs": [ 2200 | { 2201 | "internalType": "address", 2202 | "name": "operator", 2203 | "type": "address" 2204 | }, 2205 | { 2206 | "internalType": "bool", 2207 | "name": "isApproved", 2208 | "type": "bool" 2209 | } 2210 | ], 2211 | "name": "setApprovalForAll", 2212 | "outputs": [], 2213 | "stateMutability": "nonpayable", 2214 | "type": "function" 2215 | }, 2216 | { 2217 | "inputs": [ 2218 | { 2219 | "internalType": "string", 2220 | "name": "baseURI_", 2221 | "type": "string" 2222 | } 2223 | ], 2224 | "name": "setBaseURI", 2225 | "outputs": [], 2226 | "stateMutability": "nonpayable", 2227 | "type": "function" 2228 | }, 2229 | { 2230 | "inputs": [ 2231 | { 2232 | "internalType": "uint256", 2233 | "name": "claimAmount_", 2234 | "type": "uint256" 2235 | } 2236 | ], 2237 | "name": "setClaimAmount", 2238 | "outputs": [], 2239 | "stateMutability": "nonpayable", 2240 | "type": "function" 2241 | }, 2242 | { 2243 | "inputs": [ 2244 | { 2245 | "internalType": "bool", 2246 | "name": "generated_", 2247 | "type": "bool" 2248 | } 2249 | ], 2250 | "name": "setGenerated", 2251 | "outputs": [], 2252 | "stateMutability": "nonpayable", 2253 | "type": "function" 2254 | }, 2255 | { 2256 | "inputs": [ 2257 | { 2258 | "components": [ 2259 | { 2260 | "internalType": "uint256", 2261 | "name": "native", 2262 | "type": "uint256" 2263 | }, 2264 | { 2265 | "internalType": "uint256", 2266 | "name": "erc20", 2267 | "type": "uint256" 2268 | } 2269 | ], 2270 | "internalType": "struct Ticket.MintCost", 2271 | "name": "mintCost_", 2272 | "type": "tuple" 2273 | } 2274 | ], 2275 | "name": "setMintCost", 2276 | "outputs": [], 2277 | "stateMutability": "nonpayable", 2278 | "type": "function" 2279 | }, 2280 | { 2281 | "inputs": [ 2282 | { 2283 | "internalType": "contract IERC20", 2284 | "name": "paymentToken_", 2285 | "type": "address" 2286 | } 2287 | ], 2288 | "name": "setPaymentToken", 2289 | "outputs": [], 2290 | "stateMutability": "nonpayable", 2291 | "type": "function" 2292 | }, 2293 | { 2294 | "inputs": [ 2295 | { 2296 | "internalType": "bytes4", 2297 | "name": "interfaceId", 2298 | "type": "bytes4" 2299 | } 2300 | ], 2301 | "name": "supportsInterface", 2302 | "outputs": [ 2303 | { 2304 | "internalType": "bool", 2305 | "name": "result", 2306 | "type": "bool" 2307 | } 2308 | ], 2309 | "stateMutability": "view", 2310 | "type": "function" 2311 | }, 2312 | { 2313 | "inputs": [], 2314 | "name": "symbol", 2315 | "outputs": [ 2316 | { 2317 | "internalType": "string", 2318 | "name": "", 2319 | "type": "string" 2320 | } 2321 | ], 2322 | "stateMutability": "view", 2323 | "type": "function" 2324 | }, 2325 | { 2326 | "inputs": [ 2327 | { 2328 | "internalType": "uint256", 2329 | "name": "tokenId", 2330 | "type": "uint256" 2331 | } 2332 | ], 2333 | "name": "tokenURI", 2334 | "outputs": [ 2335 | { 2336 | "internalType": "string", 2337 | "name": "", 2338 | "type": "string" 2339 | } 2340 | ], 2341 | "stateMutability": "view", 2342 | "type": "function" 2343 | }, 2344 | { 2345 | "inputs": [ 2346 | { 2347 | "internalType": "address", 2348 | "name": "from", 2349 | "type": "address" 2350 | }, 2351 | { 2352 | "internalType": "address", 2353 | "name": "to", 2354 | "type": "address" 2355 | }, 2356 | { 2357 | "internalType": "uint256", 2358 | "name": "id", 2359 | "type": "uint256" 2360 | } 2361 | ], 2362 | "name": "transferFrom", 2363 | "outputs": [], 2364 | "stateMutability": "payable", 2365 | "type": "function" 2366 | }, 2367 | { 2368 | "inputs": [ 2369 | { 2370 | "internalType": "address", 2371 | "name": "newOwner", 2372 | "type": "address" 2373 | } 2374 | ], 2375 | "name": "transferLowerOwnership", 2376 | "outputs": [], 2377 | "stateMutability": "nonpayable", 2378 | "type": "function" 2379 | }, 2380 | { 2381 | "inputs": [ 2382 | { 2383 | "internalType": "address", 2384 | "name": "newOwner", 2385 | "type": "address" 2386 | } 2387 | ], 2388 | "name": "transferOwnership", 2389 | "outputs": [], 2390 | "stateMutability": "nonpayable", 2391 | "type": "function" 2392 | }, 2393 | { 2394 | "inputs": [ 2395 | { 2396 | "internalType": "address", 2397 | "name": "newRealOwner", 2398 | "type": "address" 2399 | } 2400 | ], 2401 | "name": "transferRealOwnership", 2402 | "outputs": [], 2403 | "stateMutability": "nonpayable", 2404 | "type": "function" 2405 | }, 2406 | { 2407 | "inputs": [], 2408 | "name": "withdraw", 2409 | "outputs": [], 2410 | "stateMutability": "nonpayable", 2411 | "type": "function" 2412 | }, 2413 | { 2414 | "stateMutability": "payable", 2415 | "type": "receive" 2416 | } 2417 | ] 2418 | 2419 | bera_name_abi = [ 2420 | {"inputs": [{"internalType": "contract IAddressesProvider", "name": "addressesProvider_", "type": "address"}], 2421 | "stateMutability": "nonpayable", "type": "constructor"}, {"inputs": [], "name": "Exists", "type": "error"}, 2422 | {"inputs": [], "name": "InsufficientBalance", "type": "error"}, 2423 | {"inputs": [], "name": "LeaseTooShort", "type": "error"}, {"inputs": [], "name": "NoEntity", "type": "error"}, 2424 | {"inputs": [], "name": "Nope", "type": "error"}, {"anonymous": False, "inputs": [ 2425 | {"indexed": True, "internalType": "address", "name": "owner", "type": "address"}, 2426 | {"indexed": True, "internalType": "address", "name": "approved", "type": "address"}, 2427 | {"indexed": True, "internalType": "uint256", "name": "tokenId", "type": "uint256"}], "name": "Approval", 2428 | "type": "event"}, {"anonymous": False, "inputs": [ 2429 | {"indexed": True, "internalType": "address", "name": "owner", "type": "address"}, 2430 | {"indexed": True, "internalType": "address", "name": "operator", "type": "address"}, 2431 | {"indexed": False, "internalType": "bool", "name": "approved", "type": "bool"}], "name": "ApprovalForAll", 2432 | "type": "event"}, {"anonymous": False, 2433 | "inputs": [{"indexed": True, 2434 | "internalType": "uint256", 2435 | "name": "id", 2436 | "type": "uint256"}, 2437 | { 2438 | "indexed": False, 2439 | "internalType": "string[]", 2440 | "name": "chars", 2441 | "type": "string[]"}, 2442 | {"indexed": True, 2443 | "internalType": "address", 2444 | "name": "to", 2445 | "type": "address"}], 2446 | "name": "Mint", 2447 | "type": "event"}, 2448 | {"anonymous": False, 2449 | "inputs": [{"indexed": True, "internalType": "address", "name": "previousOwner", "type": "address"}, 2450 | {"indexed": True, "internalType": "address", "name": "newOwner", "type": "address"}], 2451 | "name": "OwnershipTransferStarted", "type": "event"}, {"anonymous": False, "inputs": [ 2452 | {"indexed": True, "internalType": "address", "name": "previousOwner", "type": "address"}, 2453 | {"indexed": True, "internalType": "address", "name": "newOwner", "type": "address"}], 2454 | "name": "OwnershipTransferred", "type": "event"}, 2455 | {"anonymous": False, 2456 | "inputs": [{"indexed": False, "internalType": "address", "name": "account", "type": "address"}], "name": "Paused", 2457 | "type": "event"}, {"anonymous": False, 2458 | "inputs": [{"indexed": True, "internalType": "address", "name": "from", "type": "address"}, 2459 | {"indexed": True, "internalType": "address", "name": "to", "type": "address"}, 2460 | {"indexed": True, "internalType": "uint256", "name": "tokenId", "type": "uint256"}], 2461 | "name": "Transfer", "type": "event"}, {"anonymous": False, "inputs": [ 2462 | {"indexed": False, "internalType": "address", "name": "account", "type": "address"}], "name": "Unpaused", 2463 | "type": "event"}, 2464 | {"inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, 2465 | {"inputs": [], "name": "addressesProvider", 2466 | "outputs": [{"internalType": "contract IAddressesProvider", "name": "", "type": "address"}], 2467 | "stateMutability": "view", "type": "function"}, { 2468 | "inputs": [{"internalType": "address", "name": "to", "type": "address"}, 2469 | {"internalType": "uint256", "name": "tokenId", "type": "uint256"}], "name": "approve", "outputs": [], 2470 | "stateMutability": "nonpayable", "type": "function"}, 2471 | {"inputs": [{"internalType": "address", "name": "owner", "type": "address"}], "name": "balanceOf", 2472 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", 2473 | "type": "function"}, {"inputs": [{"internalType": "uint256", "name": "id", "type": "uint256"}], "name": "chars", 2474 | "outputs": [{"internalType": "string[]", "name": "", "type": "string[]"}], 2475 | "stateMutability": "view", "type": "function"}, {"inputs": [], "name": "fundsManager", 2476 | "outputs": [{ 2477 | "internalType": "contract IFundsManager", 2478 | "name": "", 2479 | "type": "address"}], 2480 | "stateMutability": "view", 2481 | "type": "function"}, 2482 | {"inputs": [{"internalType": "uint256", "name": "tokenId", "type": "uint256"}], "name": "getApproved", 2483 | "outputs": [{"internalType": "address", "name": "", "type": "address"}], "stateMutability": "view", 2484 | "type": "function"}, {"inputs": [{"internalType": "address", "name": "owner", "type": "address"}, 2485 | {"internalType": "address", "name": "operator", "type": "address"}], 2486 | "name": "isApprovedForAll", 2487 | "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "stateMutability": "view", 2488 | "type": "function"}, { 2489 | "inputs": [{"internalType": "string[]", "name": "chars", "type": "string[]"}, 2490 | {"internalType": "uint256", "name": "duration", "type": "uint256"}, 2491 | {"internalType": "address", "name": "whois", "type": "address"}, 2492 | {"internalType": "string", "name": "metadataURI", "type": "string"}, 2493 | {"internalType": "address", "name": "to", "type": "address"}, 2494 | {"internalType": "contract IERC20", "name": "paymentAsset", "type": "address"}], "name": "mintERC20", 2495 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "nonpayable", 2496 | "type": "function"}, {"inputs": [{"internalType": "string[]", "name": "chars", "type": "string[]"}, 2497 | {"internalType": "uint256", "name": "duration", "type": "uint256"}, 2498 | {"internalType": "address", "name": "whois", "type": "address"}, 2499 | {"internalType": "string", "name": "metadataURI", "type": "string"}, 2500 | {"internalType": "address", "name": "to", "type": "address"}], 2501 | "name": "mintNative", 2502 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], 2503 | "stateMutability": "payable", "type": "function"}, 2504 | {"inputs": [{"internalType": "string[][]", "name": "singleEmojis", "type": "string[][]"}], 2505 | "name": "mintToAuctionHouse", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, 2506 | {"inputs": [{"internalType": "bytes32", "name": "", "type": "bytes32"}], "name": "minted", 2507 | "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "stateMutability": "view", "type": "function"}, 2508 | {"inputs": [{"internalType": "bytes[]", "name": "data", "type": "bytes[]"}], "name": "multicall", 2509 | "outputs": [{"internalType": "bytes[]", "name": "results", "type": "bytes[]"}], "stateMutability": "nonpayable", 2510 | "type": "function"}, 2511 | {"inputs": [], "name": "name", "outputs": [{"internalType": "string", "name": "", "type": "string"}], 2512 | "stateMutability": "view", "type": "function"}, 2513 | {"inputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "name": "names", 2514 | "outputs": [{"internalType": "bytes32", "name": "name", "type": "bytes32"}, 2515 | {"internalType": "uint256", "name": "expiry", "type": "uint256"}, 2516 | {"internalType": "address", "name": "whois", "type": "address"}, 2517 | {"internalType": "string", "name": "metadataURI", "type": "string"}], "stateMutability": "view", 2518 | "type": "function"}, 2519 | {"inputs": [], "name": "owner", "outputs": [{"internalType": "address", "name": "", "type": "address"}], 2520 | "stateMutability": "view", "type": "function"}, 2521 | {"inputs": [{"internalType": "uint256", "name": "tokenId", "type": "uint256"}], "name": "ownerOf", 2522 | "outputs": [{"internalType": "address", "name": "", "type": "address"}], "stateMutability": "view", 2523 | "type": "function"}, 2524 | {"inputs": [], "name": "paused", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], 2525 | "stateMutability": "view", "type": "function"}, 2526 | {"inputs": [], "name": "pendingOwner", "outputs": [{"internalType": "address", "name": "", "type": "address"}], 2527 | "stateMutability": "view", "type": "function"}, {"inputs": [], "name": "priceOracle", "outputs": [ 2528 | {"internalType": "contract IPriceOracle", "name": "", "type": "address"}], "stateMutability": "view", 2529 | "type": "function"}, { 2530 | "inputs": [{"internalType": "string[]", "name": "chars", "type": "string[]"}, 2531 | {"internalType": "uint256", "name": "duration", "type": "uint256"}, 2532 | {"internalType": "contract IERC20", "name": "paymentAsset", "type": "address"}], 2533 | "name": "renewERC20", "outputs": [], "stateMutability": "payable", "type": "function"}, { 2534 | "inputs": [{"internalType": "string[]", "name": "chars", "type": "string[]"}, 2535 | {"internalType": "uint256", "name": "duration", "type": "uint256"}], "name": "renewNative", 2536 | "outputs": [], "stateMutability": "payable", "type": "function"}, 2537 | {"inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 2538 | "inputs": [{"internalType": "address", "name": "from", "type": "address"}, 2539 | {"internalType": "address", "name": "to", "type": "address"}, 2540 | {"internalType": "uint256", "name": "tokenId", "type": "uint256"}], "name": "safeTransferFrom", 2541 | "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 2542 | "inputs": [{"internalType": "address", "name": "from", "type": "address"}, 2543 | {"internalType": "address", "name": "to", "type": "address"}, 2544 | {"internalType": "uint256", "name": "tokenId", "type": "uint256"}, 2545 | {"internalType": "bytes", "name": "data", "type": "bytes"}], "name": "safeTransferFrom", 2546 | "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 2547 | "inputs": [{"internalType": "address", "name": "operator", "type": "address"}, 2548 | {"internalType": "bool", "name": "approved", "type": "bool"}], "name": "setApprovalForAll", 2549 | "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 2550 | "inputs": [{"internalType": "address[]", "name": "accounts", "type": "address[]"}, 2551 | {"internalType": "bool", "name": "status", "type": "bool"}], "name": "setWhitelisted", "outputs": [], 2552 | "stateMutability": "nonpayable", "type": "function"}, 2553 | {"inputs": [{"internalType": "bytes4", "name": "interfaceId", "type": "bytes4"}], "name": "supportsInterface", 2554 | "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], "stateMutability": "view", "type": "function"}, 2555 | {"inputs": [], "name": "symbol", "outputs": [{"internalType": "string", "name": "", "type": "string"}], 2556 | "stateMutability": "view", "type": "function"}, 2557 | {"inputs": [], "name": "togglePause", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, 2558 | {"inputs": [{"internalType": "uint256", "name": "index", "type": "uint256"}], "name": "tokenByIndex", 2559 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", 2560 | "type": "function"}, {"inputs": [{"internalType": "address", "name": "owner", "type": "address"}, 2561 | {"internalType": "uint256", "name": "index", "type": "uint256"}], 2562 | "name": "tokenOfOwnerByIndex", 2563 | "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], 2564 | "stateMutability": "view", "type": "function"}, 2565 | {"inputs": [{"internalType": "uint256", "name": "id", "type": "uint256"}], "name": "tokenURI", 2566 | "outputs": [{"internalType": "string", "name": "", "type": "string"}], "stateMutability": "view", 2567 | "type": "function"}, 2568 | {"inputs": [], "name": "totalSupply", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], 2569 | "stateMutability": "view", "type": "function"}, { 2570 | "inputs": [{"internalType": "address", "name": "from", "type": "address"}, 2571 | {"internalType": "address", "name": "to", "type": "address"}, 2572 | {"internalType": "uint256", "name": "tokenId", "type": "uint256"}], "name": "transferFrom", 2573 | "outputs": [], "stateMutability": "nonpayable", "type": "function"}, 2574 | {"inputs": [{"internalType": "address", "name": "newOwner", "type": "address"}], "name": "transferOwnership", 2575 | "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 2576 | "inputs": [{"internalType": "uint256", "name": "id", "type": "uint256"}, 2577 | {"internalType": "string", "name": "metadataURI_", "type": "string"}], "name": "updateMetadataURI", 2578 | "outputs": [], "stateMutability": "nonpayable", "type": "function"}, { 2579 | "inputs": [{"internalType": "uint256", "name": "id", "type": "uint256"}, 2580 | {"internalType": "address", "name": "aka", "type": "address"}], "name": "updateWhois", "outputs": [], 2581 | "stateMutability": "nonpayable", "type": "function"}, 2582 | {"inputs": [], "name": "whitelistEnabled", "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], 2583 | "stateMutability": "view", "type": "function"}] 2584 | --------------------------------------------------------------------------------