From bf7e10c68e1e577a9dc121d6d20831c31efbb2b8 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 9 Apr 2024 23:25:03 +0100 Subject: [PATCH 1/3] updated files added --- .gitignore | 172 +++ README.md | 172 +++ README_refactor.md | 37 + __init__.py | 0 domain/__init__.py | 1 + domain/config.py | 129 ++ domain/data/abi/aave/abi.json | 1 + domain/data/abi/bridge/deposit.json | 1 + domain/data/abi/bridge/oracle.json | 315 +++++ domain/data/abi/bridge/withdraw.json | 666 ++++++++++ domain/data/abi/dmail/abi.json | 964 ++++++++++++++ domain/data/abi/erc20_abi.json | 1 + domain/data/abi/gnosis/abi.json | 198 +++ domain/data/abi/l2pass/abi.json | 1 + domain/data/abi/layerbank/abi.json | 1 + domain/data/abi/nft-origins/abi.json | 665 ++++++++++ domain/data/abi/nft2me/abi.json | 24 + domain/data/abi/omnisea/abi.json | 175 +++ domain/data/abi/rubyscore/abi.json | 13 + domain/data/abi/scroll/weth.json | 643 +++++++++ domain/data/abi/skydrome/abi.json | 1 + domain/data/abi/syncswap/classic_pool.json | 151 +++ .../data/abi/syncswap/classic_pool_data.json | 924 +++++++++++++ domain/data/abi/syncswap/router.json | 1178 +++++++++++++++++ domain/data/abi/zebra/abi.json | 1 + domain/data/abi/zerius/abi.json | 1 + domain/data/abi/zkstars/abi.json | 552 ++++++++ domain/data/deploy/abi.json | 2 + domain/data/deploy/bytecode.txt | 1 + domain/data/rpc.json | 51 + domain/main.py | 152 +++ domain/modules/__init__.py | 25 + domain/modules/aave.py | 99 ++ domain/modules/account.py | 314 +++++ domain/modules/ambient.py | 118 ++ domain/modules/deploy.py | 32 + domain/modules/dmail.py | 36 + domain/modules/l2pass.py | 33 + domain/modules/layerbank.py | 92 ++ domain/modules/layerswap.py | 194 +++ domain/modules/multiswap.py | 82 ++ domain/modules/nftorigins.py | 57 + domain/modules/nfts2me.py | 30 + domain/modules/nitro.py | 97 ++ domain/modules/omnisea.py | 47 + domain/modules/orbiter.py | 104 ++ domain/modules/routes.py | 45 + domain/modules/rubyscore.py | 28 + domain/modules/safe.py | 47 + domain/modules/scroll.py | 168 +++ domain/modules/skydrome.py | 175 +++ domain/modules/swap_tokens.py | 60 + domain/modules/syncswap.py | 149 +++ domain/modules/transfer.py | 44 + domain/modules/tx_checker.py | 41 + domain/modules/xyswap.py | 121 ++ domain/modules/zebra.py | 117 ++ domain/modules/zerius.py | 95 ++ domain/modules/zkstars.py | 46 + domain/modules_settings.py | 682 ++++++++++ domain/settings.py | 38 + domain/utils/__init__.py | 0 domain/utils/gas_checker.py | 45 + domain/utils/helpers.py | 29 + domain/utils/sleeping.py | 12 + requirements.txt | Bin 0 -> 250 bytes run_swaps.py | 250 ++++ run_swaps.spec | 41 + 68 files changed, 10786 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 README_refactor.md create mode 100644 __init__.py create mode 100644 domain/__init__.py create mode 100644 domain/config.py create mode 100644 domain/data/abi/aave/abi.json create mode 100644 domain/data/abi/bridge/deposit.json create mode 100644 domain/data/abi/bridge/oracle.json create mode 100644 domain/data/abi/bridge/withdraw.json create mode 100644 domain/data/abi/dmail/abi.json create mode 100644 domain/data/abi/erc20_abi.json create mode 100644 domain/data/abi/gnosis/abi.json create mode 100644 domain/data/abi/l2pass/abi.json create mode 100644 domain/data/abi/layerbank/abi.json create mode 100644 domain/data/abi/nft-origins/abi.json create mode 100644 domain/data/abi/nft2me/abi.json create mode 100644 domain/data/abi/omnisea/abi.json create mode 100644 domain/data/abi/rubyscore/abi.json create mode 100644 domain/data/abi/scroll/weth.json create mode 100644 domain/data/abi/skydrome/abi.json create mode 100644 domain/data/abi/syncswap/classic_pool.json create mode 100644 domain/data/abi/syncswap/classic_pool_data.json create mode 100644 domain/data/abi/syncswap/router.json create mode 100644 domain/data/abi/zebra/abi.json create mode 100644 domain/data/abi/zerius/abi.json create mode 100644 domain/data/abi/zkstars/abi.json create mode 100644 domain/data/deploy/abi.json create mode 100644 domain/data/deploy/bytecode.txt create mode 100644 domain/data/rpc.json create mode 100644 domain/main.py create mode 100644 domain/modules/__init__.py create mode 100644 domain/modules/aave.py create mode 100644 domain/modules/account.py create mode 100644 domain/modules/ambient.py create mode 100644 domain/modules/deploy.py create mode 100644 domain/modules/dmail.py create mode 100644 domain/modules/l2pass.py create mode 100644 domain/modules/layerbank.py create mode 100644 domain/modules/layerswap.py create mode 100644 domain/modules/multiswap.py create mode 100644 domain/modules/nftorigins.py create mode 100644 domain/modules/nfts2me.py create mode 100644 domain/modules/nitro.py create mode 100644 domain/modules/omnisea.py create mode 100644 domain/modules/orbiter.py create mode 100644 domain/modules/routes.py create mode 100644 domain/modules/rubyscore.py create mode 100644 domain/modules/safe.py create mode 100644 domain/modules/scroll.py create mode 100644 domain/modules/skydrome.py create mode 100644 domain/modules/swap_tokens.py create mode 100644 domain/modules/syncswap.py create mode 100644 domain/modules/transfer.py create mode 100644 domain/modules/tx_checker.py create mode 100644 domain/modules/xyswap.py create mode 100644 domain/modules/zebra.py create mode 100644 domain/modules/zerius.py create mode 100644 domain/modules/zkstars.py create mode 100644 domain/modules_settings.py create mode 100644 domain/settings.py create mode 100644 domain/utils/__init__.py create mode 100644 domain/utils/gas_checker.py create mode 100644 domain/utils/helpers.py create mode 100644 domain/utils/sleeping.py create mode 100644 requirements.txt create mode 100644 run_swaps.py create mode 100644 run_swaps.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fac8b56 --- /dev/null +++ b/.gitignore @@ -0,0 +1,172 @@ +# Created by https://www.toptal.com/developers/gitignore/api/macos,pycharm,venv +# Edit at https://www.toptal.com/developers/gitignore?templates=macos,pycharm,venv + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### PyCharm ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### PyCharm Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint +.idea/**/sonarlint/ + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream +.idea/codestream.xml + +# Azure Toolkit for IntelliJ plugin +# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij +.idea/**/azureSettings.xml + +### venv ### +# Virtualenv +# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/ +.Python +[Bb]in +[Ii]nclude +[Ll]ib +[Ll]ib64 +[Ll]ocal +[Ss]cripts +pyvenv.cfg +.venv +pip-selfcheck.json +*.pyc +*.log + +# End of https://www.toptal.com/developers/gitignore/api/macos,pycharm,venv +poetry.lock +pyproject.toml +__pycache__/ +*/__pycache__/ +.idea/ +accounts.txt \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..d318c0e --- /dev/null +++ b/README.md @@ -0,0 +1,172 @@ +
+ +

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 --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 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

