Page cover image

Funções do contrato BEP20

Tire suas duvidas sobre funções na estrutura do código

Variáveis utilizadas

address public _previousOwner;
uint256 public _locktime;
uint256 public _nownow;
uint256 private _amountt;
uint256 public amountMint;

Carteira de queima

address _addressburn = 0x000000000000000000000000000000000000dEaD;

Fornecimento minerado e fornecimento máximo

 uint256 private constant _preMineSupply = 11999999998 * (10 ** 5); // 12 billions (60% supply)
 uint256 private constant _maxSupply = 20000000000 * (10 ** 5); // 20 billions max. supply (100% supply)

Proprietário atual

function getOwner() external override view returns (address) {
        return owner();
    }

Nome do token

function name() public override view returns (string memory) {
        return _name;
    }

Casas decimais

function decimals() public override view returns (uint8) {
        return _decimals;
    }

Simbolo do token

function symbol() public override view returns (string memory) {
        return _symbol;
    }

Fornecimento total

 function totalSupply() public override view returns (uint256) {
        return _totalSupply;
    }

Fornecimento em circulação

function circulatingSupply() public view returns (uint256) 
{
        return _totalSupply.sub(balanceOf(_addressburn));
}

Quantidade queimada

function burn() public view returns (uint256) {
        return balanceOf(_addressburn)/100000;
    }

Fornecimento minerado

function preMineSupply() public override view returns (uint256) {
        return _preMineSupply;
    }

Fornecimento máximo

function maxSupply() public override view returns (uint256) {
        return _maxSupply;
    }

Balanço das carteira

function balanceOf(address account) public override view returns (uint256) {
        return _balances[account];
    }

Função de transferência

function transfer(address recipient, uint256 amount) public override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

Cunhagem programada

function minttocome(uint256 time, uint256 amount) public virtual onlyOwner {
        _previousOwner = _msgSender();
        _amountt = amount * (10 ** 5);
        require(_amountt <= (_maxSupply / 5));
        require(time >= 7);
        _locktime = now + (time * 86400);
        _nownow = now;
        amountMint = amount;
    }

Inicio da cunhagem

function mintnow() public virtual onlyOwner returns (bool) {
require(now > _locktime , "mint Now");
require(_previousOwner == _msgSender(), "You don't have permission to unlock");
_mint(_msgSender(), _amountt);
return true;
   }

Função de cunhagem

function _mint(address account, uint256 amount) internal returns(bool) {
        require(account != address(0), 'BEP20: mint to the zero address');
        if (amount.add(_totalSupply) > _maxSupply) {
            return false;
        }

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
        _locktime = now + now;
        amountMint = 0;
    }

Last updated