Super Piccell Core Project
  • 👋Introduction
    • Welcome
    • Introduction
    • Guidelines
    • Roadmap
  • đŸ•šī¸Contents
    • Element
      • Characters
        • Kent
        • Maya
        • Lisa
        • Haraboji
        • Sho
        • Yona
        • Chunyan
        • Yichen
        • Bryant
        • Mr. and Mrs. Chen
        • Saariyah
        • Dr. Dyson
        • Kai
        • Alice
        • Bobby
      • Organizations
        • OIO
        • Unchained
        • MMC
        • BIIO
        • NMI
      • Locations
        • Sawamura House
        • Pongle Bongle Store
        • Tower "The Metaverse Bridge"
        • Multi-Metaverse Council Headquarters Hall
        • Nag-Won
        • Ovi-Wan
      • Items
        • SPP
        • MVCE
        • MD
        • Ema
        • MoVir
    • Story
      • Episodes
        • 1. The Beginning of Adventure
        • 2-1. Clash in the Metaverse
        • 2-2. Into the Abyss
        • 2-3. Entwined Destinies
        • 3. Bond of Family and Oath of Revenge
        • 4. Destruction, Rebirth, and the Light of Hope
      • Relationship Chart
      • Events
    • Music
  • đŸĻˆCrypto
    • Smart Contract
      • Core Contract
  • đŸī¸Resources & Links
    • Getting Started
    • Communities & Social Media
    • Press Kit
    • Links
Powered by GitBook
On this page
  • SuperPiccellCore Contract
  • Overview
  • Features
  • Security Features
  • Token Transfers
  • Data Structure of Contents
  • Content Formats

Was this helpful?

  1. Crypto
  2. Smart Contract

Core Contract

PreviousSmart ContractNextGetting Started

Last updated 8 months ago

Was this helpful?

SuperPiccellCore Contract

This documentation is for a prototype contract and the specifications may be updated.

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 .

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.

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
}

In the actual contract, the content field is a string that contains a JSON string representing the content object. These examples are presented as objects for clarity, but when you interact with the contract, you will need to encode these objects as JSON strings before saving them to the contract, and decode them back into objects after retrieving them.

This means that when you get the content data from the contract, it will be a JSON string. You will need to parse this string into a JavaScript object (or the equivalent in your programming language) in order to interact with the content data. For example, in JavaScript, you would use JSON.parse(contentString) to convert the JSON string into an object.

Similarly, before saving content to the contract, you will need to convert your content object into a JSON string. In JavaScript, you would use JSON.stringify(contentObject) to do this.

Remember to always handle the content data as a JSON string when interacting with the SuperPiccellCore contract directly.

Although in theory it's possible to store any form of data in the content field, including images that have been converted to a base64 string, due to the high gas costs associated with storing large amounts of data on the blockchain, it is recommended to only store text-based content. Attempting to store large images or other forms of large data can lead to extremely high transaction costs. Therefore, the SuperPiccellCore contract is primarily designed to store text-based contents.

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 or manually adding it from the settings menu.

đŸĻˆ
chainlist
SuperPiccellCore Contract GitHub repository
SuperPiccellCore Contract on Sepolia Etherscan
SuperPiccellCore DApp