A protocol for valuing on-chain contents, build on top of CKB. Check Spore Docs for a quick start.
Developers are recommended to use the Spore SDK for building applications with Spore, instead of directly interacting with the contracts. If you're interested in testing, extending the contracts, or deploying them on a local blockchain, feel free to explore the Development section for guidance.
Spore is an on-chain protocol to power digital asset ownership, distribution, and value capture. For more, check out https://spore.pro
This repo contains the Spore RFC, Spore Mutant RFC, Spore Cluster Proxy/Agent RFC, protocol types schema definition and implementation of Spore contracts written in Rust.
Before development, basic dependencies are required:
To build contracts, please run one of below commands:
$ capsule build # build in debug mode
$ capsule build --release # build in release mode for testnet
$ capsule build --release -- --features release_export # build in release mode for mainnet
To check native test cases, which are placed in tests, please run:
$ capsule test # test in debug mode
$ capsule test --release # test in release mode
If your development requires to be built on Spore, steps below are recommended:
- Writing a new Type contract
- Modify existed contracts
For method 1, the flow is:
- Run
capsule new-contract YOUR_CONTRACT_NAME
to initialize a new contract project - Modify
Cargo.toml
of your contract, and introducespore-types
,spore-utils
,spore-constant
- Implementing your contract rules in
entry.rs
- Writing new tests in
tests/src/tests.rs
. See existed test cases for how-to
The versioning philosophy is "Using code_hash as version" for Spore Protocol, which means the different code hash matches the different version.
Make sure you are using the proper version you want, because there's no such an "upgrade/downgrade" method but we suggest to use "destroy/reconstruct" method instead, which requires no modification of any fields in Spore cell.
Our forzen
versions of contract, which are our prior versions, can be found in directory ./deployment/frozen
. To describe more clearly, the frozen
information contains each avaliable code_hash
generated from Spore contracts. Historical version refers to here.
In addition, using Mutant contract requires the binary of Lua library. Information are recorded here. For simplicity, it's already deployed in the Pudge Testnet:
- tx_hash:
0x8fb7170a58d631250dabd0f323a833f4ad2cfdd0189f45497e62beb8409e7a0c
- index:
0
- data_hash:
0xed08faee8c29b7a7c29bd9d495b4b93cc207bd70ca93f7b356f39c677e7ab0fc
We provided a simple bash script to operate deployment through ckb-cli
toolchain, details refer to here