1
0
mirror of https://github.com/dap-ps/discover.git synced 2025-02-01 03:54:46 +00:00

Adds withdrawMax view function for use in UI

This commit is contained in:
andytudhope 2019-05-29 11:34:38 +02:00
parent 22718646d2
commit 4805add080

View File

@ -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.