1
0
mirror of https://github.com/dap-ps/discover.git synced 2025-02-07 15:05:07 +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/livenet/password
config/production/password config/production/password
coverage coverage
src/embarkArtifacts
embarkArtifacts embarkArtifacts
node_modules node_modules
package-lock.json package-lock.json

View File

@ -42,7 +42,7 @@ contract Discover is ApproveAndCallFallBack, BancorFormula {
Data[] public dapps; Data[] public dapps;
mapping(bytes32 => uint) public id2index; mapping(bytes32 => uint) public id2index;
mapping(bytes32 => bool) existingIDs; mapping(bytes32 => bool) public existingIDs;
event DAppCreated(bytes32 indexed id, uint newEffectiveBalance); event DAppCreated(bytes32 indexed id, uint newEffectiveBalance);
event Upvote(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); _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 * @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. SNT they originally staked minus what they have already received back in downvotes.

View File

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