Skip to content

Instantly share code, notes, and snippets.

@kushti
Last active October 15, 2021 17:04
Show Gist options
  • Save kushti/d6e2acb3dfbd507b3bb22778f7a71a5e to your computer and use it in GitHub Desktop.
Save kushti/d6e2acb3dfbd507b3bb22778f7a71a5e to your computer and use it in GitHub Desktop.
def reemissionBoxProp(s: MonetarySettings): ErgoTree = {
val rewardOut = ByIndex(Outputs, IntConstant(0))
val heightCorrect = EQ(boxCreationHeight(rewardOut), Height)
val heightIncreased = GT(Height, boxCreationHeight(Self))
val validPeriod = GE(Height, IntConstant(2080800))
val coinsToIssue = s.oneEpochReduction // 3 ERG
val correctCoinsIssued = EQ(coinsToIssue, Minus(ExtractAmount(Self), ExtractAmount(rewardOut)))
val sponsored = GT(ExtractAmount(rewardOut), ExtractAmount(Self))
OR(
AND(
sponsored,
heightCorrect),
AND(
validPeriod,
heightIncreased,
heightCorrect,
correctCoinsIssued
)
).toSigmaProp.treeWithSegregation
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment