Search code examples
blockchainethereumsolidityerc20

Can I change smart contract which is already deployed on BSC?


Everyone! I have a token contract that has a mint function. It has only burn function and it deployed to the mainnet. I am going to add the mint function to the token. It is available? Here is the current token contract. contract MyToken is ERC20, ERC20Detailed, ERC20Burnable {

    constructor () public ERC20Detailed("MyToken", "MY", 18) {
        _mint(msg.sender, 15000000 * (10 ** uint256(decimals())));
    }
}

Above contract used openzeppelin. I will be very thankful if you teach me how to change this contract.


Solution

  • You cannot update it unless you have used a proxy or otherwise coded in that you can update it. You'll have to redeploy.

    Updating a live smart contract