Core Contract

SuperPiccellCore Contract

Overview

The SuperPiccellCore contract is a smart contract on the Ethereum blockchain that is designed to store various types of content in a decentralized manner. The content is categorized into six types: Character, Episode, Event, Item, Location, and Organization. Each piece of content has a unique ID and includes metadata such as encoding, content type, and revision. Please note that this is a prototype contract and is currently deployed on the Sepolia testnet, a development environment for Ethereum, and is subject to change in the future.

You can view the contract on the Sepolia testnet at the following links:

You can also interact with the contract using our Frontend Application (DApp) which is available at SuperPiccellCore DApp.

Frontend Application (DApp)

The frontend application (DApp) provides a user-friendly interface for interacting with the SuperPiccellCore contract. The DApp allows you to view all the contents stored in the contract in a more intuitive way compared to direct interaction with the blockchain. The DApp is built using the React JavaScript library and connects to the Ethereum blockchain using the ethers.js library.

To interact with the DApp, you will need a browser extension like MetaMask that allows your browser to connect to the Ethereum blockchain. Furthermore, you will need to switch your MetaMask network to the Sepolia network. You can add the Sepolia network to MetaMask by using chainlist or manually adding it from the settings menu.

Environment Requirements for the DApp

  • PC: MetaMask, Trust Wallet, Coinbase Wallet

  • Smartphone: MetaMask

Features

Function Name
Description

createContent

Creates new content. This function can only be called by the owner of the contract. Protected content or contract cannot be modified.

updateContent

pdates existing content. This function can only be called by the owner of the contract. It cannot update protected content.

deleteContent

Deletes content. This function can only be called by the owner of the contract. It cannot delete protected content.

getContent

Gets the content with the specified ID.

getAllContents

Gets all contents.

getContentsByContentType

Gets all contents that match the specified content type.

isContentProtected

Returns whether the content with the specified ID is protected or not.

Security Features

Function Name
Description

protectContract

Calling this function puts the contract into protection mode, preventing the creation, update, and deletion of content. This function can only be called by the owner of the contract.

protectContent

Marks specific content as protected, which prevents further updates or deletions of the content.

isContractProtected

Returns whether the contract is in protection mode.

Token Transfers

This contract can receive and send out Ether and ERC20 tokens. Token transfers can only be performed by the owner of the contract.

Function Name
Description

withdrawToken

Allows the owner to withdraw ERC20 tokens accidentally sent to the contract.

Data Structure of Contents

Each piece of content stored in the contract is represented as an instance of the Content struct. The Content struct has the following fields:

  • id (uint256): The unique identifier for the content. This ID is unique across all types of content.

  • exists (bool): A flag indicating whether the content exists. This is used internally by the contract.

  • encoding (string): The encoding of the content. Typically, this will be "UTF-8".

  • contentType (string): The type of the content. This could be one of "Character", "Episode", "Event", "Item", "Location", or "Organization".

  • content (string): This field contains the content data. The content is stored as a string. This string is a JSON string that encodes the content object.

  • revision (string): The revision of the content. This is typically set to "Genesis" when the content is first created.

  • createdAt (uint256): The timestamp (in seconds since the Unix epoch) when the content was created.

  • createdBy (address): The address of the user who created the content.

  • updatedAt (uint256): The timestamp (in seconds since the Unix epoch) when the content was last updated.

  • updatedBy (address): The address of the user who last updated the content.

You can retrieve the content with a specific ID by calling the getContent function and passing the ID as the argument.

Content Formats

In the SuperPiccellCore contract, the content field is a string that stores a JSON-encoded content object. The structure of the content object depends on the contentType. Here are the formats for each content type:

Character

{
    "name": "Kent",
    "full_name": "Kent Sawamura",
    "alias": "The Beard Daddy",
    "headline": "Kent is the father of the main character Maya and husband of Lisa.",
    "gender": "Male",
    "age": 35,
    "nationality": "Japan",
    "breed": null,
    "occupation": "System engineer",
    "favorite_food": "Eel, Soba, Tempura",
    "favorite_game": "Retro games from the 1990s, Bare Knuckle (Streets of Rage) - Mega Drive (GENESIS)",
    "personality": "Serious and clumsy",
    "admire": "Ian MacKaye",
    "description": "Kent is Maya's father and Lisa's husband. He is an old geek who loves 1980s and 1990s pop culture and punk rock. He loved early HardCorePunk and was an avid fan of Straight Edge when he was younger. He is usually an average systems engineer. He works for Halliday Technologies, a subsidiary of OIO, where he primarily maintains \"Dapp\", which has become an obsolete technology. His mother died of an incurable illness during his childhood and his father disappeared."
}

Episode

{
    "episode_number": 1,
    "title": "The Beginning of Adventure",
    "subtitle": "Prologue",
    "content": [
        "There exists a star, blossoming with advanced civilization, located at the far reaches of the universe. The inhabitants of this star have been passionately engaged in the development of science and technology, relishing its fruits, since they passed a turning point called the Singularity over half a century ago.",
        "The virtual reality space \"Metaverse\" now comprises not just a part of people's lives, but the majority of it. Aside from time spent sleeping and eating, people spend most of their time in the Metaverse. Here, they work and enjoy traveling, hold music concerts, and experience love. The Metaverse mimics all aspects of the real world and sometimes even offers experiences that transcend it."
    ]
}

Event

{
    "year": 2006,
    "event": [
        "Birth of Haraboji."
    ],
    "note": null
}

Item

{
    "name": "Super Piccell Protocol",
    "alias": "SPP",
    "headline": "Super Piccell Protocol",
    "developer": "OIO (Kai Sawamura)",
    "release_year": 2067,
    "owner": "MMC (Multi-Metaverse Council)",
    "description": "Super Piccell Protocol is a large-volume encrypted data ultra-high-speed transfer protocol developed by OIO co-founder \"Kai Sawamura\". After Kai's disappearance, Dr. Dyson took over this development project and released it. By introducing this protocol into MVCE (Multi-Verse Connect Engine), seamless transfer of large-volume cryptographic data in multi-metaverse becomes possible. In addition, when used in conjunction with MD (Material Digitizer), it will be possible to digitize materials and transfer them to the metaverse for use."
}

Location

{
    "name": "Sawamura House",
    "alias": "Maya's House",
    "headline": null,
    "address": "Hyakunincho, Shinjuku-ku, Tokyo",
    "description": "This is the house where Maya, Kent and Lisa live. It is a rented house and the landlord is Haraboji.",
    "note": null
}

Organization

{
    "name": "Object Inovative Online",
    "alias": "OIO",
    "headline": "Object Inovative Online",
    "founder": "Kai Sawamura, Miles Dyson",
    "year_founded": 2057,
    "number_of_members": 52534,
    "representative": "Owen Bryant",
    "description": "OIO is a tech company founded by Kai and Dr. Dyson in their youth. The organization is currently headed by Bryant, who is also the MMC Supreme Chairman. It is one of the world's leading tech companies with the development of \"Multi-Verse Connect Engine\" and \"Material Digitizer\".",
    "note": null
}

Last updated

Was this helpful?