Polygon
Polygon
Polygon
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
web3_sha3 computes the Keccak-256 hash of the hex-encoded data you pass in and returns it as a 32-byte 0x-prefixed string. Despite the method name, this is the original Keccak-256 used throughout the EVM — not the later NIST SHA3-256 standard — which is exactly the hash Polygon and every EVM chain use for event topics and function selectors. Running it on a Polygon node lets you reproduce on-chain hashing without a local crypto library. Send the request to the Polygon mainnet endpoint at https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89).
Transfer(address,address,uint256) — to build eth_getLogs filters for Polygon contracts such as the USDT token at 0xc2132D05D31c914a87C6611C10748AEb04B58e8F.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | data | string | 是 | Arbitrary data to hash, provided as a 0x-prefixed hex string. Empty input (`"0x"`) is valid. |
| 类型 | 描述 |
|---|---|
| string | 0x-prefixed 32-byte (64-character) Keccak-256 hash of the input. |
Try it live in the Polygon playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32602 | invalid argument | Input is not a valid 0x-prefixed hex string. |
Transfer(address,address,uint256), encode it to its hex byte representation first — passing the literal string will hash the wrong bytes.参数
0x-prefixed hex string