diff --git a/README.md b/README.md index d0fb025..168b696 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,25 @@ +
+ +

Run Scroll Swaps Script

+

This software automates swap farming on the Scroll network, providing access to a CLI script that exposes a highly-customizable automated swaping system with randomization.

+
+ + +Authors: John Reyes; OxBlackfish + +Heavily adapted from Scroll Soft by https://t.me/sybilwave + +--- + +

🚀 Installation

+ +``` +# clone with https +git clone https://github.com/napindic/base + +# or clone with ssh +git clone git@github.com:napindc/base.git +=======

Base Soft

📍 Данный скрипт облегчает работу с фермой для Base @@ -10,12 +32,325 @@

🚀 Запуск

``` + git clone https://github.com/czbag/base.git cd base pip install -r requirements.txt +~/scroll$ python run_swaps.py --wallets WALLET_KEY1 WALLET_KEY2 WALLET_KEYN + +``` +--- +

🚨 Features

+ +* emables running automated trades on multiple websites as a single python command +* accepts a single or multiple wallet private keys to perform swaps +* uses a dynamically randomizing schedule to execute trades and recycle wallets +* easily configurable - command line arguments expose the abilty to change the randomization schedules, amount to swap, and token to swap +* automatically cycles between swapping from ETH to USDC and then back from USDC to ETH + +--- + + +--- +

⚙️ Settings

+ +1) All setting are set at the command line, they can be shown again with the command: +``` + +$ python run_swaps.py -h + +``` + +Note: the script has reasonable defaults + +2) The rpc.json file at the path domain/data/rpc.json we can change the rpc to a personal or private rpc + +--- +

Default Settings

+ +By default this script will execute the following: + +* 4 swaps per cycle on Skydrome, Zebra, SyncSwap, and XYSwap +* Randomize execution with between 5-20 minutes between websites, 20-30 minutes between wallets, and a random number of minutes less than 90 after 12 hours before recycle the wallets in the reverse direction +* starts swapping from USDC to ETH before reversing after the first cycle and waits complete + +--- +

Settings in detail

+ +

-h, --help

+

show this help message and exit

+

--websites WEBSITES

+

The transaction types at the website you want to perform from the available actions

+

-l, --list

+

List all available actions

+

-R, --random

+

Use wallets in a random order

+ +

Wallets:

+

--wallet WALLET

+

The wallet you want to use

+

--wallets WALLETS

+

The wallets you want to use

+

Wait Between Wallets:

+

--wait-between-wallets-max-seconds WAIT_BETWEEN_WALLETS_MAX_SECONDS

+

The maximum time in seconds to wait between wallets default: 1800 seconds (30 minutes)

+

--wait-between-wallets-min-seconds WAIT_BETWEEN_WALLETS_MIN_SECONDS

+

The minimum time in seconds to wait between wallets default: 1200 seconds (20 minutes)

+

Wait Between Websites:

+

--wait-between-websites-max-seconds WAIT_BETWEEN_WEBSITES_MAX_SECONDS

+

The maximum time in seconds to wait between websites default: 1200 seconds (20 minutes)

+

--wait-between-websites-min-seconds WAIT_BETWEEN_WEBSITES_MIN_SECONDS

+

The minimum time in seconds to wait between websites default: 300 seconds (5 minutes)

+

Wait Between Cycles:

+

--wait-between-cycles-max-seconds WAIT_BETWEEN_CYCLES_MAX_SECONDS

+

The maximum time in seconds to wait between cycles default: 48600 (12 hours and 90 minutes)

+

--wait-between-cycles-min-seconds WAIT_BETWEEN_CYCLES_MIN_SECONDS

+

The minimum time in seconds to wait between cycles default: 43500 (12 hours and 5 minutes)

+ +

Swap SyncSwap Settings:

+

--syncswap-from-token SYNCSWAP_FROM_TOKEN

+

The token you want to swap from

+

--syncswap-to-token SYNCSWAP_TO_TOKEN

+

The token you want to swap to

+

--syncswap-min-amount SYNCSWAP_MIN_AMOUNT

+

The amount of the token you want to swap

+

--syncswap-max-amount SYNCSWAP_MAX_AMOUNT

+

The amount of the token you want to swap

+

--syncswap-decimal SYNCSWAP_DECIMAL

+

The decimal of the token you want to swap

+

--syncswap-slippage SYNCSWAP_SLIPPAGE

+

The slippage of the token you want to swap

+

--syncswap-all-amount SYNCSWAP_ALL_AMOUNT

+

Swap all the amount of the token you want to swap

+

--syncswap-min-percent SYNCSWAP_MIN_PERCENT

+

The minimum percent of the token you want to swap

+

--syncswap-max-percent SYNCSWAP_MAX_PERCENT

+

The maximum percent of the token you want to swap

+

+======= +python main.py +``` + +--- + +

🚨 Возможности

+ +1. Депозит и вывод ETH через официальный мост + +2. Бридж через Orbiter + +3. Врап/анврап ETH + +4. Свапы через Uniswap, PancakeSwap, Woofi, Baseswap, AlienSwap, Maverick, Odos, 1inch, Xy.Finance, OpenOcean (для агрегаторов включена рефка, 1% от суммы транзы идет мне, приходят не с вашего кошелька, а с контракта агрегатора, можно вырубить в конфиге) + +5. Bungee Refuel + +6. Aave (депозит/вывод) + +7. Минт free NFT на Mint.Fun (работает с функцией контракта "mint", другие не прокатят, смотрите в Rabby или в эксплорере) + +8. Mint + Brdige NFT через L2Telegraph (только в arb nova) + +9. Отправка месседжей через L2Telegraph (только в arb nova) + +10. Слив токенов в ETH + +11. Возможность мультисвапов - совершает указанное количество обменов в указанных дексах + +12. Кастомные роуты - действия которые будут выполняться последовательно, либо в рандомном порядке + +13. Чекер количества транз + +--- + +

⚙️ Настройка

+ +1. Все основные настройки производятся в файле settings.py, внутри присутствует информация, что и где писать + +2. В файле accounts.txt указываем свои приватные ключи + +3. В файле rpc.json по пути data/rpc.json можем менять rpc на свои + +Инфа по апдейтам да и просто лайф блог –– https://t.me/sybilwave + + + +
+ +

Run Scroll Swaps Script

+

This software automates swap farming on the Scroll network, providing access to a CLI script that exposes a highly-customizable automated swaping system with randomization.

+
+ +--- + +Authors: John Reyes; OxBlackfish + +Heavily adapted from Scroll Soft by https://t.me/sybilwave + +--- +

🚀 Installation

+ +``` +# clone with https +git clone https://github.com/napindic/scroll + +# or clone with ssh +git clone git@github.com:napindc/scroll.git + +cd scroll + +pip install -r requirements.txt + +~/scroll$ python run_swaps.py --wallet_file json file that contains keys +``` +--- +

🚨 Features

+ +* emables running automated trades on multiple websites as a single python command +* accepts a single or multiple wallet private keys to perform swaps +* uses a dynamically randomizing schedule to execute trades and recycle wallets +* easily configurable - command line arguments expose the abilty to change the randomization schedules, amount to swap, and token to swap +* automatically cycles between swapping from ETH to USDC and then back from USDC to ETH + +--- + + +--- +

⚙️ Settings

+ +1) All setting are set at the command line, they can be shown again with the command: +``` +$ python run_swaps.py -h +``` + +Note: the script has reasonable defaults + +2) The rpc.json file at the path domain/data/rpc.json we can change the rpc to a personal or private rpc + +--- +

Default Settings

+ +By default this script will execute the following: + +* 4 swaps per cycle on Skydrome, Zebra, SyncSwap, and XYSwap +* Randomize execution with between 5-20 minutes between websites, 20-30 minutes between wallets, and a random number of minutes less than 90 after 12 hours before recycle the wallets in the reverse direction +* starts swapping from USDC to ETH before reversing after the first cycle and waits complete + +--- +

Settings in detail

+ +

-h, --help

+

show this help message and exit

+

--websites WEBSITES

+

The transaction types at the website you want to perform from the available actions

+

-l, --list

+

List all available actions

+

-R, --random

+

Use wallets in a random order

+ +

Wallets:

+

--wallet WALLET

+

The wallet you want to use

+

--wallets WALLETS

+

The wallets you want to use

+

Wait Between Wallets:

+

--wait-between-wallets-max-seconds WAIT_BETWEEN_WALLETS_MAX_SECONDS

+

The maximum time in seconds to wait between wallets default: 1800 seconds (30 minutes)

+

--wait-between-wallets-min-seconds WAIT_BETWEEN_WALLETS_MIN_SECONDS

+

The minimum time in seconds to wait between wallets default: 1200 seconds (20 minutes)

+

Wait Between Websites:

+

--wait-between-websites-max-seconds WAIT_BETWEEN_WEBSITES_MAX_SECONDS

+

The maximum time in seconds to wait between websites default: 1200 seconds (20 minutes)

+

--wait-between-websites-min-seconds WAIT_BETWEEN_WEBSITES_MIN_SECONDS

+

The minimum time in seconds to wait between websites default: 300 seconds (5 minutes)

+

Wait Between Cycles:

+

--wait-between-cycles-max-seconds WAIT_BETWEEN_CYCLES_MAX_SECONDS

+

The maximum time in seconds to wait between cycles default: 48600 (12 hours and 90 minutes)

+

--wait-between-cycles-min-seconds WAIT_BETWEEN_CYCLES_MIN_SECONDS

+

The minimum time in seconds to wait between cycles default: 43500 (12 hours and 5 minutes)

+

Swap Skydrome Settings:

+

--skydrome-from-token SKYDROME_FROM_TOKEN

+

The token you want to swap from

+

--skydrome-to-token SKYDROME_TO_TOKEN

+

The token you want to swap to

+

--skydrome-min-amount SKYDROME_MIN_AMOUNT

+

The amount of the token you want to swap

+

--skydrome-max-amount SKYDROME_MAX_AMOUNT

+

The amount of the token you want to swap

+

--skydrome-decimal SKYDROME_DECIMAL

+

The decimal of the token you want to swap

+

--skydrome-slippage SKYDROME_SLIPPAGE

+

The slippage of the token you want to swap

+

--skydrome-all-amount SKYDROME_ALL_AMOUNT

+

Swap all the amount of the token you want to swap

+

--skydrome-min-percent SKYDROME_MIN_PERCENT

+

The minimum percent of the token you want to swap

+

--skydrome-max-percent SKYDROME_MAX_PERCENT

+

The maximum percent of the token you want to swap

+

+

Swap Zebra Settings:

+

--zebra-from-token ZEBRA_FROM_TOKEN

+

The token you want to swap from

+

--zebra-to-token ZEBRA_TO_TOKEN

+

The token you want to swap to

+

--zebra-min-amount ZEBRA_MIN_AMOUNT

+

The amount of the token you want to swap

+

--zebra-max-amount ZEBRA_MAX_AMOUNT

+

The amount of the token you want to swap

+

--zebra-decimal ZEBRA_DECIMAL

+

The decimal of the token you want to swap

+

--zebra-slippage ZEBRA_SLIPPAGE

+

The slippage of the token you want to swap

+

--zebra-all-amount ZEBRA_ALL_AMOUNT

+

Swap all the amount of the token you want to swap

+

--zebra-min-percent ZEBRA_MIN_PERCENT

+

The minimum percent of the token you want to swap

+

--zebra-max-percent ZEBRA_MAX_PERCENT

+

The maximum percent of the token you want to swap

+

+

Swap SyncSwap Settings:

+

--syncswap-from-token SYNCSWAP_FROM_TOKEN

+

The token you want to swap from

+

--syncswap-to-token SYNCSWAP_TO_TOKEN

+

The token you want to swap to

+

--syncswap-min-amount SYNCSWAP_MIN_AMOUNT

+

The amount of the token you want to swap

+

--syncswap-max-amount SYNCSWAP_MAX_AMOUNT

+

The amount of the token you want to swap

+

--syncswap-decimal SYNCSWAP_DECIMAL

+

The decimal of the token you want to swap

+

--syncswap-slippage SYNCSWAP_SLIPPAGE

+

The slippage of the token you want to swap

+

--syncswap-all-amount SYNCSWAP_ALL_AMOUNT

+

Swap all the amount of the token you want to swap

+

--syncswap-min-percent SYNCSWAP_MIN_PERCENT

+

The minimum percent of the token you want to swap

+

--syncswap-max-percent SYNCSWAP_MAX_PERCENT

+

The maximum percent of the token you want to swap

+

+

Swap XYSwap Settings:

+

--xyswap-from-token XYSWAP_FROM_TOKEN

+

The token you want to swap from

+

--xyswap-to-token XYSWAP_TO_TOKEN

+

The token you want to swap to

+

--xyswap-min-amount XYSWAP_MIN_AMOUNT

+

The amount of the token you want to swap

+

--xyswap-max-amount XYSWAP_MAX_AMOUNT

+

The amount of the token you want to swap

+

--xyswap-decimal XYSWAP_DECIMAL

+

The decimal of the token you want to swap

+

--xyswap-slippage XYSWAP_SLIPPAGE

+

The slippage of the token you want to swap

+

--xyswap-all-amount XYSWAP_ALL_AMOUNT

+

Swap all the amount of the token you want to swap

+

--xyswap-min-percent XYSWAP_MIN_PERCENT

+

The minimum percent of the token you want to swap

+

--xyswap-max-percent XYSWAP_MAX_PERCENT

+

The maximum percent of the token you want to swap

