Skip to content

Commit 01ea5d9

Browse files
authored
Merge pull request #38 from SpringRole/karan/airdrop/changes
attestation change
2 parents 9b9ffc4 + f492338 commit 01ea5d9

File tree

1 file changed

+65
-2
lines changed

1 file changed

+65
-2
lines changed

contracts/Attestation.sol

+65-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,74 @@
11
pragma solidity ^0.4.24;
22

3-
contract Attestation {
3+
/**
4+
* Contract for Vanity URL on SpringRole
5+
* Go to beta.springrole.com to try this out!
6+
*/
47

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+
}
647

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);
759
function write(string _type,string _data) public returns (bool) {
860
emit Attest(msg.sender,_type,_data);
961
return true;
1062
}
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+
1174
}

0 commit comments

Comments
 (0)