Skip to main content

Adding a new ERC20 to Boba

Deploy L2 ERC20 Contract

Deploy L2StandardERC20.sol via block explorer

The L2StandardTokenFactory is deployed and verified in the block explorer, so you can interact with the block explorer to deploy a new ERC20 token.

Mainnet Address

NetworkContract AddressBlock Explorer URL
Boba Mainnet (Ethereum L2)0xD2ae16D8c66ac7bc1Cf3c9e5d6bfE5f76BeDb826https://bobascan.com/address/0xD2ae16D8c66ac7bc1Cf3c9e5d6bfE5f76BeDb826
Bobabnb (BNB L2)0xD2ae16D8c66ac7bc1Cf3c9e5d6bfE5f76BeDb826https://bobascan.com/address/0xD2ae16D8c66ac7bc1Cf3c9e5d6bfE5f76BeDb826

Testnet Address

NetworkContract AddressBlock Explorer URL
Boba Sepolia (Ethereum Sepolia L2)0x4200000000000000000000000000000000000012https://testnet.bobascan.com/address/0x4200000000000000000000000000000000000012
Bobabnb Testnet (BNB Testnet L2)0xD2ae16D8c66ac7bc1Cf3c9e5d6bfE5f76BeDb826https://testnet.bobascan.com/address/0xD2ae16D8c66ac7bc1Cf3c9e5d6bfE5f76BeDb826

Deploy L2StandardERC20.sol via the script

You can deploy L2StandardERC20.sol via the following script

const Factory__L2StandardERC20 = new ethers.ContractFactory(
L2StandardERC20Json.abi,
L2StandardERC20Json.bytecode,
L2Wallet
)
const L2StandardERC20 = await Factory__L2StandardERC20.deploy(
'0x4200000000000000000000000000000000000010',
L1_TOKEN_ADDRESS,
TOKEN_NAME,
TOKEN_SYMBOL,
TOKEN_DECIMAL
)

Bridge the New Token L2

ERC20 deposits into L2 can be triggered via the depositERC20 and depositERC20To functions on the L1StandardBridge. You must approve the Standard Token Bridge to use the amount of tokens that you want to deposit or the deposit will fail.

const L1StandardERC20 = new ethers.Contract(
PROXY__L1STANDARDBRIDGE_ADDRESS,
L1StandardBridgeJson.abi,
L1Wallet,
)

const depositTxStatus = await L1StandardERC20.depositERC20(
L1_TOKEN_ADDRESS,
'0x4200000000000000000000000000000000000006',
L1_TOKEN_AMOUNT,
9999999,
ethers.utils.formatBytes32String(new Date().getTime().toString())
)

Mainnet

L1Contract NameContract Address
EthereumProxy__L1StandardBridge0xdc1664458d2f0B6090bEa60A8793A4E66c2F1c00
BNBProxy__L1StandardBridge0x1E0f7f4b2656b14C161f1caDF3076C02908F9ACC

Testnet

L1Contract NameContract Address
Ethereum SepoliaProxy__L1StandardBridge0x244d7b81EE3949788Da5F1178D911e83bA24E157
BNB TestnetProxy__L1StandardBridge0xBf0939120b4F5E3196b9E12cAC291e03dD058e9a