Perform one-to-many cross-chain token transfers in a single transaction using DropCaster
We have created a tool to perform one-to-many cross-chain token transfers in a single transaction. The tool is built on top of the Uniswap V4 pool where the user provides the input token A and a list of addresses he wants to airdrop, the DropCaster swaps Token A <> Token B, and Token B is equally distributed to all the addresses.
The token transfer takes place in the Flashloan accounting pattern where the token is first distributed among the addresses from pool and then the user settles the amount owed to pool. We have also integrated Hyperlane to enable cross-chain distribution of the tokens from uniswap pool.
DropCaster is an awesome tool for airdrops, and we have created an interface where anybody can airdrop their favourite tokens among the nearby wallets within common bluetooth range.
The main technologies used to build DropCaster are:-
The DropCaster is built on top of Uniswap v4 hook where we have used afterSwap hook to distribute the output tokens when the user successfully performs the swap of Token A to Token B. The afterSwap performs the flash accounting where the tokens are "taken" from the pool and distributed to receivers. The user then settles the balance using native token. Along with the addresses of the receivers, their receiving chain ID is also specified and cross chain transfer is performed using Hyperlane to the receivers who want to receive on different chain ID.