Skip to content

Instantly share code, notes, and snippets.

@ylv-io
Created November 18, 2018 17:47
Show Gist options
  • Save ylv-io/5cb31f65fbc9249fafdeb093f620ae47 to your computer and use it in GitHub Desktop.
Save ylv-io/5cb31f65fbc9249fafdeb093f620ae47 to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.24;
import 'zeppelin-solidity/contracts/ownership/Ownable.sol';
contract AlienCodex is Ownable {
bool public contact;
bytes32[] public codex;
modifier contacted() {
assert(contact);
_;
}
function make_contact(bytes32[] _firstContactMessage) public {
assert(_firstContactMessage.length > 2**200);
contact = true;
}
function record(bytes32 _content) contacted public {
codex.push(_content);
}
function retract() contacted public {
codex.length--;
}
function revise(uint i, bytes32 _content) contacted public {
codex[i] = _content;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment