Skip to content

Instantly share code, notes, and snippets.

@luisivan
Created January 30, 2018 16:45
Show Gist options
  • Save luisivan/77b1c4863f7bbacee426f9bd51554e1c to your computer and use it in GitHub Desktop.
Save luisivan/77b1c4863f7bbacee426f9bd51554e1c to your computer and use it in GitHub Desktop.
Example aragonOS-powered app
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