Documentation
¶
Overview ¶
Package compiler wraps the simc binary to compile SimplicityHL contracts.
Index ¶
- func Compile(shlPath string) (binary []byte, cmr [32]byte, err error)
- func CompileAll(buildDir string, net *network.Network) (*pool.Config, error)
- func PatchLPAssetID(shlPath string, outPath string, assetID [32]byte) error
- func PatchParams(buildDir string, params map[string]ArgsParam) error
- type ArgsParam
- type SimcOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compile ¶
Compile compiles a .shl file with simc and returns the program binary and CMR. If a companion <file>.args exists it is passed via --args. The CMR (Commitment Merkle Root) is the 32-byte Simplicity commitment hash used as the taproot leaf script content for address derivation.
func CompileAll ¶
CompileAll compiles all pool contracts from buildDir and returns a Config with addresses, CMRs, binaries, and control blocks populated. pool_creation uses a single-leaf taproot; pool_a/b and lp_reserve use dual-leaf taproot (swap+remove variants share one address).
func PatchLPAssetID ¶
PatchLPAssetID updates LP_ASSET_ID in the .args file that corresponds to shlPath. outPath is used only to derive the destination .args path (usually equal to shlPath).
func PatchParams ¶
PatchParams updates the specified parameter values in all .args files found in buildDir. Only keys that already exist in a given .args file are updated; extra keys in params are silently ignored for files that don't have them.
Types ¶
type ArgsParam ¶
type ArgsParam = argsEntry
ArgsParam is one entry in a .args JSON file (value + type pair).
type SimcOutput ¶
SimcOutput is the JSON structure from simc --json