curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "ots_hasCode",
"params": [
"0x5555555555555555555555555555555555555555",
"latest"
],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
Check if an address contains deployed contract code on Hyperliquid EVM. Efficiently determine if an address is a smart contract.
curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "ots_hasCode",
"params": [
"0x5555555555555555555555555555555555555555",
"latest"
],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
ots_hasCode
JSON-RPC method checks whether a specified address contains deployed contract code on the Hyperliquid EVM blockchain. This Otterscan-specific method provides a quick way to determine if an address is a smart contract or an externally owned account (EOA).
"earliest"
, "latest"
, "pending"
"latest"
true
— the address contains deployed contract codefalse
— the address is an EOA or does not existcurl -X POST https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "ots_hasCode",
"params": ["0x5555555555555555555555555555555555555555", "latest"],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
curl -X POST https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "ots_hasCode",
"params": ["0x5555555555555555555555555555555555555555", "0x1000"],
"id": 1
}'
ots_hasCode
method is essential for:
eth_getCode
when you only need to know if code exists, not the actual bytecode itself.Successful response indicating if address has code
The response is of type object
.