This project maintains an addresses (Smart Contract or EOA) balance at a desired value and periodically tops it up when below a specified threshold.
Since computation is performed entirely off-chain by a Web3 Function, no contract deployment is necessary leading to gas savings.
Funds are stored in a user's dedicatedMsgSender
proxy which funds all topup tasks.
Note
Whilst no per-user contract deployment is necessary, a forwarder contract must be deployed once on each network and is subsequently shared by all topup tasks.
The example implements an topup hardhat task for deployment from the CLI.
Specify a desired amount
and threshold
along with a list of targets
to topup (comma-separated).
See Quick Start
Warning
Contracts are not audited by a third party. Please use at your own discretion.
- Install dependencies
yarn install
- Compile smart contracts
yarn run hardhat compile
- Edit
.env
cp .env.example .env
- Deploy forwarder contract (Optional)
yarn hardhat deploy --network [network]
- Create topup task
yarn hardhat topup --targets [addresses] --amount [value] --threshold [value] --network [network]
- Fund
dedicatedMsgSender
proxy
https://fund-proxy.web.app/