I hope you're all well.
I'm having an issue with creating an ERC20 token. I'm looking for consultation on this project, just let me know your usual fee.
I was looking for code that didn't include a link to github and that would work for pragma solidity ^0.8.17.
I deployed the token onto the Ethereum main net but I've had an issue.
I sent all of the initial supply to a single wallet. This transaction is on Etherscan however the wallet's balance is 0. I'm not sure if there was an issue with the code or something else.
I'll link below with the transaction on Etherscan, as well as attaching some screenshots and the code.
https://etherscan.io/token/0x26e4026cd0dc3a7d7ca977f5a904573ea6ef79df
PerspicacityToken on Etherscan.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
//ERC Token Standard #20 Interface
interface ERC20Interface{
function totalSupply() external view returns (uint);
function balance0f(address account) external view returns (uint balance);
function allowance(address owner, address spender) external view returns (uint remaining);
function transfer(address recipient, uint amount) external returns (bool success);
function approve(address spender, uint amount) external returns (bool success);
function transferFrom(address sender, address recipient, uint amount) external returns (bool success);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
// Actual token contract
contract PerspicacityToken is ERC20Interface {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
constructor() {
symbol = "PSPTATE";
name = "PerspicacityToken";
decimals = 18;
_totalSupply = 1000000000000000000000000;
balances[0x5231229c4b8fd6F4cF25D4c83BB580b98a8F5dCc] = _totalSupply;
emit Transfer(address(0), 0x5231229c4b8fd6F4cF25D4c83BB580b98a8F5dCc, _totalSupply);
}
function totalSupply() public view returns (uint) {
return _totalSupply;
}
function balance0f(address account) public view returns (uint balance) {
return balances[account];
}
function transfer(address recipient, uint amount) public returns (bool success) {
balances[msg.sender] = balances[msg.sender] - amount;
balances[recipient] = balances[recipient] + amount;
emit Transfer(msg.sender, recipient, amount);
return true;
}
function approve(address spender, uint amount) public returns (bool success) {
allowed[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public returns (bool success) {
balances[sender] = balances[sender] - amount;
allowed[sender][msg.sender] = allowed[sender][msg.sender] - amount;
balances[recipient] = balances[recipient] + amount;
emit Transfer(sender, recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint remaining) {
return allowed[owner][spender];
}
}
Let me know if you have any further questions.
Cheers.
[link] [comments]
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments