STINKBID

Security

What can go wrong

The contract is small on purpose and has not been audited. This page lists what it guarantees, how that was tested, and the risks that remain.

Status

Not audited. Tested with unit, fuzz, invariant and mainnet-fork tests, listed below. During the beta the API caps orders at 100 USDG. Use amounts you can afford to lose.

What the contract guarantees

  • USDG leaves your wallet only inside a fill of an order you signed, and only the signed amount.
  • You receive at least minAmountOut of the token you signed for, measured at your wallet, or the transaction reverts.
  • Each signature works once (Permit2 nonce) and only until its deadline.
  • The contract ends every transaction holding no USDG and no tokens.
  • No one can change it: no owner, no admin, no proxy, no pause, no fee.

What the keeper can and cannot do

CanChoose when to fill an order the market has reached, and the Uniswap route.
CannotChange size, price, token, recipient or expiry; fill a cancelled or expired order; take a fee; hold your funds.
If it is offlineNothing fills until it is back, or until another filler picks the order up from the public feed. Your USDG stays in your wallet.

Known risks

  • Surplus capture. If the market falls through your level, a filler can route or sandwich the swap so you receive close to your minimum rather than more. You always get at least your price.
  • No fill guaranteed. A wick shorter than a minute, thin liquidity, high gas or an RPC outage can leave an order unfilled.
  • The approval. Your USDG approval sits on Permit2, a widely used Uniswap contract. Any signature you give Permit2, here or on another site, can use it. Check the spender in your wallet before signing anything.
  • The assets. Stock tokens and USDG have issuers who can pause or restrict transfers. A restricted transfer makes a fill revert.
  • This website. A compromised site could ask you to sign a different order. Your wallet shows the spender, token, amount and minimum; compare them with Contracts.

Testing

Unit18 tests: fills, every revert path, tampered orders, foreign keys, wrong spender, bad paths, reentrancy from the router, a router that ignores the minimum or under-spends, a fee-on-transfer token
Fuzz2 properties × 1,000 runs: fills exactly when the swap pays the minimum; no foreign key ever spends
Invariant4 invariants × 256 runs × 64 calls of random sign, fill, forge, revoke and wait: the contract holds nothing; USDG leaves makers only through fills; makers always get their price; no altered order fills
ForkReal Permit2, USDG, SwapRouter02 and the NVDA/USDG pool on Robinhood Chain: a bid at the market fills; a −15% bid waits and moves nothing
Coverage96% of lines, 90% of statements of StinkBid.sol

Run them yourself: cd contracts && forge test, and with FORK_RPC=https://robinhood.drpc.org for the fork tests.

Reporting a problem

Found a way to move funds that should not move? Do not post it publicly. Report it privately; the contact is in /.well-known/security.txt.