Chains

BNB Smart Chain

Build web3 dApps effortlessly

BNB Beacon Chain

Sunset soon

BNB ecosystem’s staking & governance layer

DocumentationGitHubFaucetStake BNBBscScanBSCTraceDev ToolsLearn more about FusionDocumentationBeacon Chain ExplorerDocumentationGitHubFaucetBridgeGreenfieldScanDCellarDev ToolsDocumentationGitHubFaucetBridgeopBNBScanDev ToolsDocumentationGitHub

Developers


Submit dApps

BNB Smart ChainBNB GreenfieldopBNBzkBNBBNB HackBNB Incubation Alliance (BIA)Most Valuable Builder Accelerator Program (MVB)BNB Chain GrantsKickstartGas GrantsTVL Incentive ProgramMEME Coins InnovationSee All Programs

Ecosystem

Staking

Earn BNB and rewards effortlessly

Tokenization Solutions

Get Your Business Into Web3

Native StakingLiquid StakingCompany TokenizationReal World Assets TokenizationNFT Loyalty Program

Community

Contact UsGet Started
Contact UsGet Started

opBNB Testnet PreContract Hardfork

2023.8.9  •  2 min read
Blog post image.


Note: This is an updated version of a blog previously published on August 9th, 2023.

Description

This hard fork aims to add the PreContract hard fork, which updates the pre-deployed contract WBNB. The address of the WBNB contract is 0x4200000000000000000000000000000000000006, and it involves changes to the contract's name and symbol. Additionally, the pre-deployed contract GovernanceToken, with the address 4200000000000000000000000000000000000042, will be removed.

The hard fork block height is 5805494, expected to occur on Aug 22, 2023, at 06:00:00 AM UTC. If you are running a full node of opBNB, you must complete the upgrade before the specified time. Failing to do so will result in running a forked chain instead of the canonical chain. This will cause incorrect data queries from the node and transactions sent via the node may fail to be included in the block. You may need to clear the data and run the node again to recover it.

Changes

reference PR: feat:add preDeployedContract hardfork

  • Set preDeployed contract WBNB name to Wrapped BNB.
  • Set preDeployed contract WBNB symbol to WBNB.
  • Remove preDeployed contract 4200000000000000000000000000000000000042.

Upgrade Tutuorial

  • Build the latest op-geth binary from the op-geth repository version v0.1.3.
  • Obtain the most recent genesis.json file, which includes the new hardfork parameter preContractForkBlock.
  • Stop the op-geth process and replace the existing binary with the latest one.
  • Use the new op-geth to initialize the new genesis file by running the command:
    ./op-geth --datadir ./datadir init genesis.json.
    If the initialization fails, you may be running on a different network.
  • Restart op-geth, and the hardfork will take effect after reaching the block number specified by preContractForkBlock.
  • To ensure that the new parameter is set correctly, use the following command:
curl -X POST --data '{"jsonrpc":"2.0","method":"admin_nodeInfo","params":[],"id":1}' -H "Content-Type: application/json" http://localhost:8545

The response should include the preContractForkBlock parameter with a value of 5805494. If the transaction fails, enable the HTTP admin API.

Follow us to stay updated on everything BNB Chain!

Website | Twitter | Twitter (Devs) | Telegram | dApp Store | YouTube | Discord | LinkedIn | Build N' Build Forum | Dev Community|

Share