LM_PC_Bounties_v1.sol
Last updated
Last updated
Inherits: ILM_PC_Bounties_v1, ERC20PaymentClientBase_v1
Author: Inverter Network
Provides functionality to manage bounties and process claims, allowing participants to propose, update, and claim bounties securely and transparently.
Extends {ERC20PaymentClientBase_v1} to integrate payment processing with bounty management, supporting dynamic additions, updates, and the locking of bounties. Utilizes roles for managing permissions and maintaining robust control over bounty operations.
Marks the beginning of the list.
Role for the bounty issuer.
Role for the claimant.
Role for the verifier.
Value for what the next id will be.
Registry mapping ids to Bounty structs id => Bounty.
List of Bounty id's.
Registry mapping ids to Claim struct id => Claim.
List of Claim id's.
Connects contributor addresses to claim Ids contributor address => claim ids.
Storage gap for future upgrades.
See {IERC165-supportsInterface}.
Checks if the sender is a contributor of the given claimId.
Parameters
claimId
uint256
The id of the claim to check.
Checks if the payout amounts are valid.
Parameters
minimumPayoutAmount
uint256
The minimum payout amount.
maximumPayoutAmount
uint256
The maximum payout amount.
Checks if the array lengths are valid
Parameters
minimumPayoutAmountLength
uint256
The minimum payout amount length
maximumPayoutAmountLength
uint256
The maximum payout amount length
detailArrayLength
uint256
The detail array length
Checks if the bountyId is valid.
Parameters
bountyId
uint256
The id of the bounty to check.
Checks if the claimId is valid.
Parameters
claimId
uint256
The id of the claim to check.
Checks if the bounty is not locked.
Parameters
bountyId
uint256
The id of the bounty to check.
Checks if the claim is not claimed.
Parameters
claimId
uint256
The id of the claim to check.
Checks if the contributors have not changed.
Parameters
claimId
uint256
The id of the claim to check.
contributors
Contributor[]
The new contributors to check.
Returns the Bounty instance with id id
.
Parameters
bountyId
uint256
The id of the Bounty to return.
Returns
<none>
Bounty
Bounty with id id
.
Returns total list of Bounty ids.
List is in ascending order.
Returns
<none>
uint256[]
List of Bounty ids.
Returns whether Bounty with id id
exists.
Parameters
bountyId
uint256
The id of the Bounty to test.
Returns
<none>
bool
True if Claim with id id
exists, false otherwise.
Returns the Claim instance with id id
.
Parameters
claimId
uint256
The id of the Claim to return.
Returns
<none>
Claim
Claim with id id
.
Returns total list of Claim ids.
List is in ascending order.
Returns
<none>
uint256[]
List of Claim ids.
Returns whether Claim with id id
exists.
Parameters
claimId
uint256
The id of the Bounty to test.
Returns
<none>
bool
True if Claim with id id
exists, false otherwise.
Returns a list of Claim ids in which contributor Address is used.
List is in ascending order.
Parameters
contributorAddrs
address
claim ids are filtered by the contributor address.
Returns
<none>
uint256[]
List of Claim ids.
Adds a new Bounty.
Reverts if an argument invalid.
Parameters
minimumPayoutAmount
uint256
The minimum amount of tokens the Bounty will pay out upon being claimed.
maximumPayoutAmount
uint256
The maximum amount of tokens the Bounty will pay out upon being claimed.
details
bytes
The Bounty's details.
Returns
id
uint256
The newly added Bounty id.
Adds a new array of Bounties.
Reverts if an argument invalid.
Parameters
minimumPayoutAmounts
uint256[]
The array of minimum amount of tokens the Bounty will pay out upon being claimed
maximumPayoutAmounts
uint256[]
The array of maximum amount of tokens the Bounty will pay out upon being claimed
detailArray
bytes[]
The array of Bounty's details.
Returns
ids
uint256[]
The newly added array of Bounty ids.
Updates a Bounty's informations.
Reverts if an argument invalid.
Parameters
bountyId
uint256
The id of the Bounty that will be updated.
details
bytes
The Bounty's details.
Locks the Bounty so it cant be claimed.
Only callable by authorized addresses.
Parameters
bountyId
uint256
The id of the Bounty that will be locked.
Adds a new Claim.
Reverts if an argument invalid.
Parameters
bountyId
uint256
The id of the bounty this claim belongs to.
contributors
Contributor[]
The contributor information for the Claim.
details
bytes
The Claim's details.
Returns
id
uint256
The newly added Claim's id.
Updates a Claim's contributor informations.
Reverts if an argument invalid.
Parameters
claimId
uint256
The id of the Claim that will be updated.
contributors
Contributor[]
The contributor information for the Claim.
Updates a Claim Details.
Parameters
claimId
uint256
The id of the Claim that will be updated.
details
bytes
The Claim's details.
Completes a Bounty by verifying a claim.
Only callable by authorized addresses.
Parameters
claimId
uint256
The id of the Claim that wants to claim the Bounty.
contributors
Contributor[]
The contributor information for the Claim.
Internal function to check if the payout amounts are valid
Parameters
minimumPayoutAmount
uint256
The minimum payout amount
maximumPayoutAmount
uint256
The maximum payout amount
Checks if the contributors are valid for the given bounty.
Parameters
contributors
Contributor[]
The contributors to check.
bounty
Bounty
The bounty to check.
Internal function to add a bounty
Parameters
minimumPayoutAmount
uint256
The minimum payout amount
maximumPayoutAmount
uint256
The maximum payout amount
details
bytes
The details of the bounty
Returns
bountyId
uint256
The id of the bounty