embark/test_apps/coverage_app/contracts/modifiers.sol

26 lines
434 B
Solidity
Raw Normal View History

2018-08-30 16:49:19 +00:00
pragma solidity ^0.4.23;
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;
}
}