Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jennazenk/deb331927688c9f61ea5635d5d44a09c to your computer and use it in GitHub Desktop.
Save jennazenk/deb331927688c9f61ea5635d5d44a09c to your computer and use it in GitHub Desktop.
DBC
pragma solidity ^0.4.11;
/// @title Desing by contract (Hoare logic)
/// @author Melonport AG <team@melonport.com>
/// @notice Gives deriving contracts design by contract modifiers
contract DBC {
// MODIFIERS
modifier pre_cond(bool condition) {
require(condition);
_;
}
modifier post_cond(bool condition) {
_;
assert(condition);
}
modifier invariant(bool condition) {
require(condition);
_;
assert(condition);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment