Why does my balance still show "0"?

Hi team,

i have been trying to figure out why "when i deploy my erc20 token from remix, and add my contract address" why does my balance still show "0"?

would love the help, im sure it's something small.
im using the standard ownership progma, but still cant figure it out.

doesnt the deplying wallet get ownership once deployed

cheers

pragma solidity ^0.8.0;


abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _setOwner(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }


    function renounceOwnership() public virtual onlyOwner {
        _setOwner(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
`

> type or paste code here

`

The contract that you shared is not an ERC20 token. Could you have deployed the wrong contract? You also need at least a function to mint() tokens or to set your balance to the totalSupply once the token is deployed.

1 Like

Please before you asking questions, just have a search in the forum.

Maybe you can have a look at this tutorial:

You may find Contracts Wizard helpful. See the "Premint" field in particular.