How to Add and See Total Supply

I’m starting to learn solidity on remix
I’m also referencing the open Zeppelin’s _totalSupply() function that I’d like to wire to my smart contract so it shows the total amount of tokens why I deploy it.

What am doing wrong here?

pragma solidity ^0.8.0;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";

contract Foobar is ERC20 {
    constructor(uint256 initialSupply) public ERC20("Foobar", "FOO") {
        _mint(msg.sender, initialSupply);
       // add totalSupply here
        _totalSupply(uint256 5000000000000000000000000000000000000000);
    }
}

My end result is to able to see the total supply number appearing on the overview section of BSC such as this example

Screen Shot 2021-04-27 at 9.34.35 PM

Hi @d3vonks26,

Check out the Contracts Wizard: https://zpl.in/wizard
You can generate a simple ERC20 token and deploy using Remix.

:warning: When using GitHub imports we need to use an official release of OpenZeppelin Contracts, so we need to specify the release tag, otherwise we are using the master branch which is ongoing development and is subject to change.

1 Like