Ideamarket Docs
  • Introduction
  • 1-minute onboarding
  • Selling old tokens & unstaking
  • Navigating the app
    • How to make a good post
    • Citations
    • Post page
    • User Profile
    • Why rate posts?
  • $IMO token
  • So we've posted your thought
  • Offical T-Shirt
  • Join us on Discord
  • Build with us!
  • Use Cases
    • The New News
    • The Last Internet Argument
    • DeSci credibility, citations, and income
    • DAOs: Activism-for-profit
    • Prediction markets for public opinion
    • Crazy ideas
  • Roadmap
    • Partnerships & Integrations
    • Global knowledge graph
    • Bounties
  • PHILOSOPHY
    • Future epistemology (Ribbonfarm)
    • Status vs Truth
    • Summary of hypotheses
    • Heat Death of the Infoverse
    • Sun vs Wind
    • Bullshit recapture technology
    • Mirroring the world brain
    • Increasing population-scale comprehension
    • Journalism must become the trust-earning business
    • Exit the intellectual mafia
    • An Open Letter to Revolutionaries
    • Ideamarket Art
    • Does Ideamarket "measure truth"?
    • Beware "cryptographic truth" and the ledger of record
    • Meme Vault
  • FAQ
    • Why Arbitrum?
  • Past Experiments
    • Social account markets
    • The URL Market
  • Contracts
    • Quantstamp Audit
    • Overview
    • Bonding curve
    • IdeaTokenFactory
    • IdeaTokenExchange
    • InterestManager
    • IdeaTokenVault
    • MultiAction
    • IdeaTokenNameVerifier
  • Legal
    • Terms of Service
Powered by GitBook
On this page

Was this helpful?

  1. Contracts

IdeaTokenNameVerifier

Each market has its own IdeaTokenNameVerifier which is a small contract performing basic checks on a token name. These name verifiers are used by the IdeaTokenFactory when a new token is listed. For example on the Twitter market the TwitterHandleNameVerifier is used to verify the token name is a valid Twitter handle (@ followed by 1-15 letters or numbers including "_". All lower-case) :

contract TwitterHandleNameVerifier is IIdeaTokenNameVerifier {
    /**
     * Verifies whether a string matches the required format
     *
     * @param name The input string (Twitter handle)
     *
     * @return Bool; True=matches, False=does not match
     */
    function verifyTokenName(string calldata name) external pure override returns (bool) {
        bytes memory b = bytes(name);
        if(b.length < 2 || b.length > 16) {
            return false;
        }

        if(b[0] != 0x40) { // @
            return false;
        }

        for(uint i = 1; i < b.length; i++) {
            bytes1 char = b[i];
            if (!(char >= 0x30 && char <= 0x39) && //9-0
                !(char >= 0x61 && char <= 0x7A) && //a-z
                !(char == 0x5F)) { //_
                
                return false;
            }
        }

        return true;
    }
}

If the token name verification is unsuccessful the IdeaTokenFactory will revert on addToken.

PreviousMultiActionNextTerms of Service

Last updated 4 years ago

Was this helpful?