Verified contractExactMIT
QdayCoin
Address0xd89fc3b6bb927502bf3f1699f42879c8d0d9a4a8
- Balance
0 ETH
- Transactions
0
- Compiler
solc 0.8.28
- Same code
Only this contract
Details
- Compiler
- solc 0.8.28+commit.7893614a
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- cancun
- Via IR
- yes
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,350,379
- Creation transaction
- 0x4135bc1919…40104b420e
QdayCoin.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
// QDAY PREPRINT 1 . A coin that stops at Q-Day
// web https://quantumday.fun . x https://x.com/qday_fun
//
// Result. Each coin the QDAY pad launches: 1,000,000,000 units with 18 decimals, created in one piece and
// handed to the pad, which sells three quarters on its curve and puts the rest in the coin's pool.
// No owner. No minting after birth, no pause, no tax, no blacklist.
// Construction. An ordinary ERC-20, with one shortcut: the pad and the vault may draw coins from the account that
// is calling them, so a curve sale or a vault deposit needs no separate approval. They draw only
// from their own caller; that rule lives in QdayPad and QdayVault, which are fixed code.
// After Q-Day. The siren's secp256k1 prize, once claimed, leaves code at the alarm address given to this coin at
// birth. From that block on, a coin moves only between the pad, the vault and the Uniswap v4
// PoolManager. Coins in ordinary wallets stay where they are, because whoever can forge their
// signatures could otherwise take them. Coins in the vault keep trading under hash-based keys.
// Measured. The alarm costs one EXTCODESIZE (2,600 gas cold) on a transfer with a wallet on either side, and
// nothing on a transfer between the pad, the vault and the PoolManager.
contract QdayCoin {
uint256 public constant totalSupply = 1_000_000_000e18;
uint8 public constant decimals = 18;
address internal constant POOL_MANAGER = 0x000000000004444c5dc75cB358380D2e3dE08A90;
address public immutable pad;
address public immutable vault;
address public immutable alarm;
string public name;
string public symbol;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
error QDayFrozen();
error NotQday();
constructor(string memory name_, string memory symbol_, address vault_, address alarm_) {
pad = msg.sender;
vault = vault_;
alarm = alarm_;
name = name_;
symbol = symbol_;
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address to, uint256 amount) external returns (bool) {
_move(msg.sender, to, amount);
return true;
}
function transferFrom(address from, address to, uint256 amount) external returns (bool) {
uint256 room = allowance[from][msg.sender];
if (room != type(uint256).max) allowance[from][msg.sender] = room - amount;
_move(from, to, amount);
return true;
}
function approve(address spender, uint256 amount) external returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/// Only the pad and the vault, and they pass their own caller as `from`.
function drawFrom(address from, uint256 amount) external {
if (msg.sender != pad && msg.sender != vault) revert NotQday();
_move(from, msg.sender, amount);
}
/// True once the siren's secp256k1 prize has been claimed.
function qdayMode() external view returns (bool) {
return alarm.code.length != 0;
}
function _move(address from, address to, uint256 amount) private {
if (!(_ours(from) && _ours(to)) && alarm.code.length != 0) revert QDayFrozen();
balanceOf[from] -= amount;
unchecked {
balanceOf[to] += amount;
}
emit Transfer(from, to, amount);
}
function _ours(address a) private view returns (bool) {
return a == pad || a == vault || a == POOL_MANAGER;
}
}
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.