VacuumAgent
The VacuumAgent is a utility contract designed to clean up "dust" balances from user wallets. It aggregates small amounts of varied ERC20 tokens, swaps them to USDC, and uses that USDC to mint agtrUSD for the user.
Functions
sweepDust
function sweepDust(address[] calldata tokens, uint256[] calldata amounts) external
The core operation. Takes a list of tokens and amounts, transfers them from the user, swaps each one to USDC via Aerodrome, and finally deposits the aggregated USDC into the AgentTresor to mint agtrUSD.
Parameters
tokens: Array of ERC20 token addresses to sweep.amounts: Array of amounts corresponding to each token.
Logic Steps
- Loops through the provided token list.
- Transfers tokens from user to contract (requires approval).
- Swaps token to USDC on Aerodrome.
- Aggregates total USDC received.
- Calls
agentTresor.depositForto credit the user with agtrUSD.
