Skip to content
Merged
Show file tree
Hide file tree
Changes from 90 commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
475d401
Merge branch 'develop' of https://github.com/stacks-network/stacks-co…
jferrant Sep 18, 2025
35534ab
feat: initial implementation for `restric-assets?`
obycode Sep 15, 2025
9672363
feat: add syntax and type-checking for `as-contract?` and allowances
obycode Sep 18, 2025
e4fc430
chore: fix formatting
obycode Sep 19, 2025
e29ec16
fix: add Clarity4 version of test contract
obycode Sep 19, 2025
196e71e
feat: initial implementation of allowances
obycode Sep 20, 2025
0a141ae
fix: remove ASTRules
obycode Sep 21, 2025
7e8698f
fix: error in docs example
obycode Sep 21, 2025
204e848
fix: copy/paste error
obycode Sep 22, 2025
771262c
feat: update `with-nft` to support list of identifiers
obycode Sep 22, 2025
b450cd1
test: add tests for ft and nft post-conditions
obycode Sep 22, 2025
11c4b14
feat: add checks for max number of allowances and max NFT identifiers
obycode Sep 22, 2025
1afa168
fix: update test and fix clippy issues
obycode Sep 22, 2025
156724d
test: ignore `with-stacking` in doc examples tests
obycode Sep 22, 2025
df2b581
fix: typo in tests
obycode Sep 22, 2025
b20511e
feat: implement tracking of stacking for post-conditions
obycode Sep 22, 2025
b396d86
feat: add support for "*" wildcard in allowances
obycode Sep 23, 2025
dd13789
fix: add stacking allowance check
obycode Sep 24, 2025
103027c
test: add integration test for `with-stacking` allowances
obycode Sep 25, 2025
c4fb73d
refactor: return `uint` error from post-conditions
obycode Sep 25, 2025
22449dd
fix: handle errors in `restrict-assets?` and `as-contract?` body
obycode Sep 25, 2025
0060129
chore: fix clippy and formatting
obycode Sep 25, 2025
489793b
test: begin adding rollback integration tests
obycode Sep 27, 2025
ce562a3
test: additional rollback tests
obycode Sep 27, 2025
7806db3
docs: update doc example
obycode Sep 30, 2025
610c421
refactor: use non-panicking array access
obycode Sep 30, 2025
43b17c5
test: add `cheeck_as_contract_rollback` integration test
obycode Sep 30, 2025
a65dda4
test: add integration tests for `stack-stx` allowances
obycode Oct 1, 2025
4799797
Merge branch 'develop' into feat/restrict-assets
obycode Oct 1, 2025
c824cde
chore: remove todo for event on allowance violation
obycode Oct 1, 2025
a6afc03
chore: formatting
obycode Oct 1, 2025
4f8dfff
WIP: add consensus_test macro
Jiloc Oct 3, 2025
8bdc1d1
use TxTypes for TransactionFactory
Jiloc Oct 6, 2025
79ae07d
Merge branch 'feat/aac-tests-with-insta' into feat/improve-consensus-…
Jiloc Oct 6, 2025
d9eb380
remove unused snap
Jiloc Oct 6, 2025
6977d1a
Merge branch 'develop' into feat/improve-consensus-test-api
Jiloc Oct 7, 2025
4e37cef
fix contract_call_to_all_epochs
Jiloc Oct 7, 2025
e5e2a24
rewrite empty_blocks test with consensus_test
Jiloc Oct 7, 2025
b9fb5ab
Fix Nix builds and add more CLIs
adriano-stacks Oct 7, 2025
1bb7353
Merge branch 'develop' into feat/contrib_nix_clis
adriano-stacks Oct 8, 2025
5c6c36c
Merge branch 'develop' into feat/improve-consensus-test-api
Jiloc Oct 8, 2025
a5d8406
WIP: add consensus_test_contract_exec_helper
Jiloc Oct 9, 2025
423f5a1
Merge branch 'develop' into feat/improve-consensus-test-api
Jiloc Oct 9, 2025
7c47871
fix: various improvements suggested in PR review
obycode Oct 9, 2025
0a44836
test: `with-nft` with wrong identifier type
obycode Oct 9, 2025
9e95356
doc: add more detail to `with-stacking` doc
obycode Oct 9, 2025
8277efd
Make access to Nakamoto staging blocks restricted to one single pub e…
jferrant Oct 9, 2025
16b5ee0
Add explicit comments to NakamotoStagingBlocksTx priv fns
jferrant Oct 9, 2025
6b97225
refactor: use `Vec<Value>` for allowances
obycode Oct 9, 2025
fbe687f
Merge branch 'develop' into feat/restrict-assets
obycode Oct 9, 2025
01356c8
fix: update consensus snapshots
obycode Oct 9, 2025
8044f76
fix: update other consensus snapshots
obycode Oct 9, 2025
149ef77
test: aac add insta static reduction for vm_error, #6568
fdefelici Oct 10, 2025
c168a26
chore: make storage keys public
hugoclrd Oct 10, 2025
bd4722f
Merge branch 'bug/fix-consensus-test-canonical-tip' into feat/improve…
Jiloc Oct 10, 2025
286703c
Merge branch 'develop' into feat/improve-consensus-test-api
Jiloc Oct 10, 2025
8a6ec15
remove experimental expect_same_result
Jiloc Oct 10, 2025
73a4fb1
remove redactions features from insta
Jiloc Oct 10, 2025
a74c5f8
Merge branch 'develop' into feat/restrict-assets
obycode Oct 10, 2025
828a866
remove pinny
Jiloc Oct 13, 2025
b483f30
update comments
Jiloc Oct 13, 2025
cbe41f7
remove leftover pinny tag
Jiloc Oct 13, 2025
6fc8788
chore: aac finalize serde implementation, #6568
fdefelici Oct 13, 2025
ac9152f
update docstrings
Jiloc Oct 13, 2025
0efc005
Merge pull request #6516 from obycode/feat/restrict-assets
obycode Oct 13, 2025
ca09506
update snapshots
Jiloc Oct 14, 2025
a9fc6fe
Merge branch 'develop' into feat/improve-consensus-test-api
Jiloc Oct 14, 2025
281d442
Merge pull request #6589 from hugoclrd/refactor/make-storage-keys-public
Jiloc Oct 14, 2025
c5cca10
Merge pull request #6563 from adriano-stacks/feat/contrib_nix_clis
Jiloc Oct 14, 2025
2b74579
Merge branch 'aac-client-breaking' of github.com:jferrant/stacks-core…
jferrant Oct 14, 2025
8f7df21
Merge branch 'develop' of https://github.com/stacks-network/stacks-co…
jferrant Oct 14, 2025
8d6248b
Merge branch 'merge-develop-to-aac-client-breaking' of github.com:jfe…
jferrant Oct 14, 2025
57e6935
Merge branch 'develop' of https://github.com/stacks-network/stacks-co…
jferrant Oct 14, 2025
61c819a
Fix accept_block call after develop merge
jferrant Oct 14, 2025
dfc17c4
Merge pull request #6587 from fdefelici/test/aac-vm-error
fdefelici Oct 14, 2025
7762d88
Merge pull request #6585 from jferrant/chore/limit-staging-blocks-db-…
jferrant Oct 14, 2025
8aa9641
Make is_wellformed_tenure_*_block return Error and remove custom conv…
jferrant Oct 14, 2025
9dd8f63
Remove unreachable error type and use existing Expect error to ensure…
jferrant Oct 14, 2025
00a70b8
refactor ConsensusTest to process on block at a time
Jiloc Oct 15, 2025
d7cd95e
Merge branch 'develop' into feat/improve-consensus-test-api
Jiloc Oct 15, 2025
d1e98b0
Merge branch 'feat/improve-consensus-test-api' into feat/dynamic-nonc…
Jiloc Oct 15, 2025
67e6805
Merge pull request #6562 from Jiloc/feat/improve-consensus-test-api
jferrant Oct 15, 2025
89beb51
Merge branch 'develop' into feat/dynamic-nonce-contract-consensus-test
Jiloc Oct 15, 2025
7ee1aad
Remove unused RuntimeError Unreachable variant
jferrant Oct 15, 2025
ace1656
increase_nonce_for_tx panics if address doesn't exist
Jiloc Oct 16, 2025
ab68e4a
Merge pull request #6603 from jferrant/bugfix/make-sure-invalid-pox-c…
jferrant Oct 16, 2025
a92b29a
Merge pull request #6600 from jferrant/chore/cleanup-wellformed-tenur…
jferrant Oct 16, 2025
9c13b5f
Merge branch 'develop' of https://github.com/stacks-network/stacks-co…
jferrant Oct 16, 2025
a7d73af
Merge pull request #6605 from Jiloc/feat/dynamic-nonce-contract-conse…
Jiloc Oct 17, 2025
54f800b
Merge branch 'develop' of https://github.com/stacks-network/stacks-co…
jferrant Oct 17, 2025
2310c8c
feat: improve type-checking cost computation in epoch 3.3
obycode Oct 17, 2025
79bb31f
Add expected evaluated epoch to consensus tests for easier understand…
jferrant Oct 20, 2025
9abda1e
Move expected_epoch up and fix clippy warnings
jferrant Oct 20, 2025
27e8051
Fix prior bad clippy fix
jferrant Oct 20, 2025
dbd41f1
More clippy fixes
jferrant Oct 20, 2025
f4787ad
Merge pull request #6614 from jferrant/chore/add-evaluated-epoch-to-e…
jferrant Oct 20, 2025
9dfb1d1
Merge pull request #6613 from obycode/feat/param-type-checking-cost
brice-stacks Oct 21, 2025
7f06876
Merge branch 'develop' of https://github.com/stacks-network/stacks-co…
jferrant Oct 21, 2025
aeda2f6
Add comments to the new error variants in CheckErrorKind
jferrant Oct 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
- `current-contract`
- `block-time`
- `to-ascii?`
- `restrict-assets?`
- `as-contract?`
- Special allowance expressions:
- `with-stx`
- `with-ft`
- `with-nft`
- `with-stacking`
- `with-all-assets-unsafe`
- Added `contract_cost_limit_percentage` to the miner config file — sets the percentage of a block’s execution cost at which, if a large non-boot contract call would cause a BlockTooBigError, the miner will stop adding further non-boot contract calls and only include STX transfers and boot contract calls for the remainder of the block.
- Fixed a bug caused by a miner winning a sortition with a block commit that pointed to a previous tip, which would cause the miner to try and reorg itself. [#6481](https://github.com/stacks-network/stacks-core/issues/6481)

Expand Down
18 changes: 18 additions & 0 deletions clarity-types/src/errors/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,16 @@ pub enum CheckErrorKind {
WriteAttemptedInReadOnly,
/// `at-block` closure must be read-only but contains write operations.
AtBlockClosureMustBeReadOnly,

// contract post-conditions
ExpectedListOfAllowances(String, i32),
AllowanceExprNotAllowed,
ExpectedAllowanceExpr(String),
WithAllAllowanceNotAllowed,
WithAllAllowanceNotAlone,
WithNftExpectedListOfIdentifiers,
MaxIdentifierLengthExceeded(u32, u32),
TooManyAllowances(usize, usize),
}

#[derive(Debug, PartialEq)]
Expand Down Expand Up @@ -792,6 +802,14 @@ impl DiagnosableError for CheckErrorKind {
CheckErrorKind::CostComputationFailed(s) => format!("contract cost computation failed: {s}"),
CheckErrorKind::CouldNotDetermineSerializationType => "could not determine the input type for the serialization function".into(),
CheckErrorKind::ExecutionTimeExpired => "execution time expired".into(),
CheckErrorKind::ExpectedListOfAllowances(fn_name, arg_num) => format!("{fn_name} expects a list of asset allowances as argument {arg_num}"),
CheckErrorKind::AllowanceExprNotAllowed => "allowance expressions are only allowed in the context of a `restrict-assets?` or `as-contract?`".into(),
CheckErrorKind::ExpectedAllowanceExpr(got_name) => format!("expected an allowance expression, got: {got_name}"),
CheckErrorKind::WithAllAllowanceNotAllowed => "with-all-assets-unsafe is not allowed here, only in the allowance list for `as-contract?`".into(),
CheckErrorKind::WithAllAllowanceNotAlone => "with-all-assets-unsafe must not be used along with other allowances".into(),
CheckErrorKind::WithNftExpectedListOfIdentifiers => "with-nft allowance must include a list of asset identifiers".into(),
CheckErrorKind::MaxIdentifierLengthExceeded(max_len, len) => format!("with-nft allowance identifiers list must not exceed {max_len} elements, got {len}"),
CheckErrorKind::TooManyAllowances(max_allowed, found) => format!("too many allowances specified, the maximum is {max_allowed}, found {found}"),
}
}

