Skip to content

Instantly share code, notes, and snippets.

@hungdoansy
Last active July 23, 2024 12:39
Show Gist options
  • Save hungdoansy/08882e1306baba862817716459422b2a to your computer and use it in GitHub Desktop.
Save hungdoansy/08882e1306baba862817716459422b2a to your computer and use it in GitHub Desktop.

Summary

eth_estimateGas failed, eth_call (to simulate) failed but tx succeeded 🤷

eth_estimateGas (to estimate gas)

[
    {
        "jsonrpc": "2.0",
        "id": 9,
        "method": "eth_estimateGas",
        "params": [
            {
                "data": "0x64be5b39000000000000000000000000bd993611eee8e4fdf2759f276070118acfb085a50000000000000000000000005057c0234559a8125407b6f1a266d5f7207ce38800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000669fe190",
                "to": "0x210a772AC0bf948df5f2C62B646091ABd25f8423"
            }
        ]
    }
]
curl --location 'https://pacific-rpc.sepolia-testnet.manta.network/http' \
--header 'accept: */*' \
--header 'accept-language: en-CA,en;q=0.9,en-US;q=0.8,vi;q=0.7' \
--header 'content-type: application/json' \
--header 'origin: http://localhost:3014' \
--header 'priority: u=1, i' \
--header 'referer: http://localhost:3014/' \
--header 'sec-ch-ua: "Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: cross-site' \
--header 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36' \
--data '[
    {
        "jsonrpc": "2.0",
        "id": 9,
        "method": "eth_estimateGas",
        "params": [
            {
                "data": "0x64be5b39000000000000000000000000bd993611eee8e4fdf2759f276070118acfb085a50000000000000000000000005057c0234559a8125407b6f1a266d5f7207ce38800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000669fe190",
                "to": "0x210a772AC0bf948df5f2C62B646091ABd25f8423"
            }
        ]
    }
]'
[
    {
        "jsonrpc": "2.0",
        "id": 9,
        "error": {
            "code": 3,
            "message": "execution reverted: ds-math-sub-underflow",
            "data": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001564732d6d6174682d7375622d756e646572666c6f770000000000000000000000"
        }
    }
]

eth_call (to simulate)

[
    {
        "jsonrpc": "2.0",
        "id": 5,
        "method": "eth_call",
        "params": [
            {
                "data": "0x64be5b39000000000000000000000000bd993611eee8e4fdf2759f276070118acfb085a50000000000000000000000005057c0234559a8125407b6f1a266d5f7207ce38800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000669fe190",
                "to": "0x210a772AC0bf948df5f2C62B646091ABd25f8423"
            },
            "latest"
        ]
    }
]
curl --location 'https://pacific-rpc.sepolia-testnet.manta.network/http' \
--header 'accept: */*' \
--header 'accept-language: en-CA,en;q=0.9,en-US;q=0.8,vi;q=0.7' \
--header 'content-type: application/json' \
--header 'origin: http://localhost:3014' \
--header 'priority: u=1, i' \
--header 'referer: http://localhost:3014/' \
--header 'sec-ch-ua: "Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: cross-site' \
--header 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36' \
--data '[
    {
        "jsonrpc": "2.0",
        "id": 5,
        "method": "eth_call",
        "params": [
            {
                "data": "0x64be5b39000000000000000000000000bd993611eee8e4fdf2759f276070118acfb085a50000000000000000000000005057c0234559a8125407b6f1a266d5f7207ce38800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000669fe190",
                "to": "0x210a772AC0bf948df5f2C62B646091ABd25f8423"
            },
            "latest"
        ]
    }
]'
[
    {
        "jsonrpc": "2.0",
        "id": 5,
        "error": {
            "code": 3,
            "message": "execution reverted: ds-math-sub-underflow",
            "data": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001564732d6d6174682d7375622d756e646572666c6f770000000000000000000000"
        }
    }
]

eth_call (send tx)

[
    {
        "jsonrpc": "2.0",
        "id": 22,
        "method": "eth_call",
        "params": [
            {
                "data": "0x64be5b39000000000000000000000000bd993611eee8e4fdf2759f276070118acfb085a50000000000000000000000005057c0234559a8125407b6f1a266d5f7207ce38800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000669fe190",
                "from": "0xbd993611EEE8e4Fdf2759f276070118Acfb085A5",
                "to": "0x210a772AC0bf948df5f2C62B646091ABd25f8423"
            },
            "latest"
        ]
    }
]
curl --location 'https://pacific-rpc.sepolia-testnet.manta.network/http' \
--header 'accept: */*' \
--header 'accept-language: en-CA,en;q=0.9,en-US;q=0.8,vi;q=0.7' \
--header 'content-type: application/json' \
--header 'origin: http://localhost:3014' \
--header 'priority: u=1, i' \
--header 'referer: http://localhost:3014/' \
--header 'sec-ch-ua: "Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: cross-site' \
--header 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36' \
--data '[
    {
        "jsonrpc": "2.0",
        "id": 22,
        "method": "eth_call",
        "params": [
            {
                "data": "0x64be5b39000000000000000000000000bd993611eee8e4fdf2759f276070118acfb085a50000000000000000000000005057c0234559a8125407b6f1a266d5f7207ce38800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000669fe190",
                "from": "0xbd993611EEE8e4Fdf2759f276070118Acfb085A5",
                "to": "0x210a772AC0bf948df5f2C62B646091ABd25f8423"
            },
            "latest"
        ]
    }
]'
[
    {
        "jsonrpc": "2.0",
        "id": 22,
        "result": "0x0000000000000000000000000000000000000000000000000000000000000001"
    }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment