Skip to content

Commit

Permalink
first step towards trust levels on solved challenges
Browse files Browse the repository at this point in the history
  • Loading branch information
axelpoise committed May 17, 2016
1 parent ef3562d commit 1a67bda
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/contracts/WalletTrust.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
contract WalletTrust{

struct solvedChallenge{
uint challengeID;
}
address private wallet;
address private creator;

solvedChallenge[] trust;


function WalletTrust(address _wallet){
creator = msg.sender;
wallet = _wallet;
}

modifier isCreator(){
if(msg.sender != creator){
throw;
}
}

function increaseTrust(uint _challengeID) isCreator {
for (uint i= 0 ; i <trust.length; i++){
if (_challengeID == trust[i].challengeID){
throw;
}
}
trust.push(solvedChallenge({challengeID:_challengeID}));
}

function getTrustLevel() isCreator constant returns(uint){
return trust.length;
}
function getWallet() isCreator constant returns(address){
wallet;
}
}

0 comments on commit 1a67bda

Please sign in to comment.