-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContributor.sol
36 lines (28 loc) · 1.15 KB
/
Contributor.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
pragma solidity ^0.4.8;
contract Contributor {
enum ContributorType { author, reviewer, author_reviewer, other }
// Maps user Ethereum addresses to ORCIDs
mapping (address => uint32) ORCID;
// Maps user Ethereum addresses to their IPFS profiles
mapping (address => string) contributorIpfsHash;
// Maps user Ethereum addresses to contributors' different types
mapping (address => UserType) ContributorType;
function UpdateORCID(uint32 id) {
ORCID[msg.sender] = id;
}
function GetORCID(address userAddress) constant returns (uint32) {
return ORCID[userAddress];
}
function UpdateContributorIpfs(string ipfsProfileHash) {
contributorIpfsHash[msg.sender] = ipfsProfileHash;
}
function GetContributorIpfs(address userAddress) constant returns (string) {
return contributorIpfsHash[userAddress];
}
function updateContributorType(ContributorType newType) {
ContributorType[msg.sender] = newType;
}
function GetContributorType(address userAddress) constant returns (ContributorType) {
return ContributorType[userAddress];
}
}