https://github.com/parallelchain-io/example-smart-contracts
Examples of Smart Contracts Created by ParallelChain Lab to use with ParallelChain Mainnet SDK
https://github.com/parallelchain-io/example-smart-contracts
Last synced: 25 days ago
JSON representation
Examples of Smart Contracts Created by ParallelChain Lab to use with ParallelChain Mainnet SDK
- Host: GitHub
- URL: https://github.com/parallelchain-io/example-smart-contracts
- Owner: parallelchain-io
- License: apache-2.0
- Created: 2022-04-01T08:26:55.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-07T02:07:57.000Z (over 2 years ago)
- Last Synced: 2024-04-18T12:53:06.434Z (about 2 years ago)
- Language: Rust
- Size: 53.7 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Example ParallelChain F Smart Contracts
## Chapter 1: HelloContract
HelloContract goes through the steps of creating a simple smart contract with the use of `pchain_sdk` macros, including `contract`, `contract_methods`, and `call`.
## Chapter 2: MyLittlePony
MyLittlePony demonstrates how we define entrypoint methods and fields as data in contract storage. It goes through how a contract struct can be defined, as well as the use of `contract_field` macros. It also introduces different ways of getting and setting data in contract storage.
## Chapter 3: MyBank
MyBank simulates banking operations with data stored in ParallelChain Mainnet. We combine the knowledge from the previous chapters and provide the basic functionalities of a bank.
## Chapter 4: ContractProxy
ContractProxy introduces the use of the `use_contract` macro to interact with other contracts. We make use of the MyLittlePony smart contract from Chapter 2 to demonstrate the interaction between two contracts.
## Chapter 5: MyCollections
MyCollections illustrates the functionalities of collections provided by `pchain_sdk`. The collection structures are designed for gas efficiency, they include `Cacher`, `Vector`, `FastMap`, and `IterableMap`.
## Chapter 6: MyPool
MyPool shows how network commands are used in smart contracts. It demonstrates how they can be created in smart contracts and explains their characteristics.