ClarityVersion
Enum specifying the version of Clarity used to deploy a smart contract.
Usage
import { ClarityVersion, makeContractDeploy } from '@stacks/transactions';
const transaction = await makeContractDeploy({
// ...
clarityVersion: ClarityVersion.Clarity6,
});Notes
makeContractDeployandmakeUnsignedContractDeploydefaultclarityVersiontoClarityVersion.Clarity4in 7.6.0. SetclarityVersionexplicitly to deploy under Clarity 5 or Clarity 6.A contract that uses a Clarity 6 function, or the
with-stakingandwith-poxallowances, must be deployed withClarityVersion.Clarity6.with-stackingremains valid in Clarity 4 and 5 contracts.
Definition
enum ClarityVersion {
Clarity1 = 1,
Clarity2 = 2,
Clarity3 = 3,
Clarity4 = 4,
Clarity5 = 5,
Clarity6 = 6,
}Values
Clarity1
1
Original Clarity version
Clarity2
2
Clarity 2 with additional features
Clarity3
3
Clarity 3 (Nakamoto)
Clarity4
4
Clarity 4
Clarity5
5
Clarity 5, enabled with Stacks epoch 3.4
Clarity6
6
Clarity 6, enabled with Stacks epoch 4.0 (SIP-044). Adds ed25519-verify, secp256k1-decompress?, get-bitcoin-tx-output? and verify-merkle-proof, makes concat variadic, and replaces the with-stacking allowance with with-staking and with-pox. Details on Epoch 4.0 Consensus Changes.
Availability
Clarity4
@stacks/transactions 7.3.0
Clarity5
@stacks/transactions 7.4.0, Stacks epoch 3.4
Clarity6
@stacks/transactions 7.5.0, Stacks epoch 4.0
Last updated
Was this helpful?