Documentation ¶
Overview ¶
Package standard implements standard txvm contracts for Sequence transactions.
Index ¶
- Variables
- func AssetID(version, quorum int, pubkeys []ed25519.PublicKey, tag []byte) [32]byte
- func IssueWithAnchorContract(version, quorum int, pubkeys []ed25519.PublicKey, tag []byte, amount int64, ...) []byte
- func IssueWithoutAnchorContract(version, quorum int, pubkeys []ed25519.PublicKey, tag []byte, amount int64, ...) []byte
- func Snapshot(b *txvmutil.Builder, quorum int, pubkeys []ed25519.PublicKey, amount int64, ...)
- func SpendMultisig(b *txvmutil.Builder, quorum int, pubkeys []ed25519.PublicKey, amount int64, ...)
- func VerifyTxID(txid [32]byte) []byte
Constants ¶
This section is empty.
Variables ¶
var ( // PayToMultisigProg1 is the txvm bytecode of the first // version of the standard pay-to-multisig contract. PayToMultisigProg1 = asm.MustAssemble(payToMultisigProgSrc1) // PayToMultisigSeed1 is the seed of the standard pay-to-multisig-program contract. PayToMultisigSeed1 = txvm.ContractSeed(PayToMultisigProg1) )
var ( // PayToMultisigProg2 is the txvm bytecode of the standard // pay-to-multisig contract. PayToMultisigProg2 = asm.MustAssemble(payToMultisigProgSrc2) // PayToMultisigSeed2 is the seed of the standard pay-to-multisig-program contract. PayToMultisigSeed2 = txvm.ContractSeed(PayToMultisigProg2) )
var ( // RetireContract is the assembled txvm bytecode of the // standard retirement contract. RetireContract = asm.MustAssemble(retireSrc) // RetireContractSeed is the seed of the standard retirement // contract. RetireContractSeed = txvm.ContractSeed(RetireContract) )
var ( // AssetContractSeed is the seed of the standard asset-issuance contract. AssetContractSeed = map[int][32]byte{ 1: txvm.ContractSeed(assetProg[1]), 2: txvm.ContractSeed(assetProg[2]), } )
Functions ¶
func AssetID ¶
AssetID computes the ID of an asset using the standard asset-issuance contract with the given parameters.
func IssueWithAnchorContract ¶
func IssueWithAnchorContract(version, quorum int, pubkeys []ed25519.PublicKey, tag []byte, amount int64, refdata []byte) []byte
IssueWithAnchorContract produces the txvm bytecode of an issuance contract which invokes the standard asset-issuance contract to issue the requested number of units.
The caller must ensure that a zero-value is on top of the txvm current-contract stack at the point where this code is called. If no such value is available, IssueWithoutAnchor may be used.
func IssueWithoutAnchorContract ¶
func IssueWithoutAnchorContract(version, quorum int, pubkeys []ed25519.PublicKey, tag []byte, amount int64, refdata []byte, blockID []byte, expMS uint64, nonce []byte) []byte
IssueWithoutAnchorContract produces the txvm bytecode of an issuance contract which invokes the standard asset-issuance contract to issue the requested number of units.
It may be used when no value object is on top of the current contract stack. This requires a new nonce for use as an issuance anchor.
When possible, callers should prefer IssueWithAnchor after arranging to place a zero-value on top of the stack.
func Snapshot ¶
func Snapshot(b *txvmutil.Builder, quorum int, pubkeys []ed25519.PublicKey, amount int64, assetID bc.Hash, anchor []byte, seed []byte, )
Snapshot adds to b the snapshot of a pay-to-multisig-program contract as it appears in the UTXO set.
func SpendMultisig ¶
func SpendMultisig( b *txvmutil.Builder, quorum int, pubkeys []ed25519.PublicKey, amount int64, assetID bc.Hash, anchor []byte, seed []byte, )
SpendMultisig writes txvm bytecode to b, spending a value previously locked with the standard pay-to-multisig-program contract.
func VerifyTxID ¶
VerifyTxID returns a program that verifies the txid matches the given value.
Types ¶
This section is empty.