Created
January 30, 2018 16:45
-
-
Save luisivan/77b1c4863f7bbacee426f9bd51554e1c to your computer and use it in GitHub Desktop.
Example aragonOS-powered app
This file contains 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
pragma solidity ^0.4.0; | |
import "@aragon/core/contracts/apps/App.sol"; | |
contract Counter is App { | |
/// Events | |
event Increment(uint indexed blockNumber); | |
event Decrement(uint indexed blockNumber); | |
/// State | |
int public value; | |
/// ACL | |
bytes32 constant public INCREMENT_ROLE = bytes32(1); | |
bytes32 constant public DECREMENT_ROLE = bytes32(2); | |
function increment() auth(INCREMENT_ROLE) external { | |
value += 1; | |
Increment(block.number); | |
} | |
function decrement() auth(DECREMENT_ROLE) external { | |
value -= 1; | |
Decrement(block.number); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment