Can someone read my contract and decipher what it does?

I know what the contract I just finished writing is supposed to do. I’m hoping someone with more experience can read the code and understand what it does and then confirm that to me.

I’m super new to solidity so I’m basically asking for an assessment, interpretation, and constructive criticism if all that’s acceptable here.

pragma solidity ^0.8.0;

import "";
import "";

contract MyCode is ERC20 {

uint256 private _minimumSupply = 10000000 * (10 ** 18);

constructor () public ERC20("MyCode", "MYC") {
    _mint(msg.sender, 500000000000000 * (10 ** uint256(decimals())));

function transfer(address to, uint256 amount) public override returns (bool) {
    return super.transfer(to, _partialBurn(amount));

function transferFrom(address from, address to, uint256 amount) public override returns (bool) {
    return super.transferFrom(from, to, _partialBurn(amount));

function _partialBurn(uint256 amount) internal returns (uint256) {
    uint256 burnAmount = _calculateBurnAmount(amount);

    if (burnAmount > 0) {
        _burn(msg.sender, burnAmount);

    return amount -(burnAmount);

function _calculateBurnAmount(uint256 amount) internal view returns (uint256) {
    uint256 burnAmount = 0;

    if (totalSupply() > _minimumSupply) {
        burnAmount = amount / 1000;
        uint256 availableBurn = totalSupply() -(_minimumSupply);
        if (burnAmount > availableBurn) {
            burnAmount = availableBurn;

    return burnAmount;


On every token transfer, 0.1% of the amount being transferred will instead be burnt, as long as the totalSupply is above a minimum.

The code looks pretty good, can’t even tell you’re new to Solidity. The only weird thing is the parentheses when you subtract.

amount -(burnAmount);

should be…

amount - burnAmount;

And so on