Created
July 17, 2019 21:01
-
-
Save vinarmani/65c6be07fba8d9f36b663470c5c4be6f to your computer and use it in GitHub Desktop.
Contract Creation for Padres vs Marlins (Steven vs. Vin) July 17, 2019
This file contains 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
const jeton = require('jeton-lib') | |
const PrivateKey = jeton.PrivateKey | |
const PublicKey = jeton.PublicKey | |
const Signature = jeton.Signature | |
const OutputScript = jeton.escrow.OutputScript | |
const Transaction = jeton.Transaction | |
// Create the output script | |
var refpk = new PublicKey("029ba4d2d14a5c24e4b7b6aa953ecf24b599e2f5e944412a9d60e5878f0f6a06cd") | |
var stevenpk = new PublicKey("03e34df7c516e3a122ef72f9db4cbcd2302ac7c9ec5b1f52cd5f77740654958f31") | |
var vinpk = new PublicKey("03ef3b289d0c08ab016153975cc028871982a621f35ab548e348ce275bb2b21eca") | |
var outputScriptData = { | |
refereePubKey: refpk, | |
parties: [ | |
{message: 'padreswin', pubKey: stevenpk}, | |
{message: 'marlinswin', pubKey: vinpk} | |
] | |
} | |
outScript = new OutputScript(outputScriptData) | |
console.log(outScript.toAddress()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The winner will do the following, inputing the referee's broadcasted signature string and chosen address to send the winnings to:
EDIT
Just realized this will need to be done as two separate transactions for now. so run the code for each of the utxos
Then broadcast the resulting transaction to claim the winnings