@@ -73,6 +73,10 @@ contract FundingQueue is ColonyExtension, PatriciaTreeProofs, BasicMetaTransacti
7373 // Technically a circular singly-linked list
7474 mapping (uint256 => uint256 ) queue; // proposalId => nextProposalId
7575 mapping (address => uint256 ) metatransactionNonces;
76+
77+ /// @notice Gets the next nonce for a meta-transaction
78+ /// @param userAddress The user's address
79+ /// @return nonce The nonce
7680 function getMetatransactionNonce (address userAddress ) override public view returns (uint256 nonce ){
7781 return metatransactionNonces[userAddress];
7882 }
@@ -84,12 +88,14 @@ contract FundingQueue is ColonyExtension, PatriciaTreeProofs, BasicMetaTransacti
8488 // Public functions
8589
8690 /// @notice Returns the identifier of the extension
87- function identifier () public override pure returns (bytes32 ) {
91+ /// @return _identifier The extension's identifier
92+ function identifier () public override pure returns (bytes32 _identifier ) {
8893 return keccak256 ("FundingQueue " );
8994 }
9095
9196 /// @notice Returns the version of the extension
92- function version () public override pure returns (uint256 ) {
97+ /// @return _version The extension's version number
98+ function version () public override pure returns (uint256 _version ) {
9399 return 3 ;
94100 }
95101
@@ -110,6 +116,7 @@ contract FundingQueue is ColonyExtension, PatriciaTreeProofs, BasicMetaTransacti
110116 function finishUpgrade () public override auth {} // solhint-disable-line no-empty-blocks
111117
112118 /// @notice Called when deprecating (or undeprecating) the extension
119+ /// @param _deprecated Indicates whether the extension should be deprecated or undeprecated
113120 function deprecate (bool _deprecated ) public override auth {
114121 deprecated = _deprecated;
115122 }
@@ -119,6 +126,16 @@ contract FundingQueue is ColonyExtension, PatriciaTreeProofs, BasicMetaTransacti
119126 selfdestruct (address (uint160 (address (colony))));
120127 }
121128
129+ // Public
130+
131+ /// @notice Create a new funding proposal
132+ /// @param _domainId The domain the extension has the funding permission
133+ /// @param _fromChildSkillIndex The index of the fromPot's domain in _domainId.children[]
134+ /// @param _toChildSkillIndex The index of the toPot's domain in _domainId.children[]
135+ /// @param _fromPot Funding pot id providing the funds
136+ /// @param _toPot Funding pot id receiving the funds
137+ /// @param _totalRequested The total amount being requested
138+ /// @param _token The token being transferred
122139 function createProposal (
123140 uint256 _domainId ,
124141 uint256 _fromChildSkillIndex ,
@@ -170,6 +187,9 @@ contract FundingQueue is ColonyExtension, PatriciaTreeProofs, BasicMetaTransacti
170187 emit ProposalCreated (proposalCount, _fromPot, _toPot, _token, _totalRequested);
171188 }
172189
190+ /// @notice Cancel a funding proposal and remove from linked list
191+ /// @param _id The proposal Id
192+ /// @param _prevId The id of the preceding proposal in the linked list
173193 function cancelProposal (uint256 _id , uint256 _prevId ) public {
174194 Proposal storage proposal = proposals[_id];
175195
@@ -189,6 +209,12 @@ contract FundingQueue is ColonyExtension, PatriciaTreeProofs, BasicMetaTransacti
189209 emit ProposalCancelled (_id);
190210 }
191211
212+ /// @notice Stake a funding proposal
213+ /// @param _id The proposal Id
214+ /// @param _key A reputation hash tree key, of the total reputation in _domainId
215+ /// @param _value Reputation value indicating the total reputation in _domainId
216+ /// @param _branchMask The branchmask of the proof
217+ /// @param _siblings The siblings of the proof
192218 function stakeProposal (
193219 uint256 _id ,
194220 bytes memory _key ,
@@ -212,6 +238,15 @@ contract FundingQueue is ColonyExtension, PatriciaTreeProofs, BasicMetaTransacti
212238 emit ProposalStaked (_id, proposal.domainTotalRep);
213239 }
214240
241+ /// @notice Back a funding proposal and advance it along the list
242+ /// @param _id The proposal Id
243+ /// @param _backing The amount of backing to give the proposal (up to user's reputation)
244+ /// @param _currPrevId The current previous proposal in the list
245+ /// @param _newPrevId The new previous proposal after we re-arrange
246+ /// @param _key A reputation hash tree key, of the caller's reputation in _domainId
247+ /// @param _value Reputation value indicating the caller's reputation in _domainId
248+ /// @param _branchMask The branchmask of the proof
249+ /// @param _siblings The siblings of the proof
215250 function backProposal (
216251 uint256 _id ,
217252 uint256 _backing ,
@@ -269,6 +304,8 @@ contract FundingQueue is ColonyExtension, PatriciaTreeProofs, BasicMetaTransacti
269304 emit ProposalBacked (_id, _newPrevId, msgSender (), _backing, prevBacking);
270305 }
271306
307+ /// @notice Transfer the marginal funds
308+ /// @param _id The proposal Id
272309 function pingProposal (uint256 _id ) public {
273310 Proposal storage proposal = proposals[_id];
274311
@@ -324,6 +361,8 @@ contract FundingQueue is ColonyExtension, PatriciaTreeProofs, BasicMetaTransacti
324361 emit ProposalPinged (_id, actualFundingToTransfer);
325362 }
326363
364+ /// @notice Reclaim the stake after the proposal is funded
365+ /// @param _id The proposal Id
327366 function reclaimStake (uint256 _id ) public {
328367 Proposal storage proposal = proposals[_id];
329368
@@ -338,19 +377,31 @@ contract FundingQueue is ColonyExtension, PatriciaTreeProofs, BasicMetaTransacti
338377
339378 // Public view functions
340379
341- function getProposalCount () public view returns (uint256 ) {
380+ /// @notice Get the total number of proposals
381+ /// @return count The count
382+ function getProposalCount () public view returns (uint256 count ) {
342383 return proposalCount;
343384 }
344385
386+ /// @notice Get the proposal struct for a given proposal
387+ /// @param _id The proposal Id
388+ /// @return proposal The proposal struct
345389 function getProposal (uint256 _id ) public view returns (Proposal memory proposal ) {
346390 return proposals[_id];
347391 }
348392
349- function getSupport (uint256 _id , address _supporter ) public view returns (uint256 ) {
393+ /// @notice Gets the reputation support from a user to a proposal
394+ /// @param _id The proposal Id
395+ /// @param _supporter The supporter
396+ /// @return support The support amount
397+ function getSupport (uint256 _id , address _supporter ) public view returns (uint256 support ) {
350398 return supporters[_id][_supporter];
351399 }
352400
353- function getNextProposalId (uint256 _id ) public view returns (uint256 ) {
401+ /// @notice Gets the id of the next proposal in the list
402+ /// @param _id The proposal Id
403+ /// @return nextId The next proposal Id in the list
404+ function getNextProposalId (uint256 _id ) public view returns (uint256 nextId ) {
354405 return queue[_id];
355406 }
356407
0 commit comments