• Stars
    star
    407
  • Rank 106,183 (Top 3 %)
  • Language
    Rust
  • License
    Other
  • Created over 3 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Scrypto is the asset-oriented smart contract programming language of the Radix network. It allows you to quickly build secure and composable dApps.

Scrypto

CI

Language for building DeFi apps on Radix.

Documentation: https://docs-babylon.radixdlt.com/main/scrypto/introduction.html

Installation

  1. Install Rust - this requires Rust 1.60+ (if rust is already installed, upgrade with rustup update)
    • Windows:
    • macOS:
      • Make sure you have the xcode command line tools: xcode-select --install.
      • Install cmake: brew install cmake
      • Install the Rust compiler:
          curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    • Linux:
      • Make sure a C++ compiler, LLVM and cmake is installed (sudo apt install build-essential llvm cmake).
      • Install the Rust compiler:
      curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Enable cargo in the current shell:
    • Windows:
      • Start a new PowerShell
    • Linux and macOS:
      source $HOME/.cargo/env
      
  3. Add WebAssembly target
    rustup target add wasm32-unknown-unknown
    
  4. Install simulator
    git clone https://github.com/radixdlt/radixdlt-scrypto.git
    cd radixdlt-scrypto
    cargo install --path ./simulator
    
  5. (Optional) Open Scrypto documentation for later use
    ./doc.sh
    

Getting Started

If you want a quick walkthrough of how to deploy and run some code, please see the Run Your First Project tutorial. If you prefer to soldier through on your own, keep reading below.

Writing Scrypto Code

  1. Start by creating a new package:
scrypto new-package <package_name>
cd <package_name>
  1. Check out the files under your current directory:
  • Source code is within src/lib.rs;
  • Test code is within tests/lib.rs.
  1. Build your package:
scrypto build
  1. Run tests:
scrypto test

Playing with Radix Engine

Action Command
Create an account resim new-account
Change the default account resim set-default-account <account_address> <account_public_key>
Create a token with fixed supply resim new-token-fixed <amount>
Create a token with mutable supply resim new-token-mutable <minter_resource_address>
Create a badge with fixed supply resim new-badge-fixed <amount>
Create a badge with mutable supply resim new-badge-mutable <minter_resource_address>
Mint resource resim mint <amount> <resource_address> <minter_resource_address>
Transfer resource resim transfer <amount> <resource_address> <recipient_component_address>
Publish a package resim publish <path_to_package_dir>
Call a function resim call-function <package_address> <blueprint_name> <function> <args>
Call a method resim call-method <component_address> <method> <args>
Export the definition of a package resim export-package-definition <package_address> <output>
Show info about an entity resim show <id>
List all entities in simulator resim show-ledger
Reset simulator state resim reset

Note: The commands use the default account as transaction sender.

Project Layout

  • sbor: The binary data format used by Scrypto.
  • sbor-derive: Derives for encoding and decoding Rust struct and enum.
  • scrypto: Scrypto standard library.
  • scrypto-schema: Scrypto package schema.
  • scrypto-derive: Derives for defining and importing Scrypto blueprints.
  • radix-engine: The Scrypto execution engine.
  • simulator: A simulator that run Scrypto code on a filesystem based ledger.
  • transaction: Radix transaction manifest compiler, transaction models, signing and validationg logic.

Contribute

To learn more about how to contribute to this project, read the Contributing Guide.

License

This software/code is licensed and used pursuant to the Radix License, Version 1.0 and includes modified third party work which is reproduced here pursuant to the Apache 2.0 licensing regime. Where third party software has been used this is identified together with the appropriate open-source licence.

A copy of the Radix License, Version 1.0 may be found in the LICENSE file in the root directory of this repository.

More Repositories

1

olympia-node

Radix monorepo
Java
142
star
2

community-scrypto-examples

A place for the community to upload example Scrypto code
Rust
96
star
3

radixdlt-java

A Java/Android Client library for interacting with a RADIX Distributed Ledger.
Java
75
star
4

scrypto-challenges

Compete with other Scrypto devs and claim your place among the Scrypto champions
Rust
63
star
5

scrypto-examples

Rust
57
star
6

radixdlt-js

A Javascript Client library for interacting with a RADIX Distributed Ledger.
TypeScript
44
star
7

babylon-wallet-ios

iOS wallet for Radix DLT.
Swift
32
star
8

radixdlt-core

Radix core consensus and networking layer
Java
31
star
9

babylon-node

The Radix node, updated for Babylon. Embeds the Radix engine which lives at https://github.com/radixdlt/radixdlt-scrypto.
Java
26
star
10

radix-dapp-toolkit

TypeScript
26
star
11

desktop-wallet

Radix DLT desktop wallet
Vue
24
star
12

radix-engine-toolkit

A Rust library with multiple compilation targets that aims to make the creation and decompilation of transactions possible with clients written in any language.
Rust
21
star
13

docs

Radix DLT Knowledge Base
19
star
14

radixdlt-js-lite

DEPRECATED - A Javascript lite Client library for interacting with a RADIX Distributed Ledger through the Desktop Wallet.
JavaScript
18
star
15

radixdlt-nginx

Dockerfiles and docker-compose files + other glue to make it all stick together
Shell
15
star
16

