Skip to content

piplabs/fund-forwarder

Repository files navigation

FundForwarder

EIP-7702 delegated execution contracts for automatic fund forwarding on Story Network.

How It Works

  1. An EOA delegates to a FundForwarder contract via EIP-7702
  2. Native token transfers to that EOA execute the forwarder's receive() function
  3. Funds from authorized source vaults are forwarded based on threshold:
    • Below threshold → tradingDesk
    • Above threshold → target
    • Crossing threshold → split between both

Build & Test

forge build
forge test

Deploy

1. Deploy Factory

forge script script/DeployFundForwarderFactory.s.sol:DeployFundForwarderFactory \
  --sig "run(bytes32)" <SALT> \
  --broadcast --rpc-url <RPC_URL> --account <ACCOUNT>

2. Deploy Forwarder

forge script script/DeployFundForwarders.s.sol:DeployFundForwarders \
  --sig "run(address,address,address,address,uint256)" \
  <FACTORY> <SOURCE_VAULT> <TRADING_DESK> <TARGET> <THRESHOLD> \
  --broadcast --rpc-url <RPC_URL> --account <ACCOUNT>

Contracts

  • FundForwarder.sol - Core forwarding logic with dual-destination threshold support
  • FundForwarderFactory.sol - CREATE3-based factory for deterministic deployment

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors