1
0
mirror of https://github.com/dap-ps/discover.git synced 2025-01-31 19:45:53 +00:00
This commit is contained in:
Kamen Stoykov 2019-05-31 14:01:49 +03:00
commit 1069143140
3 changed files with 14 additions and 2 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@ config/development/mnemonic
config/livenet/password
config/production/password
coverage
src/embarkArtifacts
embarkArtifacts
node_modules
package-lock.json

View File

@ -42,7 +42,7 @@ contract Discover is ApproveAndCallFallBack, BancorFormula {
Data[] public dapps;
mapping(bytes32 => uint) public id2index;
mapping(bytes32 => bool) existingIDs;
mapping(bytes32 => bool) public existingIDs;
event DAppCreated(bytes32 indexed id, uint newEffectiveBalance);
event Upvote(bytes32 indexed id, uint newEffectiveBalance);
@ -96,6 +96,17 @@ contract Discover is ApproveAndCallFallBack, BancorFormula {
_downvote(msg.sender, _id, _amount);
}
/**
* @dev Developers can withdraw an amount not more than what was available of the
SNT they originally staked minus what they have already received back in downvotes.
* @param _id bytes32 unique identifier.
* @return max SNT that can be withdrawn == available SNT for DApp.
*/
function withdrawMax(bytes32 _id) external view returns(uint) {
Data storage d = _getDAppById(_id);
return d.available;
}
/**
* @dev Developers can withdraw an amount not more than what was available of the
SNT they originally staked minus what they have already received back in downvotes.

View File

@ -22,5 +22,5 @@
"optimize-runs": 200
}
},
"generationDir": "embarkArtifacts"
"generationDir": "src/embarkArtifacts"
}