You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I used a youtube tutorial to create a token on the Binance smart chain and have been distributing it to my community for rewards and role designation in discord. I want to get it verified so that I can add add an image to it through bscscan but I'm getting an error:
Error! Unable to generate Contract ByteCode and ABI
Found the following ContractName(s) in source code : Token
But we were unable to locate a matching bytecode (err_code_2)
I've never coded anything before this in my life before this and have very little knowledge about what anything means in the code. It compiles correctly on Remix 0.8.2 but will not verify. I've also tried optimization enabled and disabled with the same result. I'll paste it below for your review. I heard flattening it may resolve it but I couldn't figure out how to use truffle-flattener. Any help is appreciated
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
contract Token {
mapping(address => uint) public balances;
mapping(address => mapping(address => uint)) public allowance;
uint public totalSupply = 10000000 * 10 ** 18;
string public name = "Zuelyen";
string public symbol = "ZYN";
uint public decimals = 18;
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
constructor() {
balances[msg.sender] = totalSupply;
}
function balanceOf(address owner) public view returns(uint) {
return balances[owner];
}
function transfer(address to, uint value) public returns(bool) {
require(balanceOf(msg.sender) >= value, 'balance too low');
balances[to] += value;
balances[msg.sender] -= value;
emit Transfer(msg.sender, to, value);
return true;
}
function transferFrom(address from, address to, uint value) public returns(bool) {
require(balanceOf(from) >= value, 'balance to low');
require(allowance[from][msg.sender] >=value, 'allowance too low');
balances[to] += value;
balances[from] -= value;
emit Transfer(from, to, value);
return true;
}
function approve(address spender, uint value) public returns(bool) {
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
}
The text was updated successfully, but these errors were encountered:
Hello, I used a youtube tutorial to create a token on the Binance smart chain and have been distributing it to my community for rewards and role designation in discord. I want to get it verified so that I can add add an image to it through bscscan but I'm getting an error:
Error! Unable to generate Contract ByteCode and ABI
Found the following ContractName(s) in source code : Token
But we were unable to locate a matching bytecode (err_code_2)
I've never coded anything before this in my life before this and have very little knowledge about what anything means in the code. It compiles correctly on Remix 0.8.2 but will not verify. I've also tried optimization enabled and disabled with the same result. I'll paste it below for your review. I heard flattening it may resolve it but I couldn't figure out how to use truffle-flattener. Any help is appreciated
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
contract Token {
mapping(address => uint) public balances;
mapping(address => mapping(address => uint)) public allowance;
uint public totalSupply = 10000000 * 10 ** 18;
string public name = "Zuelyen";
string public symbol = "ZYN";
uint public decimals = 18;
}
The text was updated successfully, but these errors were encountered: