Created
February 7, 2017 20:31
-
-
Save izqui/11a85aae6c749eba9841465c8a47ccc6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
library CounterLib { | |
struct Counter { uint i; } | |
function incremented(Counter storage self) returns (uint) { | |
return ++self.i; | |
} | |
} | |
contract CounterContract { | |
using CounterLib for CounterLib.Counter; | |
CounterLib.Counter counter; | |
function increment() returns (uint) { | |
return counter.incremented(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment