Betarena / bta_smart

BTA Bitarena Smart Contract
GNU General Public License v3.0
0 stars 0 forks source link

BTA Burn Address #5

Open jonsnowpt opened 1 year ago

jonsnowpt commented 1 year ago

πŸ“ Issue Description

Add a burn address to a smart contract deployed on the Polygon Network, using OpenZeppelin's Burnable contract.


OpenZeppelin Libraries

The following OpenZeppelin library should be used:

Burnable: @openzeppelin/contracts/token/ERC20/extensions/Burnable.sol


Burn Address

A burn address should be added to the smart contract, and the contract should be updated to allow for burning tokens.


Code Example

The following code snippet shows how to add a burn address to a smart contract using OpenZeppelin's Burnable contract:


import "@openzeppelin/contracts/token/ERC20/extensions/Burnable.sol";

contract MyContract is ERC20, Burnable {
    address public burnAddress = address(0);

    function burn(uint256 amount) public override {
        require(_msgSender() != burnAddress, "Burn address cannot burn tokens");
        super.burn(amount);
    }
}

In this code example, the Burnable contract is imported and then inherited by the MyContract contract. The burnAddress variable is set to a hardcoded address that will act as the burn address. The burn function is overridden to disallow the burn address from burning tokens.


🎯 Acceptance Criteria

A burn address should be added to the smart contract using OpenZeppelin's Burnable contract. The contract should be updated to allow for burning tokens. The burn function should disallow the burn address from burning tokens.


πŸ“ Additional Notes

The burn address should be set to an address that is not controlled by any entity.

migbash commented 2 weeks ago

🟧 UPDATE