|
1 | 1 | pragma solidity ^0.4.24;
|
2 | 2 |
|
3 |
| -contract Attestation { |
| 3 | +/** |
| 4 | +* Contract for Vanity URL on SpringRole |
| 5 | +* Go to beta.springrole.com to try this out! |
| 6 | +*/ |
4 | 7 |
|
5 |
| - event Attest(address _address,string _type,string _data); |
| 8 | +/** |
| 9 | + * @title Ownable |
| 10 | + * @dev The Ownable contract has an owner address, and provides basic authorization control |
| 11 | + * functions, this simplifies the implementation of “user permissions”. |
| 12 | + */ |
| 13 | + |
| 14 | +contract Ownable { |
| 15 | + address public owner; |
| 16 | + |
| 17 | + |
| 18 | + event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); |
| 19 | + |
| 20 | + /** |
| 21 | + * @dev The Ownable constructor sets the original `owner` of the contract to the sender |
| 22 | + * account. |
| 23 | + */ |
| 24 | + constructor() public { |
| 25 | + owner = msg.sender; |
| 26 | + } |
| 27 | + |
| 28 | + |
| 29 | + /** |
| 30 | + * @dev Throws if called by any account other than the owner. |
| 31 | + */ |
| 32 | + modifier onlyOwner() { |
| 33 | + require(msg.sender == owner); |
| 34 | + _; |
| 35 | + } |
| 36 | + |
| 37 | + |
| 38 | + /** |
| 39 | + * @dev Allows the current owner to transfer control of the contract to a newOwner. |
| 40 | + * @param newOwner The address to transfer ownership to. |
| 41 | + */ |
| 42 | + function transferOwnership(address newOwner) onlyOwner public { |
| 43 | + require(newOwner != address(0)); |
| 44 | + emit OwnershipTransferred(owner, newOwner); |
| 45 | + owner = newOwner; |
| 46 | + } |
6 | 47 |
|
| 48 | +} |
| 49 | + |
| 50 | +/* |
| 51 | +Attestatuion contract to enter event data for all attestations |
| 52 | +*/ |
| 53 | +contract Attestation is Ownable { |
| 54 | + |
| 55 | + /* |
| 56 | + Attest by user |
| 57 | + */ |
| 58 | + event Attest(address _address,string _type,string _data); |
7 | 59 | function write(string _type,string _data) public returns (bool) {
|
8 | 60 | emit Attest(msg.sender,_type,_data);
|
9 | 61 | return true;
|
10 | 62 | }
|
| 63 | + |
| 64 | + |
| 65 | + event AttestByOwner(string _address,string _type,string _data); |
| 66 | + /* |
| 67 | + Write by owner to be committed in case of data migration |
| 68 | + */ |
| 69 | + function writeByOwner(string _type, string _data, string _address) onlyOwner public returns (bool) { |
| 70 | + emit AttestByOwner(_address,_type,_data); |
| 71 | + return true; |
| 72 | + } |
| 73 | + |
11 | 74 | }
|
0 commit comments