CompiledContract (Class)¶
A compiled SilverScript contract: the locking script plus the metadata needed to build unlocking (signature) scripts for its entrypoints.
state_layout
property
¶
(start, len): byte offset and length of the contract state within the script.
template_hash
property
¶
The canonical length-bound template hash: a 32-byte digest over the
script's template parts (the prefix before and suffix after the state
region). Matches the SilverScript templateHash(prefix, suffix) builtin,
so contracts can commit to this value and later reconstruct it on-chain.
without_selector
property
¶
Whether the contract has a single entrypoint (no function selector).
build_sig_script
¶
Build the signature (unlocking) script for an entrypoint.
| PARAMETER | DESCRIPTION |
|---|---|
function_name
|
The entrypoint to call.
TYPE:
|
args
|
Native Python values (int, bool, str, bytes, list/tuple, or dict) matching the entrypoint's ABI input types. Omit or pass None for an entrypoint that takes no arguments.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bytes
|
The signature (unlocking) script.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SilverScriptError
|
If the entrypoint is unknown or an argument is invalid (wrong type, out of range, or too deeply nested). |
build_sig_script_for_covenant_decl
¶
build_sig_script_for_covenant_decl(function_name: str, args: Optional[Any] = None, *, is_leader: bool = False) -> bytes
Build the signature (unlocking) script for a covenant declaration entrypoint.
| PARAMETER | DESCRIPTION |
|---|---|
function_name
|
The covenant entrypoint to call.
TYPE:
|
args
|
Native Python values matching the entrypoint's ABI input types. Omit or pass None for an entrypoint that takes no arguments.
TYPE:
|
is_leader
|
Select the leader path for covenants that distinguish a leader from delegates (default: False).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bytes
|
The signature (unlocking) script.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SilverScriptError
|
If the entrypoint is unknown or an argument is invalid (wrong type, out of range, or too deeply nested). |