embark/test_apps/coverage_app/contracts/modifiers.sol

26 lines
433 B
Solidity
Raw Normal View History

2018-11-19 10:29:02 +00:00
pragma solidity ^0.5.0;
2018-08-30 16:49:19 +00:00
contract Modifiers {
uint public storedData;
constructor(uint initialValue) public {
storedData = initialValue;
}
modifier upTo(uint amount, uint desired) {
require(
desired <= amount,
"Value is too high."
);
_;
}
function set(uint x) public upTo(1000, x) {
storedData = x;
}
function get() public view returns (uint retVal) {
return storedData;
}
}