This project contains the MPForwarder smart contract, which is designed to forward ETH and ERC20 tokens to a specified destination address. The contract is built using Solidity and the Hardhat development environment.
To install the dependencies for the project, run:
npm installTo compile the smart contracts, run:
npx hardhat compileTo run the tests for the smart contracts, run:
npx hardhat testWith the REPORT_GAS environment variable set to true, the tests will also report the gas usage for each test:
REPORT_GAS=true npx hardhat testSetup the required environment variables:
npx hardhat vars set INFURA_API_KEY <infura-api-key>
npx hardhat vars set PRIVATE_KEY <private-key>Modify the parameters in the ignition/parameters.json file as needed. E.g.
{
"MPForwarder": {
"destination": "0xYOUR_ADDRESS"
}
}To deploy the MPForwarder smart contract, run:
npx hardhat ignition deploy ./ignition/modules/MPForwarder.ts --network <network> --parameters ignition/parameters.jsonReplace <network> with the desired network:
localhost(default)arbitrumbsc
Or specify a custom network in the hardhat.config.ts file.
- Arbitrum:
0x59e56bB2aB29C40B340AfbE7f8D8061FE09a5841 - BSC:
0x4fA49144bb120f5665Bc5210C28013bf3421c04D