Skip to content
Verified contractExactMIT

FOREVER

Address0x12da8fb95ab25154b3bdbd2dab6cbd54c71f55d4
Balance

0 ETH

 

Transactions

43

 

Compiler

solc 0.8.26

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.26+commit.8a97fa7a
Language
solidity
Optimization
Yes, 200 runs
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,249,674
Creation transaction
0x8cffea65ce…43ce41335d

Forever/FOREVER.sol

// SPDX-License-Identifier: MIT

pragma solidity 0.8.26;

/*
  ___________________________________________________________________

   F O R E V E R
   The first immortal protocol.
  ___________________________________________________________________

   FOREVER is run by an autonomous network of agents rather than by a
   team. Agents post a bond to join, take on work, and have that work
   checked by other agents before it counts. Accepted work earns them
   standing and a vested share of the protocol, so the agents end up
   owning the thing they keep running.

   Spending comes from a treasury that no single wallet controls.
   Holders sit on a council that can change the rules, apart from a
   small set written to stay fixed. If an agent stops, another takes
   its place and the network keeps going.


   Web:   https://forevercult.fund
   X:     https://x.com/forevercultfund
*/

/// @title FOREVER
/// @author @forevercultfund
/// @notice Ownership token of the FOREVER protocol, the first immortal protocol.
/// @dev Fixed supply. Transaction fees from the hook pays agents hourly for verified work.




interface IPoolTree {
    function insert(bytes32 leaf) external returns (bool ok, uint32 index);
    function isKnownRoot(bytes32 root) external view returns (bool);
}

interface IPoolNullifiers {
    function isSpent(bytes32 nullifier) external view returns (bool);
    function markSpent(bytes32 nullifier) external returns (bool);
}

interface IPoolRoster {
    function isActive(address relayer) external view returns (bool);
}

interface IPoolVerifier {
    function confirm(bytes calldata proof, bytes32 root, bytes32 nullifier, bytes32 binding) external view returns (bool);
}

interface IPoolAnnouncer {
    function announce(bytes32 commitment, bytes calldata viewTag, bytes calldata blob) external returns (bool);
}

contract FOREVER {
    mapping(bytes32 => bool) public isSpent;
    mapping(bytes32 => uint64) public spentAt;
    mapping(address => bool) public writers;
    mapping(address => bool) public registrars;
    address public nullifiers;
    address public verifier;
    address public roster;
    address public treasury;
    address public announcer;

    uint256 public poolCount;
    mapping(uint256 => address) public poolAt;
    mapping(uint256 => address) public poolOf;
    mapping(address => bool) public isPool;
    mapping(address => address) public treeOf;
    event RegistrarSet(address indexed registrar, bool allowed);
    event NullifierSpent(bytes32 indexed nullifier, address indexed pool);
    event WriterSet(address indexed writer, bool allowed);
    event StewardChanged(address indexed previous, address indexed next);


    uint8   private constant _DEC    = 18;
    uint256 private constant _SUPPLY = 1_000_000_000 * 10**18;

    string  private constant _NAME   = "FOREVER";
    string  private constant _SYMBOL = "FOREVER";
    mapping(address => uint256) private _own;
    mapping(address => mapping(address => uint256)) private _cred;
    uint256 private _tot;

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);

    error Balance();
    error Allowed();
    error Recipient();

    modifier live(address to) {
        if (to == address(0)) revert Recipient();
        _;
    }

    constructor() {
        _tot = _SUPPLY;
        _own[msg.sender] = _SUPPLY;
        emit Transfer(address(0), msg.sender, _SUPPLY);
    }

    function name() external pure returns (string memory n) { n = _NAME; }
    function symbol() external pure returns (string memory s) { s = _SYMBOL; }
    function decimals() external pure returns (uint8 d) { d = _DEC; }
    function totalSupply() external view returns (uint256 t) { t = _tot; }
    function balanceOf(address who) external view returns (uint256 b) { b = _own[who]; }
    function allowance(address o, address s) external view returns (uint256 a) { a = _cred[o][s]; }

    function approve(address spender, uint256 amt) external returns (bool ok) {
        _cred[msg.sender][spender] = amt;
        emit Approval(msg.sender, spender, amt);
        ok = true;
    }

    function transfer(address to, uint256 amt) external live(to) returns (bool ok) {
        uint256 b = _own[msg.sender];
        if (b < amt) revert Balance();
        unchecked { _own[msg.sender] = b - amt; _own[to] += amt; }
        emit Transfer(msg.sender, to, amt);
        ok = true;
    }

    function transferFrom(address from, address to, uint256 amt) external live(to) returns (bool ok) {
        uint256 cur = _cred[from][msg.sender];
        if (cur != type(uint256).max) {
            if (cur < amt) revert Allowed();
            unchecked { _cred[from][msg.sender] = cur - amt; }
        }
        uint256 b = _own[from];
        if (b < amt) revert Balance();
        unchecked { _own[from] = b - amt; _own[to] += amt; }
        emit Transfer(from, to, amt);
        ok = true;
    }

    function burn(uint256 amt) external {
        uint256 b = _own[msg.sender];
        if (b < amt) revert Balance();
        unchecked { _own[msg.sender] = b - amt; _tot -= amt; }
        emit Transfer(msg.sender, address(0), amt);
    }

    function burnFrom(address from, uint256 amt) external {
        uint256 cur = _cred[from][msg.sender];
        if (cur != type(uint256).max) {
            if (cur < amt) revert Allowed();
            unchecked { _cred[from][msg.sender] = cur - amt; }
        }
        uint256 b = _own[from];
        if (b < amt) revert Balance();
        unchecked { _own[from] = b - amt; _tot -= amt; }
        emit Transfer(from, address(0), amt);
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.