contract Ectoplasma is ERC20("Gasoline", "GAS"), Ownable {
    using SafeMath for uint256;
    address public devaddr;

    // the amount of burn to ecto during every transfer, i.e. 100 = 1%, 50 = 2%, 40 = 2.5%, 255 being the lowest burn
    uint8 public burnDivisor;

    constructor(uint8 _burnDivisor, address _devaddr) public {
        require(_burnDivisor > 0, "Ecto: burnDivisor must be bigger than 0");
        burnDivisor = _burnDivisor;
        devaddr = _devaddr;
    }
    // mints new ecto tokens, can only be called by BooBank
    // contract during burns, no users or dev can call this
    function mint(address _to, uint256 _amount) public onlyOwner {
        _mint(_to, _amount);
    }

    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        // ecto amount is adjustable
        uint256 burnAmount = amount.div(burnDivisor);

        _burn(msg.sender, burnAmount);
        // 1%
        _mint(devaddr, amount.div(100));

        // sender transfers 99% of the ecto
        return super.transfer(recipient, amount.sub(burnAmount));
    }

    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        // ecto amount is 1%
        uint256 burnAmount = amount.div(burnDivisor);
        // recipient receives 1% ecto tokens

        // sender loses the 1% of the ecto
        _burn(sender, burnAmount);
        _mint(devaddr, amount.div(100));
        // sender transfers 99% of the ecto
        return super.transferFrom(sender, recipient, amount.sub(burnDivisor));
    }

    function setDevAddr(address _devaddr) public onlyOwner {
        devaddr = _devaddr;
    }

    function setBurnRate(uint8 _burnDivisor) public onlyOwner {
        require(_burnDivisor > 0, "Boo: burnDivisor must be bigger than 0");
        burnDivisor = _burnDivisor;
    }
}
// 
function mint(address _to, uint256 _amount) public onlyOwner {
    _mint(_to, _amount);
}

// mints new ecto tokens, can only be called by BooBank
// contract during burns, no users or dev can call this