Handling Dynamically Sized Inputs
How to work with dynamically sized types in Kontrol using NatSpec annotations
Overview
NatSpec Annotations
Basic Example
/// @custom:kontrol-array-length-equals ba: 2,
/// @custom:kontrol-bytes-length-equals ba: 600,
function test_complex_type(bytes[] calldata ba) public {
require(ba.length == 2, "DynamicTypes: invalid length for bytes[]");
assert(ba[1].length == 600);
}Real-World Example: Bridge Verification
Complex Types: Structs and Tuples
Best Practices
Limitations
References
Last updated
Was this helpful?