Expand Down
2 changes: 1 addition & 1 deletion clarity-types/src/errors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub enum VmExecutionError {
Internal(VmInternalError),
/// Errors that occur during runtime execution of Clarity code, such as arithmetic errors or
/// invalid operations, expected as part of contract evaluation.
/// The `RuntimeErrorType` wraps the specific runtime error, and the `Option<StackTrace>` provides
/// The `RuntimeError` wraps the specific runtime error, and the `Option<StackTrace>` provides
/// an optional stack trace for debugging, if available.
Runtime(RuntimeError, Option<StackTrace>),
/// Errors triggered during Clarity contract evaluation that cause early termination with
Expand Down
10 changes: 10 additions & 0 deletions clarity-types/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,16 @@ impl Value {
Err(VmInternalError::Expect("Expected response".into()).into())
}
}

pub fn expect_string_ascii(self) -> Result<String> {
if let Value::Sequence(SequenceData::String(CharType::ASCII(ASCIIData { data }))) = self {
Ok(String::from_utf8(data)
.map_err(|_| VmInternalError::Expect("Non UTF-8 data in string".into()))?)
} else {
error!("Value '{self:?}' is not an ASCII string");
Err(VmInternalError::Expect("Expected ASCII string".into()).into())
}
}
}

impl BuffData {
Expand Down
4 changes: 3 additions & 1 deletion clarity-types/src/types/signatures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,8 @@ impl TypeSignature {
pub const STRING_ASCII_MAX: TypeSignature = Self::type_ascii_const(MAX_VALUE_SIZE);
/// String ASCII type with length 40.
pub const STRING_ASCII_40: TypeSignature = Self::type_ascii_const(40);
/// String ASCII type with length 128.
pub const STRING_ASCII_128: TypeSignature = Self::type_ascii_const(128);

/// String UTF8 type with minimum length (`1`).
pub const STRING_UTF8_MIN: TypeSignature = Self::type_string_utf8(1);
Expand Down Expand Up @@ -913,7 +915,7 @@ impl TypeSignature {

/// Creates a string ASCII type with the specified length.
/// It may panic if the provided length is invalid.
#[cfg(test)]
#[cfg(any(test, feature = "testing"))]
pub const fn new_ascii_type_checked(len: u32) -> Self {
Self::type_ascii_const(len)
}
Expand Down
28 changes: 25 additions & 3 deletions clarity/src/vm/analysis/arithmetic_checker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,31 @@ impl ArithmeticOnlyChecker<'_> {
| ContractCall | StxTransfer | StxTransferMemo | StxBurn | AtBlock | GetStxBalance
| GetTokenSupply | BurnToken | FromConsensusBuff | ToConsensusBuff | BurnAsset
| StxGetAccount => Err(Error::FunctionNotPermitted(function)),
Append | Concat | AsMaxLen | ContractOf | PrincipalOf | ListCons | Print
| AsContract | ElementAt | ElementAtAlias | IndexOf | IndexOfAlias | Map | Filter
| Fold | Slice | ReplaceAt | ContractHash => Err(Error::FunctionNotPermitted(function)),
Append
| Concat
| AsMaxLen
| ContractOf
| PrincipalOf
| ListCons
| Print
| AsContract
| ElementAt
| ElementAtAlias
| IndexOf
| IndexOfAlias
| Map
| Filter
| Fold
| Slice
| ReplaceAt
| ContractHash
| RestrictAssets
| AsContractSafe
| AllowanceWithStx
| AllowanceWithFt
| AllowanceWithNft
| AllowanceWithStacking
| AllowanceAll => Err(Error::FunctionNotPermitted(function)),
BuffToIntLe | BuffToUIntLe | BuffToIntBe | BuffToUIntBe => {
Err(Error::FunctionNotPermitted(function))
}
Expand Down
148 changes: 134 additions & 14 deletions clarity/src/vm/analysis/read_only_checker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,20 +286,101 @@ impl<'a, 'b> ReadOnlyChecker<'a, 'b> {
use crate::vm::functions::NativeFunctions::*;

match function {
Add | Subtract | Divide | Multiply | CmpGeq | CmpLeq | CmpLess | CmpGreater
| Modulo | Power | Sqrti | Log2 | BitwiseXor | And | Or | Not | Hash160 | Sha256
| Keccak256 | Equals | If | Sha512 | Sha512Trunc256 | Secp256k1Recover
| Secp256k1Verify | ConsSome | ConsOkay | ConsError | DefaultTo | UnwrapRet
| UnwrapErrRet | IsOkay | IsNone | Asserts | Unwrap | UnwrapErr | Match | IsErr
| IsSome | TryRet | ToUInt | ToInt | BuffToIntLe | BuffToUIntLe | BuffToIntBe
| BuffToUIntBe | IntToAscii | IntToUtf8 | StringToInt | StringToUInt | IsStandard
| ToConsensusBuff | PrincipalDestruct | PrincipalConstruct | Append | Concat
| AsMaxLen | ContractOf | PrincipalOf | ListCons | GetBlockInfo | GetBurnBlockInfo
| GetStacksBlockInfo | GetTenureInfo | TupleGet | TupleMerge | Len | Print
| AsContract | Begin | FetchVar | GetStxBalance | StxGetAccount | GetTokenBalance
| GetAssetOwner | GetTokenSupply | ElementAt | IndexOf | Slice | ReplaceAt
| BitwiseAnd | BitwiseOr | BitwiseNot | BitwiseLShift | BitwiseRShift | BitwiseXor2
| ElementAtAlias | IndexOfAlias | ContractHash | ToAscii => {
Add
| Subtract
| Divide
| Multiply
| CmpGeq
| CmpLeq
| CmpLess
| CmpGreater
| Modulo
| Power
| Sqrti
| Log2
| BitwiseXor
| And
| Or
| Not
| Hash160
| Sha256
| Keccak256
| Equals
| If
| Sha512
| Sha512Trunc256
| Secp256k1Recover
| Secp256k1Verify
| ConsSome
| ConsOkay
| ConsError
| DefaultTo
| UnwrapRet
| UnwrapErrRet
| IsOkay
| IsNone
| Asserts
| Unwrap
| UnwrapErr
| Match
| IsErr
| IsSome
| TryRet
| ToUInt
| ToInt
| BuffToIntLe
| BuffToUIntLe
| BuffToIntBe
| BuffToUIntBe
| IntToAscii
| IntToUtf8
| StringToInt
| StringToUInt
| IsStandard
| ToConsensusBuff
| PrincipalDestruct
| PrincipalConstruct
| Append
| Concat
| AsMaxLen
| ContractOf
| PrincipalOf
| ListCons
| GetBlockInfo
| GetBurnBlockInfo
| GetStacksBlockInfo
| GetTenureInfo
| TupleGet
| TupleMerge
| Len
| Print
| AsContract
| Begin
| FetchVar
| GetStxBalance
| StxGetAccount
| GetTokenBalance
| GetAssetOwner
| GetTokenSupply
| ElementAt
| IndexOf
| Slice
| ReplaceAt
| BitwiseAnd
| BitwiseOr
| BitwiseNot
| BitwiseLShift
| BitwiseRShift
| BitwiseXor2
| ElementAtAlias
| IndexOfAlias
| ContractHash
| ToAscii
| AllowanceWithStx
| AllowanceWithFt
| AllowanceWithNft
| AllowanceWithStacking
| AllowanceAll => {
// Check all arguments.
self.check_each_expression_is_read_only(args)
}
Expand Down Expand Up @@ -435,6 +516,45 @@ impl<'a, 'b> ReadOnlyChecker<'a, 'b> {
self.check_each_expression_is_read_only(&args[2..])
.map(|args_read_only| args_read_only && is_function_read_only)
}
RestrictAssets => {
check_arguments_at_least(3, args)?;

// Check the asset owner argument.
let asset_owner_read_only = self.check_read_only(&args[0])?;

// Check the allowances argument.
let allowances =
args[1]
.match_list()
.ok_or(CheckErrorKind::ExpectedListOfAllowances(
"restrict-assets?".into(),
2,
))?;
let allowances_read_only = self.check_each_expression_is_read_only(allowances)?;

// Check the body expressions.
let body_read_only = self.check_each_expression_is_read_only(&args[2..])?;

Ok(asset_owner_read_only && allowances_read_only && body_read_only)
}
AsContractSafe => {
check_arguments_at_least(2, args)?;

// Check the allowances argument.
let allowances =
args[0]
.match_list()
.ok_or(CheckErrorKind::ExpectedListOfAllowances(
"as-contract?".into(),
1,
))?;
let allowances_read_only = self.check_each_expression_is_read_only(allowances)?;

// Check the body expressions.
let body_read_only = self.check_each_expression_is_read_only(&args[1..])?;

Ok(allowances_read_only && body_read_only)
}
}
}

Expand Down
43 changes: 37 additions & 6 deletions clarity/src/vm/analysis/type_checker/v2_05/natives/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,12 +787,43 @@ impl TypedNativeFunction {
IsNone => Special(SpecialNativeFunction(&options::check_special_is_optional)),
IsSome => Special(SpecialNativeFunction(&options::check_special_is_optional)),
AtBlock => Special(SpecialNativeFunction(&check_special_at_block)),
ElementAtAlias | IndexOfAlias | BuffToIntLe | BuffToUIntLe | BuffToIntBe
| BuffToUIntBe | IsStandard | PrincipalDestruct | PrincipalConstruct | StringToInt
| StringToUInt | IntToAscii | IntToUtf8 | GetBurnBlockInfo | StxTransferMemo
| StxGetAccount | BitwiseAnd | BitwiseOr | BitwiseNot | BitwiseLShift
| BitwiseRShift | BitwiseXor2 | Slice | ToConsensusBuff | FromConsensusBuff
| ReplaceAt | GetStacksBlockInfo | GetTenureInfo | ContractHash | ToAscii => {
ElementAtAlias
| IndexOfAlias
| BuffToIntLe
| BuffToUIntLe
| BuffToIntBe
| BuffToUIntBe
| IsStandard
| PrincipalDestruct
| PrincipalConstruct
| StringToInt
| StringToUInt
| IntToAscii
| IntToUtf8
| GetBurnBlockInfo
| StxTransferMemo
| StxGetAccount
| BitwiseAnd
| BitwiseOr
| BitwiseNot
| BitwiseLShift
| BitwiseRShift
| BitwiseXor2
| Slice
| ToConsensusBuff
| FromConsensusBuff
| ReplaceAt
| GetStacksBlockInfo
| GetTenureInfo
| ContractHash
| ToAscii
| RestrictAssets
| AsContractSafe
| AllowanceWithStx
| AllowanceWithFt
| AllowanceWithNft
| AllowanceWithStacking
| AllowanceAll => {
return Err(CheckErrorKind::Expects(
"Clarity 2+ keywords should not show up in 2.05".into(),
));
Expand Down
6 changes: 4 additions & 2 deletions clarity/src/vm/analysis/type_checker/v2_1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ impl<'a, 'b> TypeChecker<'a, 'b> {
Ok(())
}

// Type check an expression, with an expected_type that should _admit_ the expression.
/// Type check an expression, with an expected_type that should _admit_ the expression.
pub fn type_check_expects(
&mut self,
expr: &SymbolicExpression,
Expand All @@ -1165,7 +1165,7 @@ impl<'a, 'b> TypeChecker<'a, 'b> {
}
}

// Type checks an expression, recursively type checking its subexpressions
/// Type checks an expression, recursively type checking its subexpressions
pub fn type_check(
&mut self,
expr: &SymbolicExpression,
Expand All @@ -1184,6 +1184,8 @@ impl<'a, 'b> TypeChecker<'a, 'b> {
result
}

/// Type checks a list of statements, ensuring that each statement is valid
/// and any responses before the last statement are handled.
fn type_check_consecutive_statements(
&mut self,
args: &[SymbolicExpression],
Expand Down
10 changes: 10 additions & 0 deletions clarity/src/vm/analysis/type_checker/v2_1/natives/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ mod assets;
mod conversions;
mod maps;
mod options;
pub(crate) mod post_conditions;
mod sequences;

#[allow(clippy::large_enum_variant)]
Expand Down Expand Up @@ -1225,6 +1226,15 @@ impl TypedNativeFunction {
)
})?,
))),
RestrictAssets => Special(SpecialNativeFunction(
&post_conditions::check_restrict_assets,
)),
AsContractSafe => Special(SpecialNativeFunction(&post_conditions::check_as_contract)),
AllowanceWithStx
| AllowanceWithFt
| AllowanceWithNft
| AllowanceWithStacking
| AllowanceAll => Special(SpecialNativeFunction(&post_conditions::check_allowance_err)),
};

Ok(out)
Expand Down
Loading