Is it possible to overwrite a smart contract used to deploy a bep20 token on testnet? I have made changes to a smart contract already deployed and wish to rewrite the smart contract already present, or will it create a new address once I do this


No. It is not possible to override or upgrade a deployed smart contract, unless you planned and prepared carefully for this scenario.

  • In that case is it possible to remove a token that I deployed off the network and repeat the same process
    – James B
    Jul 15 at 11:51

Yes, If you wrote the contract to be upgradable. This would entail creating a proxy contract that forwards all calls to the implementation contract. This sounds harder than it is, you can use Openzeppelin's plugins to handle all the backend work and all you have to do is write your contract a specific way.

To answer the comment you asked in the other answer, yes and no. You can create a contract that has a self destruct function, and then call that function once it is deployed to delete the contract and send any remaining tokens to a specified wallet address. The blockchain is inherently immuatable, so without purposely coding your contract to conteract this immutability, the contract you deployed will always be on the blockchain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.