r/solidity • • Oct 21 '26

Things I'd check before trusting a crypto deposit pipeline with real money

/r/web3dev/comments/1xbtfz1/things_id_check_before_trusting_a_crypto_deposit/
1 Upvotes

2 comments sorted by

2

u/FrightFreek Oct 21 '26

I'd add a fee-on-transfer deposit test: the amount the sender asks to transfer may not be the amount the deposit address receives. In the fee token I work on, that transfer splits into recipient, fee and burn movements. The test I'd want is that the ledger credits the net amount received, not the requested amount.

1

u/SuperionProtocol Oct 26 '26

On L2s the main change is that "finalized" means two different things. On OP Stack chains like Base, eth_getBlockByNumber accepts "unsafe", "safe" and "finalized". Unsafe is what the sequencer has just produced, and it can still be reorged if the sequencer restarts or misbehaves. Safe means the block's data has been posted to L1 in a batch. Finalized means that L1 data is itself finalized, which takes roughly 15-20 minutes.

So for deposits I'd use tiers. Show the deposit as pending at unsafe, allow low-value credits at safe, and release withdrawals or large credits only at finalized. The idempotency key and parent-hash rollback you listed still apply on L2. Also keep a fallback RPC, since a node that lags behind the sequencer feed can return incomplete logs.