\ No newline at end of file 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..e69de29 diff --git a/domain/__init__.py b/domain/__init__.py new file mode 100644 index 0000000..b668da9 --- /dev/null +++ b/domain/__init__.py @@ -0,0 +1 @@ +from .main import main \ No newline at end of file diff --git a/domain/config.py b/domain/config.py new file mode 100644 index 0000000..7687931 --- /dev/null +++ b/domain/config.py @@ -0,0 +1,129 @@ +import json +import os +base_dir = os.path.dirname(os.path.abspath(__file__)) + +with open(os.path.join(base_dir, 'data/rpc.json')) as file: + RPC = json.load(file) + +with open(os.path.join(base_dir, 'data/abi/erc20_abi.json')) as file: + ERC20_ABI = json.load(file) + +with open(os.path.join(base_dir, 'data/abi/bridge/deposit.json')) as file: + DEPOSIT_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(os.path.join(base_dir, 'data/abi/bridge/oracle.json')) as file: + ORACLE_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(os.path.join(base_dir, 'data/abi/syncswap/router.json'), "r") as file: + SYNCSWAP_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(os.path.join(base_dir, 'data/abi/syncswap/classic_pool_data.json')) as file: + SYNCSWAP_CLASSIC_POOL_DATA_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(os.path.join(base_dir, 'data/abi/zebra/abi.json'), "r") as file: + ZEBRA_ROUTER_ABI = json.load(file) + +with open(os.path.join(base_dir, 'data/abi/aave/abi.json'), "r") as file: + AAVE_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(os.path.join(base_dir, 'data/abi/l2pass/abi.json'), "r") as file: + L2PASS_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(os.path.join(base_dir, 'data/abi/omnisea/abi.json'), "r") as file: + OMNISEA_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(os.path.join(base_dir, 'data/abi/gnosis/abi.json'), "r") as file: + SAFE_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(os.path.join(base_dir, 'data/deploy/bytecode.txt'), "r") as file: + DEPLOYER_BYTECODE = file.read() + +with open(os.path.join(base_dir, 'data/abi/zkstars/abi.json'), "r") as file: + ZKSTARS_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" + +BRIDGE_CONTRACTS = { + "deposit": "0xf8b1378579659d8f7ee5f3c929c2f3e332e41fd6", + "withdraw": "0x4C0926FF5252A435FD19e10ED15e5a249Ba19d79", + "oracle": "0x987e300fDfb06093859358522a79098848C33852" +} + +ORBITER_CONTRACT = "0x80c67432656d59144ceff962e8faf8926599bcf8" + +SCROLL_TOKENS = { + "ETH": "0x5300000000000000000000000000000000000004", + "WETH": "0x5300000000000000000000000000000000000004", + "USDC": "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4" +} + +SYNCSWAP_CONTRACTS = { + "router": "0x80e38291e06339d10aab483c65695d004dbd5c69", + "classic_pool": "0x37BAc764494c8db4e54BDE72f6965beA9fa0AC2d" +} + +SKYDROME_CONTRACTS = { + "router": "0xAA111C62cDEEf205f70E6722D1E22274274ec12F" +} + +ZEBRA_CONTRACTS = { + "router": "0x0122960d6e391478bfe8fb2408ba412d5600f621" +} + +AMBIENT_CONTRACTS = { + "router": "0xaaaaaaaacb71bf2c8cae522ea5fa455571a74106", + "impact": "0xc2c301759B5e0C385a38e678014868A33E2F3ae3" +} + +XYSWAP_CONTRACT = { + "router": "0x22bf2a9fcaab9dc96526097318f459ef74277042", + "use_ref": False # If you use True, you support me 1% of the transaction amount +} + +AAVE_CONTRACT = "0xff75a4b698e3ec95e608ac0f22a03b8368e05f5d" + +AAVE_WETH_CONTRACT = "0xf301805be1df81102c957f6d4ce29d2b8c056b2a" + +LAYERBANK_CONTRACT = "0xec53c830f4444a8a56455c6836b5d2aa794289aa" + +LAYERBANK_WETH_CONTRACT = "0x274C3795dadfEbf562932992bF241ae087e0a98C" + +ZERIUS_CONTRACT = "0xeb22c3e221080ead305cae5f37f0753970d973cd" + +DMAIL_CONTRACT = "0x47fbe95e981c0df9737b6971b451fb15fdc989d9" + +OMNISEA_CONTRACT = "0x46ce46951d12710d85bc4fe10bb29c6ea5012077" + +SAFE_CONTRACT = "0xa6b71e26c5e0845f74c812102ca7114b6a896ab2" + +RUBYSCORE_VOTE_CONTRACT = "0xe10Add2ad591A7AC3CA46788a06290De017b9fB4" diff --git a/domain/data/abi/aave/abi.json b/domain/data/abi/aave/abi.json new file mode 100644 index 0000000..6e218c2 --- /dev/null +++ b/domain/data/abi/aave/abi.json @@ -0,0 +1 @@ +[{"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 diff --git a/domain/data/abi/bridge/deposit.json b/domain/data/abi/bridge/deposit.json new file mode 100644 index 0000000..63015df --- /dev/null +++ b/domain/data/abi/bridge/deposit.json @@ -0,0 +1 @@ +[{"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"}] \ No newline at end of file diff --git a/domain/data/abi/bridge/oracle.json b/domain/data/abi/bridge/oracle.json new file mode 100644 index 0000000..d8c88a2 --- /dev/null +++ b/domain/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/domain/data/abi/bridge/withdraw.json b/domain/data/abi/bridge/withdraw.json new file mode 100644 index 0000000..e8d8e7c --- /dev/null +++ b/domain/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/domain/data/abi/dmail/abi.json b/domain/data/abi/dmail/abi.json new file mode 100644 index 0000000..80f3d62 --- /dev/null +++ b/domain/data/abi/dmail/abi.json @@ -0,0 +1,964 @@ +[ + { + "name": null, + "type": "constructor", + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "name": "AdminChanged", + "anonymous": false, + "inputs": [ + { + "name": "previousAdmin", + "type": "address", + "indexed": false, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "newAdmin", + "type": "address", + "indexed": false, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + } + ], + "type": "event", + "_isFragment": true + }, + { + "name": "Approval", + "anonymous": false, + "inputs": [ + { + "name": "owner", + "type": "address", + "indexed": true, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "spender", + "type": "address", + "indexed": true, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "value", + "type": "uint256", + "indexed": false, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "uint256", + "_isParamType": true + } + ], + "type": "event", + "_isFragment": true + }, + { + "name": "BeaconUpgraded", + "anonymous": false, + "inputs": [ + { + "name": "beacon", + "type": "address", + "indexed": true, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + } + ], + "type": "event", + "_isFragment": true + }, + { + "name": "Initialized", + "anonymous": false, + "inputs": [ + { + "name": "version", + "type": "uint8", + "indexed": false, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "uint8", + "_isParamType": true + } + ], + "type": "event", + "_isFragment": true + }, + { + "name": "Message", + "anonymous": false, + "inputs": [ + { + "name": "subject", + "type": "string", + "indexed": true, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "string", + "_isParamType": true + }, + { + "name": "from_address", + "type": "address", + "indexed": true, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "to", + "type": "string", + "indexed": true, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "string", + "_isParamType": true + } + ], + "type": "event", + "_isFragment": true + }, + { + "name": "OwnershipTransferred", + "anonymous": false, + "inputs": [ + { + "name": "previousOwner", + "type": "address", + "indexed": true, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "newOwner", + "type": "address", + "indexed": true, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + } + ], + "type": "event", + "_isFragment": true + }, + { + "name": "Paused", + "anonymous": false, + "inputs": [ + { + "name": "account", + "type": "address", + "indexed": false, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + } + ], + "type": "event", + "_isFragment": true + }, + { + "name": "Transfer", + "anonymous": false, + "inputs": [ + { + "name": "from", + "type": "address", + "indexed": true, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "to", + "type": "address", + "indexed": true, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "value", + "type": "uint256", + "indexed": false, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "uint256", + "_isParamType": true + } + ], + "type": "event", + "_isFragment": true + }, + { + "name": "Unpaused", + "anonymous": false, + "inputs": [ + { + "name": "account", + "type": "address", + "indexed": false, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + } + ], + "type": "event", + "_isFragment": true + }, + { + "name": "Upgraded", + "anonymous": false, + "inputs": [ + { + "name": "implementation", + "type": "address", + "indexed": true, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + } + ], + "type": "event", + "_isFragment": true + }, + { + "type": "function", + "name": "allowance", + "constant": true, + "inputs": [ + { + "name": "owner", + "type": "address", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "spender", + "type": "address", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + } + ], + "outputs": [ + { + "name": null, + "type": "uint256", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "uint256", + "_isParamType": true + } + ], + "payable": false, + "stateMutability": "view", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "approve", + "constant": false, + "inputs": [ + { + "name": "spender", + "type": "address", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "amount", + "type": "uint256", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "uint256", + "_isParamType": true + } + ], + "outputs": [ + { + "name": null, + "type": "bool", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "bool", + "_isParamType": true + } + ], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "balanceOf", + "constant": true, + "inputs": [ + { + "name": "account", + "type": "address", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + } + ], + "outputs": [ + { + "name": null, + "type": "uint256", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "uint256", + "_isParamType": true + } + ], + "payable": false, + "stateMutability": "view", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "burn", + "constant": false, + "inputs": [ + { + "name": "amount", + "type": "uint256", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "uint256", + "_isParamType": true + } + ], + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "burnFrom", + "constant": false, + "inputs": [ + { + "name": "account", + "type": "address", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "amount", + "type": "uint256", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "uint256", + "_isParamType": true + } + ], + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "decimals", + "constant": true, + "inputs": [], + "outputs": [ + { + "name": null, + "type": "uint8", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "uint8", + "_isParamType": true + } + ], + "payable": false, + "stateMutability": "view", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "decreaseAllowance", + "constant": false, + "inputs": [ + { + "name": "spender", + "type": "address", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "subtractedValue", + "type": "uint256", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "uint256", + "_isParamType": true + } + ], + "outputs": [ + { + "name": null, + "type": "bool", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "bool", + "_isParamType": true + } + ], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "increaseAllowance", + "constant": false, + "inputs": [ + { + "name": "spender", + "type": "address", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "addedValue", + "type": "uint256", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "uint256", + "_isParamType": true + } + ], + "outputs": [ + { + "name": null, + "type": "bool", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "bool", + "_isParamType": true + } + ], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "initialize", + "constant": false, + "inputs": [], + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "mint", + "constant": false, + "inputs": [ + { + "name": "to", + "type": "address", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "amount", + "type": "uint256", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "uint256", + "_isParamType": true + } + ], + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "name", + "constant": true, + "inputs": [], + "outputs": [ + { + "name": null, + "type": "string", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "string", + "_isParamType": true + } + ], + "payable": false, + "stateMutability": "view", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "owner", + "constant": true, + "inputs": [], + "outputs": [ + { + "name": null, + "type": "address", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + } + ], + "payable": false, + "stateMutability": "view", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "pause", + "constant": false, + "inputs": [], + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "paused", + "constant": true, + "inputs": [], + "outputs": [ + { + "name": null, + "type": "bool", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "bool", + "_isParamType": true + } + ], + "payable": false, + "stateMutability": "view", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "proxiableUUID", + "constant": true, + "inputs": [], + "outputs": [ + { + "name": null, + "type": "bytes32", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "bytes32", + "_isParamType": true + } + ], + "payable": false, + "stateMutability": "view", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "renounceOwnership", + "constant": false, + "inputs": [], + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "send_mail", + "constant": false, + "inputs": [ + { + "name": "to", + "type": "string", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "string", + "_isParamType": true + }, + { + "name": "subject", + "type": "string", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "string", + "_isParamType": true + } + ], + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "symbol", + "constant": true, + "inputs": [], + "outputs": [ + { + "name": null, + "type": "string", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "string", + "_isParamType": true + } + ], + "payable": false, + "stateMutability": "view", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "totalSupply", + "constant": true, + "inputs": [], + "outputs": [ + { + "name": null, + "type": "uint256", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "uint256", + "_isParamType": true + } + ], + "payable": false, + "stateMutability": "view", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "transfer", + "constant": false, + "inputs": [ + { + "name": "to", + "type": "address", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "amount", + "type": "uint256", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "uint256", + "_isParamType": true + } + ], + "outputs": [ + { + "name": null, + "type": "bool", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "bool", + "_isParamType": true + } + ], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "transferFrom", + "constant": false, + "inputs": [ + { + "name": "from", + "type": "address", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "to", + "type": "address", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "amount", + "type": "uint256", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "uint256", + "_isParamType": true + } + ], + "outputs": [ + { + "name": null, + "type": "bool", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "bool", + "_isParamType": true + } + ], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "transferOwnership", + "constant": false, + "inputs": [ + { + "name": "newOwner", + "type": "address", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + } + ], + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "unpause", + "constant": false, + "inputs": [], + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "upgradeTo", + "constant": false, + "inputs": [ + { + "name": "newImplementation", + "type": "address", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + } + ], + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "type": "function", + "name": "upgradeToAndCall", + "constant": false, + "inputs": [ + { + "name": "newImplementation", + "type": "address", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "address", + "_isParamType": true + }, + { + "name": "data", + "type": "bytes", + "indexed": null, + "components": null, + "arrayLength": null, + "arrayChildren": null, + "baseType": "bytes", + "_isParamType": true + } + ], + "outputs": [], + "payable": true, + "stateMutability": "payable", + "gas": null, + "_isFragment": true + } +] \ No newline at end of file diff --git a/domain/data/abi/erc20_abi.json b/domain/data/abi/erc20_abi.json new file mode 100644 index 0000000..517a4e3 --- /dev/null +++ b/domain/data/abi/erc20_abi.json @@ -0,0 +1 @@ +[{"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 diff --git a/domain/data/abi/gnosis/abi.json b/domain/data/abi/gnosis/abi.json new file mode 100644 index 0000000..59204fa --- /dev/null +++ b/domain/data/abi/gnosis/abi.json @@ -0,0 +1,198 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract GnosisSafeProxy", + "name": "proxy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "singleton", + "type": "address" + } + ], + "name": "ProxyCreation", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_singleton", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initializer", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "name": "calculateCreateProxyWithNonceAddress", + "outputs": [ + { + "internalType": "contract GnosisSafeProxy", + "name": "proxy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "singleton", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "createProxy", + "outputs": [ + { + "internalType": "contract GnosisSafeProxy", + "name": "proxy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_singleton", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initializer", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "contract IProxyCreationCallback", + "name": "callback", + "type": "address" + } + ], + "name": "createProxyWithCallback", + "outputs": [ + { + "internalType": "contract GnosisSafeProxy", + "name": "proxy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_singleton", + "type": "address" + }, + { + "internalType": "bytes", + "name": "initializer", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + } + ], + "name": "createProxyWithNonce", + "outputs": [ + { + "internalType": "contract GnosisSafeProxy", + "name": "proxy", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proxyCreationCode", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_owners", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "_threshold", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "address", + "name": "fallbackHandler", + "type": "address" + }, + { + "internalType": "address", + "name": "paymentToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "payment", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "paymentReceiver", + "type": "address" + } + ], + "name": "setup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/domain/data/abi/l2pass/abi.json b/domain/data/abi/l2pass/abi.json new file mode 100644 index 0000000..bb183ad --- /dev/null +++ b/domain/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/domain/data/abi/layerbank/abi.json b/domain/data/abi/layerbank/abi.json new file mode 100644 index 0000000..3aaf135 --- /dev/null +++ b/domain/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/domain/data/abi/nft-origins/abi.json b/domain/data/abi/nft-origins/abi.json new file mode 100644 index 0000000..a55eb84 --- /dev/null +++ b/domain/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/domain/data/abi/nft2me/abi.json b/domain/data/abi/nft2me/abi.json new file mode 100644 index 0000000..bb15229 --- /dev/null +++ b/domain/data/abi/nft2me/abi.json @@ -0,0 +1,24 @@ +[ + { + "name": null, + "type": "constructor", + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "gas": null, + "_isFragment": true + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } +] \ No newline at end of file diff --git a/domain/data/abi/omnisea/abi.json b/domain/data/abi/omnisea/abi.json new file mode 100644 index 0000000..bb002d2 --- /dev/null +++ b/domain/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/domain/data/abi/rubyscore/abi.json b/domain/data/abi/rubyscore/abi.json new file mode 100644 index 0000000..efe676e --- /dev/null +++ b/domain/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/domain/data/abi/scroll/weth.json b/domain/data/abi/scroll/weth.json new file mode 100644 index 0000000..33f62f2 --- /dev/null +++ b/domain/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/domain/data/abi/skydrome/abi.json b/domain/data/abi/skydrome/abi.json new file mode 100644 index 0000000..ee1abf9 --- /dev/null +++ b/domain/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/domain/data/abi/syncswap/classic_pool.json b/domain/data/abi/syncswap/classic_pool.json new file mode 100644 index 0000000..1db49a3 --- /dev/null +++ b/domain/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/domain/data/abi/syncswap/classic_pool_data.json b/domain/data/abi/syncswap/classic_pool_data.json new file mode 100644 index 0000000..cbda4c9 --- /dev/null +++ b/domain/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/domain/data/abi/syncswap/router.json b/domain/data/abi/syncswap/router.json new file mode 100644 index 0000000..26d9109 --- /dev/null +++ b/domain/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/domain/data/abi/zebra/abi.json b/domain/data/abi/zebra/abi.json new file mode 100644 index 0000000..ae5cab0 --- /dev/null +++ b/domain/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/domain/data/abi/zerius/abi.json b/domain/data/abi/zerius/abi.json new file mode 100644 index 0000000..08ae6ac --- /dev/null +++ b/domain/data/abi/zerius/abi.json @@ -0,0 +1 @@ +[{"inputs":[{"internalType":"uint256","name":"_minGasToTransfer","type":"uint256"},{"internalType":"address","name":"_lzEndpoint","type":"address"},{"internalType":"uint256","name":"_startMintId","type":"uint256"},{"internalType":"uint256","name":"_endMintId","type":"uint256"},{"internalType":"uint256","name":"_mintFee","type":"uint256"},{"internalType":"uint256","name":"_bridgeFee","type":"uint256"},{"internalType":"address","name":"_feeCollector","type":"address"},{"internalType":"uint256","name":"_referralEarningBips","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"errorCode","type":"uint256"}],"name":"ZeriusONFT721_CoreError","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":"uint256","name":"oldBridgeFee","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"newBridgeFee","type":"uint256"}],"name":"BridgeFeeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"uint16","name":"dstChainId","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BridgeFeeEarned","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":true,"internalType":"address","name":"referrer","type":"address"},{"indexed":false,"internalType":"uint256","name":"newEraningBips","type":"uint256"}],"name":"EarningBipsForReferrerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address[]","name":"referrers","type":"address[]"},{"indexed":false,"internalType":"uint256","name":"newEraningBips","type":"uint256"}],"name":"EarningBipsForReferrersChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldFeeCollector","type":"address"},{"indexed":true,"internalType":"address","name":"newFeeCollector","type":"address"}],"name":"FeeCollectorChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collector","type":"address"},{"indexed":false,"internalType":"uint256","name":"claimedAmount","type":"uint256"}],"name":"FeeEarningsClaimed","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":"uint256","name":"oldMintFee","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"newMintFee","type":"uint256"}],"name":"MintFeeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":true,"internalType":"uint256","name":"itemId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeEarnings","type":"uint256"},{"indexed":true,"internalType":"address","name":"referrer","type":"address"},{"indexed":false,"internalType":"uint256","name":"referrerEarnings","type":"uint256"}],"name":"ONFTMinted","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":true,"internalType":"uint256","name":"oldReferralEarningBips","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"newReferralEarningBips","type":"uint256"}],"name":"ReferralEarningBipsChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"referrer","type":"address"},{"indexed":false,"internalType":"uint256","name":"claimedAmount","type":"uint256"}],"name":"ReferrerEarningsClaimed","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":"string","name":"oldTokenURI","type":"string"},{"indexed":true,"internalType":"string","name":"newTokenURI","type":"string"},{"indexed":false,"internalType":"string","name":"fileExtension","type":"string"}],"name":"TokenURIChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"newState","type":"bool"}],"name":"TokenURILocked","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":[],"name":"DEFAULT_PAYLOAD_SIZE_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERROR_INVALID_COLLECTOR_ADDRESS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERROR_INVALID_REFERER","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERROR_INVALID_TOKEN_ID","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERROR_INVALID_URI_LOCK_STATE","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERROR_MINT_EXCEEDS_LIMIT","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERROR_MINT_INVALID_FEE","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERROR_NOTHING_TO_CLAIM","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERROR_NOT_FEE_COLLECTOR","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERROR_REFERRAL_BIPS_TOO_HIGH","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FIFTY_PERCENT","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":[],"name":"ONE_HUNDRED_PERCENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"bridgeFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimFeeEarnings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimReferrerEarnings","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":[],"name":"feeClaimedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeCollector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeEarnedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"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":[{"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":[],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"referrer","type":"address"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"referralEarningBips","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"referredTransactionsCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"referrersClaimedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"referrersEarnedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"referrersEarningBips","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_bridgeFee","type":"uint256"}],"name":"setBridgeFee","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":"referrer","type":"address"},{"internalType":"uint256","name":"earningBips","type":"uint256"}],"name":"setEarningBipsForReferrer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"referrers","type":"address[]"},{"internalType":"uint256","name":"earningBips","type":"uint256"}],"name":"setEarningBipsForReferrersBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeCollector","type":"address"}],"name":"setFeeCollector","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":"_mintFee","type":"uint256"}],"name":"setMintFee","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":"_referralEarninBips","type":"uint256"}],"name":"setReferralEarningBips","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_version","type":"uint16"}],"name":"setSendVersion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newTokenBaseURI","type":"string"},{"internalType":"string","name":"_fileExtension","type":"string"}],"name":"setTokenBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"locked","type":"bool"}],"name":"setTokenBaseURILocked","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":[],"name":"startMintId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":[],"name":"tokenBaseURILocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenCounter","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"}] \ No newline at end of file diff --git a/domain/data/abi/zkstars/abi.json b/domain/data/abi/zkstars/abi.json new file mode 100644 index 0000000..cdceeb7 --- /dev/null +++ b/domain/data/abi/zkstars/abi.json @@ -0,0 +1,552 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "string", + "name": "baseURI_", + "type": "string" + }, + { + "internalType": "uint256", + "name": "ref_precent_", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "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": [], + "name": "ReentrancyGuardReentrantCall", + "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": [], + "name": "getPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRefPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": [], + "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": [ + { + "internalType": "address payable", + "name": "ref", + "type": "address" + } + ], + "name": "safeMint", + "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": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newPrice", + "type": "uint256" + } + ], + "name": "setPrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newPercent", + "type": "uint256" + } + ], + "name": "setRefPercent", + "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": "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 payable", + "name": "to", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/domain/data/deploy/abi.json b/domain/data/deploy/abi.json new file mode 100644 index 0000000..32960f8 --- /dev/null +++ b/domain/data/deploy/abi.json @@ -0,0 +1,2 @@ +[ +] \ No newline at end of file diff --git a/domain/data/deploy/bytecode.txt b/domain/data/deploy/bytecode.txt new file mode 100644 index 0000000..99e07d0 --- /dev/null +++ b/domain/data/deploy/bytecode.txt @@ -0,0 +1 @@ +0x \ No newline at end of file diff --git a/domain/data/rpc.json b/domain/data/rpc.json new file mode 100644 index 0000000..a425149 --- /dev/null +++ b/domain/data/rpc.json @@ -0,0 +1,51 @@ +{ + "ethereum": { + "rpc": [ + "https://rpc.ankr.com/eth" + ], + "explorer": "https://etherscan.io/tx/", + "token": "ETH" + }, + "arbitrum": { + "rpc": [ + "https://rpc.ankr.com/arbitrum" + ], + "explorer": "https://arbiscan.io/tx/", + "token": "ETH" + }, + "optimism": { + "rpc": [ + "https://rpc.ankr.com/optimism" + ], + "explorer": "https://optimistic.etherscan.io/tx/", + "token": "ETH" + }, + "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" + ], + "explorer": "https://explorer.zksync.io/tx/", + "token": "ETH" + }, + "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/domain/main.py b/domain/main.py new file mode 100644 index 0000000..2bfed96 --- /dev/null +++ b/domain/main.py @@ -0,0 +1,152 @@ +import random +import time +from typing import Union +import asyncio +from eth_account import Account as EthereumAccount +from loguru import logger +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( + 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) + + +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'] + + + + diff --git a/domain/modules/__init__.py b/domain/modules/__init__.py new file mode 100644 index 0000000..48bf34f --- /dev/null +++ b/domain/modules/__init__.py @@ -0,0 +1,25 @@ +from .account import Account +from .scroll import Scroll +from .orbiter import Orbiter +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 .aave import Aave +from .layerbank import LayerBank +from .zerius import Zerius +from .l2pass import L2Pass +from .zkstars import ZkStars +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 .transfer import Transfer +from .tx_checker import check_tx diff --git a/domain/modules/aave.py b/domain/modules/aave.py new file mode 100644 index 0000000..74cfd26 --- /dev/null +++ b/domain/modules/aave.py @@ -0,0 +1,99 @@ +from typing import Dict + +from loguru import logger +from domain.config import AAVE_CONTRACT, AAVE_WETH_CONTRACT, AAVE_ABI +from domain.utils.gas_checker import check_gas +from domain.utils.helpers import retry +from domain.utils.sleeping import sleep +from .account import Account + + +class Aave(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(AAVE_CONTRACT, AAVE_ABI) + + async def get_deposit_amount(self): + aave_weth_contract = self.get_contract(AAVE_WETH_CONTRACT) + + amount = await aave_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 Aave | {amount} ETH") + + tx_data = await self.get_tx_data(amount_wei) + + transaction = await self.contract.functions.depositETH( + self.w3.to_checksum_address("0x11fCfe756c05AD438e312a7fd934381537D3cFfe"), + self.address, + 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()) + + 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 Aave | " + + f"{self.w3.from_wei(amount, 'ether')} ETH" + ) + 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("0x11fCfe756c05AD438e312a7fd934381537D3cFfe"), + amount, + self.address + ).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/domain/modules/account.py b/domain/modules/account.py new file mode 100644 index 0000000..432181e --- /dev/null +++ b/domain/modules/account.py @@ -0,0 +1,314 @@ +import asyncio +import time +import random +from typing import Union, Type, Dict, Any + +from hexbytes import HexBytes +from loguru import logger +from web3 import AsyncWeb3 +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 domain.config import RPC, ERC20_ABI, SCROLL_TOKENS +from domain.settings import GAS_MULTIPLIER, MAX_PRIORITY_FEE +from domain.utils.sleeping import sleep + + +class Account: + 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, 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) + + if abi is None: + abi = ERC20_ABI + + contract = self.w3.eth.contract(address=contract_address, abi=abi) + + 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) + + symbol = await contract.functions.symbol().call() + decimal = await contract.functions.decimals().call() + balance_wei = await contract.functions.balanceOf(self.address).call() + + balance = balance_wei / 10 ** decimal + + return {"balance_wei": balance_wei, "balance": balance, "symbol": symbol, "decimal": decimal} + + async def get_amount( + self, + from_token: str, + min_amount: float, + max_amount: float, + decimal: int, + all_amount: bool, + min_percent: int, + max_percent: int + ) -> [int, float, float]: + random_amount = round(random.uniform(min_amount, max_amount), decimal) + random_percent = random.randint(min_percent, max_percent) + percent = 1 if random_percent == 100 else random_percent / 100 + + 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: + # 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 + balance = balance["balance_wei"] + + return amount_wei, amount, balance + + async def check_allowance(self, token_address: str, contract_address: str) -> int: + 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) + amount_approved = await contract.functions.allowance(self.address, contract_address).call() + + return amount_approved + + 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) + + if amount > allowance_amount or amount == 0: + logger.success(f"[{self.account_id}][{self.address}] Make approve") + + approve_amount = 2 ** 128 if amount > allowance_amount else 0 + + tx_data = await self.get_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) + + 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) + + # 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: + try: + receipts = await self.w3.eth.get_transaction_receipt(hash) + status = receipts.get("status") + if status == 1: + logger.success(f"[{self.account_id}][{self.address}] {self.explorer}{hash} successfully!") + return + elif status is None: + await asyncio.sleep(0.3) + else: + logger.error(f"[{self.account_id}][{self.address}] {self.explorer}{hash} transaction failed!") + return + except TransactionNotFound: + if time.time() - start_time > max_wait_time: + print(f'FAILED TX: {hash}') + 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: + 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) + + + return signed_txn + + async def send_raw_transaction(self, signed_txn) -> HexBytes: + txn_hash = await self.w3.eth.send_raw_transaction(signed_txn.rawTransaction) + + return txn_hash diff --git a/domain/modules/ambient.py b/domain/modules/ambient.py new file mode 100644 index 0000000..bad7e89 --- /dev/null +++ b/domain/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/domain/modules/deploy.py b/domain/modules/deploy.py new file mode 100644 index 0000000..a3b32f6 --- /dev/null +++ b/domain/modules/deploy.py @@ -0,0 +1,32 @@ +from loguru import logger +from domain.utils.gas_checker import check_gas +from domain.utils.helpers import retry +from domain.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/domain/modules/dmail.py b/domain/modules/dmail.py new file mode 100644 index 0000000..a62030b --- /dev/null +++ b/domain/modules/dmail.py @@ -0,0 +1,36 @@ +import random +from hashlib import sha256 + +from loguru import logger +from domain.config import DMAIL_CONTRACT, DMAIL_ABI +from domain.utils.gas_checker import check_gas +from domain.utils.helpers import retry +from .account import Account + + +class Dmail(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(DMAIL_CONTRACT, DMAIL_ABI) + + @retry + @check_gas + async def send_mail(self): + logger.info(f"[{self.account_id}][{self.address}] Send email") + + email = sha256(str(1e11 * random.random()).encode()).hexdigest() + theme = sha256(str(1e11 * random.random()).encode()).hexdigest() + + 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), "gasPrice": await self.w3.eth.gas_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/domain/modules/l2pass.py b/domain/modules/l2pass.py new file mode 100644 index 0000000..ae15977 --- /dev/null +++ b/domain/modules/l2pass.py @@ -0,0 +1,33 @@ +from loguru import logger +from domain.config import L2PASS_ABI +from domain.utils.gas_checker import check_gas +from domain.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/domain/modules/layerbank.py b/domain/modules/layerbank.py new file mode 100644 index 0000000..fea1e74 --- /dev/null +++ b/domain/modules/layerbank.py @@ -0,0 +1,92 @@ +from loguru import logger +from domain.config import LAYERBANK_CONTRACT, LAYERBANK_WETH_CONTRACT, LAYERBANK_ABI +from domain.utils.gas_checker import check_gas +from domain.utils.helpers import retry +from domain.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/domain/modules/layerswap.py b/domain/modules/layerswap.py new file mode 100644 index 0000000..1b27763 --- /dev/null +++ b/domain/modules/layerswap.py @@ -0,0 +1,194 @@ +from typing import Union, Dict + +import aiohttp +from loguru import logger + +from domain.settings import LAYERSWAP_API_KEY +from domain.utils.gas_checker import check_gas +from domain.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/domain/modules/multiswap.py b/domain/modules/multiswap.py new file mode 100644 index 0000000..6508c68 --- /dev/null +++ b/domain/modules/multiswap.py @@ -0,0 +1,82 @@ +import random +from typing import Union + +from loguru import logger +from domain.config import SCROLL_TOKENS +from domain.modules import * +from domain.utils.sleeping import sleep + + +class Multiswap(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_modules = { + "syncswap": SyncSwap, + "skydrome": Skydrome, + "zebra": Zebra, + "xyswap": XYSwap, + } + + def get_swap_module(self, use_dex: list): + swap_module = random.choice(use_dex) + + return self.swap_modules[swap_module] + + async def swap( + self, + use_dex: list, + sleep_from: int, + sleep_to: int, + min_swap: int, + max_swap: int, + slippage: Union[int, float], + random_swap_token: bool, + min_percent: int, + max_percent: int + ): + quantity_swap = random.randint(min_swap, max_swap) + + if random_swap_token: + 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 "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 = "USDC" + + balance = await self.w3.eth.get_balance(self.address) + + min_amount = float(self.w3.from_wei(int(balance / 100 * min_percent), "ether")) + max_amount = float(self.w3.from_wei(int(balance / 100 * max_percent), "ether")) + else: + decimal = 18 + to_token = "ETH" + + 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, self.recipient) + await swap_module.swap( + token, + to_token, + min_amount, + max_amount, + decimal, + slippage, + False, + min_percent, + max_percent + ) + + if _ + 1 != len(path): + await sleep(sleep_from, sleep_to) diff --git a/domain/modules/nftorigins.py b/domain/modules/nftorigins.py new file mode 100644 index 0000000..b1276e0 --- /dev/null +++ b/domain/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/domain/modules/nfts2me.py b/domain/modules/nfts2me.py new file mode 100644 index 0000000..36b7ecd --- /dev/null +++ b/domain/modules/nfts2me.py @@ -0,0 +1,30 @@ +import random +from typing import List + +from loguru import logger +from domain.config import NFTS2ME_ABI +from domain.utils.gas_checker import check_gas +from domain.utils.helpers import retry +from .account import Account + + +class Minter(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 mint_nft(self, contracts: List): + logger.info(f"[{self.account_id}][{self.address}] Mint NFT on NFTS2ME") + + contract = self.get_contract(random.choice(contracts), NFTS2ME_ABI) + + tx_data = await self.get_tx_data() + + transaction = await contract.functions.mint(1).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/domain/modules/nitro.py b/domain/modules/nitro.py new file mode 100644 index 0000000..57ed1d1 --- /dev/null +++ b/domain/modules/nitro.py @@ -0,0 +1,97 @@ +import aiohttp +from loguru import logger +from domain.utils.gas_checker import check_gas +from domain.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/domain/modules/omnisea.py b/domain/modules/omnisea.py new file mode 100644 index 0000000..844f9db --- /dev/null +++ b/domain/modules/omnisea.py @@ -0,0 +1,47 @@ +import random +import time + +from loguru import logger +from domain.config import OMNISEA_CONTRACT, OMNISEA_ABI +from domain.utils.gas_checker import check_gas +from domain.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/domain/modules/orbiter.py b/domain/modules/orbiter.py new file mode 100644 index 0000000..4285a19 --- /dev/null +++ b/domain/modules/orbiter.py @@ -0,0 +1,104 @@ +import aiohttp +from loguru import logger + +from domain.utils.gas_checker import check_gas +from domain.utils.helpers import retry +from .account import Account +from domain.config import ORBITER_CONTRACT + + +class Orbiter(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", + "nova": "42170", + "zkevm": "1101", + "scroll": "534352", + "base": "8453", + "linea": "59144", + "zora": "7777777", + } + + @retry + async def get_bridge_amount(self, from_chain: str, to_chain: str, amount: float): + url = "https://openapi.orbiter.finance/explore/v3/yj6toqvwh1177e1sexfy0u1pxx5j8o47" + + data = { + "id": 1, + "jsonrpc": "2.0", + "method": "orbiter_calculatedAmount", + "params": [f"{self.chain_ids[from_chain]}-{self.chain_ids[to_chain]}:ETH-ETH", float(amount)] + } + + async with aiohttp.ClientSession() as session: + response = await session.post( + url=url, + headers={"Content-Type": "application/json"}, + json=data, + ) + + response_data = await response.json() + + if response_data.get("result").get("error", None) is None: + return int(response_data.get("result").get("_sendValue")) + + else: + error_data = response_data.get("result").get("error") + + logger.error(f"[{self.account_id}][{self.address}] Orbiter error | {error_data}") + + return False + + @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 {self.chain} –> {destination_chain} | {amount} ETH" + ) + + if ORBITER_CONTRACT == "": + logger.error(f"[{self.account_id}][{self.address}] Don't have orbiter contract") + return + + bridge_amount = await self.get_bridge_amount(self.chain, destination_chain, amount) + + if bridge_amount is False: + return + + balance = await self.w3.eth.get_balance(self.address) + + if bridge_amount > balance: + logger.error(f"[{self.account_id}][{self.address}] Insufficient funds!") + else: + tx_data = await self.get_tx_data(bridge_amount) + tx_data.update({"to": self.w3.to_checksum_address(ORBITER_CONTRACT)}) + + 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/domain/modules/routes.py b/domain/modules/routes.py new file mode 100644 index 0000000..a23f98e --- /dev/null +++ b/domain/modules/routes.py @@ -0,0 +1,45 @@ +import random + +from loguru import logger +from domain.utils.sleeping import sleep +from .account import Account + + +class Routes(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) + + def process_module(self, module): + if isinstance(module, list): + return self.process_module(random.choice(module)) + elif isinstance(module, tuple): + return [self.process_module(module[0]) for _ in range(random.randint(module[1], module[2]))] + else: + return module + + def run_modules(self, use_modules): + modules_to_run = [] + for module in use_modules: + result = self.process_module(module) + if isinstance(result, list): + modules_to_run.extend(result) + else: + modules_to_run.append(result) + return modules_to_run + + async def start(self, use_modules: list, sleep_from: int, sleep_to: int, random_module: bool): + logger.info(f"[{self.account_id}][{self.address}] Start using routes") + + run_modules = self.run_modules(use_modules) + + if random_module: + random.shuffle(run_modules) + + for module in run_modules: + if module is None: + logger.info(f"[{self.account_id}][{self.address}] Skip module") + continue + + await module(self.account_id, self.private_key, self.recipient) + + await sleep(sleep_from, sleep_to) diff --git a/domain/modules/rubyscore.py b/domain/modules/rubyscore.py new file mode 100644 index 0000000..a18778c --- /dev/null +++ b/domain/modules/rubyscore.py @@ -0,0 +1,28 @@ +from loguru import logger + +from domain.config import RUBYSCORE_VOTE_CONTRACT, RUBYSCORE_VOTE_ABI +from domain.utils.gas_checker import check_gas +from domain.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/domain/modules/safe.py b/domain/modules/safe.py new file mode 100644 index 0000000..4a5494a --- /dev/null +++ b/domain/modules/safe.py @@ -0,0 +1,47 @@ +import time + +from loguru import logger +from domain.config import SAFE_ABI, SAFE_CONTRACT, ZERO_ADDRESS +from domain.utils.gas_checker import check_gas +from domain.utils.helpers import retry +from .account import Account + + +class GnosisSafe(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(SAFE_CONTRACT, SAFE_ABI) + + @retry + @check_gas + async def create_safe(self): + logger.info(f"[{self.account_id}][{self.address}] Create gnosis safe") + + setup_data = self.contract.encodeABI( + fn_name="setup", + args=[ + [self.address], + 1, + ZERO_ADDRESS, + "0x", + self.w3.to_checksum_address("0xf48f2B2d2a534e402487b3ee7C18c33Aec0Fe5e4"), + ZERO_ADDRESS, + 0, + ZERO_ADDRESS + ] + ) + + tx_data = await self.get_tx_data() + + transaction = await self.contract.functions.createProxyWithNonce( + self.w3.to_checksum_address("0x3E5c63644E683549055b9Be8653de26E0B4CD36E"), + setup_data, + int(time.time()*1000) + ).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/domain/modules/scroll.py b/domain/modules/scroll.py new file mode 100644 index 0000000..d855abf --- /dev/null +++ b/domain/modules/scroll.py @@ -0,0 +1,168 @@ +from loguru import logger + +from domain.utils.gas_checker import check_gas +from domain.utils.helpers import retry +from .account import Account + +from domain.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/domain/modules/skydrome.py b/domain/modules/skydrome.py new file mode 100644 index 0000000..cde8f5a --- /dev/null +++ b/domain/modules/skydrome.py @@ -0,0 +1,175 @@ +import time + +from loguru import logger +from web3 import Web3 +from domain.config import SKYDROME_ROUTER_ABI, SKYDROME_CONTRACTS, SCROLL_TOKENS +from domain.utils.gas_checker import check_gas +from domain.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/domain/modules/swap_tokens.py b/domain/modules/swap_tokens.py new file mode 100644 index 0000000..c59b3f5 --- /dev/null +++ b/domain/modules/swap_tokens.py @@ -0,0 +1,60 @@ +import random +from typing import List, Union + +from loguru import logger +from domain.config import SCROLL_TOKENS +from domain.modules import * +from domain.utils.sleeping import sleep + + +class SwapTokens(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_modules = { + "syncswap": SyncSwap, + "skydrome": Skydrome, + "zebra": Zebra, + "xyswap": XYSwap, + } + + def get_swap_module(self, use_dex: list): + swap_module = random.choice(use_dex) + return self.swap_modules[swap_module] + + async def swap( + self, + use_dex: List, + tokens: List, + sleep_from: int, + sleep_to: int, + slippage: Union[int, float], + min_percent: int, + max_percent: int, + ): + random.shuffle(tokens) + + logger.info(f"[{self.account_id}][{self.address}] Start swap tokens") + + for _, token in enumerate(tokens, start=1): + if token == "ETH": + continue + + 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, self.recipient) + await swap_module.swap( + token, + "ETH", + balance["balance"], + balance["balance"], + balance["decimal"], + slippage, + True, + min_percent, + max_percent + ) + + if _ != len(tokens): + await sleep(sleep_from, sleep_to) diff --git a/domain/modules/syncswap.py b/domain/modules/syncswap.py new file mode 100644 index 0000000..76cf554 --- /dev/null +++ b/domain/modules/syncswap.py @@ -0,0 +1,149 @@ +import time + +from loguru import logger +from web3 import Web3 +from domain.config import ( + SCROLL_TOKENS, + SYNCSWAP_CLASSIC_POOL_ABI, + ZERO_ADDRESS, + SYNCSWAP_CONTRACTS, + SYNCSWAP_ROUTER_ABI, + SYNCSWAP_CLASSIC_POOL_DATA_ABI +) +from domain.utils.gas_checker import check_gas +from domain.utils.helpers import retry +from .account import Account +from eth_abi import abi + + +class SyncSwap(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(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) + 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: {converted_amount} {to_token})" + ) + tx_data.update({"value": amount_wei}) + 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 + ) + + 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!") diff --git a/domain/modules/transfer.py b/domain/modules/transfer.py new file mode 100644 index 0000000..4fc738e --- /dev/null +++ b/domain/modules/transfer.py @@ -0,0 +1,44 @@ +from eth_utils import to_bytes +from loguru import logger +from domain.utils.gas_checker import check_gas +from domain.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/domain/modules/tx_checker.py b/domain/modules/tx_checker.py new file mode 100644 index 0000000..e442a3f --- /dev/null +++ b/domain/modules/tx_checker.py @@ -0,0 +1,41 @@ +import asyncio +import random + +from eth_typing import ChecksumAddress +from loguru import logger +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 domain.config import RPC + + +async def get_nonce(address: ChecksumAddress): + web3 = AsyncWeb3( + AsyncHTTPProvider(random.choice(RPC["scroll"]["rpc"])), + middlewares=[async_geth_poa_middleware], + ) + + nonce = await web3.eth.get_transaction_count(address) + + return nonce + + +async def check_tx(wallets: list[str]): + tasks = [] + + logger.info("Start transaction checker") + + 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)) + + await asyncio.gather(*tasks) + + table = [[k, i.get_name(), i.result()] for k, i in enumerate(tasks, start=1)] + + headers = ["#", "Address", "Nonce"] + + print(tabulate(table, headers, tablefmt="github")) diff --git a/domain/modules/xyswap.py b/domain/modules/xyswap.py new file mode 100644 index 0000000..819715b --- /dev/null +++ b/domain/modules/xyswap.py @@ -0,0 +1,121 @@ +from typing import Dict + +import aiohttp +from loguru import logger +from domain.config import XYSWAP_CONTRACT, SCROLL_TOKENS +from domain.utils.gas_checker import check_gas +from domain.utils.helpers import retry +from .account import Account + + +class XYSwap(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) + + async def get_quote(self, from_token: str, to_token: str, amount: int, slippage: float): + url = "https://aggregator-api.xy.finance/v1/quote" + + params = { + "srcChainId": await self.w3.eth.chain_id, + "srcQuoteTokenAddress": self.w3.to_checksum_address(from_token), + "srcQuoteTokenAmount": amount, + "dstChainId": await self.w3.eth.chain_id, + "dstQuoteTokenAddress": self.w3.to_checksum_address(to_token), + "slippage": slippage + } + + 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, from_token: str, to_token: str, amount: int, slippage: float, swap_provider: str): + url = "https://aggregator-api.xy.finance/v1/buildTx" + + params = { + "srcChainId": await self.w3.eth.chain_id, + "srcQuoteTokenAddress": self.w3.to_checksum_address(from_token), + "srcQuoteTokenAmount": amount, + "dstChainId": await self.w3.eth.chain_id, + "dstQuoteTokenAddress": self.w3.to_checksum_address(to_token), + "slippage": slippage, + "receiver": self.address, + "srcSwapProvider": swap_provider, + } + + if XYSWAP_CONTRACT["use_ref"]: + params.update({ + "affiliate": self.w3.to_checksum_address("0x1c7ff320ae4327784b464eed07714581643b36a7"), + "commissionRate": 10000 + }) + + async with aiohttp.ClientSession() as session: + response = await session.get(url=url, params=params) + + transaction_data = await response.json() + + return transaction_data + + @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 XYSwap – {from_token} -> {to_token} | {amount} {from_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) + + swap_provider = quote["routes"][0]["srcSwapDescription"]["provider"] + + transaction_data = await self.build_transaction( + from_token, + to_token, + amount_wei, + slippage, + swap_provider + ) + + if from_token != "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE": + await self.approve(amount_wei, from_token, XYSWAP_CONTRACT["router"]) + + tx_data = await self.get_tx_data() + tx_data.update( + { + "to": self.w3.to_checksum_address(transaction_data["tx"]["to"]), + "data": transaction_data["tx"]["data"], + "value": transaction_data["tx"]["value"], + "nonce": await self.w3.eth.get_transaction_count(self.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/domain/modules/zebra.py b/domain/modules/zebra.py new file mode 100644 index 0000000..f5693a5 --- /dev/null +++ b/domain/modules/zebra.py @@ -0,0 +1,117 @@ +import time + +from loguru import logger +from web3 import Web3 +from domain.config import ZEBRA_ROUTER_ABI, ZEBRA_CONTRACTS, SCROLL_TOKENS +from domain.utils.gas_checker import check_gas +from domain.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/domain/modules/zerius.py b/domain/modules/zerius.py new file mode 100644 index 0000000..2f3fded --- /dev/null +++ b/domain/modules/zerius.py @@ -0,0 +1,95 @@ +import random +from typing import List + +from loguru import logger + +from domain.config import ZERIUS_CONTRACT, ZERIUS_ABI, ZERO_ADDRESS +from domain.utils.gas_checker import check_gas +from domain.utils.helpers import retry +from domain.utils.sleeping import sleep +from .account import Account + + +class Zerius(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(ZERIUS_CONTRACT, ZERIUS_ABI) + + self.chain_ids = { + "arbitrum": 110, + "optimism": 111, + "polygon": 109, + "bsc": 102, + "avalanche": 106, + } + + async def get_nft_id(self, txn_hash: str): + receipts = await self.w3.eth.get_transaction_receipt(txn_hash) + + nft_id = int(receipts["logs"][0]["topics"][-1].hex(), 0) + + return nft_id + + async def get_estimate_fee(self, chain: str, nft_id: int): + fee = await self.contract.functions.estimateSendFee( + self.chain_ids[chain], + self.address, + nft_id, + False, + "0x" + ).call() + + return int(fee[0] * 1.2) + + @retry + @check_gas + async def mint(self): + logger.info(f"[{self.account_id}][{self.address}] Mint Zerius NFT") + + mint_fee = await self.contract.functions.mintFee().call() + + tx_data = await self.get_tx_data(mint_fee) + + transaction = await self.contract.functions.mint().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()) + + return txn_hash.hex() + + @retry + @check_gas + async def bridge(self, chain: List, sleep_from: int, sleep_to: int): + chain_id = random.choice(chain) + + mint_nft = await self.mint() + + nft_id = await self.get_nft_id(mint_nft) + + await sleep(sleep_from, sleep_to) + + l0_fee = await self.get_estimate_fee(chain_id, nft_id) + + base_bridge_fee = await self.contract.functions.bridgeFee().call() + + tx_data = await self.get_tx_data(l0_fee + base_bridge_fee) + + transaction = await self.contract.functions.sendFrom( + self.address, + self.chain_ids[chain_id], + self.address, + nft_id, + ZERO_ADDRESS, + ZERO_ADDRESS, + "0x0001000000000000000000000000000000000000000000000000000000000003d090" + ).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/domain/modules/zkstars.py b/domain/modules/zkstars.py new file mode 100644 index 0000000..4becf79 --- /dev/null +++ b/domain/modules/zkstars.py @@ -0,0 +1,46 @@ +import random + +from loguru import logger +from domain.config import ZKSTARS_ABI +from domain.utils.gas_checker import check_gas +from domain.utils.helpers import retry +from domain.utils.sleeping import sleep +from .account import Account + + +class ZkStars(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 mint(self, contracts: list, min_mint: int, max_mint: int, mint_all: bool, sleep_from: int, sleep_to: int): + quantity_mint = random.randint(min_mint, max_mint) + + contracts = contracts if mint_all is True else random.sample(contracts, quantity_mint) + + logger.info(f"[{self.account_id}][{self.address}] Mint {quantity_mint} StarkStars NFT") + + for _, contract in enumerate(contracts, start=1): + mint_contract = self.get_contract(self.w3.to_checksum_address(contract), ZKSTARS_ABI) + + mint_price = await mint_contract.functions.getPrice().call() + nft_id = await mint_contract.functions.name().call() + + logger.info(f"[{self.account_id}][{self.address}] Mint #{nft_id} NFT") + + tx_data = await self.get_tx_data() + tx_data.update({"value": mint_price}) + + transaction = await mint_contract.functions.safeMint( + self.w3.to_checksum_address("0x1C7FF320aE4327784B464eeD07714581643B36A7") + ).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 _ != len(contracts): + await sleep(sleep_from, sleep_to) diff --git a/domain/modules_settings.py b/domain/modules_settings.py new file mode 100644 index 0000000..23d241f --- /dev/null +++ b/domain/modules_settings.py @@ -0,0 +1,682 @@ +import asyncio +from domain.modules import * +import datetime +import json +import os +from Crypto.Cipher import AES +from Crypto.Util.Padding import unpad + +async def deposit_scroll(account_id, key, recipient): + """ + Deposit from official bridge + ______________________________________________________ + all_amount - bridge from min_percent to max_percent + """ + + min_amount = 0.001 + max_amount = 0.002 + decimal = 4 + + all_amount = True + + min_percent = 1 + max_percent = 1 + + scroll = Scroll(account_id, key, "ethereum", recipient) + await scroll.deposit(min_amount, max_amount, decimal, all_amount, min_percent, max_percent) + + +async def withdraw_scroll(account_id, key, recipient): + """ + Withdraw from official bridge + ______________________________________________________ + all_amount - withdraw from min_percent to max_percent + """ + + min_amount = 0.0012 + max_amount = 0.0012 + decimal = 4 + + all_amount = True + + min_percent = 10 + max_percent = 10 + + 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 bridge_orbiter(account_id, key, recipient): + """ + Bridge from orbiter + ______________________________________________________ + from_chain – ethereum, base, polygon_zkevm, arbitrum, optimism, zksync, scroll | Select one + to_chain – ethereum, base, polygon_zkevm, arbitrum, optimism, zksync, scroll | Select one + """ + + from_chain = "scroll" + to_chain = "base" + + min_amount = 0.005 + max_amount = 0.0051 + decimal = 4 + + all_amount = False + + min_percent = 5 + max_percent = 10 + + 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 bridge_layerswap(account_id, key, recipient): + """ + Bridge from Layerswap + ______________________________________________________ + 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 + + all_amount - deposit from min_percent to max_percent + """ + + from_chain = "zksync" + to_chain = "scroll" + + min_amount = 0.003 + max_amount = 0.004 + + decimal = 5 + + all_amount = True + + min_percent = 5 + max_percent = 5 + + 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 bridge_nitro(account_id, key, recipient): + """ + Bridge from nitro + ______________________________________________________ + from_chain – ethereum, arbitrum, optimism, zksync, scroll, base, linea | Select one + to_chain – ethereum, arbitrum, optimism, zksync, scroll, base, linea | Select one + """ + + from_chain = "zksync" + to_chain = "scroll" + + min_amount = 0.005 + max_amount = 0.0051 + decimal = 4 + + all_amount = False + + min_percent = 5 + max_percent = 10 + + 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 wrap_eth(account_id, key, recipient): + """ + Wrap ETH + ______________________________________________________ + all_amount - wrap from min_percent to max_percent + """ + + min_amount = 0.001 + max_amount = 0.002 + decimal = 4 + + all_amount = True + + min_percent = 5 + max_percent = 10 + + scroll = Scroll(account_id, key, "scroll", recipient) + await scroll.wrap_eth(min_amount, max_amount, decimal, all_amount, min_percent, max_percent) + + +async def unwrap_eth(account_id, key, recipient): + """ + 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 + + 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_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 Skydrome + ______________________________________________________ + from_token – Choose SOURCE token ETH, USDC | Select one + to_token – Choose DESTINATION token ETH, USDC | 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 = from_token + to_token = to_token + + min_amount = min_amount + max_amount = max_amount + decimal = decimal + slippage = slippage + + all_amount = all_amount + + min_percent = min_percent + max_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_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 Zebra + ______________________________________________________ + from_token – Choose SOURCE token ETH, USDC | Select one + to_token – Choose DESTINATION token ETH, USDC | 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 = from_token + to_token = to_token + + min_amount = min_amount + max_amount = max_amount + decimal = decimal + slippage = slippage + + all_amount = all_amount + + min_percent = min_percent + max_percent = max_percent + + 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_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 SyncSwap + + 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 = from_token + to_token = to_token + + min_amount = min_amount + max_amount = max_amount + decimal = decimal + slippage = slippage + + all_amount = all_amount + + min_percent = min_percent + max_percent = max_percent + + 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, 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, 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 = from_token + to_token = to_token + + min_amount = min_amount + max_amount = max_amount + decimal = decimal + slippage = slippage + + all_amount = all_amount + + min_percent = min_percent + max_percent = max_percent + + 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 deposit_layerbank(account_id, key, recipient): + """ + Make deposit on LayerBank + ______________________________________________________ + make_withdraw - True, if need withdraw after deposit + + all_amount - deposit from min_percent to max_percent + """ + min_amount = 0.0001 + max_amount = 0.0002 + decimal = 5 + + sleep_from = 5 + sleep_to = 24 + + make_withdraw = True + + all_amount = True + + min_percent = 5 + max_percent = 10 + + 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_aave(account_id, key, recipient): + """ + Make deposit on Aave + ______________________________________________________ + make_withdraw - True, if need withdraw after deposit + + all_amount - deposit from min_percent to max_percent + """ + min_amount = 0.0001 + max_amount = 0.0002 + decimal = 5 + + sleep_from = 5 + sleep_to = 24 + + make_withdraw = True + + all_amount = True + + min_percent = 5 + max_percent = 10 + + 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 mint_zerius(account_id, key, recipient): + """ + Mint + bridge Zerius NFT + ______________________________________________________ + 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 + """ + + chains = ["arbitrum"] + + sleep_from = 10 + sleep_to = 20 + + zerius = Zerius(account_id, key, recipient) + await zerius.bridge(chains, sleep_from, sleep_to) + + +async def mint_l2pass(account_id, key, recipient): + """ + Mint L2Pass NFT + """ + + contract = "0x0000049f63ef0d60abe49fdd8bebfa5a68822222" + + l2pass = L2Pass(account_id, key, recipient) + await l2pass.mint(contract) + + +async def mint_nft(account_id, key, recipient): + """ + Mint NFT on NFTS2ME + ______________________________________________________ + contracts - list NFT contract addresses + """ + + contracts = [""] + + minter = Minter(account_id, key, recipient) + await minter.mint_nft(contracts) + + +async def mint_zkstars(account_id, key, recipient): + """ + Mint ZkStars NFT + """ + + contracts = [ + "0x609c2f307940b8f52190b6d3d3a41c762136884e", + "0x16c0baa8a2aa77fab8d0aece9b6947ee1b74b943", + "0xc5471e35533e887f59df7a31f7c162eb98f367f7", + "0xf861f5927c87bc7c4781817b08151d638de41036", + "0x954e8ac11c369ef69636239803a36146bf85e61b", + "0xa576ac0a158ebdcc0445e3465adf50e93dd2cad8", + "0x17863384c663c5f95e4e52d3601f2ff1919ac1aa", + "0x4c2656a6d1c0ecac86f5024e60d4f04dbb3d1623", + "0x4e86532cedf07c7946e238bd32ba141b4ed10c12", + "0x6b9db0ffcb840c3d9119b4ff00f0795602c96086", + "0x10d4749bee6a1576ae5e11227bc7f5031ad351e4", + "0x373148e566e4c4c14f4ed8334aba3a0da645097a", + "0xdacbac1c25d63b4b2b8bfdbf21c383e3ccff2281", + "0x2394b22b3925342f3216360b7b8f43402e6a150b", + "0xf34f431e3fc0ad0d2beb914637b39f1ecf46c1ee", + "0x6f1e292302dce99e2a4681be4370d349850ac7c2", + "0xa21fac8b389f1f3717957a6bb7d5ae658122fc82", + "0x1b499d45e0cc5e5198b8a440f2d949f70e207a5d", + "0xec9bef17876d67de1f2ec69f9a0e94de647fcc93", + "0x5e6c493da06221fed0259a49beac09ef750c3de1" + ] + + mint_min = 1 + mint_max = 1 + + mint_all = False + + sleep_from = 5 + sleep_to = 10 + + zkkstars = ZkStars(account_id, key, recipient) + await zkkstars.mint(contracts, mint_min, mint_max, mint_all, sleep_from, sleep_to) + + +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: syncswap, skydrome, zebra, xyswap + """ + + use_dex = [ + "syncswap", "skydrome", "zebra" + ] + + use_tokens = ["USDC"] + + sleep_from = 1 + sleep_to = 5 + + slippage = 0.1 + + min_percent = 100 + max_percent = 100 + + 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, recipient): + """ + Multi-Swap module: Automatically performs the specified number of swaps in one of the dexes. + ______________________________________________________ + use_dex - Choose any dex: syncswap, skydrome, zebra, xyswap + quantity_swap - Quantity swaps + ______________________________________________________ + 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 = ["syncswap", "skydrome", "zebra"] + + min_swap = 3 + max_swap = 4 + + sleep_from = 3 + sleep_to = 7 + + slippage = 0.1 + + random_swap_token = True + + min_percent = 5 + max_percent = 10 + + 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, recipient): + """ + BRIDGE: + – deposit_scroll + – withdraw_scroll + – bridge_orbiter + – bridge_layerswap + – bridge_nitro + WRAP: + – wrap_eth + – unwrap_eth + DEX: + – swap_skydrome + – swap_syncswap + – swap_zebra + LIQUIDITY: + LANDING: + – depost_layerbank + – withdraw_layerbank + – deposit_aave + – withdraw_aave + NFT/DOMAIN: + – mint_zerius + – mint_zkstars + – create_omnisea + – mint_nft + – mint_l2pass + ANOTHER: + – swap_multiswap + – swap_tokens + – send_mail (Dmail) + – create_safe + – 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] + The script will start with module 1, 2, 5 and select a random one from module 3 and 4 + + You can also specify None in [], and if None is selected by random, this module will be skipped + + You can also specify () to perform the desired action a certain number of times + example (send_mail, 1, 10) run this module 1 to 10 times + """ + + use_modules = [ + create_omnisea, + [create_omnisea, mint_zerius, None], + (create_omnisea, 1, 3), + ] + + sleep_from = 300 + sleep_to = 700 + + random_module = True + + routes = Routes(account_id, key, recipient) + await routes.start(use_modules, sleep_from, sleep_to, random_module) + + +######################################### +########### NO NEED TO CHANGE ########### +######################################### + +async def withdraw_layerbank(account_id, key, recipient): + layerbank = LayerBank(account_id, key, recipient) + await layerbank.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_mail(account_id, key, recipient): + dmail = Dmail(account_id, key, recipient) + await dmail.send_mail() + + +async def create_omnisea(account_id, key, recipient): + omnisea = Omnisea(account_id, key, recipient) + await omnisea.create() + + +async def create_safe(account_id, key, recipient): + gnosis_safe = GnosisSafe(account_id, key, recipient) + await gnosis_safe.create_safe() + + +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/domain/settings.py b/domain/settings.py new file mode 100644 index 0000000..f70defc --- /dev/null +++ b/domain/settings.py @@ -0,0 +1,38 @@ + +# GWEI CONTROL MODE +CHECK_GWEI = False # True/False +MAX_GWEI = 20 + +MAX_PRIORITY_FEE = { + "ethereum": 0.01, + "polygon": 40, + "arbitrum": 0.1, + "base": 0.1, + "zksync": 0.25, +} + +GAS_MULTIPLIER = 1.3 + +# RETRY MODE +RETRY_COUNT = 3 + +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/domain/utils/__init__.py b/domain/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/domain/utils/gas_checker.py b/domain/utils/gas_checker.py new file mode 100644 index 0000000..a1b0b4b --- /dev/null +++ b/domain/utils/gas_checker.py @@ -0,0 +1,45 @@ +import asyncio +import time +import random + +from web3 import Web3 +from web3.eth import AsyncEth + +from domain.config import RPC +from domain.settings import CHECK_GWEI, MAX_GWEI +from loguru import logger + + +async def get_gas(): + try: + 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) + + +async def wait_gas(): + logger.info("Get GWEI") + while True: + gas = await get_gas() + + if gas > MAX_GWEI: + logger.info(f'Current GWEI: {gas} > {MAX_GWEI}') + await asyncio.sleep(60) + else: + logger.success(f"GWEI is normal | current: {gas} < {MAX_GWEI}") + break + + +def check_gas(func): + async def _wrapper(*args, **kwargs): + if CHECK_GWEI: + await wait_gas() + return await func(*args, **kwargs) + + return _wrapper diff --git a/domain/utils/helpers.py b/domain/utils/helpers.py new file mode 100644 index 0000000..687cca9 --- /dev/null +++ b/domain/utils/helpers.py @@ -0,0 +1,29 @@ +from loguru import logger +from domain.settings import RETRY_COUNT +from domain.utils.sleeping import sleep + + +def retry(func): + async def wrapper(*args, **kwargs): + retries = 0 + while retries <= RETRY_COUNT: + try: + result = await func(*args, **kwargs) + return result + except Exception as e: + logger.error(f"Error | {e}") + await sleep(10, 20) + retries += 1 + + return wrapper + + +def remove_wallet(private_key: str): + with open("accounts.txt", "r") as file: + + lines = file.readlines() + + with open("accounts.txt", "w") as file: + for line in lines: + if private_key not in line: + file.write(line) diff --git a/domain/utils/sleeping.py b/domain/utils/sleeping.py new file mode 100644 index 0000000..838dfea --- /dev/null +++ b/domain/utils/sleeping.py @@ -0,0 +1,12 @@ +import asyncio +import random + +from loguru import logger + + +async def sleep(sleep_from: int, sleep_to: int): + delay = random.randint(sleep_from, sleep_to) + + logger.info(f"💤 Sleep {delay} s.") + for _ in range(delay): + await asyncio.sleep(1) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8af24593c6fea73bcfb5f0ae3d73198aeea9e0a3 GIT binary patch literal 250 zcmX|*T@HdU5QOKM!w{^f@xjADBxtNZV2$?j;yyf_)bp+V7fzFYsFjP2x`>g@caQ^PS`K{prfvdui>^#$#$VP?v^Cmn7N$!P}Ets nbh9DZ;~W>?=AV3ljqv8|lj>wzPC21}xDZpXxw~oB- Date: Tue, 9 Apr 2024 23:25:03 +0100 Subject: [PATCH 2/3] updated files added From 0961be502ee3fd1d8bc67a6d7867813c5f1078e6 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 10 Apr 2024 00:23:19 +0100 Subject: [PATCH 3/3] updated readme.md file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d318c0e..991721e 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ cd scroll pip install -r requirements.txt -~/scroll$ python run_swaps.py --wallets WALLET_KEY1 WALLET_KEY2 WALLET_KEYN +~/scroll$ python run_swaps.py --wallet_file json file that contains keys ``` ---

🚨 Features