Merge pull request #3722 from ethereum/fixMods

Fix modifier lookup in libraries.
This commit is contained in:
Alex Beregszaszi
2018-03-14 17:20:51 +01:00
committed by GitHub
6 changed files with 83 additions and 5 deletions
@@ -0,0 +1,14 @@
library WithModifier {
modifier mod() { require(msg.value > 10 ether); _; }
function withMod(uint self) mod() internal view { require(self > 0); }
}
contract Test {
using WithModifier for *;
function f(uint _value) public payable {
_value.withMod();
WithModifier.withMod(_value);
}
}
// ----