ILM_PC_Bounties_v1.sol

ILM_PC_Bounties_v1

Git Source

Inherits: IERC20PaymentClientBase_v1

Functions

getBountyInformation

Returns the Bounty instance with id id.

function getBountyInformation(uint bountyId)
    external
    view
    returns (Bounty memory);

Parameters

Name
Type
Description

bountyId

uint256

The id of the Bounty to return.

Returns

Name
Type
Description

<none>

Bounty

Bounty with id id.

listBountyIds

Returns total list of Bounty ids.

List is in ascending order.

function listBountyIds() external view returns (uint[] memory);

Returns

Name
Type
Description

<none>

uint256[]

List of Bounty ids.

isExistingBountyId

Returns whether Bounty with id id exists.

function isExistingBountyId(uint bountyId) external view returns (bool);

Parameters

Name
Type
Description

bountyId

uint256

The id of the Bounty to test.

Returns

Name
Type
Description

<none>

bool

True if Claim with id id exists, false otherwise.

getClaimInformation

Returns the Claim instance with id id.

function getClaimInformation(uint claimId)
    external
    view
    returns (Claim memory);

Parameters

Name
Type
Description

claimId

uint256

The id of the Claim to return.

Returns

Name
Type
Description

<none>

Claim

Claim with id id.

listClaimIds

Returns total list of Claim ids.

List is in ascending order.

function listClaimIds() external view returns (uint[] memory);

Returns

Name
Type
Description

<none>

uint256[]

List of Claim ids.

isExistingClaimId

Returns whether Claim with id id exists.

function isExistingClaimId(uint claimId) external view returns (bool);

Parameters

Name
Type
Description

claimId

uint256

The id of the Bounty to test.

Returns

Name
Type
Description

<none>

bool

True if Claim with id id exists, false otherwise.

listClaimIdsForContributorAddress

Returns a list of Claim ids in which contributor Address is used.

List is in ascending order.

Returns an empty .

function listClaimIdsForContributorAddress(address contributorAddrs)
    external
    view
    returns (uint[] memory);

Parameters

Name
Type
Description

contributorAddrs

address

claim ids are filtered by the contributor address.

Returns

Name
Type
Description

<none>

uint256[]

List of Claim ids.

addBounty

Adds a new Bounty.

Reverts if an argument invalid.

function addBounty(
    uint minimumPayoutAmount,
    uint maximumPayoutAmount,
    bytes calldata details
) external returns (uint);

Parameters

Name
Type
Description

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

Name
Type
Description

<none>

uint256

The newly added Bounty id.

addBountyBatch

Adds a new array of Bounties.

Reverts if an argument invalid.

function addBountyBatch(
    uint[] calldata minimumPayoutAmounts,
    uint[] calldata maximumPayoutAmounts,
    bytes[] calldata detailArray
) external returns (uint[] memory ids);

Parameters

Name
Type
Description

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

Name
Type
Description

ids

uint256[]

The newly added array of Bounty ids.

updateBounty

Updates a Bounty's informations.

Reverts if an argument invalid.

function updateBounty(uint bountyId, bytes calldata details) external;

Parameters

Name
Type
Description

bountyId

uint256

The id of the Bounty that will be updated.

details

bytes

The Bounty's details.

lockBounty

Locks the Bounty so it cant be claimed.

Only callable by authorized addresses.

Reverts if id invalid.

function lockBounty(uint bountyId) external;

Parameters

Name
Type
Description

bountyId

uint256

The id of the Bounty that will be locked.

addClaim

Adds a new Claim.

Reverts if an argument invalid.

function addClaim(
    uint bountyId,
    Contributor[] calldata contributors,
    bytes calldata details
) external returns (uint);

Parameters

Name
Type
Description

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

Name
Type
Description

<none>

uint256

The newly added Claim's id.

updateClaimContributors

Updates a Claim's contributor informations.

Reverts if an argument invalid.

function updateClaimContributors(
    uint claimId,
    Contributor[] calldata contributors
) external;

Parameters

Name
Type
Description

claimId

uint256

The id of the Claim that will be updated.

contributors

Contributor[]

