Skip to content

EasyA-Tech/sui-handbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

The Sui Handbook

Welcome. This is EasyA's legendary handbook. If you want to learn Sui like a legend, then you're in the right place.

Purpose

This handbook serves as a guide to the Sui ecosystem, geared towards those just joining for the first time. It isn't just a beginners' handbook; it's a legendary handbook. Even if you've already immersed yourself in the ecosystem, you'll find tons of helpful tidbits around here!

The EasyA App

Of course, the best place to start is always the EasyA app! Download it here for the fastest and most fun way to learn about Sui. Download it directly right here!

Table of Contents

Introduction

What is Sui:

  • Sui Website - The official website providing an overview of Sui.

Getting Started

The no-fluff starter:

  • Installation - Official guide to install Sui and start developing.
  • Learn - Comprehensive learning resources for understanding Sui's architecture and concepts.
  • Sui Move by Example - A practical guide to learning Sui Move through examples.

Core Concepts

Explanation of fundamental concepts in the Sui ecosystem:

  • Programming with Objects - Learn about Sui's object-centric model for smart contract development.
  • Move Patterns - A book on Move software design patterns, applicable to Sui development.

Development Tools

Key tools and environments for Sui:

  • Sui CLI - Command-line interface for interacting with the Sui network.
  • Sui Explorer - Official block explorer for the Sui network.
  • Move Analyzer VSCode Extension - Enhances the development experience for Move and Sui Move in Visual Studio Code.

Smart Contracts

How to write and deploy smart contracts on Sui:

  • Sui Smart Contracts - Guide to writing and deploying smart contracts using Sui Move.
  • Move Book - Comprehensive guide to the Move programming language.

Sui Network

Going into the network level:

Ecosystem Projects

Cool projects built on Sui:

  • Sui Wallet - Official wallet for managing assets on the Sui network.
  • Cetus - Decentralized exchange built on Sui.
  • Scallop - Lending protocol on Sui.

...and of course many more - check them out in the EasyA app!

Resources

Extra stuff:

  • Sui Blog - Official blog with updates and insights into Sui development.
  • Sui GitHub - The main repository for Sui's development.

Handy Code Snippets

Get a taste of Sui development with these code snippets:

Creating a simple coin

module examples::mycoin {
    use sui::coin;

    /// The type identifier of coin. The coin will have a type
    /// tag of kind: `Coin<package_object::mycoin::MYCOIN>`
    /// Make sure that the name of the type matches the module's name.
    public struct MYCOIN has drop {}

    /// Module initializer is called once on module publish. A treasury
    /// cap is sent to the publisher, who then controls minting and burning
    fun init(witness: MYCOIN, ctx: &mut TxContext) {
        let (treasury, metadata) = coin::create_currency(
            witness,
            6,                // decimals
            b"MYC",           // symbol
            b"My Coin",       // name
            b"Don't ask why", // description
            option::none(),   // icon url
            ctx
        );

        // transfer the `TreasuryCap` to the sender, so they can mint and burn
        transfer::public_transfer(treasury, ctx.sender());

        // metadata is typically frozen after creation
        transfer::public_freeze_object(metadata);
    }
}

Init function

module examples::init_function {
    /// The one of a kind - created in the module initializer.
    public struct CreatorCap has key {
        id: UID
    }

    /// This function is only called once on module publish.
    /// Use it to make sure something has happened only once, like
    /// here - only module author will own a version of a
    /// `CreatorCap` struct.
    fun init(ctx: &mut TxContext) {
        transfer::transfer(CreatorCap {
            id: object::new(ctx),
        }, ctx.sender())
    }
}

These examples showcase:

  1. How to create a simple coin on Sui.
  2. How to write an init function.

Contributing

We welcome contributions to make this handbook even more legendary! Here's how you can contribute:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/amazing-addition)
  3. Make your changes
  4. Commit your changes (git commit -am 'Add some amazing feature')
  5. Push to the branch (git push origin feature/amazing-addition)
  6. Create a new Pull Request

Please ensure your contributions align with our code of conduct and contribution guidelines.

Credit/Inspiration

This handbook was inspired by the famous awesome lists by sindresorhus and the Awesome Sui list. We need awesome lists for Web3 ecosystems, with more of a hacker's guide to how they work. This is the answer to that need.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published