Connect to Tensora

This guide shows how to add Tensora L2 to MetaMask, WalletConnect, and programmatic clients. You will also add BNB Chain (BSC) to interact with the bridge.

MetaMask Browser Extension

Manual Network Addition

Open MetaMask

Open MetaMask, click the network dropdown (top center).

Add a network

Select Add Network → Add a network manually.

Fill the network fields

Set the following values:

FieldValue

Network Name

Tensora L2

RPC URL

https://rpc.tensora.org

Chain ID

20250

Currency Symbol

TORA

Block Explorer URL

https://explorer.tensora.org

Save

Click Save.

Switch network

MetaMask will switch to Tensora L2 automatically.

Programmatic Addition (dApp Trigger)

Add this JavaScript to your dApp to prompt users:

add-tensora-network.jsCopy

Add BNB Chain (BSC)

Most wallets include BSC by default. If not, add the network with these values:

FieldValue

Network Name

BNB Chain

RPC URL

https://bsc-dataseed.binance.org

Chain ID

56

Currency Symbol

BNB

Block Explorer URL

https://bscscan.com

Programmatic addition:

add-bsc.jsCopy

WalletConnect (Web3Modal v3)

Configure your dApp to support both BSC and Tensora:

walletconnect-config.tsCopy

Users will see both chains in the network selector. Switching chains triggers a chainChanged event.

Wagmi (React) Configuration

For Next.js or React dApps using Wagmi:

wagmi.config.tsCopy

In your app:

app.tsxCopy

Ethers.js (Node.js or Script)

Connect programmatically with ethers.js v6:

ethers-connect.tsCopy

Web3.py (Python)

Connect with web3.py for Python-based bots or miners:

web3py-connect.pyCopy

Hardhat Network Configuration

Add Tensora and BSC to hardhat.config.ts:

hardhat.config.tsCopy

Deploy to Tensora:

Copy

Foundry (Forge, Cast, Anvil)

foundry.toml Configuration

foundry.tomlCopy

Deploy with Forge

Copy

Or use a script:

script/Deploy.s.solCopy

Deploy script command:

Copy

Cast Commands

Query Tensora:

cast-commands.shCopy

Verification Checklist

  • MetaMask shows Tensora L2 (Chain ID: 20250) in network list

  • BNB Chain (Chain ID: 56) is also available

  • cast block-number --rpc-url https://rpc.tensora.org returns a recent block number

  • tensoraProvider.getBlockNumber() succeeds in ethers.js/web3.py

  • Deploying a simple contract (e.g., ERC-20) succeeds on Tensora

  • Hardhat --network tensora deploys without errors

  • Foundry --rpc-url tensora resolves from foundry.toml

Last updated