Skip to content

Instantly share code, notes, and snippets.

@davidawad
Created April 21, 2021 14:30
Show Gist options
  • Save davidawad/4d32a93bb7fa73ead6797b719b0f9747 to your computer and use it in GitHub Desktop.
Save davidawad/4d32a93bb7fa73ead6797b719b0f9747 to your computer and use it in GitHub Desktop.
public class MyContract extends StandardContract implements Contract {
public interface Commands extends CommandData {
// note the annotations here from the Contracts SDK
@RequireNumberOfStatesOnInput(value = 0)
@RequireNumberOfStatesOnOutput(value = 1)
class Action implements Commands {}
// now the verification is clearer, and easier to read
@RequireNumberOfStatesOnInput(value = 0)
class SomeOtherAction implements Commands {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment