For the complete documentation index, see llms.txt. This page is also available as Markdown.

zks_getBridgeContracts - zksync

Example code for the zks_getBridgeContracts JSON-RPC method. Сomplete guide on how to use zks_getBridgeContracts JSON-RPC in GetBlock.io Web3 documentation.

Returns the addresses of canonical bridge contracts on both L1 and L2, including the default ERC-20 bridge and the WETH bridge.

Parameters

  • None

Request Example

curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "zks_getBridgeContracts",
    "params": [],
    "id": "getblock.io"
}'
import axios from 'axios';

const data = JSON.stringify({
    "jsonrpc": "2.0",
    "method": "zks_getBridgeContracts",
    "params": [],
    "id": "getblock.io"
});

const config = {
    method: 'post',
    url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers: {
        'Content-Type': 'application/json'
    },
    data: data
};

axios(config)
    .then(response => console.log(JSON.stringify(response.data, null, 2)))
    .catch(error => console.log(error));

Response Example

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "l1Erc20DefaultBridge": "0x57891966931eb4bb6fb81430e6ce0a03aabde063",
        "l2Erc20DefaultBridge": "0x11f943b2c77b743ab90f4a0ae7d5a4e7fca3e102",
        "l1WethBridge": "0x0000000000000000000000000000000000000000",
        "l2WethBridge": "0x0000000000000000000000000000000000000000"
    }
}

Response Parameters

Field
Type
Description

result.l1Erc20DefaultBridge

string

L1 default ERC-20 bridge contract address

result.l2Erc20DefaultBridge

string

L2 default ERC-20 bridge contract address

result.l1WethBridge

string

L1 WETH bridge contract address

result.l2WethBridge

string

L2 WETH bridge contract address

Use Cases

  • Bridge integrations needing canonical bridge addresses

  • Wallet UI showing supported bridge paths

  • Indexers tracking bridge deposit and withdrawal events

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?