From bd8c1ad7029d27d7866687d3465f8a2cf2d74734 Mon Sep 17 00:00:00 2001 From: Amin Rezaei <66468076+AminRezaei0x443@users.noreply.github.com> Date: Tue, 7 Feb 2023 08:25:48 +0000 Subject: [PATCH] update: README --- README.md | 145 ++++++++++++++++++++++-------------------------------- 1 file changed, 59 insertions(+), 86 deletions(-) diff --git a/README.md b/README.md index f9ba36b..29a0967 100644 --- a/README.md +++ b/README.md @@ -2,114 +2,87 @@ # Rift -[![PyPI version](https://img.shields.io/badge/rift--framework-0.9.8-informational?style=flat-square&color=FFFF91&labelColor=360825)](https://pypi.org/project/rift-framework/) +[![PyPI version](https://img.shields.io/badge/rift--framework-0.9.9-informational?style=flat-square&color=FFFF91&labelColor=360825)](https://pypi.org/project/rift-framework/) [![Telegram](https://img.shields.io/badge/Telegram-@skyring__org-informational?style=flat-square&color=0088cc&labelColor=360825)](https://t.me/skyring_org) [![Telegram](https://img.shields.io/badge/Docs-docs.skyring.io/rift-informational?style=flat-square&color=6A0F49&labelColor=360825)](https://docs.skyring.io/rift/) + > _A magical **Python3** -> **TON** portal_ -Rift is smart contract development framework in Python for [TON (The Open Network)](https://ton.org). Its purpose is to make the development, testing, and deployment procedures much easier! - -## Goals -- To be a simple full-stack Python framework for developing on the TON ecosystem -- Make standard contract implementations available (similar to OpenZeppelin) -- Utilize Python's syntax to provide code reuse, understandable, and organized code that is simple to test - -## Overview -Rift's main purpose is to make contract building simpler for TON by bypassing the steep learning curve of `FunC`. Rift, by exploiting Python's OOP features, will enable you to create with more ease and less worry. In Rift, here is how the [Simple wallet contract](https://github.com/ton-blockchain/ton/blob/master/crypto/smartcont/wallet-code.fc) looks: - -```python -from rift import * - - -class SimpleWallet(Contract): - """ - Simple Wallet Contract. - - # config - get-methods: - - seq_no - - public_key - """ - - class Data(Model): - seq_no: uint32 - public_key: uint256 - - class ExternalBody(Payload): - signature: slice[512] - seq_no: uint32 - valid_until: uint32 - - data: Data - - def external_receive( - self, - in_msg: Slice, - ) -> None: - msg = self.ExternalBody(in_msg) - assert msg.valid_until > std.now(), 35 - assert msg.seq_no == self.data.seq_no, 33 - assert std.check_signature( - msg.hash(after="signature"), - msg.signature, - self.data.public_key, - ), 34 - std.accept_message() - while msg.refs(): - mode = msg >> uint8 - std.send_raw_message(msg >> Ref[Cell], mode) - self.data.seq_no += 1 - self.data.save() -``` +Rift is a full-stack development framework for [TON (The Open Network)](https://ton.org) that makes it easy for developers to use Python to develop, test, and deploy smart contracts on the TON network. With Rift, you can leverage the simplicity and versatility of Python to build and interact with TON, without having to learn the complexities of FunC or Fift. For examples of how Rift simplifies these processes, visit [Rift's website](https://rift.skyring.io). + +## Features + +- Develop smart contracts using Python syntax and OOP features +- Interact with the TON network to query data and deploy contracts +- Test smart contracts with an easy-to-use testing framework +- Standalone framework that only requires `Python 3.10` +- Can be used at any stage of the project, from development to testing to deployment ## Quick Start 0. Install `Python 3.10+` 1. Install `rift` -```bash -pip install rift-framework -# or from source -git clone https://github.com/sky-ring/rift -cd rift -pip install -e . -``` + ```bash + pip install rift-framework + # or from source + git clone https://github.com/sky-ring/rift + cd rift + pip install -e . + ``` 2. Initialize your project: -```bash -rift init -``` -3. Start developing your contracts in `/contracts/` -4. Build contracts and get the `FunC` contracts in `/build/` -```bash -# in project folder -rift build -``` + ```bash + rift init + ``` +3. Develop your contracts in `/contracts/` +4. Write your tests in `/tests/` +5. Place your deploy scripts in `/deployers/` +6. Use `rift` to build, test, or deploy: + ```bash + # in project folder + # builds TARGET + rift build TARGET + # tests TARGET + rift test TARGET + # deploys TARGET + rift deploy TARGET + ``` +7. For more information, visit the documentation website at [docs.skyring.io/rift](https://docs.skyring.io/rift). + +## Guides + +- Step-by-step guide on how to use `Rift` to develop on TON: [Link](https://rift.skyring.io/guide-full) +- Step-by-step guide on integrating `Rift` into existing `FunC` projects: [Link](https://rift.skyring.io/guide-func) ## Standard Contracts Implementation -- [x] Jetton Implementation ([jetton-impl](https://github.com/sky-ring/jetton-impl)) +- [x] Jetton Implementation ([jettons](https://github.com/sky-ring/jettons)) - [ ] NFT Implementation - [ ] DEX Implementation -## Documentation and Examples -Full documentation with specifications is being developed and will be available shortly! -Until then, you may look at standard contracts implementation; they cover the majority of the ideas required; if you're looking for more, take a glance at the 'test/' directory for some demonstrations of Rift's capabilities. - ## Roadmap -### Milestone 1: Python Framework for contract development +### Milestone 1: Python Framework for Contract Development +- [x] Semi One-to-One Mapping of Functions and Expressions (Base Compiler, Python -> FunC) +- [x] First Higher Layer over the Base Mappings to Simplify Type Calls (leveraging OOP Capabilities) +- [x] Second Higher Layer over the Base, Simplifying Contract Development towards Maximizing Code Reusability and Simplicity (leveraging Meta Programming Capabilities) +- [x] Providing Standard Smart Contracts Implementation with Rift + +### Milestone 2: Deploying, Testing, Interaction Capabilities +- [x] Simple Interaction Interface with TON Blockchain +- [x] Simple Deploying Options of Developed Contracts +- [x] Testing Framework for the Contracts Developed with Rift -- [x] Semi One-to-One mapping of functions and expressions (Base Compiler, Python -> FunC) -- [x] First higher layer over the base mappings to simplify type calls (leveraging OOP capabilities) -- [x] Second higher layer over the base, simplifying contract developments towards maximizing code reusability and simplicity (leveraging Meta programming capabilities) -- [x] Providing standard smart contracts implementation with Rift +### Milestone 3: What's Next? +- Stay Tuned! We have extra plans that we will share soon with the community to further develop `Rift`. -### Milestone 2: deploying, testing, interaction capabilities -- [x] Simple interaction interface with TON Blockchain -- [x] Simple deploying options of developed contracts -- [x] Testing framework for the contracts developed with Rift +## Support the Project +1. If `Rift` has been a lifesaver for you, giving it a star on GitHub is the ultimate high five! +2. You can also show your love by contributing to `Rift` through code, ideas, or even a kind word. +3. Feeling extra generous? Treat `Rift` to a coffee by donating to this TON address: `EQAIhZCDT7-pvweWh6c_76X7Dnv6Qlzt7-l1NNP8upZ_Areu` +4. Finally, spreading the word about `Rift` is a big boost for the project and helps us reach more people. ## Contributing -If you're interested in contributing to Rift, please see [CONTRIBUTING.md](https://github.com/sky-ring/rift/blob/main/CONTRIBUTING.md) for the necessary specifications and procedure. +If you're interested in contributing to Rift, please see [CONTRIBUTING.md](https://github.com/sky-ring/rift/blob/main/CONTRIBUTING.md) for the necessary specifications and procedures. ## Supporters Special thanks to the [TON Society](https://society.ton.org/) for their support and grant, without which the project would not be feasible.