The contributor information for the Claim.

updateClaimDetails

Updates a Claim Details.

function updateClaimDetails(uint claimId, bytes calldata details) external;

Parameters

Name
Type
Description

claimId

uint256

The id of the Claim that will be updated.

details

bytes

The Claim's details.

verifyClaim

Completes a Bounty by verifying a claim.

Only callable by authorized addresses.

Reverts if id invalid.

contributors should be copied out of the given Claim. The parameter is used to prevent front running.

function verifyClaim(uint claimId, Contributor[] calldata contributors)
    external;

Parameters

Name
Type
Description

claimId

uint256

The id of the Claim that wants to claim the Bounty.

contributors

Contributor[]

The contributor information for the Claim.

Events

BountyAdded

Event emitted when a new Bounty is added.

event BountyAdded(
    uint indexed bountyId,
    uint minimumPayoutAmount,
    uint maximumPayoutAmount,
    bytes details
);

Parameters

Name
Type
Description

bountyId

uint256

The id of the newly added Bounty.

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.

BountyUpdated

Event emitted when a Bounty got updated.

event BountyUpdated(uint indexed bountyId, bytes details);

Parameters

Name
Type
Description

bountyId

uint256

The id of the updated Bounty.

details

bytes

The Bounty's details.

BountyLocked

Event emitted when a Bounty gets locked.

event BountyLocked(uint indexed bountyId);

Parameters

Name
Type
Description

bountyId

uint256

The id of the locked Bounty.

ClaimAdded

Event emitted when a new Claim is added.

event ClaimAdded(
    uint indexed claimId,
    uint indexed bountyId,
    Contributor[] contributors,
    bytes details
);

Parameters

Name
Type
Description

claimId

uint256

The id of the newly added Claim.

bountyId

uint256

The id of the Bounty that got claimed.

contributors

Contributor[]

The contributor information for the Claim.

details

bytes

The Claim's details.

ClaimContributorsUpdated

Event emitted when Claim Contributors got updated.

event ClaimContributorsUpdated(
    uint indexed claimId, Contributor[] contributors
);

Parameters

Name
Type
Description

claimId

uint256

The id of the Claim that got updated.

contributors

Contributor[]

The contributor information for the Claim.

ClaimDetailsUpdated

Event emitted when Claim Details got updated.

event ClaimDetailsUpdated(uint indexed claimId, bytes details);

Parameters

Name
Type
Description

claimId

uint256

The id of the Claim that got updated.

details

bytes

The Claim's details.

ClaimVerified

Event emitted when a Claim is verified.

event ClaimVerified(uint indexed claimId);

Parameters

Name
Type
Description

claimId

uint256

The id of the Claim that got verified.

Errors

Module__LM_PC_Bounty__OnlyClaimContributor

Access only to addresses that are listed as contributors in the according claim.

error Module__LM_PC_Bounty__OnlyClaimContributor();

Module__LM_PC_Bounty__InvalidPayoutAmounts

Given payoutAmounts are either zero or maximumPayoutAmount is smaller than minimumPayoutAmount.

error Module__LM_PC_Bounty__InvalidPayoutAmounts();

Module__LM_PC_Bounty__InvalidArrayLengths

Given array lengths are invalid.

error Module__LM_PC_Bounty__InvalidArrayLengths();

Module__LM_PC_Bounty__InvalidBountyId

Given Bounty id is not existing.

error Module__LM_PC_Bounty__InvalidBountyId();

Module__LM_PC_Bounty__InvalidClaimId

Given Claim id is not existing.

error Module__LM_PC_Bounty__InvalidClaimId();

Module__LM_PC_Bounty__InvalidContributorsLength

Given Contributors list is empty.

error Module__LM_PC_Bounty__InvalidContributorsLength();

Module__LM_PC_Bounty__InvalidContributorAmount

Given claim Amount for contributor is zero.

error Module__LM_PC_Bounty__InvalidContributorAmount();

Module__LM_PC_Bounty__InvalidContributorAddress

Given Contributor address is invalid.

error Module__LM_PC_Bounty__InvalidContributorAddress();

