The SDK simplifies the development of native Rust smart contracts on QF Network. Smart contract functionality in QF Network is implemented using pallet-revive from Polkadot SDK / Substrate. See pallet-revive-uapi for reference documentation on the API available to smart contract developers.
To contribute to this project, please read the Contributing section.
To create your first project using this SDK, see examples/increment-counter/README.md.
Existing and planed features.
- Simplified smart contract project compilation
- Essentials: allocator, panic handler
-
exportmacro which simplifiescallanddeploydefinitions - Improved storage layer API (typed / structs-based, instead of key-value API of the
pallet-revive-uapi) - JavaScript / TypeScript client library generation
- Contract address prediction, see #26.
- Examples
- Deployment and testing tools
To compile a smart contract we need to install a correct version of polkatool (it should match chain's pallet-revive version) and run a script that configures environment and invokes it with correct arguments.
-
Install
polkatoolcargo install --git https://github.com/paritytech/polkavm.git --tag v0.21.0 polkatool
-
Build a smart contract from
examples/increment-counter./build_polkavm.sh increment-counter -
The
*.polkavmbinary for the deployment should be available at the following pathoutput/increment-counter.polkavm
Run the node with pallet-revive logs and historical state.
qf-node --dev -lerror,runtime::revive::strace=trace,runtime::revive=debug --state-pruning archiveWe welcome contributions of all kinds! Whether you're reporting or fixing a bug, adding a feature, or improving documentation, your help is greatly appreciated. For a bug or vulnerability report please open a new issue.
For code contributions please follow these steps:
- Fork the repository and create a new branch following the format
your-github-name/descriptive-branch-name(e.g.,qf-polkavm-sdk/fix-123). - Make smaller commits with clear messages to simplify reviewer's work.
- Submit a pull request targeting
mainbranch and provide a concise description of your changes.
By contributing, you agree to adhere to our Contributor Covenant Code of Conduct, which fosters a respectful and inclusive environment.
We appreciate your support and look forward to your contributions! 🚀