0

We have created a smart contract token on Ethereum , this contract address has received BNB funds , is there any way to access the balance ?

2 Answers2

1

If you mean someone sent the BNB to the contract address on BSC, whereas the contract is deployed on Ethereum mainnet, your best bet is deploying a contract that allows you to recover it from the same deployer with the same nonce, since deploying contracts is deterministic.

For example, imagine your first transaction on Ethereum is deploying a contract, if you then deploy a contract on your first transaction on BSC, it's going to have the same contract address. Check out this great answer for more details!

If it was sent to your contract on the same chain it's deployed, you might be out of luck unless your contract has a function that can recover it or is upgradeable.

Zer0dot
  • 11
  • 1
0

yes, you can try to do the following steps.

  1. check your account nonce before the time you deployed the contract on ETH
  2. make some transaction in BSC so that your nonce in BSC match the nonce from step 1
  3. Create a contract with withdraw function to transfer the BNB. something like
function withdraw() external {
 (bool success, ) = YourWalletAddress.call{value : address(this).balance}();
 require(success, "withdraw failed");
}
  1. make sure to test your contract on your local BSC network by forking the latest block, because once you deploy on mainnet and it failed to withdraw, the fund is lost forever.
Jiaming Li
  • 522
  • 2
  • 10