fix: the swap summary is shown only for a transaction sent to a Universal Router (closes #520)
The Universal Router decoder recognised execute() by its selector alone, so the same calldata sent to any address was described as a swap through the router. It now keeps the router deployments Uniswap publishes for Ethereum Mainnet and Sepolia, and decodes only a transaction sent to one of them on its network, ignoring address case. TxApproval passes the transaction's chain id, TransactionDetail the active network's. Model: opus-5-5
This commit was merged in pull request #579.
This commit is contained in:
@@ -68,7 +68,11 @@ function swapData(amountIn, amountOutMin) {
|
||||
}
|
||||
|
||||
function swapDetail(amountIn, amountOutMin, label) {
|
||||
const decoded = uniswap.decode(swapData(amountIn, amountOutMin), ROUTER);
|
||||
const decoded = uniswap.decode(
|
||||
swapData(amountIn, amountOutMin),
|
||||
ROUTER,
|
||||
"0x1",
|
||||
);
|
||||
return decoded.details.find((d) => d.label === label);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user