radixdlt-wallet-android

Radix DLT Android Wallet
Kotlin
15
star
17

olympia-gateway

C#
15
star
18

babylon-gateway

The Radix Network Gateway for the Babylon network.
C#
15
star
19

radixdlt-javascript

A TypeScript client library for interacting with Radix DLT's public and decentralized Ledger/network.
TypeScript
14
star
20

typescript-radix-engine-toolkit

A TypeScript wrapper for the Radix Engine Toolkit that provides an idiomatic interface for the toolkit
TypeScript
14
star
21

node-runner

Repo containing software to aid node runners
Python
11
star
22

olympia-wallet

Vue
9
star
23

babylon-wallet-android

Kotlin
9
star
24

connector-extension

Only used with the Radix Wallet mobile app. Link Wallet Connector to your wallet to use dApps in Chrome, or use Ledger devices.
TypeScript
9
star
25

wallet-sdk

The Wallet SDK for dApp developers building on Radix.
TypeScript
9
star
26

mtps

The Million TPS Project Code (except RadixCore)
JavaScript
9
star
27

scrypto_tutorial

Code used for the Scrypto tutorial during developer events
Rust
9
star
28

connect-button

TypeScript
8
star
29

Ignition

Rust
8
star
30

radixdlt-swift-archive

A Swift library for interacting with a Radix Distributed Ledger (DLT).
Swift
8
star
31

radix-engine-library

radix-engine-library is an engine for real-time, distributed state machines.
Java
6
star
32

experimental-examples

Partial examples, snippets, and basic implementations of concepts which are provided to help with specific concepts, and may not be maintained
TypeScript
6
star
33

gumball-club

TypeScript
6
star
34

babylon-alphanet

TypeScript
6
star
35

radixdlt-kotlin

DEPRECATED: A Kotlin Client library for interacting with a RADIX Distributed Ledger compatible with Kotlin/Java projects and all versions of Android.
Kotlin
6
star
36

radix-transaction-manifest-extension

A VS Code extension that adds support for Radix's transaction manifests adding features such as an Id validator, syntax highlighting, syntax diagnostics, formatting, and other features.
TypeScript
5
star
37

official-examples

Examples for any part of the stack which are officially maintained
Rust
5
star
38

app-radix

Radix Ledger Nano app
C
5
star
39

sargon

Rust
5
star
40

radixdlt-js-server-example

An example server using Express.js
JavaScript
4
star
41

create-radix-dapp

Starter template for generating a vanilla JS and Scrypto dApp project
JavaScript
4
star
42

babylon-pte

Babylon Public Test Environment (PTE) is a simple public network simulator for the Radix Engine
TypeScript
4
star
43

react-connect-button

Example integration of Radix Connect Button and React application
TypeScript
4
star
44

android-client-sample

Samples using Radix DLT client libraries
Kotlin
3
star
45

babylon-nodecli

Repo containing software to aid node runners
Python
3
star
46

swift-engine-toolkit

Swift wrapper around Rust Transaction Compiler/Decompiler library
Swift
3
star
47

rola-examples

TypeScript
3
star
48

scrypto-demos

The code used for the Scrypto webinars and demos.
Rust
3
star
49

wallet-compatible-derivation

Library and CLI tool for generating Radix Babylon Accounts.
Rust
3
star
50

foo-hack

In June 2022, three members of the Scrypto community teamed up with redfoo to build a decentralized chess system using Scrypto
Rust
3
star
51

radixdlt-js-docs

2
star
52

radix-engine-toolkit-examples

This repository contains example usages of the transaction library in a number of different languages.
2
star
53

python-core-client

Python
2
star
54

open-rpc-spec

The shared OpenRPC specification used for the Radix code API.
JavaScript
2
star
55

radixdlt-pos-android

Android point of sale app to accept payments via NFC cards using a RADIX Distributed Ledger
Kotlin
2
star
56

scrypto101-exercises

Here are stored all the exercises for the Scrypto 101 course along with their solution.
Rust
2
star
57

radixdlt-js-lite-skeleton

DEPRECATED - Minimal sample App to showcase some of the things that can be done with the RADIX JavaScript lite Client library.
JavaScript
2
star
58

angular-connect-button

Example integration of Radix Connect Button and Angular application
TypeScript
2
star
59

babylon-ledger-app

Ledger Nano S/S Plus/X app for Babylon
Rust
2
star
60

radixdlt-js-skeleton

DEPRECATED - Minimal sample App to showcase some of the things that can be done with the Radix JavaScript client library.
JavaScript
2
star
61

radixdlt-card-applet

Java Card applet for radix payments.
Java
1
star
62

rola

TypeScript
1
star
63

radix-connect-webrtc

TypeScript
1
star
64

svelte-connect-button

A radix connect button example using SvelteKit
Svelte
1
star
65

SLIP10-Android

SLIP10 implementation for Android
Kotlin
1
star
66

CardsAgainstHumanity-SwiftUI

CardsAgainstHumanity front end client in SwiftUI
Swift
1
star
67

vue-connect-button

Example integration of Radix Connect Button and Vue3 application
Vue
1
star
68

radixdlt-java-common

Models, utils and infrastructure code shared by all our Java libraries
Java
1
star
69

escrow-exercise-boilerplate

Rust
1
star