Module__LM_PC_Bounty__ClaimExceedsGivenPayoutAmounts

Given total claims of contributors exceed or are below the given payout amounts of the bounty.

error Module__LM_PC_Bounty__ClaimExceedsGivenPayoutAmounts();

Module__LM_PC_Bounty__BountyLocked

Given Bounty id is Locked.

error Module__LM_PC_Bounty__BountyLocked();

Module__LM_PC_Bounty__AlreadyClaimed

Given Claim id got already claimed.

error Module__LM_PC_Bounty__AlreadyClaimed();

Module__LM_PC_Bounty__ContributorsChanged

The given Contributors are not the same as in the claim. This might be connected to a tried front run of the given transaction.

error Module__LM_PC_Bounty__ContributorsChanged();

Structs

Bounty

Struct used to store information about a bounty.

struct Bounty {
    uint minimumPayoutAmount;
    uint maximumPayoutAmount;
    bytes details;
    bool locked;
}

Properties

Name
Type
Description

minimumPayoutAmount

uint256

Minimum amount of tokens that can be paid out upon fulfillment of the bounty.

maximumPayoutAmount

uint256

Maximum amount of tokens that can be paid out upon fulfillment of the bounty.

details

bytes

Arbitrary data to store Bounty details if necessary. CAN be empty.

locked

bool

If locked, the Bounty is no longer available for a claim.

Contributor

Struct used to store information about a Bounty contributor.

struct Contributor {
    address addr;
    uint claimAmount;
}

Properties

Name
Type
Description

addr

address

The contributor's address.

claimAmount

uint256

The amount of tokens the Contributor gets upon claiming the bounty.

Claim

Struct used to store information about a Bounty Claim.

struct Claim {
    uint bountyId;
    Contributor[] contributors;
    bytes details;
    bool claimed;
}

Properties

Name
Type
Description

bountyId

uint256

The id of the bounty this claim belongs to.

contributors

Contributor[]

The contributors of the claim. MUST not be empty.

details

bytes

Arbitrary data to store Claim details if necessary. CAN be empty.

claimed

bool

Whether this Claim claimed its bounty already.

Inherits: IERC20PaymentClientBase_v1

Functions

getBountyInformation

Returns the Bounty instance with id id.

function getBountyInformation(uint bountyId)
    external
    view
    returns (Bounty memory);

Parameters

Name
Type
Description

bountyId

uint256

The id of the Bounty to return.

Returns

Name
Type
Description

<none>

Bounty

Bounty with id id.

listBountyIds

Returns total list of Bounty ids.

List is in ascending order.

function listBountyIds() external view returns (uint[] memory);

Returns

Name
Type
Description

<none>

uint256[]

List of Bounty ids.

isExistingBountyId

Returns whether Bounty with id id exists.

function isExistingBountyId(uint bountyId) external view returns (bool);

Parameters

Name
Type
Description

bountyId

uint256

The id of the Bounty to test.

Returns

Name
Type
Description

<none>

bool

True if Claim with id id exists, false otherwise.

getClaimInformation

Returns the Claim instance with id id.

function getClaimInformation(uint claimId)
    external
    view
    returns (Claim memory);

Parameters

Name
Type
Description

claimId

uint256

The id of the Claim to return.

Returns

Name
Type
Description

<none>

Claim

Claim with id id.

listClaimIds

Returns total list of Claim ids.

List is in ascending order.

function listClaimIds() external view returns (uint[] memory);

Returns

Name
Type
Description

<none>

uint256[]

List of Claim ids.

isExistingClaimId

Returns whether Claim with id id exists.

function isExistingClaimId(uint claimId) external view returns (bool);

Parameters

Name
Type
Description

claimId

uint256

The id of the Bounty to test.

Returns

Name
Type
Description

<none>

bool

True if Claim with id id exists, false otherwise.

listClaimIdsForContributorAddress

Returns a list of Claim ids in which contributor Address is used.

List is in ascending order.

Returns an empty .

function listClaimIdsForContributorAddress(address contributorAddrs)
    external
    view
    returns (uint[] memory);

Parameters

Name
Type
Description

contributorAddrs

address

