0

I just created a new ERC20 token on the ropsten testnet. The contract is verified and can be seend here. However when I try to search for AtariToken or ATAR I don't get any results on ropsten.etherscan.io. Is there something I'm missing. Heres the contract code:

    /**
 *Submitted for verification at Etherscan.io on 2020-05-14
*/

pragma solidity >=0.4.0 <0.7.0;

contract AtariToken {

string public constant name = "AtariToken";
string public constant symbol = "ATAR";
uint8 public constant decimals = 0;

event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
event Transfer(address indexed from, address indexed to, uint tokens);
event RegistrationSuccessful(uint256 nonce);
event RegistrationFailed(uint256 nonce);

mapping(address => uint256) balances;

mapping(address => mapping (address => uint256)) allowed;

uint256 totalSupply_ = 7771107723;

mapping (string => address) addressTable;

using SafeMath for uint256;

constructor( uint256 _totalSupply) public{
    totalSupply_ = _totalSupply;
    balances[msg.sender] = totalSupply_;
}

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

function balanceOf(address tokenOwner) public view returns (uint) {
    return balances[tokenOwner];
}

function balanceOf(string memory tokenOwner) public view returns (uint) {
    address userAddress;
    userAddress = addressTable[tokenOwner];
    return balances[userAddress];
}

function transfer(address receiver, uint numTokens) public returns (bool) {
    require(numTokens <= balances[msg.sender]);
    balances[msg.sender] = balances[msg.sender].sub(numTokens);
    balances[receiver] = balances[receiver].add(numTokens);
    emit Transfer(msg.sender, receiver, numTokens);
    return true;
}

function transfer(string memory receiver, uint numTokens) public returns (bool) {
    address receiverAddress;
    receiverAddress = addressTable[receiver];
    require(numTokens <= balances[msg.sender]);
    balances[msg.sender] = balances[msg.sender].sub(numTokens);
    balances[receiverAddress] = balances[receiverAddress].add(numTokens);
    emit Transfer(msg.sender, receiverAddress, numTokens);
    return true;
}

function approve(address delegate, uint numTokens) public returns (bool) {
    allowed[msg.sender][delegate] = numTokens;
    emit Approval(msg.sender, delegate, numTokens);
    return true;
}

function approve(string memory delegate, uint numTokens) public returns (bool) {
    address delegateAddress;
    delegateAddress = addressTable[delegate];
    allowed[msg.sender][delegateAddress] = numTokens;
    emit Approval(msg.sender, delegateAddress, numTokens);
    return true;
}

function allowance(address owner, address delegate) public view returns (uint) {
    return allowed[owner][delegate];
}

function allowance(string memory owner, string memory delegate) public view returns (uint) {
    address ownerAddress;
    ownerAddress = addressTable[owner];
    address delegateAddress;
    delegateAddress = addressTable[delegate];
    return allowed[ownerAddress][delegateAddress];
}

 function transferFrom(address owner, address buyer, uint numTokens) public returns (bool) {
    require(numTokens <= balances[owner]);    
    require(numTokens <= allowed[owner][msg.sender]);

    balances[owner] = balances[owner].sub(numTokens);
    allowed[owner][msg.sender] = allowed[owner][msg.sender].sub(numTokens);
    balances[buyer] = balances[buyer].add(numTokens);
    emit Transfer(owner, buyer, numTokens);
    return true;
}

function transferFrom(string memory owner, string memory buyer, uint numTokens) public returns (bool) {
    address ownerAddress;
    ownerAddress = addressTable[owner];
    address buyerAddress;
    buyerAddress = addressTable[buyer];

    require(numTokens <= balances[ownerAddress]);    
    require(numTokens <= allowed[ownerAddress][msg.sender]);

    balances[ownerAddress] = balances[ownerAddress].sub(numTokens);
    allowed[ownerAddress][msg.sender] = allowed[ownerAddress][msg.sender].sub(numTokens);
    balances[buyerAddress] = balances[buyerAddress].add(numTokens);
    emit Transfer(ownerAddress, buyerAddress, numTokens);
    return true;
}

function registerUser(string memory user, uint256 nonce) public returns (bool) {
    if (addressTable[user] == address(0)) {
        addressTable[user] = msg.sender;
        emit RegistrationSuccessful(nonce);
        return true;
    } else {
        emit RegistrationFailed(nonce);
        return false;
    }
}
}

library SafeMath { 
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
  assert(b <= a);
  return a - b;
}

function add(uint256 a, uint256 b) internal pure returns (uint256) {
  uint256 c = a + b;
  assert(c >= a);
  return c;
}

}

  • Out of interest are you working on the AtariToken? In a previous life I worked on the Atari Platform Network. – abcoathup May 15 at 1:51
0

I did a search and assume this is your token: https://ropsten.etherscan.io/token/0xEFdb43c081eeE890A03AD7E78bbA98397A6B8528

If you are creating ERC20 tokens you may want to look at the OpenZeppelin Contracts implementation to see if this meets your needs. See the documentation for details: https://docs.openzeppelin.com/contracts/3.x/erc20

If you have questions on using OpenZeppelin you can ask in the Community Forum: https://forum.openzeppelin.com/

Disclosure: I am the Community Manager at OpenZeppelin

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.