Created
July 4, 2019 13:56
-
-
Save tomclose/1db6e1d376a921189a128cb1567916d3 to your computer and use it in GitHub Desktop.
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
// in the adjudicator contract: | |
function respond(State memory s1, State memory s2) public { | |
// check that the first state matches the stored challenge | |
assertHashMatches(s1, stored_challenge_hash); | |
// framework checks | |
assertValidSignature(s2); | |
assertSameAppDefinition(s1, s2); | |
assertTurnNumIncrements(s1, s2); | |
// … etc. | |
// app-specific checks | |
app = NitroApp(s2.AppDefinition); | |
assert(app.validTransition(s1, s2)); | |
// once all checks have passed, cancel the challenge | |
cancel_challenge(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment