POST
/
afb8312f3710a5bc469f4c87cad3a2e4
curl --request POST \
  --url https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4 \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "zks_getBridgeContracts",
  "params": []
}'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "bridgeContractAddresses": {}
  }
}

The zks_getBridgeContracts API method fetches the addresses of the default bridges between Layer 1 (Ethereum) and Layer 2 (zkSync). These bridges are pivotal for transferring ERC-20 tokens across layers, playing an essential role in the zkSync ecosystem by enabling efficient, secure, and low-cost asset transfers. This method is especially useful for developers and applications requiring integration with the default bridging mechanisms provided by zkSync.

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • none

Response

The response includes the addresses of the default bridge contracts for ERC-20 tokens between Layer 1 and Layer 2:

  • l1Erc20DefaultBridge — the default ERC-20 bridge contract address on Layer 1 (Ethereum). This contract is used for initiating transfers from Ethereum to zkSync.
  • l2Erc20DefaultBridge — the default ERC-20 bridge contract address on Layer 2 (zkSync).

Use Case

A wallet application integrating cross-layer transfer functionalities can use the zks_getBridgeContracts method to dynamically fetch the current default bridge contracts, ensuring that transactions are routed through the appropriate channels.

Body

application/json
jsonrpc
string
default:2.0
required
Example:

"2.0"

id
integer
default:1
required
Example:

1

method
string
default:zks_getBridgeContracts
required
Example:

"zks_getBridgeContracts"

params
any[]
required

Response

200 - application/json
Successful response
jsonrpc
string
default:2.0
required
Example:

"2.0"

id
integer
default:1
required
result
object
required