claim ids are filtered by the contributor address.

Returns

Name
Type
Description

<none>

uint256[]

List of Claim ids.

addBounty

Adds a new Bounty.

Reverts if an argument invalid.

function addBounty(
    uint minimumPayoutAmount,
    uint maximumPayoutAmount,
    bytes calldata details
) external returns (uint);

Parameters

Name
Type
Description

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

Name
Type
Description

<none>

uint256

The newly added Bounty id.

addBountyBatch

Adds a new array of Bounties.

Reverts if an argument invalid.

function addBountyBatch(
    uint[] calldata minimumPayoutAmounts,
    uint[] calldata maximumPayoutAmounts,
    bytes[] calldata detailArray
) external returns (uint[] memory ids);

Parameters

Name
Type
Description

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

Name
Type
Description

ids

uint256[]

The newly added array of Bounty ids.

updateBounty

Updates a Bounty's informations.

Reverts if an argument invalid.

function updateBounty(uint bountyId, bytes calldata details) external;

Parameters

Name
Type
Description

bountyId

uint256

The id of the Bounty that will be updated.

details

bytes

The Bounty's details.

lockBounty

Locks the Bounty so it cant be claimed.

Only callable by authorized addresses.

Reverts if id invalid.

function lockBounty(uint bountyId) external;

Parameters

Name
Type
Description

bountyId

uint256

The id of the Bounty that will be locked.

addClaim

Adds a new Claim.

Reverts if an argument invalid.

function addClaim(
    uint bountyId,
    Contributor[] calldata contributors,
    bytes calldata details
) external returns (uint);

Parameters

Name
Type
Description

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

Name
Type
Description

<none>

uint256

The newly added Claim's id.

updateClaimContributors

Updates a Claim's contributor informations.

Reverts if an argument invalid.

function updateClaimContributors(
    uint claimId,
    Contributor[] calldata contributors
) external;

Parameters

Name
Type
Description

claimId

uint256

The id of the Claim that will be updated.

contributors

Contributor[]

The contributor information for the Claim.

updateClaimDetails

Updates a Claim Details.

function updateClaimDetails(uint claimId, bytes calldata details) external;

Parameters

Name
Type
Description

claimId

uint256

The id of the Claim that will be updated.

details

bytes

The Claim's details.

verifyClaim

Completes a Bounty by verifying a claim.

Only callable by authorized addresses.

Reverts if id invalid.

contributors should be copied out of the given Claim. The parameter is used to prevent front running.

function verifyClaim(uint claimId, Contributor[] calldata contributors)
    external;

Parameters

Name
Type
Description

claimId

uint256

The id of the Claim that wants to claim the Bounty.

contributors

Contributor[]

The contributor information for the Claim.

Events

BountyAdded

Event emitted when a new Bounty is added.

event BountyAdded(
    uint indexed bountyId,
    uint minimumPayoutAmount,
    uint maximumPayoutAmount,
    bytes details
);

Parameters

Name
Type
Description

bountyId

uint256

The id of the newly added Bounty.

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.

BountyUpdated

Event emitted when a Bounty got updated.

event BountyUpdated(uint indexed bountyId, bytes details);

Parameters

Name
Type
Description

bountyId

uint256

The id of the updated Bounty.

details

bytes

The Bounty's details.

BountyLocked

Event emitted when a Bounty gets locked.

event BountyLocked(uint indexed bountyId);

Parameters

Name
Type
Description

bountyId

uint256

The id of the locked Bounty.

ClaimAdded

Event emitted when a new Claim is added.

event ClaimAdded(
    uint indexed claimId,
    uint indexed bountyId,
    Contributor[] contributors,
    bytes details
);

Parameters

Name
Type
Description

claimId

uint256

The id of the newly added Claim.

bountyId

uint256

The id of the Bounty that got claimed.

contributors

Contributor[]

The contributor information for the Claim.

details

bytes

The Claim's details.

ClaimContributorsUpdated

Event emitted when Claim Contributors got updated.

event ClaimContributorsUpdated(
    uint indexed claimId, Contributor[] contributors
);

Parameters

Name
Type
Description

