Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 1.23 KB

File metadata and controls

38 lines (29 loc) · 1.23 KB

scripts

This project contains CKB smart contracts and unit tests.

Network & Constants Configuration

The contracts (e.g., vault-type) use network-specific constants such as ALWAYS_SUCCESS and xUDT code hashes. You can dynamically switch configurations at build time by passing the NETWORK variable:

1. Compile for Mainnet

make build NETWORK=mainnet

2. Compile for Testnet (Pudge)

make build NETWORK=testnet

3. Compile for Integration Testing

make build NETWORK=testing
# Or run tests directly (which automatically builds with the testing profile)
make test

4. Custom Devnet / Local Development

  • Option A: In contracts/vault-type/src/configs/, create a new configuration file (e.g., constants.mydevnet.rs). Fill in your custom hashes, and run:
    make build NETWORK=mydevnet
  • Option B: Directly edit src/constants.rs inside the contract directory, and build with NETWORK=custom (or simply omit NETWORK entirely, since by default it will not overwrite constants.rs):
    make build NETWORK=custom

This project was bootstrapped with ckb-script-templates.