Skip to content
Verified contractPartialMIT

StartAProject

Address0x47cc1db48719084c9ea5ed2d96181188a91ca39d
Balance

0 ETH

 

Transactions

4

 

Compiler

solc 0.8.36

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.36+commit.8a079791
Language
solidity
Optimization
Yes, 200 runs
EVM version
prague
Via IR
yes
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,465,320
Creation transaction
0x1e00758299…a76a035d63

src/StartAProject.sol

// SPDX-License-Identifier: MIT
//
//  sap.fun | start a project
//
//  web: https://sap.fun
//  x:   https://x.com/LaunchWithSAP
//
pragma solidity ^0.8.24;

/// @title StartAProject — the sap.fun flagship token ($SAP)
/// @notice Plain fixed-supply ERC-20 with a one-way trading switch:
///         - full supply mints to the deployer
///         - transfers are blocked until openSapTrading() EXCEPT for addresses
///           the owner exempts (deployer + Uniswap position manager), so
///           liquidity can be seeded before the public can trade
///         - openSapTrading() is one-way; after it fires the token is a
///           completely standard, unstoppable ERC-20 (no tax, no pause,
///           no blacklist), and the owner can renounce
contract StartAProject {
    string public constant name = "Start-a-Project";
    string public constant symbol = "SAP";
    uint8 public constant decimals = 18;
    uint256 public immutable totalSupply;

    address public owner;
    bool public tradingEnabled;
    mapping(address => bool) public isExempt;

    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);
    event TradingEnabled();
    event ExemptSet(address indexed account, bool exempt);
    event OwnerChanged(address owner);

    constructor(uint256 supply_) {
        owner = msg.sender;
        totalSupply = supply_;
        balanceOf[msg.sender] = supply_;
        isExempt[msg.sender] = true;
        emit Transfer(address(0), msg.sender, supply_);
    }

    modifier onlyOwner() {
        require(msg.sender == owner, "SAP: not owner");
        _;
    }

    function openSapTrading() external onlyOwner {
        tradingEnabled = true;
        emit TradingEnabled();
    }

    function setSapExempt(address account, bool exempt) external onlyOwner {
        isExempt[account] = exempt;
        emit ExemptSet(account, exempt);
    }

    /// @param newOwner address(0) renounces ownership entirely.
    function setSapOwner(address newOwner) external onlyOwner {
        owner = newOwner;
        emit OwnerChanged(newOwner);
    }

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

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

    function transferFrom(address from, address to, uint256 value) external returns (bool) {
        uint256 allowed = allowance[from][msg.sender];
        if (allowed != type(uint256).max) {
            require(allowed >= value, "SAP: insufficient allowance");
            allowance[from][msg.sender] = allowed - value;
        }
        _transfer(from, to, value);
        return true;
    }

    function _transfer(address from, address to, uint256 value) internal {
        require(to != address(0), "SAP: transfer to zero");
        require(tradingEnabled || isExempt[from] || isExempt[to], "SAP: trading not enabled");
        uint256 bal = balanceOf[from];
        require(bal >= value, "SAP: insufficient balance");
        unchecked {
            balanceOf[from] = bal - value;
            balanceOf[to] += value;
        }
        emit Transfer(from, to, value);
    }
}
Compiler settingsShow
{
  "viaIR": true,
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "prague"
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.