Description:
Smart contract deployed on Ethereum with Factory features.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/**
* ORACLYX (ORLX) — contrato simples, sem admin, sem mint extra
* - Supply fixo: 500,000,000 ORLX
* - Decimais: 8 (premium)
* - Todo o supply é emitido para msg.sender (a conta que faz o deploy)
*/
contract ORLXTokenFinal {
// Metadados
string public constant name = "ORACLYX";
string public constant symbol = "ORLX";
uint8 public constant decimals = 8;
// Estado ERC20
uint256 public immutable totalSupply; // fixo
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
// Eventos ERC20
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor() {
// 500,000,000 * 10^8
uint256 _total = 500_000_000 * (10 ** uint256(decimals));
totalSupply = _total;
balanceOf[msg.sender] = _total;
emit Transfer(address(0), msg.sender, _total);
}
// Funções ERC20 básicas
function transfer(address to, uint256 value) external returns (bool) {
require(balanceOf[msg.sender] >= value, "balance too low");
unchecked {
balanceOf[msg.sender] -= value;
balanceOf[to] += value;
}
emit Transfer(msg.sender, to, value);
return true;
}
function approve(address spender, uint256 value) external returns (bool) {
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value) external returns (bool) {
require(balanceOf[from] >= value, "balance too low");
uint256 allowed = allowance[from][msg.sender];
require(allowed >= value, "allowance too low");
unchecked {
allowance[from][msg.sender] = allowed - value;
balanceOf[from] -= value;
balanceOf[to] += value;
}
emit Transfer(from, to, value);
return true;
}
}
Submitted on: 2025-10-30 14:51:59
Comments
Log in to comment.
No comments yet.