Skip to content
Verified contractPartialMIT

Paper

Address0x368a33e7b4476ae365cff37ae893d86f43ca89fb
Balance

0 ETH

 

Transactions

15

 

Compiler

solc 0.8.28

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.28+commit.7893614a
Language
solidity
Optimization
Yes, 200 runs
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
25,975,323
Creation transaction
0x224602d940…49a85490fb

Paper.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;

//   P A P E R S T O C K
//   ══════════════════════════════════════════════════════════════════════════
//   web      paperstock.fun
//   ──────────────────────────────────────────────────────────────────────────
//   Paper.sol · THE STOCK
//   1 of 6 · Manifest names it · Foil records it · Pyx reserves against it ·
//   Exchequer issues it · PaperHook collects for it
//   ══════════════════════════════════════════════════════════════════════════
//
//   Read this the way you would read the front of a prospectus, because that
//   is what it is written as. Every heading is a question a buyer is entitled
//   to ask, and the last question in every one of the six files is the same
//   one.
//
//
//   WHERE DOES THE NAME COME FROM?
//
//       An Exchequer tally was a hazel stick, notched across the grain with a
//       sum and then split down its length. The Crown kept the short half, the
//       foil. The creditor walked away with the long half, and the long half
//       was called THE STOCK. A man holding one was a stockholder, and that is
//       the whole etymology of the word.
//
//       What the stick was a claim on had not happened yet: taxes not yet
//       collected, from a county that had not yet paid. It was a receipt for
//       an asset that did not exist. They circulated as money in England for
//       roughly seven hundred years.
//
//       In 1834 the Treasury decided the obsolete sticks were clutter and fed
//       two cartloads of them into a furnace under the House of Lords. The
//       flue overheated, the panelling caught, and Parliament burned to the
//       ground. This is the most literal thing that has ever happened in
//       finance and the project is named after it.
//
//   WHAT IS BEING SOLD HERE?
//
//       A token. One billion PAPER, minted once in the constructor, eighteen
//       decimals, and not one unit more thereafter.
//
//       Around it there is a register that issues dated claims on cargoes that
//       were never landed — tin from Valparaiso, rum from Pernambuco, cargoes
//       named by a contract that invents them out of a hash. Those claims are
//       collateralised in ether by the pool's own trading fees. The goods are
//       admitted fiction. The collateral is not.
//
//       Every tokenised-real-world-asset on this chain asks you to believe in
//       a warehouse you will never be allowed to visit. This one tells you at
//       the top of the file that the warehouse is empty, and shows you the
//       strongroom instead.
//
//   WHAT DOES HOLDING PAPER ENTITLE ME TO?
//
//       One thing, and it is worth being exact about it, because the absence
//       of everything else is the point.
//
//       PAPER is a claim on THE RESERVE — the share of trading fees the Pyx
//       sets aside under the token rather than under the tallies. You take it
//       by burning, pro rata, at any time, with nobody's permission.
//
//       PAPER is NOT a claim on the tallies. Ether paid into a tally belongs
//       to whoever holds that tally's stock, and this token has no call on a
//       wei of it. If you want the cargo, buy the cargo.
//
//       Burning is neutral to everyone who does not. Retiring n tokens for
//       n × reserve ÷ supply leaves reserve ÷ supply exactly where it was, so
//       an exit never thins the people who stay.
//
//   WHAT CANNOT BE DONE TO ME?
//
//       Minting. There is no mint function anywhere in this file. Not
//       disabled, not guarded behind an owner, not renounced after the fact —
//       never written, and a function that was never written cannot be
//       switched back on by anybody for any reason.
//
//       Administration. There is no owner. The launcher role exists so the
//       pool can be seeded before anyone is able to trade against it, and it
//       deletes itself inside the same transaction that uses it. After
//       openTrading there is nothing left to renounce.
//
//       Taxation. No transfer fee, no rebase, no reflection, no blacklist, no
//       maximum wallet, no cooldown, no pause. Moving PAPER between two
//       addresses is an ordinary ERC-20 transfer and costs what one costs.
//
//   WHAT COULD MAKE THIS WORTHLESS?
//
//       The reserve is only ever as large as the fees, and the fees are only
//       ever as large as the volume. On a pool nobody trades the reserve stays
//       at zero, every tally matures short, and the register goes on printing
//       manifests for cargoes that will never be paid for. Nothing in this
//       suite manufactures value. It refuses to let fee income leave, which is
//       a far smaller claim and is the only one being made.
//
//       And NO THIRD PARTY HAS AUDITED ANY OF IT. The six contracts are tested
//       hard against a mainnet fork, and that testing has already earned its
//       keep in this repository — it caught a sibling project selling a claim
//       for less than the money already sitting behind it, which is the same
//       as handing out cash. But a simulation written by the same hand that
//       wrote the contract is not an audit and is not offered to you as one.
//
//       Each of the other five files closes with this same question. Read all
//       six before you buy anything.
//
contract Paper {
    string public constant name = "Paperstock";
    string public constant symbol = "PAPER";
    uint8 public constant decimals = 18;

    /// @notice The entire issue, fixed in the constructor. See WHAT CANNOT BE DONE TO ME.
    uint256 public constant INITIAL_SUPPLY = 1_000_000_000 ether;

    uint256 public totalSupply;
    /// @notice Cumulative retirement, for anyone reconciling the issue against the reserve.
    uint256 public totalBurned;

    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    /// @notice Deleted by {openTrading}, in the call that uses it.
    address public launcher;
    bool public open;

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Retired(address indexed from, uint256 value, uint256 supplyAfter);
    event Opened(uint64 at);

    error NotLauncher();
    error AlreadyOpen();
    error NotOpen();
    error ZeroAddress();
    error InsufficientBalance();
    error InsufficientAllowance();

    constructor(address _launcher) {
        if (_launcher == address(0)) revert ZeroAddress();
        launcher = _launcher;
        totalSupply = INITIAL_SUPPLY;
        balanceOf[_launcher] = INITIAL_SUPPLY;
        emit Transfer(address(0), _launcher, INITIAL_SUPPLY);
    }

    /// @notice Open trading for good, and delete the launcher role in the same call.
    function openTrading() external {
        if (msg.sender != launcher) revert NotLauncher();
        if (open) revert AlreadyOpen();
        open = true;
        launcher = address(0);
        emit Opened(uint64(block.timestamp));
    }

    function _move(address from, address to, uint256 v) private {
        // Until the pool is seeded only the launcher may move, so that liquidity
        // can be placed before anybody is able to trade against it.
        if (!open && from != launcher && from != address(0)) revert NotOpen();
        uint256 bal = balanceOf[from];
        if (bal < v) revert InsufficientBalance();
        unchecked { balanceOf[from] = bal - v; }
        balanceOf[to] += v;
        emit Transfer(from, to, v);
    }

    function transfer(address to, uint256 v) external returns (bool) {
        _move(msg.sender, to, v);
        return true;
    }

    function transferFrom(address from, address to, uint256 v) external returns (bool) {
        uint256 a = allowance[from][msg.sender];
        if (a != type(uint256).max) {
            if (a < v) revert InsufficientAllowance();
            unchecked { allowance[from][msg.sender] = a - v; }
        }
        _move(from, to, v);
        return true;
    }

    function approve(address spender, uint256 v) external returns (bool) {
        allowance[msg.sender][spender] = v;
        emit Approval(msg.sender, spender, v);
        return true;
    }

    /// @notice Retire tokens permanently. Anyone, any amount they hold.
    function burn(uint256 v) external {
        _retire(msg.sender, v);
    }

    /// @notice The Pyx burns through this when it pays the reserve, and the Exchequer
    ///         when it takes a merchant's mark, so the holder never has to approve and
    ///         then trust a second call to follow.
    function burnFrom(address from, uint256 v) external {
        uint256 a = allowance[from][msg.sender];
        if (a != type(uint256).max) {
            if (a < v) revert InsufficientAllowance();
            unchecked { allowance[from][msg.sender] = a - v; }
        }
        _retire(from, v);
    }

    function _retire(address from, uint256 v) private {
        uint256 bal = balanceOf[from];
        if (bal < v) revert InsufficientBalance();
        unchecked {
            balanceOf[from] = bal - v;
            totalSupply -= v;
            totalBurned += v;
        }
        emit Transfer(from, address(0), v);
        emit Retired(from, v, totalSupply);
    }
}
Compiler settingsShow
{
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.