+======= python main.py ``` --- diff --git a/README_refactor.md b/README_refactor.md new file mode 100644 index 0000000..dd97738 --- /dev/null +++ b/README_refactor.md @@ -0,0 +1,37 @@ +## Description + +This pull request introduces significant enhancements to the existing functionality, enabling automated trades across multiple websites using a single Python command. The key features include: + +Unified Command: Users can now execute automated trades across multiple websites with a single Python command. + +Support for Multiple Wallets: The system now accepts one or multiple wallet private keys for performing swaps, offering enhanced flexibility to users. + +Dynamic Randomization Schedule: Trades are executed using a dynamically randomizing schedule, contributing to improved security and efficiency. + +Configurability: Command-line arguments have been exposed to facilitate easy configuration, allowing users to customize randomization schedules, swap amounts, and tokens. + +Cycle Functionality: The system automatically cycles between swapping from ETH to USDC and back, optimizing trading processes. + +## Changes Made +Implemented run_swaps.py to enable executing automated trades across multiple websites. + +Added support for accepting one or multiple wallet private keys for performing swaps. + +Integrated dynamic randomization schedule for executing trades and recycling wallets. + +Exposed command-line arguments for configuring randomization schedules, swap amounts, and tokens. + +Implemented automatic cycling between swapping from ETH to USDC and back for optimized trading. + +## Usage +python run_swaps.py --wallets "WALLET_KEY1 WALLET_KEY2 ... WALLET_KEYN" +or +python run_swaps.py --wallet_file + +## Testing +Manual testing has been conducted to validate the behavior across different machines all using one wallet. + +## Additional Notes +Documentation has been updated to reflect the changes and provide guidance on usage. + +All new code adheres to best practices. diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..b668da9 --- /dev/null +++ b/__init__.py @@ -0,0 +1 @@ +from .main import main \ No newline at end of file diff --git a/config.py b/config.py index 71bb1a8..7687931 100644 --- a/config.py +++ b/config.py @@ -1,187 +1,129 @@ import json +import os +base_dir = os.path.dirname(os.path.abspath(__file__)) -with open('data/rpc.json') as file: +with open(os.path.join(base_dir, 'data/rpc.json')) as file: RPC = json.load(file) -with open('data/abi/erc20_abi.json') as file: +with open(os.path.join(base_dir, 'data/abi/erc20_abi.json')) as file: ERC20_ABI = json.load(file) -with open("accounts.txt", "r") as file: - ACCOUNTS = [row.strip() for row in file] +with open(os.path.join(base_dir, 'data/abi/bridge/deposit.json')) as file: + DEPOSIT_ABI = json.load(file) -with open('data/abi/base/bridge.json') as file: - BASE_BRIDGE_ABI = json.load(file) +with open(os.path.join(base_dir, 'data/abi/bridge/withdraw.json')) as file: + WITHDRAW_ABI = json.load(file) -with open('data/abi/base/weth.json') as file: - WETH_ABI = json.load(file) - -with open("data/abi/uniswap/router.json", "r") as file: - UNISWAP_ROUTER_ABI = json.load(file) - -with open("data/abi/pancake/factory.json", "r") as file: - UNISWAP_FACTORY_ABI = json.load(file) - -with open("data/abi/uniswap/quoter.json", "r") as file: - UNISWAP_QUOTER_ABI = json.load(file) - -with open("data/abi/pancake/router.json", "r") as file: - PANCAKE_ROUTER_ABI = json.load(file) - -with open("data/abi/pancake/factory.json", "r") as file: - PANCAKE_FACTORY_ABI = json.load(file) - -with open("data/abi/pancake/quoter.json", "r") as file: - PANCAKE_QUOTER_ABI = json.load(file) - -with open("data/abi/woofi/router.json", "r") as file: - WOOFI_ROUTER_ABI = json.load(file) +with open(os.path.join(base_dir, 'data/abi/bridge/oracle.json')) as file: + ORACLE_ABI = json.load(file) -with open("data/abi/baseswap/router.json", "r") as file: - BASESWAP_ROUTER_ABI = json.load(file) - -with open("data/abi/alien/abi.json", "r") as file: - ALIEN_ROUTER_ABI = json.load(file) +with open(os.path.join(base_dir, 'data/abi/scroll/weth.json')) as file: + WETH_ABI = json.load(file) -with open("data/abi/maverick/position.json", "r") as file: - MAVERICK_POSITION_ABI = json.load(file) +with open(os.path.join(base_dir, 'data/abi/syncswap/router.json'), "r") as file: + SYNCSWAP_ROUTER_ABI = json.load(file) -with open("data/abi/maverick/router.json", "r") as file: - MAVERICK_ROUTER_ABI = json.load(file) +with open(os.path.join(base_dir, 'data/abi/syncswap/classic_pool.json')) as file: + SYNCSWAP_CLASSIC_POOL_ABI = json.load(file) -with open("data/abi/bungee/abi.json", "r") as file: - BUNGEE_ABI = json.load(file) +with open(os.path.join(base_dir, 'data/abi/syncswap/classic_pool_data.json')) as file: + SYNCSWAP_CLASSIC_POOL_DATA_ABI = json.load(file) -with open("data/abi/stargate/bridge.json", "r") as file: - STARGATE_BRIDGE_ABI = json.load(file) +with open(os.path.join(base_dir, 'data/abi/skydrome/abi.json'), "r") as file: + SKYDROME_ROUTER_ABI = json.load(file) -with open("data/abi/stargate/router.json", "r") as file: - STARGATE_ROUTER_ABI = json.load(file) +with open(os.path.join(base_dir, 'data/abi/zebra/abi.json'), "r") as file: + ZEBRA_ROUTER_ABI = json.load(file) -with open("data/abi/aave/abi.json", "r") as file: +with open(os.path.join(base_dir, 'data/abi/aave/abi.json'), "r") as file: AAVE_ABI = json.load(file) -with open("data/abi/moonwell/abi.json", "r") as file: - MOONWELL_ABI = json.load(file) +with open(os.path.join(base_dir, 'data/abi/layerbank/abi.json'), "r") as file: + LAYERBANK_ABI = json.load(file) + +with open(os.path.join(base_dir, 'data/abi/zerius/abi.json'), "r") as file: + ZERIUS_ABI = json.load(file) -with open("data/abi/l2telegraph/send_message.json", "r") as file: - L2TELEGRAPH_MESSAGE_ABI = json.load(file) +with open(os.path.join(base_dir, 'data/abi/l2pass/abi.json'), "r") as file: + L2PASS_ABI = json.load(file) -with open("data/abi/l2telegraph/bridge_nft.json", "r") as file: - L2TELEGRAPH_NFT_ABI = json.load(file) +with open(os.path.join(base_dir, 'data/abi/dmail/abi.json'), "r") as file: + DMAIL_ABI = json.load(file) -with open("data/abi/mintfun/abi.json", "r") as file: - MINTFUN_ABI = json.load(file) +with open(os.path.join(base_dir, 'data/abi/omnisea/abi.json'), "r") as file: + OMNISEA_ABI = json.load(file) -with open("data/abi/rai/abi.json", "r") as file: - RAI_ABI = json.load(file) +with open(os.path.join(base_dir, 'data/abi/nft2me/abi.json'), "r") as file: + NFTS2ME_ABI = json.load(file) -with open("data/abi/gnosis/abi.json", "r") as file: +with open(os.path.join(base_dir, 'data/abi/gnosis/abi.json'), "r") as file: SAFE_ABI = json.load(file) -with open("data/abi/zerius/abi.json", "r") as file: - ZERIUS_ABI = json.load(file) - -with open("data/abi/nft2me/abi.json", "r") as file: - NFTS2ME_ABI = json.load(file) +with open(os.path.join(base_dir, 'data/deploy/abi.json'), "r") as file: + DEPLOYER_ABI = json.load(file) -with open("data/abi/dmail/abi.json", "r") as file: - DMAIL_ABI = json.load(file) +with open(os.path.join(base_dir, 'data/deploy/bytecode.txt'), "r") as file: + DEPLOYER_BYTECODE = file.read() -with open("data/abi/zkstars/abi.json", "r") as file: +with open(os.path.join(base_dir, 'data/abi/zkstars/abi.json'), "r") as file: ZKSTARS_ABI = json.load(file) -with open("data/abi/rocketsam/abi.json", "r") as file: - ROCKETSAM_ABI = json.load(file) +with open(os.path.join(base_dir, 'data/abi/rubyscore/abi.json'), "r") as file: + RUBYSCORE_VOTE_ABI = json.load(file) ZERO_ADDRESS = "0x0000000000000000000000000000000000000000" -BASE_BRIDGE_CONTRACT = "0x49048044D57e1C92A77f79988d21Fa8fAF74E97e" - -ORBITER_CONTRACT = "" - -BASE_TOKENS = { - "ETH": "0x4200000000000000000000000000000000000006", - "WETH": "0x4200000000000000000000000000000000000006", - "USDBC": "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA", - "USDC": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", - "DAI": "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb", -} - -UNISWAP_CONTRACTS = { - "router": "0x2626664c2603336E57B271c5C0b26F421741e481", - "factory": "0x33128a8fC17869897dcE68Ed026d694621f6FDfD", - "quoter": "0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a", -} - -PANCAKE_CONTRACTS = { - "router": "0x678Aa4bF4E210cf2166753e054d5b7c31cc7fa86", - "factory": "0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865", - "quoter": "0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997" +BRIDGE_CONTRACTS = { + "deposit": "0xf8b1378579659d8f7ee5f3c929c2f3e332e41fd6", + "withdraw": "0x4C0926FF5252A435FD19e10ED15e5a249Ba19d79", + "oracle": "0x987e300fDfb06093859358522a79098848C33852" } -WOOFI_CONTRACTS = { - "router": "0x27425e9fb6a9a625e8484cfd9620851d1fa322e5" -} +ORBITER_CONTRACT = "0x80c67432656d59144ceff962e8faf8926599bcf8" -BASESWAP_CONTRACTS = { - "router": "0x327Df1E6de05895d2ab08513aaDD9313Fe505d86" +SCROLL_TOKENS = { + "ETH": "0x5300000000000000000000000000000000000004", + "WETH": "0x5300000000000000000000000000000000000004", + "USDC": "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4" } -ALIEN_CONTRACTS = { - "router": "0x8c1a3cf8f83074169fe5d7ad50b978e1cd6b37c7" +SYNCSWAP_CONTRACTS = { + "router": "0x80e38291e06339d10aab483c65695d004dbd5c69", + "classic_pool": "0x37BAc764494c8db4e54BDE72f6965beA9fa0AC2d" } -ODOS_CONTRACT = { - "router": "0x19ceead7105607cd444f5ad10dd51356436095a1", - "use_ref": True # If you use True, you support me 1% of the transaction amount +SKYDROME_CONTRACTS = { + "router": "0xAA111C62cDEEf205f70E6722D1E22274274ec12F" } -INCH_CONTRACT = { - "router": "0x1111111254eeb25477b68fb85ed929f73a960582", - "use_ref": True # If you use True, you support me 1% of the transaction amount +ZEBRA_CONTRACTS = { + "router": "0x0122960d6e391478bfe8fb2408ba412d5600f621" } -OPENOCEAN_CONTRACT = { - "router": "0x6352a56caadc4f1e25cd6c75970fa768a3304e64", - "use_ref": True # If you use True, you support me 1% of the transaction amount +AMBIENT_CONTRACTS = { + "router": "0xaaaaaaaacb71bf2c8cae522ea5fa455571a74106", + "impact": "0xc2c301759B5e0C385a38e678014868A33E2F3ae3" } XYSWAP_CONTRACT = { - "router": "0x6acd0ec9405ccb701c57a88849c4f1cd85a3f3ab", - "use_ref": True # If you use True, you support me 1% of the transaction amount -} - -MAVERICK_CONTRACTS = { - "router": "0x32AED3Bce901DA12ca8489788F3A99fCe1056e14", - "pool": "0x06e6736ca9e922766279a22b75a600fe8b8473b6", - "pool_information": "0x6E230D0e457Ea2398FB3A22FB7f9B7F68F06a14d", -} - -BUNGEE_CONTRACT = "0xe8c5b8488feafb5df316be73ede3bdc26571a773" - -STARGATE_CONTRACTS = { - "router": "0xAF54BE5B6eEc24d6BFACf1cce4eaF680A8239398", - "bridge": "0x50b6ebc2103bfec165949cc946d739d5650d7ae4" + "router": "0x22bf2a9fcaab9dc96526097318f459ef74277042", + "use_ref": False # If you use True, you support me 1% of the transaction amount } -AAVE_CONTRACT = "0x18cd499e3d7ed42feba981ac9236a278e4cdc2ee" - -AAVE_WETH_CONTRACT = "0xD4a0e0b9149BCee3C920d2E00b5dE09138fd8bb7" - -MOONWELL_CONTRACT = "0x70778cfcFC475c7eA0f24cC625Baf6EaE475D0c9" +AAVE_CONTRACT = "0xff75a4b698e3ec95e608ac0f22a03b8368e05f5d" -MOONWELL_WETH_CONTRACT = "0x628ff693426583D9a7FB391E54366292F509D457" +AAVE_WETH_CONTRACT = "0xf301805be1df81102c957f6d4ce29d2b8c056b2a" -MINTFUN_CONTRACT = "0xf39ac57beaf8f97b89db7a9203a4e47c17cf4391" +LAYERBANK_CONTRACT = "0xec53c830f4444a8a56455c6836b5d2aa794289aa" -L2TELEGRAPH_MESSAGE_CONTRACT = "0x64e0f6164ac110b67df9a4848707ffbcb86c87a9" +LAYERBANK_WETH_CONTRACT = "0x274C3795dadfEbf562932992bF241ae087e0a98C" -L2TELEGRAPH_NFT_CONTRACT = "0x36a358b3ba1fb368e35b71ea40c7f4ab89bfd8e1" +ZERIUS_CONTRACT = "0xeb22c3e221080ead305cae5f37f0753970d973cd" -RAI_CONTRACT = "0xbc097e42bf1e6531c32c5cee945e0c014fa21964" +DMAIL_CONTRACT = "0x47fbe95e981c0df9737b6971b451fb15fdc989d9" -SAFE_CONTRACT = "0xc22834581ebc8527d974f8a1c97e1bea4ef910bc" +OMNISEA_CONTRACT = "0x46ce46951d12710d85bc4fe10bb29c6ea5012077" -ZERIUS_CONTRACT = "0x178608ffe2cca5d36f3fc6e69426c4d3a5a74a41" +SAFE_CONTRACT = "0xa6b71e26c5e0845f74c812102ca7114b6a896ab2" -DMAIL_CONTRACT = "0x47fbe95e981C0Df9737B6971B451fB15fdC989d9" +RUBYSCORE_VOTE_CONTRACT = "0xe10Add2ad591A7AC3CA46788a06290De017b9fB4" diff --git a/data/abi/aave/abi.json b/data/abi/aave/abi.json index 6e218c2..1a19787 100644 --- a/data/abi/aave/abi.json +++ b/data/abi/aave/abi.json @@ -1 +1,148 @@ -[{"inputs":[{"internalType":"address","name":"weth","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"contract IPool","name":"pool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"interestRateMode","type":"uint256"},{"internalType":"uint16","name":"referralCode","type":"uint16"}],"name":"borrowETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"onBehalfOf","type":"address"},{"internalType":"uint16","name":"referralCode","type":"uint16"}],"name":"depositETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"emergencyEtherTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"emergencyTokenTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getWETHAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rateMode","type":"uint256"},{"internalType":"address","name":"onBehalfOf","type":"address"}],"name":"repayETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"withdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"permitV","type":"uint8"},{"internalType":"bytes32","name":"permitR","type":"bytes32"},{"internalType":"bytes32","name":"permitS","type":"bytes32"}],"name":"withdrawETHWithPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}] \ No newline at end of file +[ + { + "inputs": [ + { "internalType": "address", "name": "weth", "type": "address" }, + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "contract IPool", "name": "pool", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { "stateMutability": "payable", "type": "fallback" }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "borrowETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "depositETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "emergencyEtherTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "token", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "emergencyTokenTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getWETHAddress", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "rateMode", "type": "uint256" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" } + ], + "name": "repayETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "to", "type": "address" } + ], + "name": "withdrawETH", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "permitV", "type": "uint8" }, + { "internalType": "bytes32", "name": "permitR", "type": "bytes32" }, + { "internalType": "bytes32", "name": "permitS", "type": "bytes32" } + ], + "name": "withdrawETHWithPermit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "stateMutability": "payable", "type": "receive" } +] diff --git a/data/abi/bridge/deposit.json b/data/abi/bridge/deposit.json new file mode 100644 index 0000000..ffa8d1a --- /dev/null +++ b/data/abi/bridge/deposit.json @@ -0,0 +1,511 @@ +[ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "DepositERC20", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "DepositETH", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "FinalizeWithdrawERC20", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "FinalizeWithdrawETH", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "RefundERC20", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "RefundETH", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldDefaultERC20Gateway", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newDefaultERC20Gateway", + "type": "address" + } + ], + "name": "SetDefaultERC20Gateway", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldGateway", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newGateway", + "type": "address" + } + ], + "name": "SetERC20Gateway", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldETHGateway", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newEthGateway", + "type": "address" + } + ], + "name": "SetETHGateway", + "type": "event" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "ERC20Gateway", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "defaultERC20Gateway", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_token", "type": "address" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { "internalType": "uint256", "name": "_gasLimit", "type": "uint256" } + ], + "name": "depositERC20", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_token", "type": "address" }, + { "internalType": "address", "name": "_to", "type": "address" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { "internalType": "uint256", "name": "_gasLimit", "type": "uint256" } + ], + "name": "depositERC20", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_token", "type": "address" }, + { "internalType": "address", "name": "_to", "type": "address" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { "internalType": "bytes", "name": "_data", "type": "bytes" }, + { "internalType": "uint256", "name": "_gasLimit", "type": "uint256" } + ], + "name": "depositERC20AndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { "internalType": "uint256", "name": "_gasLimit", "type": "uint256" } + ], + "name": "depositETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_to", "type": "address" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { "internalType": "uint256", "name": "_gasLimit", "type": "uint256" } + ], + "name": "depositETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_to", "type": "address" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { "internalType": "bytes", "name": "_data", "type": "bytes" }, + { "internalType": "uint256", "name": "_gasLimit", "type": "uint256" } + ], + "name": "depositETHAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "ethGateway", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "bytes", "name": "", "type": "bytes" } + ], + "name": "finalizeWithdrawERC20", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "bytes", "name": "", "type": "bytes" } + ], + "name": "finalizeWithdrawETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "gatewayInContext", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_token", "type": "address" } + ], + "name": "getERC20Gateway", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_l1Address", "type": "address" } + ], + "name": "getL2ERC20Address", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_ethGateway", "type": "address" }, + { + "internalType": "address", + "name": "_defaultERC20Gateway", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_sender", "type": "address" }, + { "internalType": "address", "name": "_token", "type": "address" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" } + ], + "name": "requestERC20", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newDefaultERC20Gateway", + "type": "address" + } + ], + "name": "setDefaultERC20Gateway", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "_tokens", "type": "address[]" }, + { "internalType": "address[]", "name": "_gateways", "type": "address[]" } + ], + "name": "setERC20Gateway", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_newEthGateway", "type": "address" } + ], + "name": "setETHGateway", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/data/abi/bridge/oracle.json b/data/abi/bridge/oracle.json new file mode 100644 index 0000000..d8c88a2 --- /dev/null +++ b/data/abi/bridge/oracle.json @@ -0,0 +1,315 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "txGas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "txGasContractCreation", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "zeroGas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonZeroGas", + "type": "uint256" + } + ], + "name": "IntrinsicParamsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldL2BaseFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newL2BaseFee", + "type": "uint256" + } + ], + "name": "L2BaseFeeUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_oldWhitelist", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "_newWhitelist", + "type": "address" + } + ], + "name": "UpdateWhitelist", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + } + ], + "name": "calculateIntrinsicGasFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_gasLimit", + "type": "uint256" + } + ], + "name": "estimateCrossDomainMessageFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_txGas", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "_txGasContractCreation", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "_zeroGas", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "_nonZeroGas", + "type": "uint64" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "intrinsicParams", + "outputs": [ + { + "internalType": "uint64", + "name": "txGas", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "txGasContractCreation", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "zeroGas", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "nonZeroGas", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2BaseFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "_txGas", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "_txGasContractCreation", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "_zeroGas", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "_nonZeroGas", + "type": "uint64" + } + ], + "name": "setIntrinsicParams", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_newL2BaseFee", + "type": "uint256" + } + ], + "name": "setL2BaseFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newWhitelist", + "type": "address" + } + ], + "name": "updateWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "whitelist", + "outputs": [ + { + "internalType": "contract IWhitelist", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/data/abi/bridge/withdraw.json b/data/abi/bridge/withdraw.json new file mode 100644 index 0000000..e8d8e7c --- /dev/null +++ b/data/abi/bridge/withdraw.json @@ -0,0 +1,666 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "FinalizeDepositERC20", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "FinalizeDepositETH", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldDefaultERC20Gateway", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newDefaultERC20Gateway", + "type": "address" + } + ], + "name": "SetDefaultERC20Gateway", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldGateway", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newGateway", + "type": "address" + } + ], + "name": "SetERC20Gateway", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldETHGateway", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newEthGateway", + "type": "address" + } + ], + "name": "SetETHGateway", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2Token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "WithdrawERC20", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "WithdrawETH", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "ERC20Gateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "defaultERC20Gateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ethGateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "finalizeDepositERC20", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "finalizeDepositETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + } + ], + "name": "getERC20Gateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l2Address", + "type": "address" + } + ], + "name": "getL1ERC20Address", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "getL2ERC20Address", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_ethGateway", + "type": "address" + }, + { + "internalType": "address", + "name": "_defaultERC20Gateway", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newDefaultERC20Gateway", + "type": "address" + } + ], + "name": "setDefaultERC20Gateway", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "_gateways", + "type": "address[]" + } + ], + "name": "setERC20Gateway", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newEthGateway", + "type": "address" + } + ], + "name": "setETHGateway", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_gasLimit", + "type": "uint256" + } + ], + "name": "withdrawERC20", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_gasLimit", + "type": "uint256" + } + ], + "name": "withdrawERC20", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_gasLimit", + "type": "uint256" + } + ], + "name": "withdrawERC20AndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_gasLimit", + "type": "uint256" + } + ], + "name": "withdrawETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_gasLimit", + "type": "uint256" + } + ], + "name": "withdrawETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_gasLimit", + "type": "uint256" + } + ], + "name": "withdrawETHAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } +] \ No newline at end of file diff --git a/data/abi/erc20_abi.json b/data/abi/erc20_abi.json index 517a4e3..060b361 100644 --- a/data/abi/erc20_abi.json +++ b/data/abi/erc20_abi.json @@ -1 +1,172 @@ -[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint256","name":"_initialSupply","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"decimals_","type":"uint8"}],"name":"setupDecimals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file +[ + { + "inputs": [ + { "internalType": "string", "name": "_name", "type": "string" }, + { "internalType": "string", "name": "_symbol", "type": "string" }, + { "internalType": "uint256", "name": "_initialSupply", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "decimals_", "type": "uint8" } + ], + "name": "setupDecimals", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/data/abi/l2pass/abi.json b/data/abi/l2pass/abi.json new file mode 100644 index 0000000..bb183ad --- /dev/null +++ b/data/abi/l2pass/abi.json @@ -0,0 +1 @@ +[{"inputs":[{"internalType":"uint256","name":"minGasToStore","type":"uint256"},{"internalType":"uint256","name":"defaultGasLimit","type":"uint256"},{"internalType":"address","name":"layerZeroEndpoint","type":"address"},{"internalType":"uint256","name":"startMintId","type":"uint256"},{"internalType":"uint256","name":"endMintId","type":"uint256"},{"internalType":"uint256","name":"mintPrice_","type":"uint256"},{"internalType":"uint256","name":"sendPrice_","type":"uint256"},{"internalType":"uint8","name":"chainId","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"_hashedPayload","type":"bytes32"}],"name":"CreditCleared","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"_hashedPayload","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"CreditStored","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":false,"internalType":"uint64","name":"_nonce","type":"uint64"},{"indexed":false,"internalType":"bytes","name":"_payload","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"_reason","type":"bytes"}],"name":"MessageFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":true,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":true,"internalType":"address","name":"_toAddress","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"ReceiveFromChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"referrer","type":"address"},{"indexed":false,"internalType":"address","name":"referral","type":"address"}],"name":"Referral","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"indexed":false,"internalType":"uint64","name":"_nonce","type":"uint64"},{"indexed":false,"internalType":"bytes32","name":"_payloadHash","type":"bytes32"}],"name":"RetryMessageSuccess","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"bytes","name":"_toAddress","type":"bytes"},{"indexed":false,"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"SendToChain","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"_dstChainIdToBatchLimit","type":"uint256"}],"name":"SetDstChainIdToBatchLimit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"_dstChainIdToTransferGas","type":"uint256"}],"name":"SetDstChainIdToTransferGas","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"_type","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"_minDstGas","type":"uint256"}],"name":"SetMinDstGas","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_minGasToTransferAndStore","type":"uint256"}],"name":"SetMinGasToTransferAndStore","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"precrime","type":"address"}],"name":"SetPrecrime","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_path","type":"bytes"}],"name":"SetTrustedRemote","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"_remoteAddress","type":"bytes"}],"name":"SetTrustedRemoteAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"DEFAULT_PAYLOAD_SIZE_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FUNCTION_TYPE_SEND","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"clearCredits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"dstChainIdToBatchLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"dstChainIdToTransferGas","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"bool","name":"_useZro","type":"bool"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"estimateSendBatchFee","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"zroFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bool","name":"_useZro","type":"bool"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"estimateSendFee","outputs":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"zroFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"uint64","name":"","type":"uint64"}],"name":"failedMessages","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"forceResumeReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"_configType","type":"uint256"}],"name":"getConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"}],"name":"getTrustedRemoteAddress","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getVisitedChains","outputs":[{"internalType":"uint8[]","name":"visitedChains","type":"uint8[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"}],"name":"isTrustedRemote","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lzEndpoint","outputs":[{"internalType":"contract ILayerZeroEndpoint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxMintId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metadataGenerator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"name":"minDstGasLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minGasToTransferAndStore","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"n","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"n","type":"uint256"},{"internalType":"address","name":"referrer","type":"address"}],"name":"mintWithReferral","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextMintId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"nonblockingLzReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"payloadSizeLimitLookup","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"precrime","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_srcChainId","type":"uint16"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"retryMessage","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"address","name":"_zroPaymentAddress","type":"address"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"sendBatchFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"bytes","name":"_toAddress","type":"bytes"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"address","name":"_zroPaymentAddress","type":"address"},{"internalType":"bytes","name":"_adapterParams","type":"bytes"}],"name":"sendFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"sendPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"},{"internalType":"uint16","name":"_chainId","type":"uint16"},{"internalType":"uint256","name":"_configType","type":"uint256"},{"internalType":"bytes","name":"_config","type":"bytes"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint256","name":"_dstChainIdToBatchLimit","type":"uint256"}],"name":"setDstChainIdToBatchLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint256","name":"_dstChainIdToTransferGas","type":"uint256"}],"name":"setDstChainIdToTransferGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"metadataGenerator_","type":"address"}],"name":"setMetadataGenerator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint16","name":"_packetType","type":"uint16"},{"internalType":"uint256","name":"_minGas","type":"uint256"}],"name":"setMinDstGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minGasToTransferAndStore","type":"uint256"}],"name":"setMinGasToTransferAndStore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintPrice_","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint256","name":"_size","type":"uint256"}],"name":"setPayloadSizeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_precrime","type":"address"}],"name":"setPrecrime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setReceiveVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"sendPrice_","type":"uint256"}],"name":"setSendPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setSendVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"bytes","name":"_path","type":"bytes"}],"name":"setTrustedRemote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_remoteChainId","type":"uint16"},{"internalType":"bytes","name":"_remoteAddress","type":"bytes"}],"name":"setTrustedRemoteAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"storedCredits","outputs":[{"internalType":"uint16","name":"srcChainId","type":"uint16"},{"internalType":"address","name":"toAddress","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"bool","name":"creditsRemain","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"trustedRemoteLookup","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"visitedChainsMask","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}] \ No newline at end of file diff --git a/data/abi/layerbank/abi.json b/data/abi/layerbank/abi.json new file mode 100644 index 0000000..3aaf135 --- /dev/null +++ b/data/abi/layerbank/abi.json @@ -0,0 +1 @@ +[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"lToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"newBorrowCap","type":"uint256"}],"name":"BorrowCapUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newCloseFactor","type":"uint256"}],"name":"CloseFactorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"lToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"newCollateralFactor","type":"uint256"}],"name":"CollateralFactorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":true,"internalType":"address","name":"initiator","type":"address"},{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"premium","type":"uint256"}],"name":"FlashLoan","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newKeeper","type":"address"}],"name":"KeeperUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newLABDistributor","type":"address"}],"name":"LABDistributorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newLeverager","type":"address"}],"name":"LeveragerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newLiquidationIncentive","type":"uint256"}],"name":"LiquidationIncentiveUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"lToken","type":"address"},{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"MarketEntered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"lToken","type":"address"},{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"MarketExited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"lToken","type":"address"}],"name":"MarketListed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"lToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"uAmount","type":"uint256"}],"name":"MarketRedeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"lToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"uAmount","type":"uint256"}],"name":"MarketSupply","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newRebateDistributor","type":"address"}],"name":"RebateDistributorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"lToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"newSupplyCap","type":"uint256"}],"name":"SupplyCapUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newValidator","type":"address"}],"name":"ValidatorUpdated","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"accountLiquidityOf","outputs":[{"internalType":"uint256","name":"collateralInUSD","type":"uint256"},{"internalType":"uint256","name":"supplyInUSD","type":"uint256"},{"internalType":"uint256","name":"borrowInUSD","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allMarkets","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"lToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"borrow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"borrower","type":"address"},{"internalType":"address","name":"lToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"borrowBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"lToken","type":"address"}],"name":"checkMembership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimLab","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"market","type":"address"}],"name":"claimLab","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"}],"name":"claimLabBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"closeFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"lockDuration","type":"uint256"}],"name":"compoundLab","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"lTokens","type":"address[]"}],"name":"enterMarkets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"lToken","type":"address"}],"name":"exitMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_priceCalculator","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"keeper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"labDistributor","outputs":[{"internalType":"contract ILABDistributor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"leverager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"lTokenBorrowed","type":"address"},{"internalType":"address","name":"lTokenCollateral","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"liquidateBorrow","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"liquidationIncentive","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"lToken","type":"address"},{"internalType":"uint256","name":"supplyCap","type":"uint256"},{"internalType":"uint256","name":"borrowCap","type":"uint256"},{"internalType":"uint256","name":"collateralFactor","type":"uint256"}],"name":"listMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"lToken","type":"address"}],"name":"marketInfoOf","outputs":[{"components":[{"internalType":"bool","name":"isListed","type":"bool"},{"internalType":"uint256","name":"supplyCap","type":"uint256"},{"internalType":"uint256","name":"borrowCap","type":"uint256"},{"internalType":"uint256","name":"collateralFactor","type":"uint256"}],"internalType":"struct Constant.MarketInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"marketInfos","outputs":[{"internalType":"bool","name":"isListed","type":"bool"},{"internalType":"uint256","name":"supplyCap","type":"uint256"},{"internalType":"uint256","name":"borrowCap","type":"uint256"},{"internalType":"uint256","name":"collateralFactor","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"marketListOf","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"marketListOfUsers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"markets","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceCalculator","outputs":[{"internalType":"contract IPriceCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebateDistributor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"lToken","type":"address"},{"internalType":"uint256","name":"lAmount","type":"uint256"}],"name":"redeemToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"lToken","type":"address"},{"internalType":"uint256","name":"uAmount","type":"uint256"}],"name":"redeemUnderlying","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"lToken","type":"address"}],"name":"removeMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"lToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"repayBorrow","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newCloseFactor","type":"uint256"}],"name":"setCloseFactor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"lToken","type":"address"},{"internalType":"uint256","name":"newCollateralFactor","type":"uint256"}],"name":"setCollateralFactor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_keeper","type":"address"}],"name":"setKeeper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_labDistributor","type":"address"}],"name":"setLABDistributor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_leverager","type":"address"}],"name":"setLeverager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newLiquidationIncentive","type":"uint256"}],"name":"setLiquidationIncentive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"lTokens","type":"address[]"},{"internalType":"uint256[]","name":"newBorrowCaps","type":"uint256[]"}],"name":"setMarketBorrowCaps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"lTokens","type":"address[]"},{"internalType":"uint256[]","name":"newSupplyCaps","type":"uint256[]"}],"name":"setMarketSupplyCaps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_priceCalculator","type":"address"}],"name":"setPriceCalculator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rebateDistributor","type":"address"}],"name":"setRebateDistributor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_validator","type":"address"}],"name":"setValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"lToken","type":"address"},{"internalType":"uint256","name":"uAmount","type":"uint256"}],"name":"supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"supplier","type":"address"},{"internalType":"address","name":"lToken","type":"address"},{"internalType":"uint256","name":"uAmount","type":"uint256"}],"name":"supplyBehalf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"usersOfMarket","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"validator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}] \ No newline at end of file diff --git a/data/abi/nft-origins/abi.json b/data/abi/nft-origins/abi.json new file mode 100644 index 0000000..a55eb84 --- /dev/null +++ b/data/abi/nft-origins/abi.json @@ -0,0 +1,665 @@ +[ + { + "inputs": [ + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "_root", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ERC721EnumerableForbiddenBatchMint", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "ERC721IncorrectOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ERC721InsufficientApproval", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "approver", + "type": "address" + } + ], + "name": "ERC721InvalidApprover", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "ERC721InvalidOperator", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "ERC721InvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "ERC721InvalidReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ERC721InvalidSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ERC721NonexistentToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "ERC721OutOfBoundsIndex", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrancyGuardReentrantCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "StringsInsufficientHexLength", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "getApproved", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "metadata", + "outputs": [ + { + "internalType": "address", + "name": "deployer", + "type": "address" + }, + { + "internalType": "address", + "name": "firstDeployedContract", + "type": "address" + }, + { + "internalType": "address", + "name": "bestDeployedContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "rarityData", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "deployer", + "type": "address" + }, + { + "internalType": "address", + "name": "firstDeployedContract", + "type": "address" + }, + { + "internalType": "address", + "name": "bestDeployedContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "rarityData", + "type": "uint256" + } + ], + "internalType": "struct ScrollGenesisNFT.Metadata", + "name": "meta", + "type": "tuple" + }, + { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "mintData", + "outputs": [ + { + "internalType": "uint64", + "name": "mintAt", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "root", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenOfOwnerByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "tokenURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/data/abi/omnisea/abi.json b/data/abi/omnisea/abi.json new file mode 100644 index 0000000..bb002d2 --- /dev/null +++ b/data/abi/omnisea/abi.json @@ -0,0 +1,175 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "_scheduler", + "type": "address" + }, + { + "internalType": "address", + "name": "_universalONFT", + "type": "address" + }, + { + "internalType": "address", + "name": "_omniseaERC721Psi", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collection", + "type": "address" + } + ], + "name": "Created", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + }, + { + "internalType": "string", + "name": "tokensURI", + "type": "string" + }, + { + "internalType": "uint24", + "name": "maxSupply", + "type": "uint24" + }, + { + "internalType": "bool", + "name": "isZeroIndexed", + "type": "bool" + }, + { + "internalType": "uint24", + "name": "royaltyAmount", + "type": "uint24" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + } + ], + "internalType": "struct CreateParams", + "name": "_params", + "type": "tuple" + } + ], + "name": "create", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "drops", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "omniseaERC721Psi", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "scheduler", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "manager_", + "type": "address" + } + ], + "name": "setManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "universalONFT", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/data/abi/rubyscore/abi.json b/data/abi/rubyscore/abi.json new file mode 100644 index 0000000..efe676e --- /dev/null +++ b/data/abi/rubyscore/abi.json @@ -0,0 +1,13 @@ +[ + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "vote", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } +] \ No newline at end of file diff --git a/data/abi/scroll/weth.json b/data/abi/scroll/weth.json new file mode 100644 index 0000000..33f62f2 --- /dev/null +++ b/data/abi/scroll/weth.json @@ -0,0 +1,643 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "BridgeBurn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "l1Token", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + } + ], + "name": "BridgeInitialize", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "BridgeMint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + } + ], + "name": "Initialize", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "bridgeBurn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "bridgeMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + } + ], + "name": "depositTo", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "l1Address", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2Bridge", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } +] \ No newline at end of file diff --git a/data/abi/skydrome/abi.json b/data/abi/skydrome/abi.json new file mode 100644 index 0000000..ee1abf9 --- /dev/null +++ b/data/abi/skydrome/abi.json @@ -0,0 +1 @@ +[{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bool","name":"stable","type":"bool"}],"internalType":"struct Router.route[]","name":"routes","type":"tuple[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"UNSAFE_swapExactTokensForTokens","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"bool","name":"stable","type":"bool"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesired","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"bool","name":"stable","type":"bool"},{"internalType":"uint256","name":"amountTokenDesired","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidityETH","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountETH","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"}],"name":"getAmountOut","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"stable","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"bool","name":"stable","type":"bool"}],"name":"getAmountOut","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bool","name":"stable","type":"bool"}],"internalType":"struct Router.route[]","name":"routes","type":"tuple[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"bool","name":"stable","type":"bool"}],"name":"getReserves","outputs":[{"internalType":"uint256","name":"reserveA","type":"uint256"},{"internalType":"uint256","name":"reserveB","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pair","type":"address"}],"name":"isPair","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"bool","name":"stable","type":"bool"}],"name":"pairFor","outputs":[{"internalType":"address","name":"pair","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"bool","name":"stable","type":"bool"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesired","type":"uint256"}],"name":"quoteAddLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"bool","name":"stable","type":"bool"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"name":"quoteRemoveLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"bool","name":"stable","type":"bool"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"bool","name":"stable","type":"bool"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidityETH","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"bool","name":"stable","type":"bool"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"approveMax","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"removeLiquidityETHWithPermit","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"bool","name":"stable","type":"bool"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"approveMax","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"removeLiquidityWithPermit","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"}],"name":"sortTokens","outputs":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bool","name":"stable","type":"bool"}],"internalType":"struct Router.route[]","name":"routes","type":"tuple[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactETHForTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bool","name":"stable","type":"bool"}],"internalType":"struct Router.route[]","name":"routes","type":"tuple[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForETH","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bool","name":"stable","type":"bool"}],"internalType":"struct Router.route[]","name":"routes","type":"tuple[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address","name":"tokenFrom","type":"address"},{"internalType":"address","name":"tokenTo","type":"address"},{"internalType":"bool","name":"stable","type":"bool"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForTokensSimple","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}] \ No newline at end of file diff --git a/data/abi/syncswap/classic_pool.json b/data/abi/syncswap/classic_pool.json new file mode 100644 index 0000000..1db49a3 --- /dev/null +++ b/data/abi/syncswap/classic_pool.json @@ -0,0 +1,151 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "_master", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "InvalidTokens", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token0", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "token1", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "PoolCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "createPool", + "outputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getDeployData", + "outputs": [ + { + "internalType": "bytes", + "name": "deployData", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "getPool", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "getSwapFee", + "outputs": [ + { + "internalType": "uint24", + "name": "swapFee", + "type": "uint24" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "master", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/data/abi/syncswap/classic_pool_data.json b/data/abi/syncswap/classic_pool_data.json new file mode 100644 index 0000000..cbda4c9 --- /dev/null +++ b/data/abi/syncswap/classic_pool_data.json @@ -0,0 +1,924 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "Expired", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientLiquidityMinted", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSignature", + "type": "error" + }, + { + "inputs": [], + "name": "Overflow", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0In", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1In", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount0Out", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount1Out", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "Swap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "reserve0", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reserve1", + "type": "uint256" + } + ], + "name": "Sync", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "address", + "name": "_callback", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_callbackData", + "type": "bytes" + } + ], + "name": "burn", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct IPool.TokenAmount[]", + "name": "_amounts", + "type": "tuple[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "address", + "name": "_callback", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_callbackData", + "type": "bytes" + } + ], + "name": "burnSingle", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct IPool.TokenAmount", + "name": "_tokenAmount", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountOut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_sender", + "type": "address" + } + ], + "name": "getAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "_amountIn", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenIn", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amountIn", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_sender", + "type": "address" + } + ], + "name": "getAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "_amountOut", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAssets", + "outputs": [ + { + "internalType": "address[]", + "name": "assets", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProtocolFee", + "outputs": [ + { + "internalType": "uint24", + "name": "_protocolFee", + "type": "uint24" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "_reserve0", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_reserve1", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenOut", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "getSwapFee", + "outputs": [ + { + "internalType": "uint24", + "name": "_swapFee", + "type": "uint24" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "invariantLast", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "master", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "address", + "name": "_callback", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_callbackData", + "type": "bytes" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "_v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "_r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "_s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_signature", + "type": "bytes" + } + ], + "name": "permit2", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "poolType", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reserve0", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reserve1", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "address", + "name": "_callback", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_callbackData", + "type": "bytes" + } + ], + "name": "swap", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct IPool.TokenAmount", + "name": "_tokenAmount", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token0", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token1", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vault", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/data/abi/syncswap/router.json b/data/abi/syncswap/router.json new file mode 100644 index 0000000..26d9109 --- /dev/null +++ b/data/abi/syncswap/router.json @@ -0,0 +1,1178 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "_vault", + "type": "address" + }, + { + "internalType": "address", + "name": "_wETH", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ApproveFailed", + "type": "error" + }, + { + "inputs": [], + "name": "Expired", + "type": "error" + }, + { + "inputs": [], + "name": "NotEnoughLiquidityMinted", + "type": "error" + }, + { + "inputs": [], + "name": "TooLittleReceived", + "type": "error" + }, + { + "inputs": [], + "name": "TransferFromFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct SyncSwapRouter.TokenInput[]", + "name": "inputs", + "type": "tuple[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "minLiquidity", + "type": "uint256" + }, + { + "internalType": "address", + "name": "callback", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callbackData", + "type": "bytes" + } + ], + "name": "addLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct SyncSwapRouter.TokenInput[]", + "name": "inputs", + "type": "tuple[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "minLiquidity", + "type": "uint256" + }, + { + "internalType": "address", + "name": "callback", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callbackData", + "type": "bytes" + } + ], + "name": "addLiquidity2", + "outputs": [ + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct SyncSwapRouter.TokenInput[]", + "name": "inputs", + "type": "tuple[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "minLiquidity", + "type": "uint256" + }, + { + "internalType": "address", + "name": "callback", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callbackData", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "approveAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct IRouter.SplitPermitParams[]", + "name": "permits", + "type": "tuple[]" + } + ], + "name": "addLiquidityWithPermit", + "outputs": [ + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct SyncSwapRouter.TokenInput[]", + "name": "inputs", + "type": "tuple[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "minLiquidity", + "type": "uint256" + }, + { + "internalType": "address", + "name": "callback", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callbackData", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "approveAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct IRouter.SplitPermitParams[]", + "name": "permits", + "type": "tuple[]" + } + ], + "name": "addLiquidityWithPermit2", + "outputs": [ + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256[]", + "name": "minAmounts", + "type": "uint256[]" + }, + { + "internalType": "address", + "name": "callback", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callbackData", + "type": "bytes" + } + ], + "name": "burnLiquidity", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct IPool.TokenAmount[]", + "name": "amounts", + "type": "tuple[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "minAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "callback", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callbackData", + "type": "bytes" + } + ], + "name": "burnLiquiditySingle", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct IPool.TokenAmount", + "name": "amountOut", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "minAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "callback", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callbackData", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "approveAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct IRouter.ArrayPermitParams", + "name": "permit", + "type": "tuple" + } + ], + "name": "burnLiquiditySingleWithPermit", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct IPool.TokenAmount", + "name": "amountOut", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256[]", + "name": "minAmounts", + "type": "uint256[]" + }, + { + "internalType": "address", + "name": "callback", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callbackData", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "approveAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct IRouter.ArrayPermitParams", + "name": "permit", + "type": "tuple" + } + ], + "name": "burnLiquidityWithPermit", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct IPool.TokenAmount[]", + "name": "amounts", + "type": "tuple[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_factory", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "createPool", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "enteredPools", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "enteredPoolsLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isPoolEntered", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "selfPermit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "selfPermit2", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "selfPermit2IfNecessary", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "selfPermitAllowed", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "selfPermitAllowedIfNecessary", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "selfPermitIfNecessary", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "stakingPool", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "onBehalf", + "type": "address" + } + ], + "name": "stake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "address", + "name": "callback", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callbackData", + "type": "bytes" + } + ], + "internalType": "struct IRouter.SwapStep[]", + "name": "steps", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + } + ], + "internalType": "struct IRouter.SwapPath[]", + "name": "paths", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swap", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct IPool.TokenAmount", + "name": "amountOut", + "type": "tuple" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "address", + "name": "callback", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callbackData", + "type": "bytes" + } + ], + "internalType": "struct IRouter.SwapStep[]", + "name": "steps", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + } + ], + "internalType": "struct IRouter.SwapPath[]", + "name": "paths", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "approveAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "internalType": "struct IRouter.SplitPermitParams", + "name": "permit", + "type": "tuple" + } + ], + "name": "swapWithPermit", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct IPool.TokenAmount", + "name": "amountOut", + "type": "tuple" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "vault", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "wETH", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/data/abi/zebra/abi.json b/data/abi/zebra/abi.json new file mode 100644 index 0000000..ae5cab0 --- /dev/null +++ b/data/abi/zebra/abi.json @@ -0,0 +1 @@ +[{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_WETH","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesired","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountTokenDesired","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidityETH","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountETH","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"reserveIn","type":"uint256"},{"internalType":"uint256","name":"reserveOut","type":"uint256"}],"name":"getAmountIn","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"reserveIn","type":"uint256"},{"internalType":"uint256","name":"reserveOut","type":"uint256"}],"name":"getAmountOut","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsIn","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"}],"name":"pairFor","outputs":[{"internalType":"address","name":"pair","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"reserveA","type":"uint256"},{"internalType":"uint256","name":"reserveB","type":"uint256"}],"name":"quote","outputs":[{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidityETH","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidityETHSupportingFeeOnTransferTokens","outputs":[{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"approveMax","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"removeLiquidityETHWithPermit","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"approveMax","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"removeLiquidityETHWithPermitSupportingFeeOnTransferTokens","outputs":[{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bool","name":"approveMax","type":"bool"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"removeLiquidityWithPermit","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_swapMininng","type":"address"}],"name":"setSwapMining","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapETHForExactTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactETHForTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactETHForTokensSupportingFeeOnTransferTokens","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForETH","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForETHSupportingFeeOnTransferTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForTokensSupportingFeeOnTransferTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapMining","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapTokensForExactETH","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapTokensForExactTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}] \ No newline at end of file diff --git a/data/deploy/abi.json b/data/deploy/abi.json new file mode 100644 index 0000000..32960f8 --- /dev/null +++ b/data/deploy/abi.json @@ -0,0 +1,2 @@ +[ +] \ No newline at end of file diff --git a/data/deploy/bytecode.txt b/data/deploy/bytecode.txt new file mode 100644 index 0000000..99e07d0 --- /dev/null +++ b/data/deploy/bytecode.txt @@ -0,0 +1 @@ +0x \ No newline at end of file diff --git a/data/rpc.json b/data/rpc.json index a7e8e95..0e1b976 100644 --- a/data/rpc.json +++ b/data/rpc.json @@ -1,44 +1,37 @@ { "ethereum": { - "rpc": [ - "https://rpc.ankr.com/eth" - ], + "rpc": ["https://rpc.ankr.com/eth"], "explorer": "https://etherscan.io/tx/", "token": "ETH" }, "arbitrum": { - "rpc": [ - "https://rpc.ankr.com/arbitrum" - ], + "rpc": ["https://rpc.ankr.com/arbitrum"], "explorer": "https://arbiscan.io/tx/", "token": "ETH" }, "optimism": { - "rpc": [ - "https://rpc.ankr.com/optimism" - ], + "rpc": ["https://rpc.ankr.com/optimism"], "explorer": "https://optimistic.etherscan.io/tx/", "token": "ETH" }, "polygon_zkevm": { - "rpc": [ - "https://rpc.ankr.com/polygon_zkevm" - ], + "rpc": ["https://rpc.ankr.com/polygon_zkevm"], "explorer": "https://zkevm.polygonscan.com/tx/", "token": "ETH" }, "zksync": { - "rpc": [ - "https://rpc.ankr.com/zksync_era" - ], + "rpc": ["https://rpc.ankr.com/zksync_era"], "explorer": "https://explorer.zksync.io/tx/", "token": "ETH" }, "base": { - "rpc": [ - "https://rpc.ankr.com/base" - ], + "rpc": ["https://rpc.ankr.com/base"], "explorer": "https://basescan.org/tx/", "token": "ETH" + }, + "scroll": { + "rpc": ["https://rpc.scroll.io"], + "explorer": "https://scrollscan.com/tx/", + "token": "ETH" } } diff --git a/logging.log b/logging.log new file mode 100644 index 0000000..1dd6b5e --- /dev/null +++ b/logging.log @@ -0,0 +1,17 @@ +2024-04-07 22:22:00.006 | INFO | __main__:run:47 - Wait between wallets: 1200 - 1800 seconds +2024-04-07 22:22:00.010 | INFO | __main__:run:48 - Wait between websites: 300 - 1200 seconds +2024-04-07 22:22:00.012 | INFO | __main__:run:49 - Wait between cycles: 43500 - 48600 seconds +2024-04-07 22:22:00.014 | INFO | main:main:51 - Running module swap_syncswap with wallet 36020cc5a0d264284bed0c4343bc122c79590d54db49748ebf96ed7af1ae4288 +2024-04-07 22:22:03.002 | INFO | modules.syncswap:swap:72 - [1][0x5990293D87Cf4979F2233422f9B2DeB722013915] Swap on SyncSwap – USDC -> ETH | 0.000193 USDC +2024-04-07 22:39:09.644 | INFO | __main__:run:47 - Wait between wallets: 1200 - 1800 seconds +2024-04-07 22:39:09.644 | INFO | __main__:run:48 - Wait between websites: 300 - 1200 seconds +2024-04-07 22:39:09.699 | INFO | __main__:run:49 - Wait between cycles: 43500 - 48600 seconds +2024-04-07 22:39:09.701 | INFO | main:main:51 - Running module swap_syncswap with wallet 36020cc5a0d264284bed0c4343bc122c79590d54db49748ebf96ed7af1ae4288 +2024-04-07 22:39:12.600 | INFO | modules.syncswap:swap:72 - [1][0x5990293D87Cf4979F2233422f9B2DeB722013915] Swap on SyncSwap – USDC -> ETH | 0.000129 USDC +2024-04-07 22:39:15.201 | SUCCESS | modules.account:approve:121 - [1][0x5990293D87Cf4979F2233422f9B2DeB722013915] Make approve +2024-04-07 22:39:16.734 | ERROR | utils.helpers:wrapper:14 - Error | {'code': -32000, 'message': 'insufficient funds for transfer'} +2024-04-07 22:39:16.735 | INFO | utils.sleeping:sleep:10 - 💤 Sleep 17 s. +2024-04-07 22:42:56.797 | INFO | __main__:run:47 - Wait between wallets: 1200 - 1800 seconds +2024-04-07 22:42:56.798 | INFO | __main__:run:48 - Wait between websites: 300 - 1200 seconds +2024-04-07 22:42:56.798 | INFO | __main__:run:49 - Wait between cycles: 43500 - 48600 seconds +2024-04-07 22:42:56.798 | INFO | main:main:51 - Running module swap_syncswap with wallet 36020cc5a0d264284bed0c4343bc122c79590d54db49748ebf96ed7af1ae4288 diff --git a/main.py b/main.py index 5150be0..7310b7d 100644 --- a/main.py +++ b/main.py @@ -1,131 +1,152 @@ import random -import sys import time -from concurrent.futures import ThreadPoolExecutor - -import questionary +from typing import Union +import asyncio +from eth_account import Account as EthereumAccount from loguru import logger -from questionary import Choice - -from config import ACCOUNTS -from settings import ( - RANDOM_WALLET, - SLEEP_TO, - SLEEP_FROM, - QUANTITY_THREADS, - THREAD_SLEEP_FROM, - THREAD_SLEEP_TO, REMOVE_WALLET, -) -from modules_settings import * -from utils.helpers import remove_wallet -from utils.sleeping import sleep - - -def get_module(): - result = questionary.select( - "Select a method to get started", - choices=[ - Choice("1) Make bridge to Base", bridge_base), - Choice("2) Make bridge on Orbiter", bridge_orbiter), - Choice("3) Wrap ETH", wrap_eth), - Choice("4) Unwrap ETH", unwrap_eth), - Choice("5) Swap on Uniswap", swap_uniswap), - Choice("6) Swap on Pancake", swap_pancake), - Choice("7) Swap on WooFi", swap_woofi), - Choice("8) Swap on BaseSwap", swap_baseswap), - Choice("9) Swap on AlienSwap", swap_alienswap), - Choice("10) Swap on Maverick", swap_maverick), - Choice("11) Swap on Odos", swap_odos), - Choice("12) Swap on 1inch", swap_inch), - Choice("13) Swap on OpenOcean", swap_openocean), - Choice("14) Swap on XYSwap", swap_xyswap), - Choice("15) Bungee Refuel", bungee_refuel), - Choice("16) Stargate bridge", stargate_bridge), - Choice("17) Deposit Aave", deposit_aave), - Choice("18) Withdraw Aave", withdraw_aave), - Choice("19) Deposit MoonWell", deposit_moonwell), - Choice("20) Withdraw MoonWell", withdraw_moonwell), - Choice("21) Deposit RocketSam", deposit_rocketsam), - Choice("22) Withdraw RocketSam", withdraw_rocketsam), - Choice("23) Mint NFT on MintFun", mint_mintfun), - Choice("24) Mint and Bridge Zerius NFT", mint_zerius), - Choice("25) Mint ZkStars NFT", mint_zkstars), - Choice("26) Dmail sending mail", send_mail), - Choice("27) Send message L2Telegraph", send_message), - Choice("28) Mint and bridge NFT L2Telegraph", bridge_nft), - Choice("29) Create portfolio on Ray", create_portfolio), - Choice("30) Create gnosis safe", create_safe), - Choice("31) Mint NFT on NFTS2ME", mint_nft), - Choice("32) Swap tokens to ETH", swap_tokens), - Choice("33) Use Multiswap", swap_multiswap), - Choice("34) Use custom routes", custom_routes), - Choice("35) Check transaction count", "tx_checker"), - Choice("36) Exit", "exit"), - ], - qmark="⚙️ ", - pointer="✅ " - ).ask() - if result == "exit": - print("\n❤️ Subscribe to me – https://t.me/sybilwave\n") - print("🤑 Donate me: 0x00000b0ddce0bfda4531542ad1f2f5fad7b9cde9") - sys.exit() - return result - - -def get_wallets(): - wallets = [ - { - "id": _id, - "key": key, - } for _id, key in enumerate(ACCOUNTS, start=1) - ] - - return wallets - - -async def run_module(module, account_id, key): +from modules_settings import handle_app_expiration +from settings import managingEnvironment + +async def run_module(module, wallet_number, key, recipient: Union[str, None] = None, settings: dict = {}): try: - await module(account_id, key) + await module( + wallet_number, + key, + recipient, + from_token=settings.get('from_token'), + to_token=settings.get('to_token'), + min_amount=settings.get('min_amount'), + max_amount=settings.get('max_amount'), + slippage=settings.get('slippage'), + all_amount=settings.get('all_amount'), + min_percent=settings.get('min_percent'), + max_percent=settings.get('max_percent'), + ) + except Exception as e: logger.error(e) - if REMOVE_WALLET: - remove_wallet(key) - - await sleep(SLEEP_FROM, SLEEP_TO) - - -def _async_run_module(module, account_id, key): - asyncio.run(run_module(module, account_id, key)) - - -def main(module): - wallets = get_wallets() - - if RANDOM_WALLET: - random.shuffle(wallets) - - with ThreadPoolExecutor(max_workers=QUANTITY_THREADS) as executor: - for _, account in enumerate(wallets, start=1): - executor.submit( - _async_run_module, - module, - account.get("id"), - account.get("key"), - ) - time.sleep(random.randint(THREAD_SLEEP_FROM, THREAD_SLEEP_TO)) +def _async_run_module(module, wallet_number, key, recipient, settings): + asyncio.run(run_module(module, wallet_number, key, recipient, settings)) + + + +def main( + websites, + wallets, + website_settings, + wait_between_wallets_max=30, + wait_between_wallets_min=20, + wait_between_websites_max=20, + wait_between_websites_min=5, + wait_between_cycles_max=((12*60*60)+90), + wait_between_cycles_min=((12*60*60)+5), + ): + + # is_expired = handle_app_expiration() + # if is_expired: + # return + + + + while True: + + logger.info(f"Selected wallets: {len(wallets)}") + # iterate through the wallets + for _, wallet_key in enumerate(wallets, start=1): + # website transactions to perform at each website + + wallet_address = EthereumAccount.from_key(wallet_key).address + logger.info(f"Running module {websites[0].__name__}") + logger.info(f"With wallet {wallet_address[:6]}...{wallet_address[-6:]}") + + _async_run_module( + websites[0], + _, + wallet_key, + None, + website_settings[0] + ) + + env = managingEnvironment["python_running_env"] + # random wait to swap back + random_wait = random.randint(managingEnvironment[env]["waitTimeBetweenSwapBack"]["from"], managingEnvironment[env]["waitTimeBetweenSwapBack"]["to"]) + minutes = int((random_wait % managingEnvironment['totalSecond']) // managingEnvironment['totalMinutes']) + + logger.info(f"Randomly wait between switching from {website_settings[0]['from_token']} to {website_settings[0]['to_token']} for {minutes} minutes") + time.sleep(random_wait) + website_settings[0]['from_token'], website_settings[0]['to_token'] = website_settings[0]['to_token'], website_settings[0]['from_token'] + + # After Switching running the module again + # logger.info(f"Running module {websites[0].__name__} with wallet {wallet_key}") + _async_run_module( + websites[0], + _, + wallet_key, + None, + website_settings[0] + ) + + # Switch the token back to original for next wallet + website_settings[0]['from_token'], website_settings[0]['to_token'] = website_settings[0]['to_token'], website_settings[0]['from_token'] + + #----- for multiple website we comment this for now ------ + # iterate through websites + # for tuple in zip(websites, website_settings): + # logger.info(f"Running module {tuple[0].__name__} with wallet {wallet_key}") + # _async_run_module( + # tuple[0], + # _, + # wallet_key, + # None, + # tuple[1] + # ) + + + # wait between website actions + # random_wait = random.randint(wait_between_websites_min, wait_between_websites_max) + # logger.info(f"Waiting between websites for {random_wait/3600} hours") + # time.sleep(random_wait) + + #---------- multiple website comment end ---------- + + # wait between wallets + if len(wallets) > 1: + random_wait = random.randint(wait_between_wallets_min, wait_between_wallets_max) + hours = int(random_wait // managingEnvironment['totalSecond']) + minutes = int((random_wait % managingEnvironment['totalSecond']) // managingEnvironment['totalMinutes']) + + if hours == 0: + logger.info(f"Waiting between wallets for {minutes} minutes.") + else: + logger.info(f"Waiting between wallets for {hours} hours and {minutes} minutes.") + time.sleep(random_wait) + + # wait between cycles + random_wait = random.randint(wait_between_cycles_min, wait_between_cycles_max) + hours = int(random_wait // managingEnvironment['totalSecond']) + minutes = int((random_wait % managingEnvironment['totalSecond']) // managingEnvironment['totalMinutes']) + if hours == 0: + logger.info(f"Waiting between cycles for {minutes} minutes.") + else: + logger.info(f"Waiting between cycles for {hours} hours and {minutes} minutes.") + + while random_wait >= 3600: # If the wait time is more than equal to 1 hour + hours_remaining = int(random_wait // 3600) + if hours_remaining >= 1: # Log time every hour + logger.info(f"{hours_remaining} hours left until next swap") + # Sleep for 1 hour + time.sleep(3600) + # Decrease the remaining time by 1 hour + random_wait -= 3600 + + # change all the settings + + # for setting in website_settings: + # # ETH to USDC or back + # setting['from_token'], setting['to_token'] = setting['to_token'], setting['from_token'] -if __name__ == '__main__': - print("❤️ Subscribe to me – https://t.me/sybilwave\n") - logger.add("logging.log") - module = get_module() - if module == "tx_checker": - get_tx_count() - else: - main(module) - print("\n❤️ Subscribe to me – https://t.me/sybilwave\n") - print("🤑 Donate me: 0x00000b0ddce0bfda4531542ad1f2f5fad7b9cde9") diff --git a/modules/__init__.py b/modules/__init__.py index 716628a..0013511 100644 --- a/modules/__init__.py +++ b/modules/__init__.py @@ -1,30 +1,25 @@ from .account import Account -from .base import Base +from .scroll import Scroll from .orbiter import Orbiter -from .uniswap import Uniswap -from .pancake import Pancake -from .woofi import WooFi -from .baseswap import BaseSwap -from .alienswap import AlienSwap -from .odos import Odos -from .inch import Inch -from .openocean import OpenOcean +from .nitro import Nitro +from .layerswap import LayerSwap +from .skydrome import Skydrome +from .zebra import Zebra +from .syncswap import SyncSwap from .xyswap import XYSwap -from .maverick import Maverick -from .bungee import Bungee -from .stargate import Stargate from .aave import Aave -from .moonwell import MoonWell -from .rocketsam import RocketSam -from .l2telegraph import L2Telegraph -from .mintfun import MintFun +from .layerbank import LayerBank from .zerius import Zerius +from .l2pass import L2Pass from .zkstars import ZkStars -from .rai import Rai -from .safe import GnosisSafe -from .nfts2me import Minter from .dmail import Dmail +from .omnisea import Omnisea +from .nfts2me import Minter +from .rubyscore import RubyScore +from .safe import GnosisSafe +from .deploy import Deployer from .swap_tokens import SwapTokens from .multiswap import Multiswap from .routes import Routes -from .tx_checker import check_tx +from .transfer import Transfer + diff --git a/modules/aave.py b/modules/aave.py index 7f65ae1..57ed947 100644 --- a/modules/aave.py +++ b/modules/aave.py @@ -9,8 +9,8 @@ class Aave(Account): - def __init__(self, account_id: int, private_key: str) -> None: - super().__init__(account_id=account_id, private_key=private_key, chain="base") + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) self.contract = self.get_contract(AAVE_CONTRACT, AAVE_ABI) @@ -50,7 +50,7 @@ async def deposit( tx_data = await self.get_tx_data(amount_wei) transaction = await self.contract.functions.depositETH( - self.w3.to_checksum_address("0xA238Dd80C259a72e81d7e4664a9801593F98d1c5"), + self.w3.to_checksum_address("0x11fCfe756c05AD438e312a7fd934381537D3cFfe"), self.address, 0 ).build_transaction(tx_data) @@ -76,13 +76,16 @@ async def withdraw(self) -> None: f"[{self.account_id}][{self.address}] Make withdraw from Aave | " + f"{self.w3.from_wei(amount, 'ether')} ETH" ) - - await self.approve(amount, "0xD4a0e0b9149BCee3C920d2E00b5dE09138fd8bb7", AAVE_CONTRACT) + try: + await self.approve(amount, "0xf301805be1df81102c957f6d4ce29d2b8c056b2a", AAVE_CONTRACT) + except Exception as e: + logger.error(f"Output while dealing with func:self.approve() under withdraw function in aave file{e} ") + await self.approve(amount, "0xf301805be1df81102c957f6d4ce29d2b8c056b2a", AAVE_CONTRACT) tx_data = await self.get_tx_data() transaction = await self.contract.functions.withdrawETH( - self.w3.to_checksum_address("0xA238Dd80C259a72e81d7e4664a9801593F98d1c5"), + self.w3.to_checksum_address("0x11fCfe756c05AD438e312a7fd934381537D3cFfe"), amount, self.address ).build_transaction(tx_data) diff --git a/modules/account.py b/modules/account.py index 00e0996..eda326e 100644 --- a/modules/account.py +++ b/modules/account.py @@ -9,37 +9,51 @@ from eth_account import Account as EthereumAccount from web3.contract import Contract from web3.exceptions import TransactionNotFound + from web3.middleware import async_geth_poa_middleware -from config import RPC, ERC20_ABI, BASE_TOKENS -from settings import GAS_MULTIPLIER, GAS_PRIORITY_FEE +from config import RPC, ERC20_ABI, SCROLL_TOKENS +from settings import GAS_MULTIPLIER, MAX_PRIORITY_FEE from utils.sleeping import sleep class Account: - def __init__(self, account_id: int, private_key: str, chain: str) -> None: + def __init__(self, account_id: int, private_key: str, chain: str, recipient: str) -> None: self.account_id = account_id self.private_key = private_key self.chain = chain self.explorer = RPC[chain]["explorer"] self.token = RPC[chain]["token"] + self.recipient = recipient + self.w3 = AsyncWeb3( AsyncWeb3.AsyncHTTPProvider(random.choice(RPC[chain]["rpc"])), middlewares=[async_geth_poa_middleware] ) + self.account = EthereumAccount.from_key(private_key) self.address = self.account.address - async def get_tx_data(self, value: int = 0): + async def get_tx_data(self, value: int = 0, gas_price: bool = True): tx = { "chainId": await self.w3.eth.chain_id, "from": self.address, "value": value, "nonce": await self.w3.eth.get_transaction_count(self.address), } + + if gas_price: + tx.update({"gasPrice": await self.w3.eth.gas_price}) + return tx + async def transaction_fee(self, tx_data: dict): + gas_price = await self.w3.eth.gas_price + gas = await self.w3.eth.estimate_gas(tx_data) + + return int(gas * gas_price) + def get_contract(self, contract_address: str, abi=None) -> Union[Type[Contract], Contract]: contract_address = self.w3.to_checksum_address(contract_address) @@ -50,6 +64,7 @@ def get_contract(self, contract_address: str, abi=None) -> Union[Type[Contract], return contract + async def get_balance(self, contract_address: str) -> Dict: contract_address = self.w3.to_checksum_address(contract_address) contract = self.get_contract(contract_address) @@ -78,10 +93,12 @@ async def get_amount( if from_token == "ETH": balance = await self.w3.eth.get_balance(self.address) + amount_wei = int(balance * percent) if all_amount else self.w3.to_wei(random_amount, "ether") amount = self.w3.from_wei(int(balance * percent), "ether") if all_amount else random_amount else: - balance = await self.get_balance(BASE_TOKENS[from_token]) + # all_amount = True + balance = await self.get_balance(SCROLL_TOKENS[from_token]) amount_wei = int(balance["balance_wei"] * percent) \ if all_amount else int(random_amount * 10 ** balance["decimal"]) amount = balance["balance"] * percent if all_amount else random_amount @@ -98,7 +115,7 @@ async def check_allowance(self, token_address: str, contract_address: str) -> in return amount_approved - async def approve(self, amount: int, token_address: str, contract_address: str) -> None: + async def approve(self, amount: float, token_address: str, contract_address: str) -> None: token_address = self.w3.to_checksum_address(token_address) contract_address = self.w3.to_checksum_address(contract_address) @@ -113,19 +130,95 @@ async def approve(self, amount: int, token_address: str, contract_address: str) tx_data = await self.get_tx_data() - transaction = await contract.functions.approve( - contract_address, - approve_amount - ).build_transaction(tx_data) + # logger.info(f"contract_address-----{contract_address}") + # logger.info(f"approve_amount-----{approve_amount}") + try: + transaction = await contract.functions.approve( + contract_address, + approve_amount + ).build_transaction(tx_data) + + # logger.info(f"transaction========{transaction}") + except Exception as e: + logger.error(f"Output while dealing with func:await contract.functions.approve under approve function{e} ") + transaction = await contract.functions.approve( + contract_address, + approve_amount + ).build_transaction(tx_data) - signed_txn = await self.sign(transaction) + try: + signed_txn = await self.sign(transaction) + except Exception as e: + logger.error(f"Output while dealing with func:await self.sign(transaction) under approve function {e} ") + signed_txn = await self.sign(transaction) - txn_hash = await self.send_raw_transaction(signed_txn) + try: + txn_hash = await self.send_raw_transaction(signed_txn) + except Exception as e: + logger.error(f"Output while dealing with func:await self.send_raw_transaction(signed_txn) under approve function {e} ") + txn_hash = await self.send_raw_transaction(signed_txn) - await self.wait_until_tx_finished(txn_hash.hex()) + try: + await self.wait_until_tx_finished(txn_hash.hex()) + except Exception as e: + logger.error(f"Output while dealing with func:await self.wait_until_tx_finished(txn_hash.hex()) under approve function {e} ") await sleep(5, 20) + # static approve function to test or run with insufficient funds + # async def approve(self, amount: float, token_address: str, contract_address: str) -> None: + # token_address = self.w3.to_checksum_address(token_address) + # contract_address = self.w3.to_checksum_address(contract_address) + + # contract = self.w3.eth.contract(address=token_address, abi=ERC20_ABI) + + # allowance_amount = await self.check_allowance(token_address, contract_address) + + # logger.info(f"allowance_amount{allowance_amount}") + + # if amount > allowance_amount or amount == 0: + # logger.success(f"[{self.account_id}][{self.address}] Make approve") + + # approve_amount = 2 ** 128 + + # tx_data = await self.get_tx_data() + + # try: + # # transaction = await contract.functions.approve( + # # contract_address, + # # approve_amount + # # ).build_transaction(tx_data) + # transaction = {'gas': 187199, 'chainId': 534352, 'from': '0x3f29f6815f12e33cDEC040a453cd9120525dB4b9', 'value': 100000000000000, 'nonce': 3, 'gasPrice': 550000000, 'to': '0xAA111C62cDEEf205f70E6722D1E22274274ec12F', 'data': '0x67ffb66a00000000000000000000000000000000000000000000000000000000000504fb00000000000000000000000000000000000000000000000000000000000000800000000000000000000000003f29f6815f12e33cdec040a453cd9120525db4b900000000000000000000000000000000000000000000000000000000661c66c70000000000000000000000000000000000000000000000000000000000000001000000000000000000000000530000000000000000000000000000000000000400000000000000000000000006efdbff2a14a7c8e15944d1f4a48f9f95f663a40000000000000000000000000000000000000000000000000000000000000000'} + + # except Exception as e: + # logger.error(f"Output while dealing with func:await contract.functions.approve under approve function{e} ") + # transaction = await contract.functions.approve( + # contract_address, + # approve_amount + # ).build_transaction(tx_data) + + # logger.info(f"transaction on approve : {transaction}") + + # try: + # signed_txn = await self.sign(transaction) + # except Exception as e: + # logger.error(f"Output while dealing with func:await self.sign(transaction) under approve function {e} ") + # signed_txn = await self.sign(transaction) + + # try: + # txn_hash = await self.send_raw_transaction(signed_txn) + # except Exception as e: + # logger.error(f"Output while dealing with func:await self.send_raw_transaction(signed_txn) under approve function {e} ") + # txn_hash = await self.send_raw_transaction(signed_txn) + + # try: + # await self.wait_until_tx_finished(txn_hash.hex()) + # except Exception as e: + # logger.error(f"Output while dealing with func:await self.wait_until_tx_finished(txn_hash.hex()) under approve function {e} ") + + # await sleep(5, 20) + + async def wait_until_tx_finished(self, hash: str, max_wait_time=180) -> None: start_time = time.time() while True: @@ -146,20 +239,74 @@ async def wait_until_tx_finished(self, hash: str, max_wait_time=180) -> None: return await asyncio.sleep(1) + +# static sign function to run with insufficient funds + # async def sign(self, transaction) -> Any: + # # if transaction.get("gasPrice", None) is None: + + + # max_priority_fee_per_gas = self.w3.to_wei(MAX_PRIORITY_FEE["ethereum"], "gwei") + # max_fee_per_gas = await self.w3.eth.gas_price + + + # transaction.update( + # { + # "maxPriorityFeePerGas": max_priority_fee_per_gas, + # "maxFeePerGas": max_fee_per_gas, + # } + # ) + + # logger.info(f"transaction under sign--{transaction}") + + # try: + # # Add nonce if it's not already present in the transaction + # if 'nonce' not in transaction: + # transaction['nonce'] = 3 + + # gas = 10000000000000000 + # gas = int(gas * GAS_MULTIPLIER) + + # logger.info(f"gas------- {gas}") + + # transaction.update({"gas": gas}) + + # logger.info(f"transaction after updating gas------:{transaction}") + + # logger.info(f"private key--------:{self.private_key}") + + # signed_txn = self.w3.eth.account.sign_transaction(transaction, self.private_key) + # return signed_txn + + # except Exception as e: + # logger.error(f"Error in sign_transaction: {e}") + # return None + async def sign(self, transaction) -> Any: - max_fee_per_gas = await self.w3.eth.gas_price - max_priority_fee_per_gas = self.w3.to_wei(GAS_PRIORITY_FEE[self.chain], "gwei") - gas = int(await self.w3.eth.estimate_gas(transaction) * GAS_MULTIPLIER) - - transaction.update( - { - "maxPriorityFeePerGas": max_priority_fee_per_gas, - "maxFeePerGas": max_fee_per_gas, - "gas": gas - } - ) + if transaction.get("gasPrice", None) is None: + max_priority_fee_per_gas = self.w3.to_wei(MAX_PRIORITY_FEE["ethereum"], "gwei") + max_fee_per_gas = await self.w3.eth.gas_price + + transaction.update( + { + "maxPriorityFeePerGas": max_priority_fee_per_gas, + "maxFeePerGas": max_fee_per_gas, + } + ) + + # logger.info(f"transaction under sign--{transaction}") + + gas = await self.w3.eth.estimate_gas(transaction) + gas = int(gas * GAS_MULTIPLIER) + # logger.info(f"gas------- {gas}") + transaction.update({"gas": gas}) + # logger.info(f"transaction after updating gas------:{transaction}") + + try: + signed_txn = self.w3.eth.account.sign_transaction(transaction, self.private_key) + except Exception as e: + logger.error(f"Error in sign_transaction: {e}") + signed_txn = self.w3.eth.account.sign_transaction(transaction, self.private_key) - signed_txn = self.w3.eth.account.sign_transaction(transaction, self.private_key) return signed_txn diff --git a/modules/ambient.py b/modules/ambient.py new file mode 100644 index 0000000..bad7e89 --- /dev/null +++ b/modules/ambient.py @@ -0,0 +1,118 @@ +import time + +from loguru import logger +from web3 import Web3 +from config import AMBIENT_CONTRACTS, AMBIENT_ROUTER_ABI, AMBIENT_IMPACT_ABI, SCROLL_TOKENS +from utils.gas_checker import check_gas +from utils.helpers import retry +from .account import Account + + +class Ambient(Account): + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) + + self.swap_contract = self.get_contract(AMBIENT_CONTRACTS["router"], AMBIENT_ROUTER_ABI) + self.impact_contract = self.get_contract(AMBIENT_CONTRACTS["impact"], AMBIENT_IMPACT_ABI) + + async def get_min_amount_out(self, from_token: str, to_token: str, amount: int, slippage: float): + min_amount_out = await self.impact_contract.functions.calcImpact( + amount, + [ + Web3.to_checksum_address(from_token), + Web3.to_checksum_address(to_token) + ] + ).call() + return int(min_amount_out[1] - (min_amount_out[1] / 100 * slippage)) + + async def swap_to_token(self, from_token: str, to_token: str, amount: int, slippage: int): + tx_data = await self.get_tx_data(amount) + + deadline = int(time.time()) + 1000000 + + min_amount_out = await self.get_min_amount_out( + SCROLL_TOKENS[from_token], + SCROLL_TOKENS[to_token], + amount, + slippage + ) + + contract_txn = await self.swap_contract.functions.swapExactETHForTokens( + min_amount_out, + [ + Web3.to_checksum_address(SCROLL_TOKENS[from_token]), + Web3.to_checksum_address(SCROLL_TOKENS[to_token]), + ], + self.address, + deadline + ).build_transaction(tx_data) + + return contract_txn + + async def swap_to_eth(self, from_token: str, to_token: str, amount: int, slippage: int): + token_address = Web3.to_checksum_address(SCROLL_TOKENS[from_token]) + + await self.approve(amount, token_address, ZEBRA_CONTRACTS["router"]) + + tx_data = await self.get_tx_data() + + deadline = int(time.time()) + 1000000 + + min_amount_out = await self.get_min_amount_out( + SCROLL_TOKENS[from_token], + SCROLL_TOKENS[to_token], + amount, + slippage + ) + + contract_txn = await self.swap_contract.functions.swapExactTokensForETH( + amount, + min_amount_out, + [ + Web3.to_checksum_address(SCROLL_TOKENS[from_token]), + Web3.to_checksum_address(SCROLL_TOKENS[to_token]), + ], + self.address, + deadline + ).build_transaction(tx_data) + + return contract_txn + + @retry + @check_gas + async def swap( + self, + from_token: str, + to_token: str, + min_amount: float, + max_amount: float, + decimal: int, + slippage: int, + all_amount: bool, + min_percent: int, + max_percent: int + ): + amount_wei, amount, balance = await self.get_amount( + from_token, + min_amount, + max_amount, + decimal, + all_amount, + min_percent, + max_percent + ) + + logger.info( + f"[{self.account_id}][{self.address}] Swap on Ambient – {from_token} -> {to_token} | {amount} {from_token}" + ) + + if from_token == "ETH": + contract_txn = await self.swap_to_token(from_token, to_token, amount_wei, slippage) + else: + contract_txn = await self.swap_to_eth(from_token, to_token, amount_wei, slippage) + + signed_txn = await self.sign(contract_txn) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) diff --git a/modules/deploy.py b/modules/deploy.py new file mode 100644 index 0000000..beb5e4d --- /dev/null +++ b/modules/deploy.py @@ -0,0 +1,32 @@ +from loguru import logger +from utils.gas_checker import check_gas +from utils.helpers import retry +from config import DEPLOYER_ABI, DEPLOYER_BYTECODE +from .account import Account + + +class Deployer(Account): + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) + + @retry + @check_gas + async def deploy_token(self): + logger.info(f"[{self.account_id}][{self.address}] Deploy contract") + + tx_data = await self.get_tx_data() + + contract = self.w3.eth.contract( + abi=DEPLOYER_ABI, + bytecode=DEPLOYER_BYTECODE + ) + + transaction = await contract.constructor().build_transaction( + tx_data + ) + + signed_txn = await self.sign(transaction) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) diff --git a/modules/dmail.py b/modules/dmail.py index be8a81e..4ad4015 100644 --- a/modules/dmail.py +++ b/modules/dmail.py @@ -2,15 +2,15 @@ from hashlib import sha256 from loguru import logger -from config import DMAIL_ABI, DMAIL_CONTRACT +from config import DMAIL_CONTRACT, DMAIL_ABI from utils.gas_checker import check_gas from utils.helpers import retry from .account import Account class Dmail(Account): - def __init__(self, account_id: int, private_key: str) -> None: - super().__init__(account_id=account_id, private_key=private_key, chain="base") + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) self.contract = self.get_contract(DMAIL_CONTRACT, DMAIL_ABI) @@ -25,7 +25,9 @@ async def send_mail(self): data = self.contract.encodeABI("send_mail", args=(email, theme)) tx_data = await self.get_tx_data() - tx_data.update({"data": data, "to": self.w3.to_checksum_address(DMAIL_CONTRACT)}) + tx_data.update( + {"data": data, "to": self.w3.to_checksum_address(DMAIL_CONTRACT), "gasPrice": await self.w3.eth.gas_price} + ) signed_txn = await self.sign(tx_data) diff --git a/modules/l2pass.py b/modules/l2pass.py new file mode 100644 index 0000000..3053e9d --- /dev/null +++ b/modules/l2pass.py @@ -0,0 +1,33 @@ +from loguru import logger +from config import L2PASS_ABI +from utils.gas_checker import check_gas +from utils.helpers import retry +from .account import Account + + +class L2Pass(Account): + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) + + @staticmethod + async def get_mint_price(contract): + price = await contract.functions.mintPrice().call() + + return price + + @retry + @check_gas + async def mint(self, contract: str): + logger.info(f"[{self.account_id}][{self.address}] Mint L2Pass NFT") + + contract = self.get_contract(contract, L2PASS_ABI) + + mint_price = await self.get_mint_price(contract) + + tx_data = await self.get_tx_data(mint_price) + + signed_txn = await self.sign(tx_data) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) diff --git a/modules/layerbank.py b/modules/layerbank.py new file mode 100644 index 0000000..d1511ec --- /dev/null +++ b/modules/layerbank.py @@ -0,0 +1,92 @@ +from loguru import logger +from config import LAYERBANK_CONTRACT, LAYERBANK_WETH_CONTRACT, LAYERBANK_ABI +from utils.gas_checker import check_gas +from utils.helpers import retry +from utils.sleeping import sleep +from .account import Account + + +class LayerBank(Account): + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) + + self.contract = self.get_contract(LAYERBANK_CONTRACT, LAYERBANK_ABI) + + async def get_deposit_amount(self): + weth_contract = self.get_contract(LAYERBANK_WETH_CONTRACT) + + amount = await weth_contract.functions.balanceOf(self.address).call() + + return amount + + @retry + @check_gas + async def deposit( + self, + min_amount: float, + max_amount: float, + decimal: int, + sleep_from: int, + sleep_to: int, + make_withdraw: bool, + all_amount: bool, + min_percent: int, + max_percent: int + ) -> None: + amount_wei, amount, balance = await self.get_amount( + "ETH", + min_amount, + max_amount, + decimal, + all_amount, + min_percent, + max_percent + ) + + logger.info(f"[{self.account_id}][{self.address}] Make deposit on LayerBank | {amount} ETH") + + tx_data = await self.get_tx_data(amount_wei) + + transaction = await self.contract.functions.supply( + self.w3.to_checksum_address(LAYERBANK_WETH_CONTRACT), + amount_wei, + ).build_transaction(tx_data) + + signed_txn = await self.sign(transaction) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) + + if make_withdraw: + await sleep(sleep_from, sleep_to) + + await self.withdraw() + + @retry + @check_gas + async def withdraw(self) -> None: + amount = await self.get_deposit_amount() + + if amount > 0: + logger.info( + f"[{self.account_id}][{self.address}] Make withdraw from LayerBank | " + + f"{self.w3.from_wei(amount, 'ether')} ETH" + ) + + await self.approve(amount, LAYERBANK_WETH_CONTRACT, LAYERBANK_CONTRACT) + + tx_data = await self.get_tx_data() + + transaction = await self.contract.functions.redeemUnderlying( + self.w3.to_checksum_address(LAYERBANK_WETH_CONTRACT), + amount, + ).build_transaction(tx_data) + + signed_txn = await self.sign(transaction) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) + else: + logger.error(f"[{self.account_id}][{self.address}] Deposit not found") diff --git a/modules/layerswap.py b/modules/layerswap.py new file mode 100644 index 0000000..ea4f31a --- /dev/null +++ b/modules/layerswap.py @@ -0,0 +1,194 @@ +from typing import Union, Dict + +import aiohttp +from loguru import logger + +from settings import LAYERSWAP_API_KEY +from utils.gas_checker import check_gas +from utils.helpers import retry +from .account import Account + + +class LayerSwap(Account): + def __init__(self, account_id: int, private_key: str, chain: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain=chain, recipient=recipient) + + self.networks = { + "ethereum": "ETHEREUM_MAINNET", + "arbitrum": "ARBITRUM_MAINNET", + "optimism": "OPTIMISM_MAINNET", + "avalanche": "AVAX_MAINNET", + "polygon": "POLYGON_MAINNET", + "base": "BASE_MAINNET", + "zksync": "ZKSYNCERA_MAINNET", + "scroll": "SCROLL_MAINNET", + } + + self.headers = {"X-LS-APIKEY": LAYERSWAP_API_KEY} + + async def check_available_route(self, from_chain: str, to_chain: str) -> Union[Dict, bool]: + url = "https://api.layerswap.io/api/available_routes" + + params = { + "source": self.networks[from_chain], + "destination": self.networks[to_chain], + "sourceAsset": "ETH", + "destinationAsset": "ETH", + } + + async with aiohttp.ClientSession() as session: + response = await session.get(url=url, params=params) + + if response.status == 200: + transaction_data = await response.json() + + if transaction_data["data"]: + return transaction_data["data"] + else: + logger.error(f"[{self.account_id}][{self.address}][{self.chain}] Layerswap path not found") + + return False + else: + logger.error(f"[{self.account_id}][{self.address}][{self.chain}] Bad layerswap request") + + return False + + async def get_swap_rate(self, from_chain: str, to_chain: str) -> Union[Dict, bool]: + url = "https://api.layerswap.io/api/swap_rate" + + params = { + "source": self.networks[from_chain], + "source_asset": "ETH", + "destination": self.networks[to_chain], + "destination_asset": "ETH", + "refuel": False + } + + async with aiohttp.ClientSession() as session: + response = await session.post(url=url, json=params) + + if response.status == 200: + transaction_data = await response.json() + + if transaction_data["data"]: + return transaction_data["data"] + else: + logger.error(f"[{self.account_id}][{self.address}][{self.chain}] Layerswap swap rate error") + + return False + else: + logger.error(f"[{self.account_id}][{self.address}][{self.chain}] Bad layerswap request") + + return False + + async def create_swap(self, from_chain: str, to_chain: str, amount: float) -> Union[Dict, bool]: + url = "https://api.layerswap.io/api/swaps" + + params = { + "source": self.networks[from_chain], + "source_asset": "ETH", + "destination": self.networks[to_chain], + "destination_asset": "ETH", + "refuel": False, + "amount": float(amount), + "destination_address": self.address + } + + async with aiohttp.ClientSession() as session: + response = await session.post(url=url, headers=self.headers, json=params) + + if response.status == 200: + transaction_data = await response.json() + + if transaction_data["data"]: + return transaction_data["data"]["swap_id"] + else: + logger.error(f"[{self.account_id}][{self.address}][{self.chain}] Layerswap swap rate error") + + return False + else: + logger.error(f"[{self.account_id}][{self.address}][{self.chain}] Bad layerswap request") + + return False + + async def prepare_transaction(self, from_chain: str, to_chain: str, amount: float) -> Union[Dict, bool]: + swap_id = await self.create_swap(from_chain, to_chain, amount) + + url = f"https://api.layerswap.io/api/swaps/{swap_id}/prepare_src_transaction" + + params = { + "from_address": self.address + } + + async with aiohttp.ClientSession() as session: + response = await session.get(url=url, headers=self.headers, params=params) + + if response.status == 200: + transaction_data = await response.json() + + if transaction_data["data"]: + return transaction_data["data"] + else: + logger.error(f"[{self.account_id}][{self.address}][{self.chain}] Layerswap swap rate error") + + return False + else: + logger.error(f"[{self.account_id}][{self.address}][{self.chain}] Bad layerswap request") + + return False + + @retry + @check_gas + async def bridge( + self, + from_chain: str, + to_chain: str, + min_amount: float, + max_amount: float, + decimal: int, + all_amount: bool, + min_percent: int, + max_percent: int + ): + amount_wei, amount, balance = await self.get_amount( + "ETH", + min_amount, + max_amount, + decimal, + all_amount, + min_percent, + max_percent + ) + + available_route = await self.check_available_route(from_chain, to_chain) + + if available_route is False: + return + + swap_rate = await self.get_swap_rate(from_chain, to_chain) + + if amount < swap_rate["min_amount"] or amount > swap_rate["max_amount"]: + logger.error( + f"[{self.account_id}][{self.address}][{self.chain}] Limit range amount for bridge " + + f"{swap_rate['min_amount']} – {swap_rate['max_amount']} ETH | {amount} ETH" + ) + return + + if swap_rate is False: + return + + prepare_transaction = await self.prepare_transaction(from_chain, to_chain, amount) + + if prepare_transaction is False: + return + + logger.info(f"[{self.account_id}][{self.address}] Bridge {from_chain} –> {to_chain} | {amount} ETH") + + tx_data = await self.get_tx_data(amount_wei) + tx_data.update({"to": self.w3.to_checksum_address(prepare_transaction["to_address"])}) + + signed_txn = await self.sign(tx_data) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) diff --git a/modules/multiswap.py b/modules/multiswap.py index 5337b2f..ec1d6c9 100644 --- a/modules/multiswap.py +++ b/modules/multiswap.py @@ -1,26 +1,21 @@ import random +from typing import Union from loguru import logger -from config import BASE_TOKENS +from config import SCROLL_TOKENS from modules import * from utils.sleeping import sleep class Multiswap(Account): - def __init__(self, account_id: int, private_key: str) -> None: - super().__init__(account_id=account_id, private_key=private_key, chain="base") + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) self.swap_modules = { - "uniswap": Uniswap, - "pancake": Pancake, - "woofi": WooFi, - "baseswap": BaseSwap, - "alienswap": AlienSwap, - "maverick": Maverick, - "odos": Odos, - "inch": Inch, + "syncswap": SyncSwap, + "skydrome": Skydrome, + "zebra": Zebra, "xyswap": XYSwap, - "openocean": OpenOcean, } def get_swap_module(self, use_dex: list): @@ -35,7 +30,7 @@ async def swap( sleep_to: int, min_swap: int, max_swap: int, - slippage: int, + slippage: Union[int, float], random_swap_token: bool, min_percent: int, max_percent: int @@ -43,19 +38,19 @@ async def swap( quantity_swap = random.randint(min_swap, max_swap) if random_swap_token: - path = [random.choice(["ETH", "USDBC"]) for _ in range(0, quantity_swap)] - USDBC_balance = await self.get_balance(BASE_TOKENS["USDBC"]) - if path[0] == "USDBC" and USDBC_balance["balance"] <= 1: + path = [random.choice(["ETH", "USDC"]) for _ in range(0, quantity_swap)] + usdc_balance = await self.get_balance(SCROLL_TOKENS["USDC"]) + if path[0] == "USDC" and usdc_balance["balance"] <= 1: path[0] = "ETH" else: - path = ["ETH" if _ % 2 == 0 else "USDBC" for _ in range(0, quantity_swap)] + path = ["ETH" if _ % 2 == 0 else "USDC" for _ in range(0, quantity_swap)] logger.info(f"[{self.account_id}][{self.address}] Start MultiSwap | quantity swaps: {quantity_swap}") for _, token in enumerate(path): if token == "ETH": decimal = 6 - to_token = "USDBC" + to_token = "USDC" balance = await self.w3.eth.get_balance(self.address) @@ -65,12 +60,12 @@ async def swap( decimal = 18 to_token = "ETH" - balance = await self.get_balance(BASE_TOKENS["USDBC"]) + balance = await self.get_balance(SCROLL_TOKENS["USDC"]) min_amount = balance["balance"] if balance["balance"] <= 1 else balance["balance"] / 100 * min_percent max_amount = balance["balance"] if balance["balance"] <= 1 else balance["balance"] / 100 * max_percent - swap_module = self.get_swap_module(use_dex)(self.account_id, self.private_key) + swap_module = self.get_swap_module(use_dex)(self.account_id, self.private_key, self.recipient) await swap_module.swap( token, to_token, diff --git a/modules/nftorigins.py b/modules/nftorigins.py new file mode 100644 index 0000000..b1276e0 --- /dev/null +++ b/modules/nftorigins.py @@ -0,0 +1,57 @@ +import aiohttp +from loguru import logger + +from config import NFT_ORIGINS_CONTRACT, NFT_ORIGINS_ABI +from utils.gas_checker import check_gas +from utils.helpers import retry +from .account import Account + + +class NftOrigins(Account): + def __init__(self, account_id: int, private_key: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll") + + self.contract = self.get_contract(NFT_ORIGINS_CONTRACT, NFT_ORIGINS_ABI) + + async def get_nft_data(self): + url = f"https://nft.scroll.io/p/{self.address}.json" + + async with aiohttp.ClientSession() as session: + response = await session.get(url=url) + + if response.status == 200: + transaction_data = await response.json() + + if "metadata" in transaction_data: + return transaction_data["metadata"], transaction_data["proof"] + + return False, False + + @retry + @check_gas + async def mint(self): + logger.info(f"[{self.account_id}][{self.address}] Mint Scroll Origins NFT") + + metadata, proof = await self.get_nft_data() + + if not metadata or not proof: + return logger.error(f"[{self.account_id}][{self.address}] Scroll Origins NFT Not Found") + + tx_data = await self.get_tx_data() + + transaction = await self.contract.functions.mint( + self.address, + ( + metadata.get("deployer"), + metadata.get("firstDeployedContract"), + metadata.get("bestDeployedContract"), + int(metadata.get("rarityData", 0), 16), + ), + proof + ).build_transaction(tx_data) + + signed_txn = await self.sign(transaction) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) diff --git a/modules/nfts2me.py b/modules/nfts2me.py index 29b98a6..3cef6c8 100644 --- a/modules/nfts2me.py +++ b/modules/nfts2me.py @@ -9,8 +9,8 @@ class Minter(Account): - def __init__(self, account_id: int, private_key: str) -> None: - super().__init__(account_id=account_id, private_key=private_key, chain="base") + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) @retry @check_gas diff --git a/modules/nitro.py b/modules/nitro.py new file mode 100644 index 0000000..bb2cf12 --- /dev/null +++ b/modules/nitro.py @@ -0,0 +1,97 @@ +import aiohttp +from loguru import logger +from utils.gas_checker import check_gas +from utils.helpers import retry +from .account import Account + + +class Nitro(Account): + def __init__(self, account_id: int, private_key: str, chain: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain=chain, recipient=recipient) + + self.chain_ids = { + "ethereum": "1", + "arbitrum": "42161", + "optimism": "10", + "zksync": "324", + "scroll": "534352", + "base": "8453", + "linea": "59144", + } + + async def get_quote(self, amount: int, destination_chain: str): + url = "https://api-beta.pathfinder.routerprotocol.com/api/v2/quote" + + params = { + "fromTokenAddress": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "toTokenAddress": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "amount": amount, + "fromTokenChainId": self.chain_ids[self.chain], + "toTokenChainId": self.chain_ids[destination_chain], + "partnerId": 1 + } + + async with aiohttp.ClientSession() as session: + response = await session.get(url=url, params=params) + + transaction_data = await response.json() + + return transaction_data + + async def build_transaction(self, params: dict): + url = "https://api-beta.pathfinder.routerprotocol.com/api/v2/transaction" + + async with aiohttp.ClientSession() as session: + response = await session.post(url=url, json=params) + + transaction_data = await response.json() + + return transaction_data + + @retry + @check_gas + async def bridge( + self, + destination_chain: str, + min_amount: float, + max_amount: float, + decimal: int, + all_amount: bool, + min_percent: int, + max_percent: int + ): + amount_wei, amount, balance = await self.get_amount( + "ETH", + min_amount, + max_amount, + decimal, + all_amount, + min_percent, + max_percent + ) + + logger.info( + f"[{self.account_id}][{self.address}] Bridge Nitro – {self.chain.title()} -> " + + f"{destination_chain.title()} | {amount} ETH" + ) + + quote = await self.get_quote(amount_wei, destination_chain) + quote.update({"senderAddress": self.address, "receiverAddress": self.address}) + + transaction_data = await self.build_transaction(quote) + + tx_data = await self.get_tx_data() + tx_data.update( + { + "from": self.w3.to_checksum_address(transaction_data["txn"]["from"]), + "to": self.w3.to_checksum_address(transaction_data["txn"]["to"]), + "value": transaction_data["txn"]["value"], + "data": transaction_data["txn"]["data"], + } + ) + + signed_txn = await self.sign(tx_data) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) diff --git a/modules/omnisea.py b/modules/omnisea.py new file mode 100644 index 0000000..1587a24 --- /dev/null +++ b/modules/omnisea.py @@ -0,0 +1,47 @@ +import random +import time + +from loguru import logger +from config import OMNISEA_CONTRACT, OMNISEA_ABI +from utils.gas_checker import check_gas +from utils.helpers import retry +from .account import Account + + +class Omnisea(Account): + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) + + self.contract = self.get_contract(OMNISEA_CONTRACT, OMNISEA_ABI) + + @staticmethod + def generate_collection_data(): + title = "".join(random.sample([chr(i) for i in range(97, 123)], random.randint(5, 15))) + symbol = "".join(random.sample([chr(i) for i in range(65, 91)], random.randint(3, 6))) + return title, symbol + + @retry + @check_gas + async def create(self): + logger.info(f"[{self.account_id}][{self.address}] Create NFT collection on Omnisea") + + title, symbol = self.generate_collection_data() + + tx_data = await self.get_tx_data() + + transaction = await self.contract.functions.create([ + title, + symbol, + "", + "", + 0, + True, + 0, + int(time.time()) + 1000000] + ).build_transaction(tx_data) + + signed_txn = await self.sign(transaction) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) diff --git a/modules/orbiter.py b/modules/orbiter.py index 4564254..483f58c 100644 --- a/modules/orbiter.py +++ b/modules/orbiter.py @@ -8,8 +8,8 @@ class Orbiter(Account): - def __init__(self, account_id: int, private_key: str, chain: str) -> None: - super().__init__(account_id=account_id, private_key=private_key, chain=chain) + def __init__(self, account_id: int, private_key: str, chain: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain=chain, recipient=recipient) self.chain_ids = { "ethereum": "1", diff --git a/modules/routes.py b/modules/routes.py index badb6f6..12b129c 100644 --- a/modules/routes.py +++ b/modules/routes.py @@ -6,8 +6,8 @@ class Routes(Account): - def __init__(self, account_id: int, private_key: str) -> None: - super().__init__(account_id=account_id, private_key=private_key, chain="base") + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) def process_module(self, module): if isinstance(module, list): @@ -40,6 +40,6 @@ async def start(self, use_modules: list, sleep_from: int, sleep_to: int, random_ logger.info(f"[{self.account_id}][{self.address}] Skip module") continue - await module(self.account_id, self.private_key) + await module(self.account_id, self.private_key, self.recipient) await sleep(sleep_from, sleep_to) diff --git a/modules/rubyscore.py b/modules/rubyscore.py new file mode 100644 index 0000000..368637f --- /dev/null +++ b/modules/rubyscore.py @@ -0,0 +1,28 @@ +from loguru import logger + +from config import RUBYSCORE_VOTE_CONTRACT, RUBYSCORE_VOTE_ABI +from utils.gas_checker import check_gas +from utils.helpers import retry +from .account import Account + + +class RubyScore(Account): + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) + + self.contract = self.get_contract(RUBYSCORE_VOTE_CONTRACT, RUBYSCORE_VOTE_ABI) + + @retry + @check_gas + async def vote(self): + logger.info(f"[{self.account_id}][{self.address}] RubyScore Voting") + + tx_data = await self.get_tx_data() + + transaction = await self.contract.functions.vote().build_transaction(tx_data) + + signed_txn = await self.sign(transaction) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) diff --git a/modules/safe.py b/modules/safe.py index 0a8f9e4..3645692 100644 --- a/modules/safe.py +++ b/modules/safe.py @@ -1,5 +1,4 @@ import time -from typing import Dict from loguru import logger from config import SAFE_ABI, SAFE_CONTRACT, ZERO_ADDRESS @@ -9,8 +8,8 @@ class GnosisSafe(Account): - def __init__(self, account_id: int, private_key: str) -> None: - super().__init__(account_id=account_id, private_key=private_key, chain="base") + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) self.contract = self.get_contract(SAFE_CONTRACT, SAFE_ABI) @@ -26,7 +25,7 @@ async def create_safe(self): 1, ZERO_ADDRESS, "0x", - self.w3.to_checksum_address("0x017062a1dE2FE6b99BE3d9d37841FeD19F573804"), + self.w3.to_checksum_address("0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4"), ZERO_ADDRESS, 0, ZERO_ADDRESS @@ -36,7 +35,7 @@ async def create_safe(self): tx_data = await self.get_tx_data() transaction = await self.contract.functions.createProxyWithNonce( - self.w3.to_checksum_address("0xfb1bffC9d739B8D520DaF37dF666da4C687191EA"), + self.w3.to_checksum_address("0x3E5c63644E683549055b9Be8653de26E0B4CD36E"), setup_data, int(time.time()*1000) ).build_transaction(tx_data) diff --git a/modules/scroll.py b/modules/scroll.py new file mode 100644 index 0000000..0ec3267 --- /dev/null +++ b/modules/scroll.py @@ -0,0 +1,167 @@ +from loguru import logger +from utils.gas_checker import check_gas +from utils.helpers import retry +from .account import Account + +from config import ( + BRIDGE_CONTRACTS, + DEPOSIT_ABI, + WITHDRAW_ABI, + ORACLE_ABI, + SCROLL_TOKENS, + WETH_ABI +) + + +class Scroll(Account): + def __init__(self, account_id: int, private_key: str, chain: str, recipient) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain=chain, recipient=recipient) + + @retry + @check_gas + async def deposit( + self, + min_amount: float, + max_amount: float, + decimal: int, + all_amount: bool, + min_percent: int, + max_percent: int + ): + amount_wei, amount, balance = await self.get_amount( + "ETH", + min_amount, + max_amount, + decimal, + all_amount, + min_percent, + max_percent + ) + + logger.info(f"[{self.account_id}][{self.address}] Bridge to Scroll | {amount} ETH") + + contract = self.get_contract(BRIDGE_CONTRACTS["deposit"], DEPOSIT_ABI) + contract_oracle = self.get_contract(BRIDGE_CONTRACTS["oracle"], ORACLE_ABI) + + fee = await contract_oracle.functions.estimateCrossDomainMessageFee(168000).call() + + tx_data = await self.get_tx_data(amount_wei + fee, False) + + transaction = await contract.functions.depositETH( + amount_wei, + 168000, + ).build_transaction(tx_data) + + signed_txn = await self.sign(transaction) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) + + @retry + @check_gas + async def withdraw( + self, + min_amount: float, + max_amount: float, + decimal: int, + all_amount: bool, + min_percent: int, + max_percent: int + ): + amount_wei, amount, balance = await self.get_amount( + "ETH", + min_amount, + max_amount, + decimal, + all_amount, + min_percent, + max_percent + ) + + logger.info(f"[{self.account_id}][{self.address}] Bridge from Scroll | {amount} ETH") + + contract = self.get_contract(BRIDGE_CONTRACTS["withdraw"], WITHDRAW_ABI) + + tx_data = await self.get_tx_data(amount_wei) + + transaction = await contract.functions.withdrawETH( + amount_wei, + 0 + ).build_transaction(tx_data) + + signed_txn = await self.sign(transaction) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) + + @retry + @check_gas + async def wrap_eth( + self, + min_amount: float, + max_amount: float, + decimal: int, + all_amount: bool, + min_percent: int, + max_percent: int + ): + amount_wei, amount, balance = await self.get_amount( + "ETH", + min_amount, + max_amount, + decimal, + all_amount, + min_percent, + max_percent + ) + + weth_contract = self.get_contract(SCROLL_TOKENS["WETH"], WETH_ABI) + + logger.info(f"[{self.account_id}][{self.address}] Wrap {amount} ETH") + + tx_data = await self.get_tx_data(amount_wei) + + transaction = await weth_contract.functions.deposit().build_transaction(tx_data) + + signed_txn = await self.sign(transaction) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) + + @retry + @check_gas + async def unwrap_eth( + self, + min_amount: float, + max_amount: float, + decimal: int, + all_amount: bool, + min_percent: int, + max_percent: int + ): + amount_wei, amount, balance = await self.get_amount( + "WETH", + min_amount, + max_amount, + decimal, + all_amount, + min_percent, + max_percent + ) + + weth_contract = self.get_contract(SCROLL_TOKENS["WETH"], WETH_ABI) + + logger.info(f"[{self.account_id}][{self.address}] Unwrap {amount} ETH") + + tx_data = await self.get_tx_data() + + transaction = await weth_contract.functions.withdraw(amount_wei).build_transaction(tx_data) + + signed_txn = await self.sign(transaction) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) diff --git a/modules/skydrome.py b/modules/skydrome.py new file mode 100644 index 0000000..92781fd --- /dev/null +++ b/modules/skydrome.py @@ -0,0 +1,175 @@ +import time + +from loguru import logger +from web3 import Web3 +from config import SKYDROME_ROUTER_ABI, SKYDROME_CONTRACTS, SCROLL_TOKENS +from utils.gas_checker import check_gas +from utils.helpers import retry +from .account import Account + + +class Skydrome(Account): + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) + + self.swap_contract = self.get_contract(SKYDROME_CONTRACTS["router"], SKYDROME_ROUTER_ABI) + + async def get_min_amount_out(self, from_token: str, to_token: str, amount: int, slippage: float): + min_amount_out, swap_type = await self.swap_contract.functions.getAmountOut( + amount, + Web3.to_checksum_address(from_token), + Web3.to_checksum_address(to_token) + ).call() + return int(min_amount_out - (min_amount_out / 100 * slippage)), swap_type + + async def swap_to_token(self, from_token: str, to_token: str, amount: int, slippage: int): + tx_data = await self.get_tx_data(amount) + + + deadline = int(time.time()) + 1000000 + + min_amount_out, swap_type = await self.get_min_amount_out( + SCROLL_TOKENS[from_token], + SCROLL_TOKENS[to_token], + amount, + slippage + ) + + + + contract_txn = await self.swap_contract.functions.swapExactETHForTokens( + min_amount_out, + [ + [ + Web3.to_checksum_address(SCROLL_TOKENS[from_token]), + Web3.to_checksum_address(SCROLL_TOKENS[to_token]), + swap_type + ] + ], + self.address, + deadline + ).build_transaction(tx_data) + + + + return contract_txn + + async def swap_to_eth(self, from_token: str, to_token: str, amount: int, slippage: int): + token_address = Web3.to_checksum_address(SCROLL_TOKENS[from_token]) + + await self.approve(amount, token_address, SKYDROME_CONTRACTS["router"]) + + tx_data = await self.get_tx_data() + + deadline = int(time.time()) + 1000000 + + min_amount_out, swap_type = await self.get_min_amount_out( + SCROLL_TOKENS[from_token], + SCROLL_TOKENS[to_token], + amount, + slippage + ) + + + contract_txn = await self.swap_contract.functions.swapExactTokensForETH( + amount, + min_amount_out, + [ + [ + Web3.to_checksum_address(SCROLL_TOKENS[from_token]), + Web3.to_checksum_address(SCROLL_TOKENS[to_token]), + swap_type + ] + ], + self.address, + deadline + ).build_transaction(tx_data) + + + + return contract_txn + + @retry + @check_gas + async def swap( + self, + from_token: str, + to_token: str, + min_amount: float, + max_amount: float, + decimal: int, + slippage: int, + all_amount: bool, + min_percent: int, + max_percent: int + ): + + global converted_amount + + + + if from_token == "ETH": + amount_wei, amount, balance = await self.get_amount( + from_token, + min_amount, + max_amount, + decimal, + all_amount, + min_percent, + max_percent, + # to_token=to_token, + # slippage=slippage + ) + + min_amount_out, _ = await self.get_min_amount_out( + SCROLL_TOKENS[from_token], + SCROLL_TOKENS[to_token], + amount_wei, + slippage + ) + # logger.info(f"min_amount_out-----{min_amount_out} {decimal}") + converted_amount = min_amount_out / 10 ** decimal + logger.info( + f"[{self.account_id}][{self.address[:5]+'.....'+self.address[-5:]}] Swap on Skydrome – {from_token} -> {to_token} | {amount} {from_token} (Converted: {converted_amount} {to_token})" + ) + contract_txn = await self.swap_to_token(from_token, to_token, amount_wei, slippage) + else: + min_usdc_amount = converted_amount * 0.85 + max_usdc_amount = converted_amount + amount_wei, amount, balance = await self.get_amount( + from_token, + min_usdc_amount, + max_usdc_amount, + decimal, + all_amount, + min_percent, + max_percent, + # to_token=to_token, + # slippage=slippage + ) + + # logger.info(f"amount_wei======={amount_wei}") + min_amount_out, _ = await self.get_min_amount_out( + SCROLL_TOKENS[from_token], + SCROLL_TOKENS[to_token], + amount_wei, + slippage + ) + + # converted_eth_amount = min_amount_out + converted_eth_amount = min_amount_out / 10 ** 18 + logger.info( + f"[{self.account_id}][{self.address[:5]+'.....'+self.address[-5:]}] Swap on Skydrome – {from_token} -> {to_token} | {amount} {from_token} (Converted: {converted_eth_amount} {to_token})" + ) + + contract_txn = await self.swap_to_eth(from_token, to_token, amount_wei, slippage) + + signed_txn = await self.sign(contract_txn) + + txn_hash = await self.send_raw_transaction(signed_txn) + + + await self.wait_until_tx_finished(txn_hash.hex()) + + + diff --git a/modules/swap_tokens.py b/modules/swap_tokens.py index 524913f..efa5d56 100644 --- a/modules/swap_tokens.py +++ b/modules/swap_tokens.py @@ -1,27 +1,21 @@ import random -from typing import List +from typing import List, Union from loguru import logger -from config import BASE_TOKENS +from config import SCROLL_TOKENS from modules import * from utils.sleeping import sleep class SwapTokens(Account): - def __init__(self, account_id: int, private_key: str) -> None: - super().__init__(account_id=account_id, private_key=private_key, chain="base") + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) self.swap_modules = { - "uniswap": Uniswap, - "pancake": Pancake, - "woofi": WooFi, - "baseswap": BaseSwap, - "alienswap": AlienSwap, - "maverick": Maverick, - "odos": Odos, - "inch": Inch, + "syncswap": SyncSwap, + "skydrome": Skydrome, + "zebra": Zebra, "xyswap": XYSwap, - "openocean": OpenOcean, } def get_swap_module(self, use_dex: list): @@ -34,7 +28,7 @@ async def swap( tokens: List, sleep_from: int, sleep_to: int, - slippage: int, + slippage: Union[int, float], min_percent: int, max_percent: int, ): @@ -46,10 +40,10 @@ async def swap( if token == "ETH": continue - balance = await self.get_balance(BASE_TOKENS[token]) + balance = await self.get_balance(SCROLL_TOKENS[token]) if balance["balance_wei"] > 0: - swap_module = self.get_swap_module(use_dex)(self.account_id, self.private_key) + swap_module = self.get_swap_module(use_dex)(self.account_id, self.private_key, self.recipient) await swap_module.swap( token, "ETH", diff --git a/modules/syncswap.py b/modules/syncswap.py new file mode 100644 index 0000000..dc9cff4 --- /dev/null +++ b/modules/syncswap.py @@ -0,0 +1,152 @@ +import time + +from loguru import logger +from web3 import Web3 +from config import ( + SCROLL_TOKENS, + SYNCSWAP_CLASSIC_POOL_ABI, + ZERO_ADDRESS, + SYNCSWAP_CONTRACTS, + SYNCSWAP_ROUTER_ABI, + SYNCSWAP_CLASSIC_POOL_DATA_ABI +) +from utils.gas_checker import check_gas +from utils.helpers import retry +from .account import Account +from eth_abi import abi + +# converted_amount = 0 +class SyncSwap(Account): + converted_amount = 0 + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) + + self.swap_contract = self.get_contract(SYNCSWAP_CONTRACTS["router"], SYNCSWAP_ROUTER_ABI) + + async def get_pool(self, from_token: str, to_token: str): + contract = self.get_contract(SYNCSWAP_CONTRACTS["classic_pool"], SYNCSWAP_CLASSIC_POOL_ABI) + + pool_address = await contract.functions.getPool( + Web3.to_checksum_address(SCROLL_TOKENS[from_token]), + Web3.to_checksum_address(SCROLL_TOKENS[to_token]) + ).call() + + return pool_address + + async def get_min_amount_out(self, pool_address: str, token_address: str, amount: int, slippage: float): + pool_contract = self.get_contract(pool_address, SYNCSWAP_CLASSIC_POOL_DATA_ABI) + + min_amount_out = await pool_contract.functions.getAmountOut( + token_address, + amount, + self.address + ).call() + + return int(min_amount_out - (min_amount_out / 100 * slippage)) + + @retry + @check_gas + async def swap( + self, + from_token: str, + to_token: str, + min_amount: float, + max_amount: float, + decimal: int, + slippage: float, + all_amount: bool, + min_percent: int, + max_percent: int + ): + token_address = Web3.to_checksum_address(SCROLL_TOKENS[from_token]) + global converted_amount + + + # amount_wei, amount, balance = await self.get_amount( + # from_token, + # min_amount, + # max_amount, + # decimal, + # all_amount, + # min_percent, + # max_percent + # ) + + # logger.info( + # f"[{self.account_id}][{self.address}] Swap on SyncSwap – {from_token} -> {to_token} | {amount} {from_token}" + # ) + + + pool_address = await self.get_pool(from_token, to_token) + + if pool_address != ZERO_ADDRESS: + tx_data = await self.get_tx_data() + + if from_token == "ETH": + amount_wei, amount, balance = await self.get_amount( + from_token, + min_amount, + max_amount, + decimal, + all_amount, + min_percent, + max_percent + ) + min_amount_out = await self.get_min_amount_out(pool_address, token_address, amount_wei, slippage) + self.converted_amount = min_amount_out / 10 ** decimal + logger.info( + f"[{self.account_id}][{self.address[:5]+'.....'+self.address[-5:]}] Swap on SyncSwap – {from_token} -> {to_token} | {amount} {from_token} (Converted: {self.converted_amount} {to_token})" + ) + tx_data.update({"value": amount_wei}) + else: + min_usdc_amount = self.converted_amount * 0.85 + max_usdc_amount = self.converted_amount + + amount_wei, amount, balance = await self.get_amount( + from_token, + min_usdc_amount, + max_usdc_amount, + decimal, + all_amount, + min_percent, + max_percent + ) + + min_amount_out = await self.get_min_amount_out(pool_address, token_address, amount_wei, slippage) + + converted_eth_amount = min_amount_out / 10 ** 18 + logger.info( + f"[{self.account_id}][{self.address[:5]+'.....'+self.address[-5:]}] Swap on SyncSwap – {from_token} -> {to_token} | {amount} {from_token} (Converted: {converted_eth_amount} {to_token})" + ) + await self.approve(amount_wei, token_address, Web3.to_checksum_address(SYNCSWAP_CONTRACTS["router"])) + + # min_amount_out = await self.get_min_amount_out(pool_address, token_address, amount_wei, slippage) + + steps = [{ + "pool": pool_address, + "data": abi.encode(["address", "address", "uint8"], [token_address, self.address, 1]), + "callback": ZERO_ADDRESS, + "callbackData": "0x" + }] + + paths = [{ + "steps": steps, + "tokenIn": ZERO_ADDRESS if from_token == "ETH" else token_address, + "amountIn": amount_wei + }] + + deadline = int(time.time()) + 1000000 + + contract_txn = await self.swap_contract.functions.swap( + paths, + min_amount_out, + deadline + ).build_transaction(tx_data) + + signed_txn = await self.sign(contract_txn) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) + else: + logger.error(f"[{self.account_id}][{self.address}] Swap path {from_token} to {to_token} not found!") \ No newline at end of file diff --git a/modules/transfer.py b/modules/transfer.py new file mode 100644 index 0000000..b26fe3b --- /dev/null +++ b/modules/transfer.py @@ -0,0 +1,44 @@ +from eth_utils import to_bytes +from loguru import logger +from utils.gas_checker import check_gas +from utils.helpers import retry +from .account import Account + + +class Transfer(Account): + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) + + @retry + @check_gas + async def transfer( + self, + min_amount: float, + max_amount: float, + decimal: int, + all_amount: bool, + min_percent: int, + max_percent: int + ) -> None: + amount_wei, amount, balance = await self.get_amount( + "ETH", + min_amount, + max_amount, + decimal, + all_amount, + min_percent, + max_percent + ) + + logger.info(f"[{self.account_id}][{self.address}] Make transfer to {self.recipient} | {amount} ETH") + + tx_data = await self.get_tx_data(amount_wei) + tx_data.update({ + "to": self.w3.to_checksum_address(self.recipient) + }) + + signed_txn = await self.sign(tx_data) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) diff --git a/modules/tx_checker.py b/modules/tx_checker.py index ed32157..eb3a792 100644 --- a/modules/tx_checker.py +++ b/modules/tx_checker.py @@ -3,17 +3,17 @@ from eth_typing import ChecksumAddress from loguru import logger -from web3 import AsyncWeb3 +from web3 import AsyncWeb3, AsyncHTTPProvider +from web3.middleware import async_geth_poa_middleware from eth_account import Account as EthereumAccount from tabulate import tabulate -from web3.middleware import async_geth_poa_middleware -from config import ACCOUNTS, RPC +from config import RPC async def get_nonce(address: ChecksumAddress): web3 = AsyncWeb3( - AsyncWeb3.AsyncHTTPProvider(random.choice(RPC["base"]["rpc"])), + AsyncHTTPProvider(random.choice(RPC["scroll"]["rpc"])), middlewares=[async_geth_poa_middleware], ) @@ -22,12 +22,12 @@ async def get_nonce(address: ChecksumAddress): return nonce -async def check_tx(): +async def check_tx(wallets: list[str]): tasks = [] logger.info("Start transaction checker") - for _id, pk in enumerate(ACCOUNTS, start=1): + for _id, pk in enumerate(wallets, start=1): account = EthereumAccount.from_key(pk) tasks.append(asyncio.create_task(get_nonce(account.address), name=account.address)) diff --git a/modules/xyswap.py b/modules/xyswap.py index 4384646..9fd87d6 100644 --- a/modules/xyswap.py +++ b/modules/xyswap.py @@ -2,15 +2,15 @@ import aiohttp from loguru import logger -from config import XYSWAP_CONTRACT, BASE_TOKENS +from config import XYSWAP_CONTRACT, SCROLL_TOKENS from utils.gas_checker import check_gas from utils.helpers import retry from .account import Account class XYSwap(Account): - def __init__(self, account_id: int, private_key: str) -> None: - super().__init__(account_id=account_id, private_key=private_key, chain="base") + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) async def get_quote(self, from_token: str, to_token: str, amount: int, slippage: float): url = "https://aggregator-api.xy.finance/v1/quote" @@ -86,8 +86,8 @@ async def swap( f"[{self.account_id}][{self.address}] Swap on XYSwap – {from_token} -> {to_token} | {amount} {from_token}" ) - from_token = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" if from_token == "ETH" else BASE_TOKENS[from_token] - to_token = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" if to_token == "ETH" else BASE_TOKENS[to_token] + from_token = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" if from_token == "ETH" else SCROLL_TOKENS[from_token] + to_token = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" if to_token == "ETH" else SCROLL_TOKENS[to_token] quote = await self.get_quote(from_token, to_token, amount_wei, slippage) diff --git a/modules/zebra.py b/modules/zebra.py new file mode 100644 index 0000000..be351c3 --- /dev/null +++ b/modules/zebra.py @@ -0,0 +1,117 @@ +import time + +from loguru import logger +from web3 import Web3 +from config import ZEBRA_ROUTER_ABI, ZEBRA_CONTRACTS, SCROLL_TOKENS +from utils.gas_checker import check_gas +from utils.helpers import retry +from .account import Account + + +class Zebra(Account): + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) + + self.swap_contract = self.get_contract(ZEBRA_CONTRACTS["router"], ZEBRA_ROUTER_ABI) + + async def get_min_amount_out(self, from_token: str, to_token: str, amount: int, slippage: float): + min_amount_out = await self.swap_contract.functions.getAmountsOut( + amount, + [ + Web3.to_checksum_address(from_token), + Web3.to_checksum_address(to_token) + ] + ).call() + return int(min_amount_out[1] - (min_amount_out[1] / 100 * slippage)) + + async def swap_to_token(self, from_token: str, to_token: str, amount: int, slippage: int): + tx_data = await self.get_tx_data(amount) + + deadline = int(time.time()) + 1000000 + + min_amount_out = await self.get_min_amount_out( + SCROLL_TOKENS[from_token], + SCROLL_TOKENS[to_token], + amount, + slippage + ) + + contract_txn = await self.swap_contract.functions.swapExactETHForTokens( + min_amount_out, + [ + Web3.to_checksum_address(SCROLL_TOKENS[from_token]), + Web3.to_checksum_address(SCROLL_TOKENS[to_token]), + ], + self.address, + deadline + ).build_transaction(tx_data) + + return contract_txn + + async def swap_to_eth(self, from_token: str, to_token: str, amount: int, slippage: int): + token_address = Web3.to_checksum_address(SCROLL_TOKENS[from_token]) + + await self.approve(amount, token_address, ZEBRA_CONTRACTS["router"]) + + tx_data = await self.get_tx_data() + + deadline = int(time.time()) + 1000000 + + min_amount_out = await self.get_min_amount_out( + SCROLL_TOKENS[from_token], + SCROLL_TOKENS[to_token], + amount, + slippage + ) + + contract_txn = await self.swap_contract.functions.swapExactTokensForETH( + amount, + min_amount_out, + [ + Web3.to_checksum_address(SCROLL_TOKENS[from_token]), + Web3.to_checksum_address(SCROLL_TOKENS[to_token]), + ], + self.address, + deadline + ).build_transaction(tx_data) + + return contract_txn + + @retry + @check_gas + async def swap( + self, + from_token: str, + to_token: str, + min_amount: float, + max_amount: float, + decimal: int, + slippage: int, + all_amount: bool, + min_percent: int, + max_percent: int + ): + amount_wei, amount, balance = await self.get_amount( + from_token, + min_amount, + max_amount, + decimal, + all_amount, + min_percent, + max_percent + ) + + logger.info( + f"[{self.account_id}][{self.address}] Swap on Zebra – {from_token} -> {to_token} | {amount} {from_token}" + ) + + if from_token == "ETH": + contract_txn = await self.swap_to_token(from_token, to_token, amount_wei, slippage) + else: + contract_txn = await self.swap_to_eth(from_token, to_token, amount_wei, slippage) + + signed_txn = await self.sign(contract_txn) + + txn_hash = await self.send_raw_transaction(signed_txn) + + await self.wait_until_tx_finished(txn_hash.hex()) diff --git a/modules/zerius.py b/modules/zerius.py index 4dec51b..9b68bf2 100644 --- a/modules/zerius.py +++ b/modules/zerius.py @@ -1,5 +1,5 @@ import random -from typing import Dict, List +from typing import List from loguru import logger @@ -11,13 +11,12 @@ class Zerius(Account): - def __init__(self, account_id: int, private_key: str) -> None: - super().__init__(account_id=account_id, private_key=private_key, chain="base") + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) self.contract = self.get_contract(ZERIUS_CONTRACT, ZERIUS_ABI) self.chain_ids = { - "zora": 195, "arbitrum": 110, "optimism": 111, "polygon": 109, diff --git a/modules/zkstars.py b/modules/zkstars.py index 6eea0a9..03221ec 100644 --- a/modules/zkstars.py +++ b/modules/zkstars.py @@ -9,8 +9,8 @@ class ZkStars(Account): - def __init__(self, account_id: int, private_key: str) -> None: - super().__init__(account_id=account_id, private_key=private_key, chain="base") + def __init__(self, account_id: int, private_key: str, recipient: str) -> None: + super().__init__(account_id=account_id, private_key=private_key, chain="scroll", recipient=recipient) @retry @check_gas diff --git a/modules_settings.py b/modules_settings.py index c062025..ed83296 100644 --- a/modules_settings.py +++ b/modules_settings.py @@ -1,9 +1,12 @@ import asyncio - from modules import * +import datetime +import json +import os +from Crypto.Cipher import AES +from Crypto.Util.Padding import unpad - -async def bridge_base(account_id, key): +async def deposit_scroll(account_id, key, recipient): """ Deposit from official bridge ______________________________________________________ @@ -16,432 +19,301 @@ async def bridge_base(account_id, key): all_amount = True - min_percent = 5 - max_percent = 10 + min_percent = 1 + max_percent = 1 - base = Base(account_id, key, "ethereum") - await base.deposit(min_amount, max_amount, decimal, all_amount, min_percent, max_percent) + scroll = Scroll(account_id, key, "ethereum", recipient) + await scroll.deposit(min_amount, max_amount, decimal, all_amount, min_percent, max_percent) -async def bridge_orbiter(account_id, key): +async def withdraw_scroll(account_id, key, recipient): """ - Bridge from orbiter + Withdraw from official bridge ______________________________________________________ - from_chain – ethereum, base, polygon_zkevm, arbitrum, optimism, zksync | Select one - to_chain – ethereum, base, polygon_zkevm, arbitrum, optimism, zksync | Select one + all_amount - withdraw from min_percent to max_percent """ - from_chain = "zksync" - to_chain = "base" - - min_amount = 0.005 - max_amount = 0.0051 + min_amount = 0.0012 + max_amount = 0.0012 decimal = 4 - all_amount = False + all_amount = True - min_percent = 5 + min_percent = 10 max_percent = 10 - orbiter = Orbiter(account_id, key, from_chain) - await orbiter.bridge(to_chain, min_amount, max_amount, decimal, all_amount, min_percent, max_percent) + scroll = Scroll(account_id, key, "scroll", recipient) + try: + await scroll.withdraw(min_amount, max_amount, decimal, all_amount, min_percent, max_percent) + except Exception as e: + logger.error(f"Output while dealing with func:await scroll.withdraw{e} ") + await scroll.withdraw(min_amount, max_amount, decimal, all_amount, min_percent, max_percent) -async def wrap_eth(account_id, key): +async def bridge_orbiter(account_id, key, recipient): """ - Wrap ETH + Bridge from orbiter ______________________________________________________ - all_amount - wrap from min_percent to max_percent + from_chain – ethereum, base, polygon_zkevm, arbitrum, optimism, zksync, scroll | Select one + to_chain – ethereum, base, polygon_zkevm, arbitrum, optimism, zksync, scroll | Select one """ - min_amount = 0.001 - max_amount = 0.002 + from_chain = "scroll" + to_chain = "base" + + min_amount = 0.005 + max_amount = 0.0051 decimal = 4 - all_amount = True + all_amount = False min_percent = 5 max_percent = 10 - base = Base(account_id, key, "base") - await base.wrap_eth(min_amount, max_amount, decimal, all_amount, min_percent, max_percent) - - -async def unwrap_eth(account_id, key): - """ - Unwrap ETH - ______________________________________________________ - all_amount - unwrap from min_percent to max_percent - """ - - min_amount = 0.001 - max_amount = 0.002 - decimal = 4 - - all_amount = True - - min_percent = 100 - max_percent = 100 - - base = Base(account_id, key, "base") - await base.unwrap_eth(min_amount, max_amount, decimal, all_amount, min_percent, max_percent) + orbiter = Orbiter(account_id=account_id, private_key=key, chain=from_chain, recipient=recipient) + await orbiter.bridge(to_chain, min_amount, max_amount, decimal, all_amount, min_percent, max_percent) -async def swap_uniswap(account_id, key): +async def bridge_layerswap(account_id, key, recipient): """ - Make swap on Uniswap + Bridge from Layerswap ______________________________________________________ - from_token – Choose SOURCE token ETH, USDBC | Select one - to_token – Choose DESTINATION token ETH, USDBC | Select one - - Disclaimer - You can swap only ETH to any token or any token to ETH! - ______________________________________________________ - all_amount - swap from min_percent to max_percent - """ - - from_token = "USDBC" - to_token = "ETH" - - min_amount = 0.001 - max_amount = 0.002 - decimal = 6 - slippage = 1 - - all_amount = True - - min_percent = 1 - max_percent = 1 - - uniswap = Uniswap(account_id, key) - await uniswap.swap( - from_token, to_token, min_amount, max_amount, decimal, slippage, all_amount, min_percent, max_percent - ) + from_chain - Choose any chain: ethereum, arbitrum, optimism, avalanche, polygon, base, scroll + to_chain - Choose any chain: ethereum, arbitrum, optimism, avalanche, polygon, base, scroll + make_withdraw - True, if need withdraw after deposit -async def swap_pancake(account_id, key): + all_amount - deposit from min_percent to max_percent """ - Make swap on PancakeSwap - ______________________________________________________ - from_token – Choose SOURCE token ETH, USDBC | Select one - to_token – Choose DESTINATION token ETH, USDBC | Select one - Disclaimer - You can swap only ETH to any token or any token to ETH! - ______________________________________________________ - all_amount - swap from min_percent to max_percent - """ + from_chain = "zksync" + to_chain = "scroll" - from_token = "ETH" - to_token = "USDBC" + min_amount = 0.003 + max_amount = 0.004 - min_amount = 0.001 - max_amount = 0.002 - decimal = 6 - slippage = 1 + decimal = 5 all_amount = True - min_percent = 1 - max_percent = 1 + min_percent = 5 + max_percent = 5 - pancake = Pancake(account_id, key) - await pancake.swap( - from_token, to_token, min_amount, max_amount, decimal, slippage, all_amount, min_percent, max_percent + layerswap = LayerSwap(account_id=account_id, private_key=key, chain=from_chain, recipient=recipient) + await layerswap.bridge( + from_chain, to_chain, min_amount, max_amount, decimal, all_amount, min_percent, max_percent ) -async def swap_woofi(account_id, key): +async def bridge_nitro(account_id, key, recipient): """ - Make swap on WooFi + Bridge from nitro ______________________________________________________ - from_token – Choose SOURCE token ETH, USDBC | Select one - to_token – Choose DESTINATION token ETH, USDBC | Select one - ______________________________________________________ - all_amount - swap from min_percent to max_percent + from_chain – ethereum, arbitrum, optimism, zksync, scroll, base, linea | Select one + to_chain – ethereum, arbitrum, optimism, zksync, scroll, base, linea | Select one """ - from_token = "ETH" - to_token = "USDBC" + from_chain = "zksync" + to_chain = "scroll" - min_amount = 0.0001 - max_amount = 0.0002 - decimal = 6 - slippage = 1 + min_amount = 0.005 + max_amount = 0.0051 + decimal = 4 - all_amount = True + all_amount = False - min_percent = 1 - max_percent = 1 + min_percent = 5 + max_percent = 10 - woofi = WooFi(account_id, key) - await woofi.swap( - from_token, to_token, min_amount, max_amount, decimal, slippage, all_amount, min_percent, max_percent - ) + nitro = Nitro(account_id=account_id, private_key=key, chain=from_chain, recipient=recipient) + await nitro.bridge(to_chain, min_amount, max_amount, decimal, all_amount, min_percent, max_percent) -async def swap_baseswap(account_id, key): +async def wrap_eth(account_id, key, recipient): """ - Make swap on BaseSwap - ______________________________________________________ - from_token – Choose SOURCE token ETH, USDBC | Select one - to_token – Choose DESTINATION token ETH, USDBC | Select one - - Disclaimer - You can swap only ETH to any token or any token to ETH! + Wrap ETH ______________________________________________________ - all_amount - swap from min_percent to max_percent + all_amount - wrap from min_percent to max_percent """ - from_token = "USDBC" - to_token = "ETH" - - min_amount = 0.0001 - max_amount = 0.0002 - decimal = 6 - slippage = 1 + min_amount = 0.001 + max_amount = 0.002 + decimal = 4 all_amount = True - min_percent = 1 - max_percent = 1 + min_percent = 5 + max_percent = 10 - baseswap = BaseSwap(account_id, key) - await baseswap.swap(from_token, to_token, min_amount, max_amount, decimal, slippage, all_amount, min_percent, - max_percent) + scroll = Scroll(account_id, key, "scroll", recipient) + await scroll.wrap_eth(min_amount, max_amount, decimal, all_amount, min_percent, max_percent) -async def swap_alienswap(account_id, key): +async def unwrap_eth(account_id, key, recipient): """ - Make swap on AlienSwap - ______________________________________________________ - from_token – Choose SOURCE token ETH, USDBC | Select one - to_token – Choose DESTINATION token ETH, USDBC | Select one - - Disclaimer - You can swap only ETH to any token or any token to ETH! + Unwrap ETH ______________________________________________________ - all_amount - swap from min_percent to max_percent + all_amount - unwrap from min_percent to max_percent """ - from_token = "USDC" - to_token = "ETH" - - min_amount = 0.0001 - max_amount = 0.0002 - decimal = 6 - slippage = 1 + min_amount = 0.001 + max_amount = 0.002 + decimal = 4 all_amount = True min_percent = 100 max_percent = 100 - alienswap = AlienSwap(account_id, key) - await alienswap.swap( - from_token, to_token, min_amount, max_amount, decimal, slippage, all_amount, min_percent, max_percent - ) + scroll = Scroll(account_id, key, "scroll", recipient) + await scroll.unwrap_eth(min_amount, max_amount, decimal, all_amount, min_percent, max_percent) -async def swap_odos(account_id, key): +async def swap_skydrome(account_id, key, recipient, + from_token="USDC", to_token="ETH", + min_amount=0.0001, max_amount=0.0002, decimal=6, slippage=1, + all_amount=True, min_percent=100, max_percent=100): """ - Make swap on Odos + Make swap on Skydrome ______________________________________________________ - from_token – Choose SOURCE token ETH, WETH, USDBC | Select one - to_token – Choose DESTINATION token ETH, WETH, USDBC | Select one + from_token – Choose SOURCE token ETH, USDC | Select one + to_token – Choose DESTINATION token ETH, USDC | Select one - Disclaimer - If you use True for use_fee, you support me 1% of the transaction amount + Disclaimer - You can swap only ETH to any token or any token to ETH! ______________________________________________________ all_amount - swap from min_percent to max_percent """ - from_token = "USDBC" - to_token = "ETH" + from_token = from_token + to_token = to_token - min_amount = 0.0001 - max_amount = 0.0002 - decimal = 6 - slippage = 1 + min_amount = min_amount + max_amount = max_amount + decimal = decimal + slippage = slippage - all_amount = True + all_amount = all_amount - min_percent = 1 - max_percent = 1 + min_percent = min_percent + max_percent = max_percent - odos = Odos(account_id, key) - await odos.swap( - from_token, to_token, min_amount, max_amount, decimal, slippage, all_amount, min_percent, max_percent - ) + skydrome = Skydrome(account_id, key, recipient) + try: + await skydrome.swap( + from_token, to_token, min_amount, max_amount, decimal, slippage, all_amount, min_percent, max_percent + ) + except Exception as e: + logger.error(f"Output while dealing with func:skydrome.swap : {e} ") + await skydrome.swap( + from_token, to_token, min_amount, max_amount, decimal, slippage, all_amount, min_percent, max_percent + ) -async def swap_inch(account_id, key): +async def swap_zebra(account_id, key, recipient, + from_token="USDC", to_token="ETH", + min_amount=0.0001, max_amount=0.0002, decimal=6, slippage=1, + all_amount=True, min_percent=100, max_percent=100): """ - Make swap on 1inch + Make swap on Zebra ______________________________________________________ - from_token – Choose SOURCE token ETH, WETH, USDBC | Select one - to_token – Choose DESTINATION token ETH, WETH, USDBC | Select one + from_token – Choose SOURCE token ETH, USDC | Select one + to_token – Choose DESTINATION token ETH, USDC | Select one - Disclaimer - If you use True for use_fee, you support me 1% of the transaction amount + Disclaimer - You can swap only ETH to any token or any token to ETH! ______________________________________________________ all_amount - swap from min_percent to max_percent """ - from_token = "ETH" - to_token = "USDBC" + from_token = from_token + to_token = to_token - min_amount = 0.0001 - max_amount = 0.0002 - decimal = 6 - slippage = 1 + min_amount = min_amount + max_amount = max_amount + decimal = decimal + slippage = slippage - all_amount = True + all_amount = all_amount - min_percent = 1 - max_percent = 1 + min_percent = min_percent + max_percent = max_percent - inch_dex = Inch(account_id, key) - await inch_dex.swap( + zebra = Zebra(account_id, key, recipient) + await zebra.swap( from_token, to_token, min_amount, max_amount, decimal, slippage, all_amount, min_percent, max_percent ) -async def swap_openocean(account_id, key): +async def swap_syncswap(account_id, key, recipient, + from_token="USDC", to_token="ETH", + min_amount=0.0001, max_amount=0.0002, decimal=6, slippage=1, + all_amount=True, min_percent=100, max_percent=100): """ - Make swap on OpenOcean - ______________________________________________________ - from_token – Choose SOURCE token ETH, WETH, USDBC | Select one - to_token – Choose DESTINATION token ETH, WETH, USDBC | Select one + Make swap on SyncSwap - Disclaimer - If you use True for use_fee, you support me 1% of the transaction amount + from_token – Choose SOURCE token ETH, USDC | Select one + to_token – Choose DESTINATION token ETH, USDC | Select one + + Disclaimer – Don't use stable coin in from and to token | from_token USDC to_token USDT DON'T WORK!!! ______________________________________________________ all_amount - swap from min_percent to max_percent """ - from_token = "ETH" - to_token = "USDBC" + from_token = from_token + to_token = to_token - min_amount = 0.0001 - max_amount = 0.0001 - decimal = 6 - slippage = 1 + min_amount = min_amount + max_amount = max_amount + decimal = decimal + slippage = slippage - all_amount = True + all_amount = all_amount - min_percent = 1 - max_percent = 1 + min_percent = min_percent + max_percent = max_percent - openocean = OpenOcean(account_id, key) - await openocean.swap( + syncswap = SyncSwap(account_id, key, recipient) + await syncswap.swap( from_token, to_token, min_amount, max_amount, decimal, slippage, all_amount, min_percent, max_percent ) -async def swap_xyswap(account_id, key): +async def swap_xyswap(account_id, key, recipient, + from_token="USDC", to_token="ETH", + min_amount=0.0001, max_amount=0.0002, decimal=6, slippage=1, + all_amount=True, min_percent=100, max_percent=100): """ Make swap on XYSwap ______________________________________________________ - from_token – Choose SOURCE token ETH, WETH, USDBC | Select one - to_token – Choose DESTINATION token ETH, WETH, USDBC | Select one + from_token – Choose SOURCE token ETH, WETH, USDC | Select one + to_token – Choose DESTINATION token ETH, WETH, USDC | Select one Disclaimer - If you use True for use_fee, you support me 1% of the transaction amount ______________________________________________________ all_amount - swap from min_percent to max_percent """ - from_token = "ETH" - to_token = "USDBC" + from_token = from_token + to_token = to_token - min_amount = 0.0001 - max_amount = 0.0001 - decimal = 6 - slippage = 1 + min_amount = min_amount + max_amount = max_amount + decimal = decimal + slippage = slippage - all_amount = True + all_amount = all_amount - min_percent = 1 - max_percent = 1 + min_percent = min_percent + max_percent = max_percent - xyswap = XYSwap(account_id, key) + xyswap = XYSwap(account_id, key, recipient) await xyswap.swap( from_token, to_token, min_amount, max_amount, decimal, slippage, all_amount, min_percent, max_percent ) -async def swap_maverick(account_id, key): - """ - Make swap on Maverick - ______________________________________________________ - from_token – Choose SOURCE token ETH, USDBC | Select one - to_token – Choose DESTINATION token ETH, USDBC | Select one - ______________________________________________________ - all_amount - swap from min_percent to max_percent - """ - - from_token = "ETH" - to_token = "USDBC" - - min_amount = 0.0001 - max_amount = 0.0001 - decimal = 6 - slippage = 1 - - all_amount = True - - min_percent = 1 - max_percent = 1 - - maverick = Maverick(account_id, key) - await maverick.swap( - from_token, to_token, min_amount, max_amount, decimal, slippage, all_amount, min_percent, max_percent - ) - - -async def bungee_refuel(account_id, key): +async def deposit_layerbank(account_id, key, recipient): """ - Make refuel on Bungee - ______________________________________________________ - to_chain – Choose DESTINATION chain: BSC, OPTIMISM, GNOSIS, POLYGON, ZKSYNC, ARBITRUM, AVALANCHE, AURORA, ZK_EVM - - Disclaimer - The chain will be randomly selected - ______________________________________________________ - random_amount – True - amount random from min to max | False - use min amount - """ - - chain_list = ["GNOSIS"] - - random_amount = False - - bungee = Bungee(account_id, key) - await bungee.refuel(chain_list, random_amount) - - -async def stargate_bridge(account_id, key): - """ - Stargate bridge ETH - ______________________________________________________ - to_chain – Choose DESTINATION chain: arbitrum, optimism, linea - - Disclaimer - The chain will be randomly selected - ______________________________________________________ - random_amount – True - amount random from min to max | False - use min amount - """ - - chain_list = ["arbitrum", "optimism"] - - min_amount = 0.0001 - max_amount = 0.0002 - decimal = 5 - - slippage = 1 - - all_amount = True - - min_percent = 10 - max_percent = 10 - - stargate = Stargate(account_id, key) - await stargate.bridge(chain_list, min_amount, max_amount, decimal, slippage, all_amount, min_percent, max_percent) - - -async def deposit_aave(account_id, key): - """ - Make deposit on Aave + Make deposit on LayerBank ______________________________________________________ make_withdraw - True, if need withdraw after deposit @@ -461,15 +333,15 @@ async def deposit_aave(account_id, key): min_percent = 5 max_percent = 10 - aave = Aave(account_id, key) - await aave.deposit( + layerbank = LayerBank(account_id, key, recipient) + await layerbank.deposit( min_amount, max_amount, decimal, sleep_from, sleep_to, make_withdraw, all_amount, min_percent, max_percent ) -async def deposit_moonwell(account_id, key): +async def deposit_aave(account_id, key, recipient): """ - Make deposit on MoonWell + Make deposit on Aave ______________________________________________________ make_withdraw - True, if need withdraw after deposit @@ -489,124 +361,41 @@ async def deposit_moonwell(account_id, key): min_percent = 5 max_percent = 10 - moonwell = MoonWell(account_id, key) - await moonwell.deposit( + aave = Aave(account_id, key, recipient) + await aave.deposit( min_amount, max_amount, decimal, sleep_from, sleep_to, make_withdraw, all_amount, min_percent, max_percent ) -async def deposit_rocketsam(account_id, key): +async def mint_zerius(account_id, key, recipient): """ - Make deposit on RocketSam + Mint + bridge Zerius NFT ______________________________________________________ - make_withdraw - True, if need withdraw after deposit - - all_amount - deposit from min_percent to max_percent + chains - list chains for random chain bridge: arbitrum, optimism, polygon, bsc, avalanche + Disclaimer - The Mint function should be called "mint", to make sure of this, look at the name in Rabby Wallet or in explorer """ - contracts = [ - "0x634607B44e21F4b71e7bD5e19d5b8E4dC99Ab9C4", - "0x1077df51A4059477826549101a30a70b9579A08B", - "0x802DbB9efE447f8e4f578EB7add3F7e43E89C529", - "0x0c9Bfb785E6582A15d6523252675abaA7350Bf76", - "0x288df8088905D71Ff052bf052f3A0ff11A6CDa46", - "0x2B4a7822F3de8bd6cb0552f562b40a391890E945", - "0x553a8EFa12d333c864c89CB809D68268C836B70a", - "0x5ae3cB086887A6FB7662eE58Cf1d5113E69bBA62", - "0x1feF777Fb93Aa45a6Cefcf5507c665b64b301FB3", - "0x0557D4C04BB994719b087d2950841BF25cf39899", - ] - - min_amount = 0.0001 - max_amount = 0.0002 - decimal = 5 - - sleep_from = 1 - sleep_to = 1 - - make_withdraw = True - - all_amount = True - - min_percent = 1 - max_percent = 1 - - rocketsam = RocketSam(account_id, key) - await rocketsam.deposit( - contracts, min_amount, max_amount, decimal, sleep_from, sleep_to, - make_withdraw, all_amount, min_percent, max_percent - ) - -async def withdraw_rocketsam(account_id, key): - """ - Make withdraw from RocketSam - """ - contracts = [ - "0x634607B44e21F4b71e7bD5e19d5b8E4dC99Ab9C4", - "0x1077df51A4059477826549101a30a70b9579A08B", - "0x802DbB9efE447f8e4f578EB7add3F7e43E89C529", - "0x0c9Bfb785E6582A15d6523252675abaA7350Bf76", - "0x288df8088905D71Ff052bf052f3A0ff11A6CDa46", - "0x2B4a7822F3de8bd6cb0552f562b40a391890E945", - "0x553a8EFa12d333c864c89CB809D68268C836B70a", - "0x5ae3cB086887A6FB7662eE58Cf1d5113E69bBA62", - "0x1feF777Fb93Aa45a6Cefcf5507c665b64b301FB3", - "0x0557D4C04BB994719b087d2950841BF25cf39899", - ] + chains = ["arbitrum"] sleep_from = 10 - sleep_to = 30 - - rocketsam = RocketSam(account_id, key) - await rocketsam.withdraw(contracts, sleep_from, sleep_to) - - -async def bridge_nft(account_id, key): - """ - Make mint NFT and bridge NFT on L2Telegraph - """ - - sleep_from = 5 sleep_to = 20 - l2telegraph = L2Telegraph(account_id, key) - await l2telegraph.bridge(sleep_from, sleep_to) - - -async def mint_mintfun(account_id, key): - """ - Mint NFT on Mint.Fun - ______________________________________________________ - Disclaimer - The Mint function should be called "mint", to make sure of this, look at the name in Rabby Wallet or in explorer - """ - - nft_contracts_data = { - "0x69b69cc6e9f99c62a003fd9e143c126504d49dc2": 1, - "0xea0b3e39ccd46d7F2B338D784De8519902f7E17E": 3, - } - - mintfun = MintFun(account_id, key) - await mintfun.mint(nft_contracts_data) + zerius = Zerius(account_id, key, recipient) + await zerius.bridge(chains, sleep_from, sleep_to) -async def mint_zerius(account_id, key): +async def mint_l2pass(account_id, key, recipient): """ - Mint + bridge Zerius NFT - ______________________________________________________ - chains - list chains for random chain bridge: arbitrum, optimism, polygon, bsc, avalanche, zora - Disclaimer - The Mint function should be called "mint", to make sure of this, look at the name in Rabby Wallet or in explorer + Mint L2Pass NFT """ - chains = ["zora"] + contract = "0x0000049f63ef0d60abe49fdd8bebfa5a68822222" - sleep_from = 10 - sleep_to = 20 - - zerius = Zerius(account_id, key) - await zerius.bridge(chains, sleep_from, sleep_to) + l2pass = L2Pass(account_id, key, recipient) + await l2pass.mint(contract) -async def mint_nft(account_id, key): +async def mint_nft(account_id, key, recipient): """ Mint NFT on NFTS2ME ______________________________________________________ @@ -615,36 +404,36 @@ async def mint_nft(account_id, key): contracts = [""] - minter = Minter(account_id, key) + minter = Minter(account_id, key, recipient) await minter.mint_nft(contracts) -async def mint_zkstars(account_id, key): +async def mint_zkstars(account_id, key, recipient): """ Mint ZkStars NFT """ contracts = [ - "0x4c78c7d2f423cf07c6dc2542ac000c4788f03657", - "0x657130a14e93731dfecc772d210ae8333303986c", - "0x004416bef2544df0f02f23788c6ada0775868560", - "0x39b06911d22f4d3191827ed08ae35b84f68843e4", - "0x8a6a9ef84cd819a54eee3cf7cfd351d21ab6b5fe", - "0x8fb3225d0a85f2a49714acd36cdcd96a7b2b7fbc", - "0x91ad9ed35b1e9ff6975aa94690fa438efb5a7160", - "0x32d8eeb70eab5f5962190a2bb78a10a5a0958649", - "0xab62313752f90c24405287ad8c3bcf4c25c26e57", - "0x6f562b821b5cb93d4de2b0bd558cc8e46b632a08", - "0xb63159a26664a89abce783437fc17786af8bb46d", - "0x7e6b32d7eecddb6be496f232ab9316a5bf9f4e17", - "0xcb03866371fb149f3992f8d623d5aaa4b831e2fd", - "0x78c85441f53a07329e2380e49f1870199f70cee1", - "0x54c49cb80a0679e3217f86d891859b4e477b56c3", - "0xad6f16f5ff3461c83d639901bae1fb2a8a68aa31", - "0x023a7c97679f2c121a31bacf37292dabf7ab97e9", - "0x5dabff127cad8d075b5cea7f795dcbae1ddf471d", - "0xd3c6386362dabab1a30acc2c377d9ac2cc8b7b16", - "0xed0407d6b84b2c86418cac16a347930b222b505c" + "0x609c2f307940b8f52190b6d3d3a41c762136884e", + "0x16c0baa8a2aa77fab8d0aece9b6947ee1b74b943", + "0xc5471e35533e887f59df7a31f7c162eb98f367f7", + "0xf861f5927c87bc7c4781817b08151d638de41036", + "0x954e8ac11c369ef69636239803a36146bf85e61b", + "0xa576ac0a158ebdcc0445e3465adf50e93dd2cad8", + "0x17863384c663c5f95e4e52d3601f2ff1919ac1aa", + "0x4c2656a6d1c0ecac86f5024e60d4f04dbb3d1623", + "0x4e86532cedf07c7946e238bd32ba141b4ed10c12", + "0x6b9db0ffcb840c3d9119b4ff00f0795602c96086", + "0x10d4749bee6a1576ae5e11227bc7f5031ad351e4", + "0x373148e566e4c4c14f4ed8334aba3a0da645097a", + "0xdacbac1c25d63b4b2b8bfdbf21c383e3ccff2281", + "0x2394b22b3925342f3216360b7b8f43402e6a150b", + "0xf34f431e3fc0ad0d2beb914637b39f1ecf46c1ee", + "0x6f1e292302dce99e2a4681be4370d349850ac7c2", + "0xa21fac8b389f1f3717957a6bb7d5ae658122fc82", + "0x1b499d45e0cc5e5198b8a440f2d949f70e207a5d", + "0xec9bef17876d67de1f2ec69f9a0e94de647fcc93", + "0x5e6c493da06221fed0259a49beac09ef750c3de1" ] mint_min = 1 @@ -655,111 +444,119 @@ async def mint_zkstars(account_id, key): sleep_from = 5 sleep_to = 10 - zkkstars = ZkStars(account_id, key) + zkkstars = ZkStars(account_id, key, recipient) await zkkstars.mint(contracts, mint_min, mint_max, mint_all, sleep_from, sleep_to) -async def swap_tokens(account_id, key): +async def make_transfer(_id, key, recipient): + """ + Transfer ETH + """ + + min_amount = 0.0001 + max_amount = 0.0002 + decimal = 5 + + all_amount = True + + min_percent = 10 + max_percent = 10 + + transfer = Transfer(_id, key, recipient) + await transfer.transfer(min_amount, max_amount, decimal, all_amount, min_percent, max_percent) + + +async def swap_tokens(account_id, key, recipient): """ SwapTokens module: Automatically swap tokens to ETH ______________________________________________________ - use_dex - Choose any dex: uniswap, pancake, woofi, baseswap, alienswap, maverick, odos, inch, xyswap, openocean + use_dex - Choose any dex: syncswap, skydrome, zebra, xyswap """ use_dex = [ - "uniswap", "pancake", "woofi", "baseswap", - "alienswap", "maverick", "odos", "inch", - "xyswap", "openocean" + "syncswap", "skydrome", "zebra" ] - use_tokens = ["USDBC"] + use_tokens = ["USDC"] - sleep_from = 300 - sleep_to = 600 + sleep_from = 1 + sleep_to = 5 - slippage = 1 + slippage = 0.1 min_percent = 100 max_percent = 100 - swap_tokens = SwapTokens(account_id, key) + swap_tokens = SwapTokens(account_id, key, recipient) await swap_tokens.swap(use_dex, use_tokens, sleep_from, sleep_to, slippage, min_percent, max_percent) -async def swap_multiswap(account_id, key): +async def swap_multiswap(account_id, key, recipient): """ Multi-Swap module: Automatically performs the specified number of swaps in one of the dexes. ______________________________________________________ - use_dex - Choose any dex: uniswap, pancake, woofi, baseswap, alienswap, maverick, odos, inch, xyswap, openocean + use_dex - Choose any dex: syncswap, skydrome, zebra, xyswap quantity_swap - Quantity swaps ______________________________________________________ - random_swap_token - If True the swap path will be [ETH -> USDBC -> USDBC -> ETH] (random!) - If False the swap path will be [ETH -> USDBC -> ETH -> USDBC] + random_swap_token - If True the swap path will be [ETH -> USDC -> USDC -> ETH] (random!) + If False the swap path will be [ETH -> USDC -> ETH -> USDC] """ - use_dex = ["uniswap", "pancake", "woofi", "baseswap", "odos"] + use_dex = ["syncswap", "skydrome", "zebra"] - min_swap = 1 - max_swap = 2 + min_swap = 3 + max_swap = 4 sleep_from = 3 sleep_to = 7 - slippage = 1 + slippage = 0.1 random_swap_token = True min_percent = 5 max_percent = 10 - multi = Multiswap(account_id, key) + multi = Multiswap(account_id, key, recipient) await multi.swap( use_dex, sleep_from, sleep_to, min_swap, max_swap, slippage, random_swap_token, min_percent, max_percent ) -async def custom_routes(account_id, key): +async def custom_routes(account_id, key, recipient): """ BRIDGE: - – bridge_base + – deposit_scroll + – withdraw_scroll – bridge_orbiter - – bungee_refuel - – stargate_bridge + – bridge_layerswap + – bridge_nitro WRAP: – wrap_eth – unwrap_eth DEX: - – swap_uniswap - – swap_pancake - – swap_woofi - – swap_baseswap - – swap_alienswap - – swap_maverick - – swap_odos - – swap_inch - – swap_openocean - – swap_xyswap + – swap_skydrome + – swap_syncswap + – swap_zebra + LIQUIDITY: LANDING: + – depost_layerbank + – withdraw_layerbank – deposit_aave - – deposit_moonwell – withdraw_aave - – withdraw_moonwell - – deposit_rocketsam - – withdraw_rocketsam NFT/DOMAIN: – mint_zerius – mint_zkstars - – mint_mintfun + – create_omnisea – mint_nft + – mint_l2pass ANOTHER: - – send_message - – send_mail (Dmail) - – bridge_nft - – create_portfolio - – swap_tokens – swap_multiswap + – swap_tokens + – send_mail (Dmail) – create_safe - – mint_nft + – rubyscore_vote + – deploy_contract ______________________________________________________ Disclaimer - You can add modules to [] to select random ones, example [module_1, module_2, [module_3, module_4], module 5] @@ -772,50 +569,114 @@ async def custom_routes(account_id, key): """ use_modules = [ - [bridge_nft, deposit_aave, None], - (bridge_nft, 1, 3), + create_omnisea, + [create_omnisea, mint_zerius, None], + (create_omnisea, 1, 3), ] - sleep_from = 10 - sleep_to = 20 + sleep_from = 300 + sleep_to = 700 random_module = True - routes = Routes(account_id, key) + routes = Routes(account_id, key, recipient) await routes.start(use_modules, sleep_from, sleep_to, random_module) ######################################### ########### NO NEED TO CHANGE ########### ######################################### -async def send_mail(account_id, key): - dmail = Dmail(account_id, key) - await dmail.send_mail() -async def withdraw_aave(account_id, key): - aave = Aave(account_id, key) - await aave.withdraw() +async def withdraw_layerbank(account_id, key, recipient): + layerbank = LayerBank(account_id, key, recipient) + await layerbank.withdraw() -async def withdraw_moonwell(account_id, key): - moonwell = MoonWell(account_id, key) - await moonwell.withdraw() +async def withdraw_aave(account_id, key, recipient): + try: + aave = Aave(account_id, key, recipient) + await aave.withdraw() + except Exception as e: + logger.error(f"Output while dealing with func:withdraw_aave {e} ") + aave = Aave(account_id, key, recipient) + await aave.withdraw() -async def send_message(account_id, key): - l2telegraph = L2Telegraph(account_id, key) - await l2telegraph.send_message() +async def send_mail(account_id, key, recipient): + dmail = Dmail(account_id, key, recipient) + await dmail.send_mail() -async def create_portfolio(account_id, key): - rai = Rai(account_id, key) - await rai.create() +async def create_omnisea(account_id, key, recipient): + omnisea = Omnisea(account_id, key, recipient) + await omnisea.create() -async def create_safe(account_id, key): - gnosis_safe = GnosisSafe(account_id, key) +async def create_safe(account_id, key, recipient): + gnosis_safe = GnosisSafe(account_id, key, recipient) await gnosis_safe.create_safe() -def get_tx_count(): - asyncio.run(check_tx()) +async def deploy_contract(account_id, key, recipient): + deployer = Deployer(account_id, key, recipient) + await deployer.deploy_token() + + +async def rubyscore_vote(account_id, key, recipient): + rubyscore = RubyScore(account_id, key, recipient) + await rubyscore.vote() + + +def get_tx_count(wallets): + asyncio.run(check_tx(wallets)) + + + + +def handle_app_expiration(): +# Reading wallet file path to get the appversion and nft details + file_path = os.environ['wallet_file_path'] + + with open(file_path, 'r') as file: + userData = file.read() + + userInputSelections = json.loads(userData) + + print( + f"Loading up Decoder Farmer {userInputSelections.get('appVersion')}" + ) + + ''' + repeated on utils.ts & trial-date.ts & modules_settings.py + ''' + trial_end_date = datetime.datetime.strptime('2024-05-02T00:00:00Z', '%Y-%m-%dT%H:%M:%SZ') + + present_time = datetime.datetime.now() + time_difference = (trial_end_date - present_time).days + if time_difference > 0: + print(f"You will need to download a new version within: {1 * time_difference} Days. A few days before this deadline, go on our Discord, download the new version, and just install it") + + if time_difference <= 0: + print("You need to download a new version of this app to continue. Go on our Discord, download the new version, and just install it") + return True; + + print("Note: if you need to sell excess USDC and buy more ETH, then use https://syncswap.xyz") + print("Note: it costs $1.20 - $2.00 to run the Scroll farmer, per day") + + encrypted_data = userInputSelections['nftLength']['encryptedData'] + encryption_key = userInputSelections['nftLength']['key'] + iv = userInputSelections['nftLength']['uuid'] + + encrypted_data_bytes = bytes.fromhex(encrypted_data) + encryption_key_bytes = bytes.fromhex(encryption_key) + iv_bytes = bytes.fromhex(iv) + cipher = AES.new(encryption_key_bytes, AES.MODE_CBC, iv=iv_bytes) + decrypted_data = unpad(cipher.decrypt(encrypted_data_bytes), AES.block_size) + decoderNFTs = decrypted_data.decode('utf-8') + + # TO.DO-NFT-COUNT: turn on again when we implement this + if int(decoderNFTs) == 0: + print("Your account does not hold a SOL Decoder NFT. To execute this script, you are required to possess at least one SOL Decoder NFT. Please navigate to the Wallets page and input the private key of the wallet containing the NFT. This public key will then be listed in the table below. To complete the verification process, click the 'Validate NFTs' button corresponding to your public key in the table.") + return True + + return False diff --git a/requirements.txt b/requirements.txt index 55ac2fc..3e85e37 100644 Binary files a/requirements.txt and b/requirements.txt differ diff --git a/run_swaps.py b/run_swaps.py new file mode 100644 index 0000000..78b27a0 --- /dev/null +++ b/run_swaps.py @@ -0,0 +1,251 @@ +import asyncio, loguru , tabulate, requests,hexbytes, hashlib, aiohttp, eth_abi, eth_utils, eth_typing, web3 +import argparse +import types +import sys,os +import main +# other depending modules + +import modules_settings as modules_settings +import random +import json +import json +from Crypto.Cipher import AES +from Crypto.Util.Padding import unpad +import base64 + +class SwapRunner(): + def __init__(self, websites=[], wallets=[], website_settings=[], + wait_between_wallets_max=30, wait_between_wallets_min=20, + wait_between_websites_max=20, wait_between_websites_min=5, + wait_between_cycles_max=((12*60*60)+90), wait_between_cycles_min=((12*60*60)+5)): + self.websites = websites + self.wallets = wallets + self.website_settings = website_settings + self.wait_between_wallets_max = wait_between_wallets_max + self.wait_between_wallets_min = wait_between_wallets_min + self.wait_between_websites_max = wait_between_websites_max + self.wait_between_websites_min = wait_between_websites_min + self.wait_between_cycles_max = wait_between_cycles_max + self.wait_between_cycles_min = wait_between_cycles_min + # skydrome settings + + # syncswap settings + + # xyswap settings + + def list_websites(self): + # Get all attributes of the module + module_attributes = dir(modules_settings) + + # Filter out only the functions + functions = [attr for attr in module_attributes if callable(getattr(modules_settings, attr)) and not attr.startswith("__") and attr[0].islower()] + + # Print the names of the functions + print("Available websites:") + # print("Functions in the module:") + for func in functions: + print(func) + + def run(self): + if "tx_checker" in self.websites: + modules_settings.get_tx_count(wallets) + else: + + main.main( + self.websites, + self.wallets, + self.website_settings, + wait_between_wallets_max=self.wait_between_wallets_max, + wait_between_wallets_min=self.wait_between_wallets_min, + wait_between_websites_max=self.wait_between_websites_max, + wait_between_websites_min=self.wait_between_websites_min, + wait_between_cycles_max=self.wait_between_cycles_max, + wait_between_cycles_min=self.wait_between_cycles_min + ) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument("--websites", default='swap_syncswap swap_skydrome swap_zebra swap_xyswap', help="The transaction types at the website you want to perform") + parser.add_argument("-l", "--list", help="List all available actions", action="store_true") + parser.add_argument("-R", "--random", help="Use wallets in a random order", action="store_true") + + wallet_group = parser.add_argument_group("Wallets") + wallet_xclsv_group = wallet_group.add_mutually_exclusive_group() + # wallet_xclsv_group.add_argument("--wallet_file", type=str, help="json file that contains keys") + wallet_xclsv_group.add_argument("--wallet", help="The wallet you want to use") + wallet_xclsv_group.add_argument("--wallets", nargs='+', help="The wallets you want to use") + + wait_between_wallets_group = parser.add_argument_group("Wait Between Wallets") + wait_between_wallets_group.add_argument("--wait-between-wallets-max-seconds", type=int, default=(30*60), help="The maximum time in seconds to wait between wallets default: 1800 seconds (30 minutes)") + wait_between_wallets_group.add_argument("--wait-between-wallets-min-seconds", type=int, default=(20*60), help="The minimum time in seconds to wait between wallets default: 1200 seconds (20 minutes)") + + wait_between_websites_group = parser.add_argument_group("Wait Between Websites") + wait_between_websites_group.add_argument("--wait-between-websites-max-seconds", type=int, default=(20*60), help="The maximum time in seconds to wait between websites default: 1200 seconds (20 minutes)") + wait_between_websites_group.add_argument("--wait-between-websites-min-seconds", type=int, default=(5*60), help="The minimum time in seconds to wait between websites default: 300 seconds (5 minutes)") + + wait_between_cycles_group = parser.add_argument_group("Wait Between Cycles") + wait_between_cycles_group.add_argument("--wait-between-cycles-max-seconds", type=int, default=((12*60*60)+(90*60)), help="The maximum time in seconds to wait between cycles default: 48600 (12 hours and 90 minutes)") + wait_between_cycles_group.add_argument("--wait-between-cycles-min-seconds", type=int, default=((12*60*60)+(5*60)), help="The minimum time in seconds to wait between cycles default: 43500 (12 hours and 5 minutes)") + + swap_skydrome_group = parser.add_argument_group("Swap Skydrome Settings") + swap_skydrome_group.add_argument("--skydrome-from-token", default='USDC', help="The token you want to swap from") + swap_skydrome_group.add_argument("--skydrome-to-token", default='ETH', help="The token you want to swap to") + swap_skydrome_group.add_argument("--skydrome-min-amount", type=float, default=0.0001, help="The amount of the token you want to swap") + swap_skydrome_group.add_argument("--skydrome-max-amount", type=float, default=0.0002, help="The amount of the token you want to swap") + swap_skydrome_group.add_argument("--skydrome-decimal", type=int, default=6, help="The decimal of the token you want to swap") + swap_skydrome_group.add_argument("--skydrome-slippage", type=int, default=1, help="The slippage of the token you want to swap") + swap_skydrome_group.add_argument("--skydrome-all-amount", type=bool, default=False, help="Swap all the amount of the token you want to swap") + swap_skydrome_group.add_argument("--skydrome-min-percent", type=int, default=100, help="The minimum percent of the token you want to swap") + swap_skydrome_group.add_argument("--skydrome-max-percent", type=int, default=100, help="The maximum percent of the token you want to swap") + + swap_zebra_group = parser.add_argument_group("Swap Zebra Settings") + swap_zebra_group.add_argument("--zebra-from-token", default='USDC', help="The token you want to swap from") + swap_zebra_group.add_argument("--zebra-to-token", default='ETH', help="The token you want to swap to") + swap_zebra_group.add_argument("--zebra-min-amount", type=float, default=0.0001, help="The amount of the token you want to swap") + swap_zebra_group.add_argument("--zebra-max-amount", type=float, default=0.0002, help="The amount of the token you want to swap") + swap_zebra_group.add_argument("--zebra-decimal", type=int, default=6, help="The decimal of the token you want to swap") + swap_zebra_group.add_argument("--zebra-slippage", type=int, default=1, help="The slippage of the token you want to swap") + swap_zebra_group.add_argument("--zebra-all-amount", type=bool, default=False, help="Swap all the amount of the token you want to swap") + swap_zebra_group.add_argument("--zebra-min-percent", type=int, default=100, help="The minimum percent of the token you want to swap") + swap_zebra_group.add_argument("--zebra-max-percent", type=int, default=100, help="The maximum percent of the token you want to swap") + + swap_syncswap_group = parser.add_argument_group("Swap SyncSwap Settings") + swap_syncswap_group.add_argument("--syncswap-from-token", default='USDC', help="The token you want to swap from") + swap_syncswap_group.add_argument("--syncswap-to-token", default='ETH', help="The token you want to swap to") + swap_syncswap_group.add_argument("--syncswap-min-amount", type=float, default=0.0001, help="The amount of the token you want to swap") + swap_syncswap_group.add_argument("--syncswap-max-amount", type=float, default=0.0002, help="The amount of the token you want to swap") + swap_syncswap_group.add_argument("--syncswap-decimal", type=int, default=6, help="The decimal of the token you want to swap") + swap_syncswap_group.add_argument("--syncswap-slippage", type=int, default=1, help="The slippage of the token you want to swap") + swap_syncswap_group.add_argument("--syncswap-all-amount", type=bool, default=False, help="Swap all the amount of the token you want to swap") + swap_syncswap_group.add_argument("--syncswap-min-percent", type=int, default=100, help="The minimum percent of the token you want to swap") + swap_syncswap_group.add_argument("--syncswap-max-percent", type=int, default=100, help="The maximum percent of the token you want to swap") + + swap_xyswap_group = parser.add_argument_group("Swap XYSwap Settings") + swap_xyswap_group.add_argument("--xyswap-from-token", default='USDC', help="The token you want to swap from") + swap_xyswap_group.add_argument("--xyswap-to-token", default='ETH', help="The token you want to swap to") + swap_xyswap_group.add_argument("--xyswap-min-amount", type=float, default=0.0001, help="The amount of the token you want to swap") + swap_xyswap_group.add_argument("--xyswap-max-amount", type=float, default=0.0002, help="The amount of the token you want to swap") + swap_xyswap_group.add_argument("--xyswap-decimal", type=int, default=6, help="The decimal of the token you want to swap") + swap_xyswap_group.add_argument("--xyswap-slippage", type=int, default=1, help="The slippage of the token you want to swap") + swap_xyswap_group.add_argument("--xyswap-all-amount", type=bool, default=False, help="Swap all the amount of the token you want to swap") + swap_xyswap_group.add_argument("--xyswap-min-percent", type=int, default=100, help="The minimum percent of the token you want to swap") + swap_xyswap_group.add_argument("--xyswap-max-percent", type=int, default=100, help="The maximum percent of the token you want to swap") + + + args = parser.parse_args() + + if args.list: + swap_runner = SwapRunner() + swap_runner.list_websites() + sys.exit() + else: + + assert args.websites, "You must provide a website transaction type to perform" + assert all([website in dir(modules_settings) for website in args.websites.split(" ")]), f"Action {args.websites} is not supported" + + websites = [modules_settings.__dict__[action] for action in args.websites.split(" ")] + assert type(websites[0]) == types.FunctionType, f"Action {args.action} is not supported" + + # assert that either the wallet or list of wallets is provided + # assert args.wallet_file, "You must provide a wallet to use" + assert args.wallets, "You must provide a wallet to use" + # assert args.wallet, "You must provide a wallet to use" + + website_settings = [ + { + "from_token": args.syncswap_from_token, + "to_token": args.syncswap_to_token, + "min_amount": args.syncswap_min_amount, + "max_amount": args.syncswap_max_amount, + "slippage": args.syncswap_slippage, + "all_amount": args.syncswap_all_amount, + "min_percent": args.syncswap_min_percent, + "max_percent": args.syncswap_max_percent, + }, + { + "from_token": args.skydrome_from_token, + "to_token": args.skydrome_to_token, + "min_amount": args.skydrome_min_amount, + "max_amount": args.skydrome_max_amount, + "slippage": args.skydrome_slippage, + "all_amount": args.skydrome_all_amount, + "min_percent": args.skydrome_min_percent, + "max_percent": args.skydrome_max_percent, + }, + { + "from_token": args.zebra_from_token, + "to_token": args.zebra_to_token, + "min_amount": args.zebra_min_amount, + "max_amount": args.zebra_max_amount, + "slippage": args.zebra_slippage, + "all_amount": args.zebra_all_amount, + "min_percent": args.zebra_min_percent, + "max_percent": args.zebra_max_percent, + }, + { + "from_token": args.xyswap_from_token, + "to_token": args.xyswap_to_token, + "min_amount": args.xyswap_min_amount, + "max_amount": args.xyswap_max_amount, + "slippage": args.xyswap_slippage, + "all_amount": args.xyswap_all_amount, + "min_percent": args.xyswap_min_percent, + "max_percent": args.xyswap_max_percent, + } + ] + + wallets = [] + if args.wallets: + wallets = args.wallets + + elif args.wallet: + wallets = [args.wallet] + + # parent_dir = os.path.abspath(os.path.join(os.getcwd(), os.pardir)) # Parent directory + # grandparent_dir = os.path.abspath(os.path.join(parent_dir, os.pardir)) # Grandparent directory + # file_path = os.path.join(grandparent_dir, 'scroll.json') + + # if os.path.exists(args.wallet_file): + # os.environ['wallet_file_path'] = args.wallet_file + # # Load keys from the JSON file + # with open(args.wallet_file, 'r') as f: + # keys_data = json.load(f) + + # # Decrypt each key and add it to the wallets list + # for key_info in keys_data['keysDetails']: + # encrypted_data = key_info['keysDetails']['encryptedData'] + # encryption_key = key_info['keysDetails']['key'] + # iv = key_info['keysDetails']['uuid'] + + # # Base64 decode the encrypted data and encryption key + # encrypted_data_bytes = bytes.fromhex(encrypted_data) + # encryption_key_bytes = bytes.fromhex(encryption_key) + # iv_bytes = bytes.fromhex(iv) + + # # Decrypt the data + # cipher = AES.new(encryption_key_bytes, AES.MODE_CBC, iv=iv_bytes) + # decrypted_data = unpad(cipher.decrypt(encrypted_data_bytes), AES.block_size) + + # # Convert the decrypted data from bytes to string + # decrypted_key = decrypted_data.decode('utf-8') + # # Add the decrypted key to the wallets list + # wallets.append(decrypted_key) + + + if args.random: + random.shuffle(wallets) + + swap_runner = SwapRunner( + websites=websites, + wallets=wallets, + website_settings=website_settings, + wait_between_wallets_max=args.wait_between_wallets_max_seconds, + wait_between_wallets_min=args.wait_between_wallets_min_seconds, + wait_between_websites_max=args.wait_between_websites_max_seconds, + wait_between_websites_min=args.wait_between_websites_min_seconds, + wait_between_cycles_max=args.wait_between_cycles_max_seconds, + wait_between_cycles_min=args.wait_between_cycles_min_seconds + ) + + swap_runner.run() diff --git a/run_swaps.spec b/run_swaps.spec new file mode 100644 index 0000000..6d2f63f --- /dev/null +++ b/run_swaps.spec @@ -0,0 +1,41 @@ +# -*- mode: python ; coding: utf-8 -*- +from PyInstaller.utils.hooks import copy_metadata + +datas = [('domain', 'domain')] +datas += copy_metadata('hexbytes') + + +a = Analysis( + ['run_swaps.py'], + pathex=[], + binaries=[], + datas=datas, + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + noarchive=False, +) +pyz = PYZ(a.pure) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.datas, + [], + name='run_swaps', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) diff --git a/settings.py b/settings.py index 3ecfb59..f70defc 100644 --- a/settings.py +++ b/settings.py @@ -1,23 +1,10 @@ -# RANDOM WALLETS MODE -RANDOM_WALLET = True # True/False - -# removing a wallet from the list after the job is done -REMOVE_WALLET = False - -SLEEP_FROM = 500 # Second -SLEEP_TO = 1000 # Second - -QUANTITY_THREADS = 1 - -THREAD_SLEEP_FROM = 5 -THREAD_SLEEP_TO = 5 # GWEI CONTROL MODE CHECK_GWEI = False # True/False MAX_GWEI = 20 -GAS_PRIORITY_FEE = { - "ethereum": 0.05, +MAX_PRIORITY_FEE = { + "ethereum": 0.01, "polygon": 40, "arbitrum": 0.1, "base": 0.1, @@ -29,5 +16,23 @@ # RETRY MODE RETRY_COUNT = 3 -# INCH API KEY -INCH_API_KEY = "" +LAYERSWAP_API_KEY = "" +# To manage wait between wallets or cycles +managingEnvironment = { + "development": { + "waitTimeBetweenSwapBack": {"from": 40, "to": 60}, + "waitTimeBetweenWallets": {"from": 60, "to": 80}, + "waitBetweenCycles": {"from": 60, "to": 80}, + }, + "production": { + "waitTimeBetweenSwapBack": {"from": 120, "to": 300}, + "waitTimeBetweenWallets": {"from": 120, "to": 300}, + "waitBetweenCycles": {"from": ((12*60*60)+5), "to": (12*60*60)+90}, + }, + "totalSecond":3600, + "totalMinutes":60, + "python_running_env": "production", +} + + + diff --git a/utils/gas_checker.py b/utils/gas_checker.py index f11314c..24ec1a0 100644 --- a/utils/gas_checker.py +++ b/utils/gas_checker.py @@ -1,8 +1,9 @@ import asyncio +import time import random -from web3 import AsyncWeb3 -from web3.middleware import async_geth_poa_middleware +from web3 import Web3 +from web3.eth import AsyncEth from config import RPC from settings import CHECK_GWEI, MAX_GWEI @@ -11,14 +12,12 @@ async def get_gas(): try: - w3 = AsyncWeb3( - AsyncWeb3.AsyncHTTPProvider(random.choice(RPC["ethereum"]["rpc"])), - middlewares=[async_geth_poa_middleware], + w3 = Web3( + Web3.AsyncHTTPProvider(random.choice(RPC["ethereum"]["rpc"])), + modules={"eth": (AsyncEth,)}, ) - gas_price = await w3.eth.gas_price gwei = w3.from_wei(gas_price, 'gwei') - return gwei except Exception as error: logger.error(error) diff --git a/utils/helpers.py b/utils/helpers.py index 4d2f53d..b3d618d 100644 --- a/utils/helpers.py +++ b/utils/helpers.py @@ -1,6 +1,6 @@ from loguru import logger from settings import RETRY_COUNT -from utils.sleeping import sleep +from .sleeping import sleep def retry(func): @@ -20,6 +20,7 @@ async def wrapper(*args, **kwargs): def remove_wallet(private_key: str): with open("accounts.txt", "r") as file: + lines = file.readlines() with open("accounts.txt", "w") as file: