FuelLabs / sway-by-example

Examples of Sway programs

Home Page:sway-by-example.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sway-by-example

Examples of Sway programs

Development

npm i
nom run start

Production

npm run deploy

Memo

# md to react
npx ts-node --project ./scripts/tsconfig.json scripts/md-to-react.ts src/pages/array

# build routes
npx ts-node --project ./scripts/tsconfig.json scripts/build-routes.ts

TODO

  • update npm

  • Basic

    • variables (immutable, mut, type annotations)
    • built-in
      • primitive types (u64, bool, str[], b256)
      • compound type (tuple, struct, array)
    • blockchain types (Address, ContractId and Identity)
    • functions (return outputs, ref mut)
    • structs
    • tuples
    • enums
    • constants
    • configurable constants
    • std lib types - option
    • std lib types - result
    • control flow
      • if
      • match
      • while loop
    • logging
    • test in sway
  • Blockchain

    • msg_sender (ownership)
    • base asset (wallet)
    • native support for assets (wrapped token)
    • events
    • storage map (simple, nested)
    • vector (storage, heap) (nft)
    • hash
    • crypto signature (air drop)
    • calling contracts (multi sig)
      • call
      • low level call
    • function purity
    • identifier (address and contract id)
  • rename sway files from .rs to .sw

  • move hello-sway repo to here?

  • Integrate https://github.com/t4sk/hello-sway

About

Examples of Sway programs

sway-by-example.vercel.app

License:MIT License


Languages

Language:Solidity 60.1%Language:TypeScript 33.5%Language:Sway 2.6%Language:Rust 2.3%Language:CSS 0.8%Language:JavaScript 0.3%Language:Mustache 0.1%Language:HTML 0.1%Language:RenderScript 0.1%