Verified contractPartialMIT
Sat0Token
Address0xcb66efc6eb377fcbb0b14cdc321e1fcb957b0000
- Balance
0 ETH
- Transactions
292
- Compiler
solc 0.8.26
- Same code
3 more contracts
Details
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- cancun
- Via IR
- yes
- License
- MIT
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 25,036,639
- Creation transaction
- 0x21127a4f17…88f3297c87
6 files
- contracts/Sat0Token.solmain4.22 KB
- @openzeppelin/contracts/interfaces/draft-IERC6093.sol1.5 KB
- @openzeppelin/contracts/token/ERC20/ERC20.sol4.15 KB
- @openzeppelin/contracts/token/ERC20/IERC20.sol779 B
- @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol404 B
- @openzeppelin/contracts/utils/Context.sol428 B
contracts/Sat0Token.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
/// @title sat0 launchpad token
/// @notice Minimal ERC20 used for tokens launched from the sat0.run platform.
/// The factory deploys it, then permanently assigns exactly one hook as minter.
/// @dev Launchpad: Website https://sat0.run/ · X https://x.com/sat0v4
/// No owner, no pause, no blacklist, no transfer tax, and no upgrade path.
contract Sat0Token is ERC20 {
/// @notice Absolute maximum supply for every launched token: 21,000,000 tokens.
uint256 public constant MAX_SUPPLY = 21_000_000e18;
/// @notice The designated minter (the sat0 Hook). Locked once `setMinter` is called.
address public minter;
/// @notice Immutable project/social/logo metadata URL.
string public _metaUrl;
/// @notice The SAT0 Launchpad Hook bound to this token. Same value as `minter`, exposed for integrators.
address public hook;
/// @notice The address that deployed this contract (only entity allowed to set the minter once).
address public immutable DEPLOYER;
/// @notice Marker that asserts this contract makes no use of any restriction primitive.
bool public immutable RESTRICTIONS_FORBIDDEN = true;
/// @notice The block at which this contract was deployed.
uint256 public immutable GENESIS_BLOCK;
/// @notice The hash of the block immediately preceding deployment. Burned into bytecode.
bytes32 public immutable GENESIS_HASH;
/// @notice Reverts when a caller other than the deployer tries to set the minter.
error NotDeployer();
/// @notice Reverts when a caller other than the locked-in minter tries to mint.
error NotMinter();
/// @notice Reverts when `setMinter` is called more than once.
error MinterAlreadySet();
/// @notice Reverts when a zero-address minter is supplied.
error MinterIsZero();
/// @notice Reverts when minting would exceed the immutable 21,000,000-token cap.
error MaxSupplyExceeded();
/// @notice Emitted exactly once, the moment the minter is permanently locked in.
event MinterLocked(address indexed minter);
/// @notice Construct the token with custom metadata. No owner/admin after deployment.
/// @param metadataUrl Immutable project/social/logo metadata URL. Read via `metaUrl()` / `_metaUrl()`.
constructor(string memory name_, string memory symbol_, string memory metadataUrl) ERC20(name_, symbol_) {
_metaUrl = metadataUrl;
DEPLOYER = msg.sender;
GENESIS_BLOCK = block.number;
GENESIS_HASH = blockhash(block.number - 1);
}
/// @notice Return the immutable project/social/logo metadata URL.
function metaUrl() public view returns (string memory) {
return _metaUrl;
}
/// @notice Set the minter exactly once, then lock forever.
/// @param newMinter The address (the sat0 Hook) that will be the sole entity allowed to mint.
function setMinter(address newMinter) external {
if (msg.sender != DEPLOYER) revert NotDeployer();
if (minter != address(0)) revert MinterAlreadySet();
if (newMinter == address(0)) revert MinterIsZero();
minter = newMinter;
hook = newMinter;
emit MinterLocked(newMinter);
}
/// @notice Mint sat0 launch tokens. Callable only by the locked-in minter and capped at 21,000,000 total supply.
/// @param to Recipient of newly minted tokens.
/// @param amount Amount in 1e18-scaled units.
function mint(address to, uint256 amount) external {
if (msg.sender != minter) revert NotMinter();
if (totalSupply() + amount > MAX_SUPPLY) revert MaxSupplyExceeded();
_mint(to, amount);
}
/// @notice Burn sat0 launch tokens held by `from`. Callable only by the locked-in minter (the hook),
/// used to retire tokens during sells settled against the inverse curve.
/// @param from Account whose tokens are burned.
/// @param amount Amount in 1e18-scaled units.
function burn(address from, uint256 amount) external {
if (msg.sender != minter) revert NotMinter();
_burn(from, amount);
}
}
@openzeppelin/contracts/interfaces/draft-IERC6093.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (interfaces/draft-IERC6093.sol)
pragma solidity >=0.8.4;
interface IERC20Errors {
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
error ERC20InvalidSender(address sender);
error ERC20InvalidReceiver(address receiver);
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
error ERC20InvalidApprover(address approver);
error ERC20InvalidSpender(address spender);
}
interface IERC721Errors {
error ERC721InvalidOwner(address owner);
error ERC721NonexistentToken(uint256 tokenId);
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
error ERC721InvalidSender(address sender);
error ERC721InvalidReceiver(address receiver);
error ERC721InsufficientApproval(address operator, uint256 tokenId);
error ERC721InvalidApprover(address approver);
error ERC721InvalidOperator(address operator);
}
interface IERC1155Errors {
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
error ERC1155InvalidSender(address sender);
error ERC1155InvalidReceiver(address receiver);
error ERC1155MissingApprovalForAll(address operator, address owner);
error ERC1155InvalidApprover(address approver);
error ERC1155InvalidOperator(address operator);
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}
@openzeppelin/contracts/token/ERC20/ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC20Metadata} from "./extensions/IERC20Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol";
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
mapping(address account => uint256) private _balances;
mapping(address account => mapping(address spender => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function name() public view virtual returns (string memory) { return _name; }
function symbol() public view virtual returns (string memory) { return _symbol; }
function decimals() public view virtual returns (uint8) { return 18; }
function totalSupply() public view virtual returns (uint256) { return _totalSupply; }
function balanceOf(address account) public view virtual returns (uint256) { return _balances[account]; }
function transfer(address to, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, value);
return true;
}
function allowance(address owner, address spender) public view virtual returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
return true;
}
function _transfer(address from, address to, uint256 value) internal {
if (from == address(0)) revert ERC20InvalidSender(address(0));
if (to == address(0)) revert ERC20InvalidReceiver(address(0));
_update(from, to, value);
}
function _update(address from, address to, uint256 value) internal virtual {
if (from == address(0)) {
_totalSupply += value;
} else {
uint256 fromBalance = _balances[from];
if (fromBalance < value) revert ERC20InsufficientBalance(from, fromBalance, value);
unchecked { _balances[from] = fromBalance - value; }
}
if (to == address(0)) {
unchecked { _totalSupply -= value; }
} else {
unchecked { _balances[to] += value; }
}
emit Transfer(from, to, value);
}
function _mint(address account, uint256 value) internal {
if (account == address(0)) revert ERC20InvalidReceiver(address(0));
_update(address(0), account, value);
}
function _burn(address account, uint256 value) internal {
if (account == address(0)) revert ERC20InvalidSender(address(0));
_update(account, address(0), value);
}
function _approve(address owner, address spender, uint256 value) internal {
_approve(owner, spender, value, true);
}
function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
if (owner == address(0)) revert ERC20InvalidApprover(address(0));
if (spender == address(0)) revert ERC20InvalidSpender(address(0));
_allowances[owner][spender] = value;
if (emitEvent) emit Approval(owner, spender, value);
}
function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance < type(uint256).max) {
if (currentAllowance < value) revert ERC20InsufficientAllowance(spender, currentAllowance, value);
unchecked { _approve(owner, spender, currentAllowance - value, false); }
}
}
}
@openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)
pragma solidity >=0.4.16;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity >=0.6.2;
import {IERC20} from "../IERC20.sol";
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
@openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
abstract contract Context {
function _msgSender() internal view virtual returns (address) { return msg.sender; }
function _msgData() internal view virtual returns (bytes calldata) { return msg.data; }
function _contextSuffixLength() internal view virtual returns (uint256) { return 0; }
}
Compiler settingsShow
{
"viaIR": true,
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "cancun"
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.