Functions
DISCLAIMER // NFA // DYOR
This analysis is based on observations of the contract behavior. We are not smart contract security experts. This document aims to explain what the contract appears to do based on the code. It should not be considered a comprehensive security audit or financial advice. Always verify critical information independently and consult with blockchain security professionals for important decisions.
⊙ generated by robots | curated by humans
| METADATA | |
|---|---|
| Contract Address | 0x000000000000FB114709235f1ccBFfb925F600e4 (etherscan) |
| Network | Ethereum Mainnet |
| Analysis Date | 2026-02-28 |
Function Selectors
| SELECTOR | FUNCTION SIGNATURE | CATEGORY |
|---|---|---|
0x6e0a4f98 |
swapV2(address,bool,address,address,uint256,uint256,uint256) |
User |
0xafeae12b |
swapV3(address,bool,uint24,address,address,uint256,uint256,uint256) |
User |
0x21c0dad2 |
swapV4(address,bool,uint24,int24,address,address,uint256,uint256,uint256) |
User |
0x9d5b5af8 |
swapVZ(address,bool,uint256,address,address,uint256,uint256,uint256,uint256,uint256) |
User |
0x12db224a |
swapCurve(address,bool,address[11],uint256[4][5],address[5],uint256,uint256,uint256) |
User |
0x5f3bd1c8 |
snwap(address,uint256,address,address,uint256,address,bytes) |
User |
0x3f896275 |
snwapMulti(address,uint256,address,address[],uint256[],address,bytes) |
User |
0xf76aaa4d |
addLiquidity(tuple,uint256,uint256,uint256,uint256,address,uint256) |
User |
0xac9650d8 |
multicall(bytes[]) |
User |
0x0efe6a8b |
deposit(address,uint256,uint256) |
User |
0xcb019b84 |
sweep(address,uint256,uint256,address) |
User |
0xea598cb0 |
wrap(uint256) |
User |
0xde0e9a3e |
unwrap(uint256) |
User |
0x7ac2ff7b |
permit(address,uint256,uint256,uint8,bytes32,bytes32) |
User |
0x230390f4 |
permitDAI(uint256,uint256,uint8,bytes32,bytes32) |
User |
0x09d31579 |
permit2TransferFrom(address,uint256,uint256,uint256,bytes) |
User |
0x4c766bbc |
permit2BatchTransferFrom(tuple[],uint256,uint256,bytes) |
User |
0x47c1ba3a |
exactETHToSTETH(address) |
User |
0xf978602c |
exactETHToWSTETH(address) |
User |
0xbd6b76d7 |
ethToExactSTETH(address,uint256) |
User |
0xc391b381 |
ethToExactWSTETH(address,uint256) |
User |
0x2cb9f974 |
revealName(string,bytes32,address) |
User |
0x91dd7346 |
unlockCallback(bytes) |
Callback |
0x150b7a02 |
onERC721Received(address,address,uint256,bytes) |
Callback |
(fallback) |
uniswapV3SwapCallback (via fallback) |
Callback |
0xb61d27f6 |
execute(address,uint256,bytes) |
Trusted |
0x06262f1b |
trust(address,bool) |
Admin |
0xf2fde38b |
transferOwnership(address) |
Admin |
0x41abb1ef |
ensureAllowance(address,bool,address) |
Admin |
0xe8382b01 |
safeExecutor() |
View |
Summary
| CATEGORY | COUNT |
|---|---|
| Total Functions | 31 (incl. fallback + receive) |
| User Functions | 22 |
| Callback Functions | 3 |
| Trusted Functions | 1 |
| Admin Functions | 3 |
| View Functions | 1 |
User Functions
Function: swapV2(address to, bool exactOut, address tokenIn, address tokenOut, uint256 swapAmount, uint256 amountLimit, uint256 deadline)
Executes an exact-in or exact-out swap on a Uniswap V2 or SushiSwap pool. The pool address is computed deterministically on-chain using CREATE2. Supports ETH as input or output by wrapping/unwrapping WETH automatically. When deadline == type(uint256).max, routes through SushiSwap instead of Uniswap.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0x6e0a4f98 |
| Parameters | to — recipient address; exactOut — true for exact-out mode; tokenIn/tokenOut — use address(0) for ETH; swapAmount — amount in (exact-in) or target out (exact-out); amountLimit — max in (exact-out) or min out (exact-in); deadline — expiry timestamp (use type(uint256).max for SushiSwap) |
| Access | Public, payable |
| FLAG | OBSERVATION |
|---|---|
| ◇ | deadline == type(uint256).max is a non-standard overloading to select SushiSwap — not deadline bypass |
| ◇ | swapAmount == 0 with exact-in mode uses entire contract/transient balance of tokenIn |
| △ | Slippage check (amountLimit == 0) can be bypassed if caller passes zero |
| ☑ | ETH input refund sent to msg.sender if msg.value > amountIn |
| CONDITION | REQUIREMENT |
|---|---|
| Deadline | block.timestamp <= deadline (via checkDeadline modifier) |
| Non-zero swap | amountIn > 0 or msg.value > 0 if swapAmount == 0 |
| Slippage | amountIn <= amountLimit (exact-out) or amountOut >= amountLimit (exact-in) when limit != 0 |
| STEP | ACTION |
|---|---|
| 1 | Replace address(0) with WETH for tokenIn/tokenOut |
| 2 | Compute V2 pool address deterministically |
| 3 | Fetch reserves via getReserves() |
| 4 | Calculate amountIn/amountOut using x*y=k formula |
| 5 | Pull input tokens (transient balance, contract balance, or transferFrom) |
| 6 | Call IV2Pool.swap() |
| 7 | Unwrap WETH and send ETH if ethOut, otherwise deliver token to to |
| CONDITION | REVERT MESSAGE |
|---|---|
| Deadline passed | Expired() |
| Zero swap amount | BadSwap() |
| Slippage exceeded | Slippage() |
Function: swapV3(address to, bool exactOut, uint24 swapFee, address tokenIn, address tokenOut, uint256 swapAmount, uint256 amountLimit, uint256 deadline)
Executes a swap on a Uniswap V3 pool. Pool address is derived on-chain. Triggers the standard V3 uniswapV3SwapCallback flow, handled by the contract's fallback() function. Supports ETH in/out via WETH wrapping.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0xafeae12b |
| Parameters | swapFee — pool fee tier (e.g., 500, 3000, 10000); other params match swapV2 |
| Access | Public, payable |
| FLAG | OBSERVATION |
|---|---|
| ◇ | Swap callback data is packed inline via abi.encodePacked — no struct overhead |
| ☑ | ETH refund sent back to msg.sender after V3 swap if any balance remains |
| ◇ | amountLimit == 0 disables slippage check |
| CONDITION | REVERT MESSAGE |
|---|---|
| Deadline passed | Expired() |
| Zero swap amount | BadSwap() |
| Slippage exceeded | Slippage() |
Function: swapV4(address to, bool exactOut, uint24 swapFee, int24 tickSpace, address tokenIn, address tokenOut, uint256 swapAmount, uint256 amountLimit, uint256 deadline)
Executes a swap via Uniswap V4's lock/callback architecture. Calls IV4PoolManager.unlock() with encoded calldata; the PoolManager calls back unlockCallback() on this contract to execute the actual swap. Supports ETH natively (V4 uses native ETH rather than WETH).
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0x21c0dad2 |
| Parameters | tickSpace — pool tick spacing; swapFee — fee tier; other params match swapV2 |
| Access | Public, payable |
| FLAG | OBSERVATION |
|---|---|
| ◇ | Hookless pools only — V4PoolKey hooks field hardcoded to address(0) |
| ◇ | V4 uses native ETH (currency0 = address(0)) rather than WETH |
| ☑ | ETH refund returned to payer after swap completes |
| CONDITION | REVERT MESSAGE |
|---|---|
| Deadline passed | Expired() |
| Zero swap amount | BadSwap() |
| Slippage exceeded | Slippage() |
| Caller not V4 PoolManager (in callback) | Unauthorized() |
Function: swapVZ(address to, bool exactOut, uint256 feeOrHook, address tokenIn, address tokenOut, uint256 idIn, uint256 idOut, uint256 swapAmount, uint256 amountLimit, uint256 deadline)
Executes a swap against zFi's zAMM contract. Supports ERC-6909 multi-token IDs (set idIn/idOut to 0 for standard ERC-20). deadline == type(uint256).max routes to hookless ZAMM_0 instead of hooked ZAMM. Pulls full expected input upfront and handles excess refund.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0x9d5b5af8 |
| Parameters | feeOrHook — fee tier or hook address for pool key; idIn/idOut — ERC-6909 token IDs (0 = ERC-20) |
| Access | Public, payable |
| FLAG | OBSERVATION |
|---|---|
| ◇ | deadline == type(uint256).max selects hookless ZAMM_0 (same non-standard overloading as swapV2) |
| ☑ | Exact-out excess input refunded to msg.sender after swap |
| ◇ | Supports ERC-6909 fractional token IDs alongside standard ERC-20 |
| CONDITION | REVERT MESSAGE |
|---|---|
| Deadline passed | Expired() |
| Zero swap amount | BadSwap() |
| zAMM call fails (exact-in) | SwapExactInFail() |
| zAMM call fails (exact-out) | SwapExactOutFail() |
Function: swapCurve(address to, bool exactOut, address[11] route, uint256[4][5] swapParams, address[5] basePools, uint256 swapAmount, uint256 amountLimit, uint256 deadline)
Executes a multi-hop swap through Curve Finance pools. Supports up to 5 hops with 8 swap types (exchange, exchange_underlying, add_liquidity, remove_liquidity_one_coin, ETH/WETH wrapping). Uses Curve's get_dx functions for exact-out mode. The router pre-funds itself, then calls each Curve pool in sequence.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0x12db224a |
| Parameters | route — 11-element array of alternating tokens and pools; swapParams — per-hop [i, j, swap_type, pool_type]; basePools — base pools for meta-pool underlying swaps |
| Access | Public, payable |
| FLAG | OBSERVATION |
|---|---|
| △ | Lazy approval: sets unlimited token approval to Curve pools on first use if allowance is zero |
| ◇ | Up to 5 hops supported; route terminates at first zero pool address |
| ◇ | Surplus output refunded to msg.sender in exact-out mode |
| △ | Minimum output set to 0 on each Curve hop — slippage checked only at final output |
| CONDITION | REVERT MESSAGE |
|---|---|
| Deadline passed | Expired() |
| Zero input amount | BadSwap() |
| Slippage exceeded | Slippage() |
| Invalid swap type | BadSwap() |
| ETH amount mismatch | InvalidMsgVal() |
Function: snwap(address tokenIn, uint256 amountIn, address recipient, address tokenOut, uint256 amountOutMin, address executor, bytes executorData)
Generic executor swap. Sends tokenIn to the executor address, then calls executor via the isolated SafeExecutor contract, then checks that recipient received at least amountOutMin of tokenOut. Enables integration with any DEX or protocol not directly supported by the named swap functions.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0x5f3bd1c8 |
| Parameters | executor — the contract to call; executorData — arbitrary calldata |
| Access | Public, payable |
| FLAG | OBSERVATION |
|---|---|
| △ | executor is arbitrary — no whitelist; caller controls where tokens and ETH are sent |
| ☑ | Output measured as balance delta on recipient — cannot be faked by the executor |
| ☑ | Execution routed through SafeExecutor which holds no token approvals |
| ◇ | amountIn == 0 sends all but 1 wei of router's tokenIn balance to executor |
| CONDITION | REVERT MESSAGE |
|---|---|
| Output below minimum | SnwapSlippage(tokenOut, received, minimum) |
Function: snwapMulti(address tokenIn, uint256 amountIn, address recipient, address[] tokensOut, uint256[] amountsOutMin, address executor, bytes executorData)
Multi-output variant of snwap. Records pre-execution balances for multiple output tokens and validates each delta after the executor call.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0x3f896275 |
| Parameters | tokensOut — array of expected output tokens; amountsOutMin — minimum output per token |
| Access | Public, payable |
| CONDITION | REVERT MESSAGE |
|---|---|
| Any output below minimum | SnwapSlippage(token, received, minimum) |
Function: multicall(bytes[] data)
Executes multiple encoded calls to this contract atomically via delegatecall. Enables chaining of swaps across different DEX protocols in a single transaction. Transient balances from earlier calls are available to later calls within the same multicall batch.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0xac9650d8 |
| Parameters | data — array of ABI-encoded calldata for each sub-call |
| Access | Public, payable |
| FLAG | OBSERVATION |
|---|---|
| △ | Uses delegatecall — sub-calls execute in the context of zRouter itself |
| ☑ | Reverts the entire batch if any sub-call fails |
| ◇ | msg.sender is preserved across delegatecall sub-calls |
| CONDITION | REVERT MESSAGE |
|---|---|
| Any sub-call fails | Propagates the sub-call's revert reason |
Function: deposit(address token, uint256 id, uint256 amount)
Pre-funds the router's transient balance for a given token/id. This enables multi-step swaps via multicall — the first call deposits tokens, subsequent swap calls consume from transient balance without additional transferFrom calls.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0x0efe6a8b |
| Parameters | token — address(0) for ETH, WETH address for WETH; id — ERC-6909 token ID (0 for ERC-20); amount — amount to pre-fund |
| Access | Public, payable |
Function: sweep(address token, uint256 id, uint256 amount, address to)
Transfers tokens or ETH from the router contract to to. When amount == 0, sweeps the full balance. Anyone can call this — it is intended for recovering any residual balances left after a transaction completes.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0xcb019b84 |
| Parameters | token — address(0) for ETH; id — ERC-6909 ID (0 for ERC-20); amount — 0 sweeps all |
| Access | Public, payable (no access restriction) |
| FLAG | OBSERVATION |
|---|---|
| △ | No access control — any caller can sweep any token balance held by the router |
| ◇ | Intended behavior: router should not hold persistent balances; sweep is a safety valve |
Function: wrap(uint256 amount) / unwrap(uint256 amount)
wrap converts ETH held by the contract to WETH and records it in transient balance. unwrap converts WETH held by the contract back to ETH. Both are primarily utility functions for use within multicall chains.
| ATTRIBUTE | VALUE |
|---|---|
| Selectors | wrap: 0xea598cb0 / unwrap: 0xde0e9a3e |
| Parameters | amount — 0 uses entire balance |
| Access | Public, payable |
Function: addLiquidity(PoolKey poolKey, uint256 amount0Desired, uint256 amount1Desired, uint256 amount0Min, uint256 amount1Min, address to, uint256 deadline)
Adds liquidity to a zAMM pool by delegating directly to IZAMM.addLiquidity(). Passes ETH if poolKey.token0 == address(0).
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0xf76aaa4d |
| Parameters | poolKey — zAMM PoolKey struct (id0, id1, token0, token1, feeOrHook) |
| Access | Public, payable |
Function: permit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
Calls ERC-2612 permit() on token to grant the router spending approval without a separate transaction. Useful at the start of a multicall batch before a swap that requires transferFrom.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0x7ac2ff7b |
| Access | Public, payable |
Function: permitDAI(uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s)
Function: permit2TransferFrom(address token, uint256 amount, uint256 nonce, uint256 deadline, bytes signature)
Transfers amount of token from msg.sender to the router using Uniswap Permit2's signature-based transfer. Records the received amount in transient balance for subsequent swap steps.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0x09d31579 |
| Access | Public, payable |
Function: permit2BatchTransferFrom(IPermit2.TokenPermissions[] permitted, uint256 nonce, uint256 deadline, bytes signature)
Batch variant of permit2TransferFrom. Transfers multiple tokens in a single Permit2 signature, depositing each into transient balance.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0x4c766bbc |
| Access | Public, payable |
Function: exactETHToSTETH(address to)
Function: exactETHToWSTETH(address to)
Function: ethToExactSTETH(address to, uint256 exactOut)
Stakes exactly exactOut stETH worth of ETH, refunding any surplus ETH to msg.sender. Computes required ETH input using on-chain Lido share rate math.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0xbd6b76d7 |
| Access | Public, payable |
| CONDITION | REVERT MESSAGE |
|---|---|
msg.value insufficient |
Reverts (inline assembly) |
Function: ethToExactWSTETH(address to, uint256 exactOut)
Function: revealName(string label, bytes32 innerSecret, address to)
Reveals a .wei name registration commitment on the zFi NameNFT contract and transfers the minted NFT to to. The secret is derived as keccak256(abi.encode(innerSecret, to)) — binding it to the intended recipient and preventing mempool front-running. Can be chained with a swap via multicall for an atomic swap-to-register flow.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0x2cb9f974 |
| Access | Public, payable |
| FLAG | OBSERVATION |
|---|---|
| ☑ | Recipient-bound secret prevents front-running of the reveal transaction |
| ◇ | Uses full ETH balance of router (from transient or msg.value) for the reveal payment |
Callback Functions
Function: fallback() (uniswapV3SwapCallback)
Handles the Uniswap V3 uniswapV3SwapCallback. Verifies the caller is the expected V3 pool, then fulfills the required token payment. Also handles ETH output unwrapping when the output token is ETH.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | (fallback — any unmatched calldata) |
| Access | External, payable |
| FLAG | OBSERVATION |
|---|---|
| ☑ | Rejects if transient lock slot is non-zero (prevents callback during execute()) |
| ☑ | Verifies msg.sender == expected V3 pool before fulfilling payment |
| CONDITION | REVERT MESSAGE |
|---|---|
Called during execute() lock |
Reverts (assembly revert(0, 0)) |
| Caller is not expected pool | Unauthorized() |
| Zero deltas | BadSwap() |
Function: unlockCallback(bytes callbackData)
Uniswap V4 callback triggered by V4PoolManager.unlock(). Executes the actual V4 pool swap, settles input tokens, and delivers output tokens to to.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0x91dd7346 |
| Access | Public, payable |
| FLAG | OBSERVATION |
|---|---|
| ☑ | Requires msg.sender == V4_POOL_MANAGER |
| ☑ | Rejects if transient lock slot is non-zero |
| CONDITION | REVERT MESSAGE |
|---|---|
Called during execute() lock |
Reverts (assembly revert(0, 0)) |
| Caller is not V4 PoolManager | Unauthorized() |
| Slippage exceeded | Slippage() |
Function: onERC721Received(address, address, uint256, bytes)
Trusted Functions
Function: execute(address target, uint256 value, bytes data)
Calls an arbitrary target contract with value ETH and data calldata. Only callable by addresses that the owner has whitelisted via trust(). Sets a transient lock during execution to prevent V3/V4 swap callbacks from being triggered by the external call.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0xb61d27f6 |
| Access | Public, payable — restricted to _isTrustedForCall[msg.sender] == true |
| FLAG | OBSERVATION |
|---|---|
| △ | Arbitrary external call — target is unconstrained beyond the trust whitelist |
| ☑ | Transient lock (tstore(0x00, 1)) blocks V3/V4 callbacks during execution |
| ☑ | Access restricted to owner-whitelisted addresses only |
| CONDITION | REVERT MESSAGE |
|---|---|
| Caller not trusted | Unauthorized() |
| External call fails | Propagates external revert |
Admin Functions
Function: trust(address target, bool ok)
Function: transferOwnership(address owner)
Transfers the _owner role to a new address. Emits OwnershipTransferred. No two-step confirmation, no timelock.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0xf2fde38b |
| Access | Public, payable — onlyOwner |
| FLAG | OBSERVATION |
|---|---|
| △ | Single-step ownership transfer — no confirmation from new owner required |
| △ | No timelock — ownership change is immediate and irreversible without new owner cooperation |
Function: ensureAllowance(address token, bool is6909, address to)
Sets unlimited token approval (type(uint256).max) for token to to, or sets ERC-6909 operator status. Used by the owner to pre-approve Curve pools and other integrations as needed.
| ATTRIBUTE | VALUE |
|---|---|
| Selector | 0x41abb1ef |
| Access | Public, payable — onlyOwner |
| FLAG | OBSERVATION |
|---|---|
| △ | Grants unlimited approval to any arbitrary address at owner discretion |