Verified contractExactMIT
LIBERTY
Address0x7e847eef07669f3fcba1d469dc6ac262c3e5c6e1
- Balance
0 ETH
- Transactions
3
- Compiler
solc 0.6.6
- Same code
Only this contract
Details
- Compiler
- solc 0.6.6+commit.6c089d02
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- istanbul
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,471,253
- Creation transaction
- 0x7652735f01…2da12410b3
contracts/LIBERTY_50M_DEFINITIVO.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.6;
library SafeMath {
function add(uint256 a, uint256 b)
internal pure returns (uint256)
{
uint256 c = a + b;
require(c >= a, "Overflow");
return c;
}
function sub(uint256 a, uint256 b)
internal pure returns (uint256)
{
require(b <= a, "Insufficient balance");
return a - b;
}
}
contract LIBERTY {
using SafeMath for uint256;
string public constant name = "LIBERTY";
string public constant symbol = "LBY";
uint8 public constant decimals = 18;
uint256 public constant MAX_SUPPLY =
1000000000 * (10 ** 18);
uint256 public totalSupply;
address public owner;
mapping(address => uint256) private balances;
mapping(address => mapping(address => uint256))
private allowances;
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed holder,
address indexed spender,
uint256 value
);
modifier onlyOwner() {
require(msg.sender == owner, "Not owner");
_;
}
constructor() public {
owner = msg.sender;
totalSupply = 50000000 * (10**18);
balances[owner] = totalSupply;
emit Transfer(address(0), owner, totalSupply);
}
function balanceOf(address account)
public view returns (uint256)
{
return balances[account];
}
function allowance(address holder, address spender)
public view returns (uint256)
{
return allowances[holder][spender];
}
function approve(address spender, uint256 amount)
public returns (bool)
{
require(spender != address(0), "Zero address");
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transfer(address to, uint256 amount)
public returns (bool)
{
_transfer(msg.sender, to, amount);
return true;
}
function transferFrom(
address from,
address to,
uint256 amount
) public returns (bool) {
allowances[from][msg.sender] =
allowances[from][msg.sender].sub(amount);
_transfer(from, to, amount);
emit Approval(
from,
msg.sender,
allowances[from][msg.sender]
);
return true;
}
function mint(address to, uint256 amount)
external onlyOwner
{
require(to != address(0), "Zero address");
require(
totalSupply.add(amount) <= MAX_SUPPLY,
"Maximum supply exceeded"
);
totalSupply = totalSupply.add(amount);
balances[to] = balances[to].add(amount);
emit Transfer(address(0), to, amount);
}
function burn(uint256 amount) external {
balances[msg.sender] =
balances[msg.sender].sub(amount);
totalSupply = totalSupply.sub(amount);
emit Transfer(msg.sender, address(0), amount);
}
function _transfer(
address from,
address to,
uint256 amount
) internal {
require(to != address(0), "Zero address");
balances[from] = balances[from].sub(amount);
balances[to] = balances[to].add(amount);
emit Transfer(from, to, amount);
}
}
Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "istanbul",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.