Created
April 1, 2022 12:09
-
-
Save arkhaminferno/755957b28ac1b882aefeb783978a9eb7 to your computer and use it in GitHub Desktop.
Ascent Reach Bootcamp Week - 1 assignment
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
'reach 0.1' | |
const Player = { | |
getChallenge:Fun([],UInt), | |
seeResult:Fun([UInt],Null) | |
}; | |
export const main = Reach.App(()=>{ | |
const Pat = Participant('Pat',{...Player}); | |
const Vanna = Participant('Vanna',{...Player}); | |
init(); | |
Pat.only(()=>{ | |
const challengePat = declassify(interact.getChallenge()); | |
}); | |
Pat.publish(challengePat); | |
commit(); | |
Vanna.only(()=>{ | |
const challengeVanna = declassify(interact.getChallenge()); | |
}) | |
Vanna.publish(challengeVanna); | |
commit(); | |
}) | |
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
'reach 0.1' | |
const User = { | |
seePrice:Fun([],UInt), | |
getDescription:Fun([],Bytes(8)) | |
} | |
export const main= Reach.App(()=>{ | |
const Creator = Participant('Creator',{...User}); | |
const Bidder = Participant('Bidder',{...User}); | |
const Buyer = Participant('Buyer',{...User}); | |
init(); | |
Bidder.only(()=>{ | |
const price = declassify(interact.seePrice()); | |
}); | |
Bidder.publish(price); | |
commit() | |
Buyer.only(()=>{ | |
const description = declassify(interact.getDescription()); | |
}); | |
Buyer.publish(description); | |
commit() | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment