Skip to content

Instantly share code, notes, and snippets.

@kushti
Created June 6, 2021 21:15
Show Gist options
  • Save kushti/cda32aad01ae02ff9a76bd9992bf8215 to your computer and use it in GitHub Desktop.
Save kushti/cda32aad01ae02ff9a76bd9992bf8215 to your computer and use it in GitHub Desktop.
object ValueEncoder extends App {
val pd = ErgoAddressEncoder
.apply(ErgoAddressEncoder.MainnetNetworkPrefix)
.fromString("9gmNsqrqdSppLUBqg2UzREmmivgqh1r3jmNcLAc53hk3YCvAGWE")
.get
.asInstanceOf[P2PKAddress]
.pubkey
val s = SigmaPropConstant(pd)
val bs = ValueSerializer.serialize(s)
println("script: " + Base16.encode(bs))
val deadline = 602000
println(Base16.encode(ValueSerializer.serialize(IntConstant(deadline))))
val amount = 2000000000L
println(Base16.encode(ValueSerializer.serialize(LongConstant(amount))))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment