[Development] How to Deploy a Basic Token on Fantom Opera using Remix
Hey! It’s Josiah from Chad Finance (and CzTears, and a few other projects) in this post I’m going to show you how to create a basic token on Fantom Opera Mainnet
To start go to https://remix.ethereum.org and create a new .sol file (if on mobile use an existing .sol file)

Then you should have something like this:

Then paste this into the file:
pragma solidity ^0.8.2;
contract TokenName {
mapping(address => uint) public balances;
mapping(address => mapping(address => uint)) public allowance;
uint public totalSupply = 21000000 * 10 ** 18;
string public name = "Name";
string public symbol = "Symbol";
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 too 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;
}
}
Change the token name and supply to whatever you want (change the 21 million for supply, but don’t remove the *10 **18)
Then compile the contract using version 0.8.2:

After that go to the deploy area and change from JavaScript VM to injected web3 and connect MetaMask

After that click “Deploy” and approve the transaction, after that it should show the contract was deployed at the bottom, from there you can copy the token address and your token is created!
