Created
August 22, 2018 17:00
-
-
Save eolszewski/e818fbcdd3f3e98713410dbaa6550ea5 to your computer and use it in GitHub Desktop.
Revisions
-
eolszewski created this gist
Aug 22, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ pragma solidity ^0.4.19; import "./EventStoreLib.sol"; contract EventStore { EventStoreLib.Storage store; address public owner; function () public payable { revert(); } constructor() public { owner = tx.origin; } function count() public view returns (uint) { return store.events.length; } function write(bytes32 key, bytes32 value) public { EventStoreLib.write( store, key, value ); } function read(uint index) public view returns (uint, address, bytes32, bytes32 ) { return EventStoreLib.read(store, index); } function destroy(address target) public { require(msg.sender == owner); selfdestruct(target); } }