claimId

uint256

The id of the Claim that got updated.

contributors

Contributor[]

The contributor information for the Claim.

ClaimDetailsUpdated

Event emitted when Claim Details got updated.

event ClaimDetailsUpdated(uint indexed claimId, bytes details);

Parameters

Name
Type
Description

claimId

uint256

The id of the Claim that got updated.

details

bytes

The Claim's details.

ClaimVerified

Event emitted when a Claim is verified.

event ClaimVerified(uint indexed claimId);

Parameters

Name
Type
Description

claimId

uint256

The id of the Claim that got verified.

Errors

Module__LM_PC_Bounty__OnlyClaimContributor

Access only to addresses that are listed as contributors in the according claim.

error Module__LM_PC_Bounty__OnlyClaimContributor();

Module__LM_PC_Bounty__InvalidPayoutAmounts

Given payoutAmounts are either zero or maximumPayoutAmount is smaller than minimumPayoutAmount.

error Module__LM_PC_Bounty__InvalidPayoutAmounts();

Module__LM_PC_Bounty__InvalidArrayLengths

Given array lengths are invalid.

error Module__LM_PC_Bounty__InvalidArrayLengths();

Module__LM_PC_Bounty__InvalidBountyId

Given Bounty id is not existing.

error Module__LM_PC_Bounty__InvalidBountyId();

Module__LM_PC_Bounty__InvalidClaimId

Given Claim id is not existing.

error Module__LM_PC_Bounty__InvalidClaimId();

Module__LM_PC_Bounty__InvalidContributorsLength

Given Contributors list is empty.

error Module__LM_PC_Bounty__InvalidContributorsLength();

Module__LM_PC_Bounty__InvalidContributorAmount

Given claim Amount for contributor is zero.

error Module__LM_PC_Bounty__InvalidContributorAmount();

Module__LM_PC_Bounty__InvalidContributorAddress

Given Contributor address is invalid.

error Module__LM_PC_Bounty__InvalidContributorAddress();

Module__LM_PC_Bounty__ClaimExceedsGivenPayoutAmounts

Given total claims of contributors exceed or are below the given payout amounts of the bounty.

error Module__LM_PC_Bounty__ClaimExceedsGivenPayoutAmounts();

Module__LM_PC_Bounty__BountyLocked

Given Bounty id is Locked.

error Module__LM_PC_Bounty__BountyLocked();

Module__LM_PC_Bounty__AlreadyClaimed

Given Claim id got already claimed.

error Module__LM_PC_Bounty__AlreadyClaimed();

Module__LM_PC_Bounty__ContributorsChanged

The given Contributors are not the same as in the claim. This might be connected to a tried front run of the given transaction.

error Module__LM_PC_Bounty__ContributorsChanged();

Structs

Bounty

Struct used to store information about a bounty.

struct Bounty {
    uint minimumPayoutAmount;
    uint maximumPayoutAmount;
    bytes details;
    bool locked;
}

Properties

Name
Type
Description

minimumPayoutAmount

uint256

Minimum amount of tokens that can be paid out upon fulfillment of the bounty.

maximumPayoutAmount

uint256

Maximum amount of tokens that can be paid out upon fulfillment of the bounty.

details

bytes

Arbitrary data to store Bounty details if necessary. CAN be empty.

locked

bool

If locked, the Bounty is no longer available for a claim.

Contributor

Struct used to store information about a Bounty contributor.

struct Contributor {
    address addr;
    uint claimAmount;
}

Properties

Name
Type
Description

addr

address

The contributor's address.

claimAmount

uint256

The amount of tokens the Contributor gets upon claiming the bounty.

Claim

Struct used to store information about a Bounty Claim.

struct Claim {
    uint bountyId;
    Contributor[] contributors;
    bytes details;
    bool claimed;
}

Properties

Name
Type
Description

bountyId

uint256

The id of the bounty this claim belongs to.

contributors

Contributor[]

The contributors of the claim. MUST not be empty.

details

bytes

Arbitrary data to store Claim details if necessary. CAN be empty.

claimed

bool

Whether this Claim claimed its bounty already.

Last updated