This framework enables the development of smart contracts for the QF Network. For the smart contract platform implementation details, please refer to the PolkaVM pallet documentation.
For contributing to this project, please read Contributing section.
The QF Network executes smart contracts in the PolkaVM virtual machine and requires PolkaVM tools for smart contracts compilation.
-
Install
polkatool
.cargo install --git https://github.com/paritytech/polkavm.git --tag v0.21.0 polkatool
-
Build smart-contract
examples/hello-qf-polkavm
../build_polkavm.sh hello-qf-polkavm
Or compile manually:
export CRATE_NAME=hello-qf-polkavm mkdir -p output pushd "examples/${CRATE_NAME}" RUSTFLAGS="--remap-path-prefix=$(pwd)= --remap-path-prefix=${HOME}=~" \ cargo +nightly build \ -Z build-std=core,alloc \ --target $(polkatool get-target-json-path) \ -q --release --bin "${CRATE_NAME}" -p "${CRATE_NAME}" popd polkatool link \ --run-only-if-newer \ -s "examples/${CRATE_NAME}/target/riscv64emac-unknown-none-polkavm/release/${CRATE_NAME}" \ -o "output/${CRATE_NAME}.polkavm"
./build_polkavm.sh increment-counter
See guides.md for explaination on how to deploy smart contract on a QF Network Portal.
To run tests on a local network run:
cd cli
npx ts-node upload_and_execute.ts ws://127.0.0.1:9944 ../output/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 archive
We 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
main
branch 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! 🚀