Skip to content

Nine protocols publish an address whose chain prefix has no contract on that chain (Kromatika's own adapter contradicts the API) #20663

Description

@fabio-rovai

Summary

Nine protocol entries in the /protocols API publish an address field whose chain prefix names a chain on which no contract exists at that address. Five of the nine are real contracts that live on a different chain than the prefix states.

These are the rows where the field describes its own chain, so there is no ambiguity about interpretation and no assumption on my side about which chain was meant.

Method

I took every row from https://api.llama.fi/protocols whose address field is chain-prefixed and whose prefix resolves to one of eight chains I can query (ethereum, arbitrum, optimism, base, polygon, bsc, gnosis, avalanche). That is 1,327 rows of 8,098 protocols. For each I called eth_getCode at latest on every public RPC provider I have configured for that chain.

1,318 of 1,327 resolve to a contract. Nine return zero code, and for those nine every provider queried agreed.

The rows

protocol TVL reported address as published contract actually found on
Kromatika 1,184,467 optimism:0x3af33bef05c2dcb3c7288b77fe1c8d2aeba4d789 ethereum
LuigiSwap 316,138 bsc:0x196ad5a70279fc112db4f8baf6f5022c9b1cf0a5 avalanche
Binary Swap 85,236 bsc:0xa41b3067ec694dbec668c389550ba8fc589e5797 none of the eight chains queried
DexPad 26,953 avax:0xe0c41ff9a7032de445771e12c14868cbe061c993 none of the eight chains queried
Aurum old 0 avax:0x7F144F8691CbA3d2EfD8e5bcf042f9303EE31a46 none of the eight chains queried
Chronicle 0 bsc:0x06a00715e6f92210af9d7680b584931faf71a833 ethereum
Strips Finance 0 arbitrum:0x97872EAfd79940C7b24f7BCc1EADb1457347ADc9 ethereum
Luna.fun 0 bsc:0x55cD6469F597452B5A7536e2CD98fDE4c1247ee4 base
AurumSwap 0 avax:0x7F144F8691CbA3d2EfD8e5bcf042f9303EE31a46 none of the eight chains queried

The clearest case

Kromatika is published as optimism:0x3af33bef05c2dcb3c7288b77fe1c8d2aeba4d789. There is no contract at that address on Optimism. There is one on Ethereum.

This repository already says so. In projects/kromatika/index.js the same address is declared under the ethereum key:

ethereum: {
  KROM: "0x3af33bef05c2dcb3c7288b77fe1c8d2aeba4d789",
  ...
}

So the adapter and chain state agree with each other, and the API metadata disagrees with both. Chronicle (bsc:0x06a0..., contract on Ethereum) and Strips Finance (arbitrum:0x9787..., contract on Ethereum) have the same shape.

Reproduce

curl -s https://api.llama.fi/protocols \
| jq -r '.[] | select(.address != null and (.address | contains(":"))) | "\(.name)\t\(.address)"' \
| grep -E '\b(Kromatika|Chronicle|Strips Finance|LuigiSwap|Binary Swap|DexPad|Luna.fun|AurumSwap|Aurum old)\b'

# then, for any row, check the chain the prefix names:
cast code 0x3af33bef05c2dcb3c7288b77fe1c8d2aeba4d789 --rpc-url https://mainnet.optimism.io   # 0x
cast code 0x3af33bef05c2dcb3c7288b77fe1c8d2aeba4d789 --rpc-url https://eth.drpc.org          # bytecode

Why it matters for consumers

Anything that treats address as a chain:address pair, which is what the format invites, will look the token up on the wrong chain and find nothing. It fails silently rather than loudly, because an address with no code is a perfectly valid RPC response.

Not claimed here

I am not reporting the 26 unprefixed rows I also found with no code on Ethereum. Without a prefix the intended chain is not stated, most of those protocols list chains I cannot query (Aurora, Boba, smartBCH, IOTA EVM, Dogechain and others), and treating an unprefixed value as Ethereum is my assumption rather than your specification. Those may well be correct.

Context

Found while building an open cross-chain contract control census, which uses your protocol list as one of its population sources. Repository: https://github.com/fabio-rovai/chain-control-ontology. Happy to send the full per-row JSON, or to open a PR if you can point me at where the address metadata is maintained, since it does not appear to be in this repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions