Created
May 23, 2018 13:53
-
-
Save jennazenk/deb331927688c9f61ea5635d5d44a09c to your computer and use it in GitHub Desktop.
DBC
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
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