This NestJS application provides a solution for retrieving Arbitrum airdrops from compromised Ethereum wallets. It will attempt and deposit gas tokens, perform the claim and the withdraw all in the same block, so that sweeper bots don't get a chance to steal gas tokens or the claimed $ARB as they won't be aware of it yet.
- Node.js version 12 or higher
- Safe Ethereum wallet with private key
- Compromised Ethereum wallet with private key
- Arbitrum airdrop contract address and ABI
- ERC20 token contract address and ABI
- RPC node URL
- Clone the repository
- Install dependencies using
yarn install
- Update the environment variables in a
.env
file based on the provided.env.example
file - Update the
main.ts
file with the appropriate values for the target block number, $ARB ERC20 token address, own Ethereum wallet address, and private keys for both the own and compromised wallets - Run the application using
yarn start
The arbitrum.service.ts
file provides methods for interacting with the Arbitrum blockchain and executing transactions. These methods include:
getWeb3Instance()
: Returns the current Web3 instancegetCurrentBlockNumber()
: Returns the current block number on the Ethereum blockchain via a multicall contract on ArbitrumexecuteTransaction()
: Executes a transaction on the Ethereum blockchain using a private key, to address, value, and gas pricegetERC20TokenContract()
: Returns a contract instance for a given ERC20 token addresstransferERC20Token()
: Transfers ERC20 tokens from one address to another using a private key, token address, to address, value, and gas priceexecuteContractMethod()
: Executes a method on a smart contract using a private key, contract address, ABI, method name, gas price, and optional method argumentsgetGasPrice()
: Returns the current gas price on the Arbitrum blockchain
Contributions to this project are welcome. Please create a pull request with your changes.
This project is licensed under the MIT license. See the LICENSE
file for more details.