mirror of
https://github.com/dap-ps/discover.git
synced 2025-02-07 15:05:07 +00:00
Merge branch 'master' of https://github.com/dap-ps/discover
This commit is contained in:
commit
1069143140
1
.gitignore
vendored
1
.gitignore
vendored
@ -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
|
||||||
|
@ -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.
|
||||||
|
@ -22,5 +22,5 @@
|
|||||||
"optimize-runs": 200
|
"optimize-runs": 200
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"generationDir": "embarkArtifacts"
|
"generationDir": "src/embarkArtifacts"
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user