Create ErgoTree with false
proposition, which is never true.
Create ErgoTree with false
proposition, which is never true.
ErgoTree header flags to be combined with default header
ErgoTree.headerWithVersion()
Create ErgoTree with true
proposition, which is always true.
Create ErgoTree with true
proposition, which is always true.
ErgoTree header flags to be combined with default header
ErgoTree.headerWithVersion()
Creation height of a box
A contract that only allows to collect emission reward by a box with miner proposition.
Byte array value of the serialized reward output script proposition with pk being substituted with given pk
Byte array value of the serialized reward output script proposition with pk being substituted with given pk
- number of blocks for which miner should hold this box before spending it
- byte array val for pk to substitute in the reward script
Proposition that allows to send coins to a box which is protected by the following proposition:
prove dlog of miner's public key and height is at least delta
blocks bigger then the current one.
Script for Ergo foundation box.
Script for Ergo foundation box. The script allows to spend a box, if: - first transaction output contains at least EmissionRules.remainingFoundationAtHeight coins in it - first transaction output is protected by this script - conditions from the first non-mandatory register (R4) are satisfied
Thus, this script always controls the level of emission and does not allow to take
more coinы than prescribed by emission rules. In addition, it is protected by
custom proposition in R4 which is assumed to be a simple 2-of-3 multisignature with
public keys of foundation members in the beginning. When foundation members spend
this box, they are free to put any new proposition to the R4 register, thus they
may add or remove members, or change it to something more complicated like
tokenThresholdScript
.
Required script of the box, that collects mining rewards
Proposition of the box that may be spent by a transaction
which inputs contains at least thresholdAmount
of token with id tokenId
.
Proposition of the box that may be spent by a transaction
which inputs contains at least thresholdAmount
of token with id tokenId
.
The logic of this script is following
(v1) INPUTS.flatMap(box => box.tokens.filter(t => t._1 == tokenId).map(t => t._2)).sum >= thresholdAmount
(v2) INPUTS.flatMap(box => box.tokens).filter(t => t._1 == tokenId).sum >= thresholdAmount
(v3) INPUTS.map(box => box.tokens.find(t => t._1 == tokenId).map(t => t._2).getOrElse(0)).sum >= thresholdAmount