Query editor
/* ===========================================================================VB-001 -- Garden Finance HTLC `initiateWithSignature` signature reuse---------------------------------------------------------------------------Root cause: the signed EIP-712 struct isInitiate(address redeemer,uint256 timelock,uint256 amount,bytes32 secretHash)It does NOT bind `initiator` -- the account whose tokens are pulled.`initiator` is unsigned calldata used only as the expected-signer argument toSignatureChecker.isValidSignatureNow, which falls through to ERC-1271 for anyaddress with code. So ONE signature validates for every account that honoursthe signing key (owner EOA, 1-of-1 Safe, ERC-4337, EIP-7702 EOA), and because`initiator` is part of the orderID preimage the replay gets a fresh orderIDand clears the HTLC__DuplicateOrder guard.Detection: the same signature bytes appearing with two or more DISTINCTinitiators is definitive replay. Scanned by selector rather than by a fixedaddress so every Garden HTLC deployment is covered.calldata layout for 0xd4705e9e (1-indexed, verified against a real encoding):1..4 selector5..36 initiator (address, last 20 bytes at 17)37..68 redeemer (address, last 20 bytes at 49)69..100 timelock101..132 amount133..164 secretHash165..196 offset to bytes (0xc0)197..228 signature length229.. signature bytes=========================================================================== */WITH calls AS (SELECTt.block_time,t.block_number,t.tx_hash,t."from" AS submitter,t.to AS htlc,-- 20-byte addresses for displaybytearray_substring(t.input, 17, 20) AS initiator,bytearray_substring(t.input, 49, 20) AS redeemer,-- full 32-byte words, reused verbatim to rebuild the orderID preimagebytearray_substring(t.input, 5, 32) AS w_initiator,bytearray_substring(t.input, 37, 32) AS w_redeemer,bytearray_substring(t.input, 69, 32) AS w_timelock,bytearray_substring(t.input, 101, 32) AS w_amount,bytearray_substring(t.input, 133, 32) AS secret_hash,bytearray_to_uint256(bytearray_substring(t.input, 69, 32)) AS timelock,bytearray_to_uint256(bytearray_substring(t.input, 101, 32)) AS amount_raw,bytearray_substring(t.input, 229,CAST(bytearray_to_uint256(bytearray_substring(t.input, 197, 32)) AS INTEGER)) AS signatureFROM ethereum.traces tWHERE t.block_date >= DATE '{{start_date}}'AND t.successAND t.call_type = 'call'AND length(t.input) >= 293AND bytearray_substring(t.input, 1, 4) = 0xd4705e9e),