You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
653 B
46 lines
653 B
4 years ago
|
pragma solidity ^0.6.0;
|
||
|
|
||
|
import "./ModifiersB.sol";
|
||
|
|
||
|
/**
|
||
|
* New syntaxes in solc 0.6.x
|
||
|
*/
|
||
|
contract ModifiersA is ModifiersB {
|
||
|
uint counter;
|
||
|
bool flag = true;
|
||
|
|
||
|
modifier flippable {
|
||
|
require(flag);
|
||
|
_;
|
||
|
}
|
||
|
|
||
|
modifier overridden() override {
|
||
|
require(true);
|
||
|
_;
|
||
|
}
|
||
|
|
||
|
function flip() public {
|
||
|
flag = !flag;
|
||
|
}
|
||
|
|
||
|
function simpleSet(uint i)
|
||
|
public
|
||
|
override(ModifiersB)
|
||
|
{
|
||
|
counter = counter + i;
|
||
|
}
|
||
|
|
||
|
function simpleView(uint i)
|
||
|
view
|
||
|
overridden
|
||
|
external
|
||
|
returns (uint, bool)
|
||
|
{
|
||
|
return (counter + i, true);
|
||
|
}
|
||
|
|
||
|
function simpleSetFlip(uint i) flippable public {
|
||
|
counter = counter + i;
|
||
|
}
|
||
|
}
|