MCPcopy Create free account
hub / github.com/chain/txvm / opIssue

Function opIssue

protocol/txvm/values.go:29–43  ·  view source on GitHub ↗
(vm *VM)

Source from the content-addressed store, hash-verified

27)
28
29func opIssue(vm *VM) {
30 tag := vm.popBytes()
31 amount := vm.popInt()
32 if amount < 0 {
33 panic(errors.Wrap(errors.WithData(ErrNegAmount, "amount", amount), "issue"))
34 }
35 anchor := vm.popZeroValue().anchor
36
37 assetID := AssetID(vm.contract.seed, tag)
38
39 val := vm.createValue(int64(amount), assetID[:], anchor)
40 vm.push(val)
41
42 vm.logIssuance(int64(amount), assetID[:], anchor)
43}
44
45// AssetID produces the ID for the asset whose issuing contract has
46// the given ID, and that has the given optional asset tag.

Callers

nothing calls this directly

Calls 9

WrapFunction · 0.92
WithDataFunction · 0.92
popBytesMethod · 0.80
popIntMethod · 0.80
popZeroValueMethod · 0.80
createValueMethod · 0.80
logIssuanceMethod · 0.80
AssetIDFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected