Last active
October 15, 2021 17:04
-
-
Save kushti/d6e2acb3dfbd507b3bb22778f7a71a5e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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