Inverter Documentation
GithubDiscordTwitterLinks
  • Getting Started
  • Concepts
    • What is Inverter Network
    • The Inverter Protocol
    • Protocol Concepts
      • Workflow Model
        • Factories
        • Orchestrator
        • Authorizer
        • Funding Manager
        • Payment Processor
        • Logic Module
      • Module Library
        • Authorizers
          • Role Authorizer
          • Single Vote Governance Module
          • Token Gated Role Authorizer
        • Funding Managers
          • PIMs
            • Bancor Based PIM: Virtual Supply
            • Bancor Based PIM: Virtual Supply Buy Restriction
          • Deposit Vault Funding Manager
        • Payment Processors
          • Streaming Payment Processor
          • Simple Payment Processor
        • Logic Modules
          • Bounty Manager
          • Recurring Payment Manager
          • KPI Rewarder
          • Staking Manager
      • Primary Issuance Markets (PIMs)
      • Governance
      • Security
        • Upgradeability
        • Emergency Protocol
        • Audits
        • Bug Bounties
      • Fees
  • SDK's
    • TypeScript SDK
      • Deploy a Workflow
      • Operate a Workflow
      • Deploy a Contract
    • React SDK
      • Deploy a Workflow
      • Operate a Workflow
      • Deploy a Contract
      • Query the Indexer
      • Subscribe to the Indexer
    • Graphql SDK
    • Workflow Guides
      • Grant/Revoke Roles
      • Bounty Manager
      • Bonding Curve
      • Deposit Vault
    • API
      • Inverter
      • getDeployWorkflowOptions
      • deployWorkflow
      • getModule
      • getWorkflow
      • deploy
  • Contracts
    • Technical Specification
    • Security Guidelines
    • Deployment Addresses
    • Technical Reference
      • Factories
        • Interfaces
          • IModuleFactory_v1.sol
          • IOrchestratorFactory_v1.sol
        • ModuleFactory_v1.sol
        • OrchestratorFactory_v1.sol
      • Orchestrator
        • Abstracts
          • ModuleManagerBase_v1.sol
        • Interfaces
          • IModuleManagerBase_v1.sol
          • IOrchestrator_v1.sol
        • Orchestrator_v1.sol
      • Modules
        • Authorizer
          • Role
            • Interfaces
              • IAUT_EXT_VotingRoles_v1.sol
              • IAUT_TokenGated_Roles_v1.sol
            • AUT_EXT_VotingRoles_v1.sol
            • AUT_Roles_v1.sol
            • AUT_TokenGated_Roles_v1.sol
          • IAuthorizer_v1.sol
        • Base
          • IModule_v1.sol
          • Module_v1.sol
        • Funding Manager
          • Deposit Vault
            • FM_DepositVault_v1
            • Interfaces
              • IFM_DepositVault_v1
          • Bonding Curve
            • Abstracts
              • BondingCurveBase_v1.sol
              • RedeemingBondingCurveBase_v1.sol
              • VirtualCollateralSupplyBase_v1.sol
              • VirtualIssuanceSupplyBase_v1.sol
            • Formulas
              • BancorFormula.sol
              • Utils.sol
            • Interfaces
              • IBancorFormula.sol
              • IBondingCurveBase_v1.sol
              • IFM_BC_Bancor_Redeeming_VirtualSupply_v1.sol
              • IRedeemingBondingCurveBase_v1.sol
              • IVirtualCollateralSupplyBase_v1.sol
              • IVirtualIssuanceSupplyBase_v1.sol
            • FM_BC_Bancor_Redeeming_VirtualSupply_v1.sol
            • FM_BC_Restricted_Bancor_Redeeming_VirtualSupply_v1.sol
            • FM_BC_Tools
          • IFundingManager_v1.sol
        • Logic Module
          • Abstracts
            • ERC20PaymentClientBase_v1.sol
            • Oracle Integrations
              • UMA Optimistic Oracle V3
                • Optimistic Oracle V3
                  • Interfaces
                    • OptimisticOracleV3CallbackRecipientInterface.sol
                    • OptimisticOracleV3Interface.sol
                  • AncillaryData.sol
                  • ClaimData.sol
                • IOptimisticOracleIntegrator.sol
                • OptimisticOracleIntegrator.sol
          • Interfaces
            • IERC20PaymentClientBase_v1.sol
            • ILM_PC_Bounties_v1.sol
            • ILM_PC_KPIRewarder_v1.sol
            • ILM_PC_PaymentRouter_v1.sol
            • ILM_PC_RecurringPayments_v1.sol
            • ILM_PC_Staking_v1.sol
          • LM_PC_Bounties_v1.sol
          • LM_PC_KPIRewarder_v1.sol
          • LM_PC_PaymentRouter_v1.sol
          • LM_PC_RecurringPayments_v1.sol
          • LM_PC_Staking_v1.sol
        • Payment Processor
          • Interfaces
            • IPP_Streaming_v1.sol
          • IPaymentProcessor_v1.sol
          • PP_Simple_v1.sol
          • PP_Streaming_v1.sol
        • Lib
          • LibMetadata.sol
          • LinkedIdList.sol
          • SafeMath.sol
      • External
        • Fees
          • Interfaces
            • IFeeManager_v1.sol
          • FeeManager_v1.sol
        • Forwarder
          • Interfaces
            • ITransactionForwarder_v1.sol
          • TransactionForwarder_v1
        • Governance
          • Interfaces
            • IGovernor_v1.sol
          • Governor_v1.sol
        • Reverter
          • InverterReverter_v1.sol
        • ERC20Issuance
          • Interfaces
            • IERC20Issuance_v1.sol
          • ERC20Issuance_v1.sol
        • Interfaces
          • IERC2771Context.sol
      • Proxies
        • Interfaces
          • IInverterBeacon_v1.sol
          • IInverterProxyAdmin_v1.sol
          • IInverterTransparentUpgradeableProxy_v1.sol
        • InverterBeacon_v1.sol
        • InverterBeaconProxy_v1.sol
        • InverterProxyAdmin_v1.sol
        • InverterTransparentUpgradeableProxy_v1.sol
  • Apps
  • Support
Powered by GitBook
On this page
  • State Variables
  • Modifiers
  • Public Functions
  • Internal Functions
  1. Contracts
  2. Technical Reference
  3. Modules
  4. Logic Module

LM_PC_Bounties_v1.sol

PreviousILM_PC_Staking_v1.solNextLM_PC_KPIRewarder_v1.sol

Last updated 5 months ago

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.

State Variables

_SENTINEL

Marks the beginning of the list.

uint internal constant _SENTINEL = type(uint).max;

BOUNTY_ISSUER_ROLE

Role for the bounty issuer.

bytes32 public constant BOUNTY_ISSUER_ROLE = "BOUNTY_ISSUER";

CLAIMANT_ROLE

Role for the claimant.

bytes32 public constant CLAIMANT_ROLE = "CLAIMANT";

VERIFIER_ROLE

Role for the verifier.

bytes32 public constant VERIFIER_ROLE = "VERIFIER";

_nextId

Value for what the next id will be.

uint private _nextId;

_bountyRegistry

Registry mapping ids to Bounty structs id => Bounty.

mapping(uint => Bounty) private _bountyRegistry;

_bountyList

List of Bounty id's.

LinkedIdList.List _bountyList;

_claimRegistry

Registry mapping ids to Claim struct id => Claim.

mapping(uint => Claim) private _claimRegistry;

_claimList

List of Claim id's.

LinkedIdList.List _claimList;

contributorAddressToClaimIds

Connects contributor addresses to claim Ids contributor address => claim ids.

mapping(address => EnumerableSet.UintSet) contributorAddressToClaimIds;

__gap

Storage gap for future upgrades.

uint[50] private __gap;

Modifiers

supportsInterface

See {IERC165-supportsInterface}.

function supportsInterface(bytes4 interfaceId)
    public
    view
    virtual
    override(ERC20PaymentClientBase_v1)
    returns (bool);

onlyClaimContributor

Checks if the sender is a contributor of the given claimId.

modifier onlyClaimContributor(uint claimId);

Parameters

Name
Type
Description

claimId

uint256

The id of the claim to check.

validPayoutAmounts

Checks if the payout amounts are valid.

modifier validPayoutAmounts(uint minimumPayoutAmount, uint maximumPayoutAmount);

Parameters

Name
Type
Description

minimumPayoutAmount

uint256

The minimum payout amount.

maximumPayoutAmount

uint256

The maximum payout amount.

validArrayLengths

Checks if the array lengths are valid

modifier validArrayLengths(
    uint minimumPayoutAmountLength,
    uint maximumPayoutAmountLength,
    uint detailArrayLength
);

Parameters

Name
Type
Description

minimumPayoutAmountLength

uint256

The minimum payout amount length

maximumPayoutAmountLength

uint256

The maximum payout amount length

detailArrayLength

uint256

The detail array length

validBountyId

Checks if the bountyId is valid.

modifier validBountyId(uint bountyId);

Parameters

Name
Type
Description

bountyId

uint256

The id of the bounty to check.

validClaimId

Checks if the claimId is valid.

modifier validClaimId(uint claimId);

Parameters

Name
Type
Description

claimId

uint256

The id of the claim to check.

notLocked

Checks if the bounty is not locked.

modifier notLocked(uint bountyId);

Parameters

Name
Type
Description

bountyId

uint256

The id of the bounty to check.

notClaimed

Checks if the claim is not claimed.

modifier notClaimed(uint claimId);

Parameters

Name
Type
Description

claimId

uint256

The id of the claim to check.

_contributorsNotChanged

Checks if the contributors have not changed.

function _contributorsNotChanged(
    uint claimId,
    Contributor[] memory contributors
) internal view;

Parameters

Name
Type
Description

claimId

uint256

The id of the claim to check.

contributors

Contributor[]

The new contributors to check.

Public Functions

init

function init(
    IOrchestrator_v1 orchestrator_,
    Metadata memory metadata,
    bytes memory
) external override(Module_v1) initializer;

getBountyInformation

Returns the Bounty instance with id id.

function getBountyInformation(uint bountyId)
    external
    view
    validBountyId(bountyId)
    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) public 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
    validClaimId(claimId)
    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) public 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.

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
    onlyModuleRole(BOUNTY_ISSUER_ROLE)
    validPayoutAmounts(minimumPayoutAmount, maximumPayoutAmount)
    returns (uint id);

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

id

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
    onlyModuleRole(BOUNTY_ISSUER_ROLE)
    validArrayLengths(
        minimumPayoutAmounts.length,
        maximumPayoutAmounts.length,
        detailArray.length
    )
    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
    onlyModuleRole(BOUNTY_ISSUER_ROLE)
    validBountyId(bountyId)
    notLocked(bountyId);

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.

function lockBounty(uint bountyId)
    external
    onlyModuleRole(BOUNTY_ISSUER_ROLE)
    validBountyId(bountyId)
    notLocked(bountyId);

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
    onlyModuleRole(CLAIMANT_ROLE)
    validBountyId(bountyId)
    notLocked(bountyId)
    returns (uint id);

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

id

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
    validClaimId(claimId)
    notClaimed(claimId)
    notLocked(_claimRegistry[claimId].bountyId)
    onlyModuleRole(CLAIMANT_ROLE);

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
    validClaimId(claimId)
    notClaimed(claimId)
    notLocked(_claimRegistry[claimId].bountyId)
    onlyClaimContributor(claimId);

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.

function verifyClaim(uint claimId, Contributor[] calldata contributors)
    external
    onlyModuleRole(VERIFIER_ROLE)
    validClaimId(claimId)
    notClaimed(claimId)
    notLocked(_claimRegistry[claimId].bountyId);

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.

Internal Functions

_validPayoutAmounts

Internal function to check if the payout amounts are valid

function _validPayoutAmounts(uint minimumPayoutAmount, uint maximumPayoutAmount)
    internal
    pure;

Parameters

Name
Type
Description

minimumPayoutAmount

uint256

The minimum payout amount

maximumPayoutAmount

uint256

The maximum payout amount

_validContributorsForBounty

Checks if the contributors are valid for the given bounty.

function _validContributorsForBounty(
    Contributor[] memory contributors,
    Bounty memory bounty
) internal view;

Parameters

Name
Type
Description

contributors

Contributor[]

The contributors to check.

bounty

Bounty

The bounty to check.

_addBounty

Internal function to add a bounty

function _addBounty(
    uint minimumPayoutAmount,
    uint maximumPayoutAmount,
    bytes calldata details
) internal returns (uint bountyId);

Parameters

Name
Type
Description

minimumPayoutAmount

uint256

The minimum payout amount

maximumPayoutAmount

uint256

The maximum payout amount

details

bytes

The details of the bounty

Returns

Name
Type
Description

bountyId

uint256

The id of the bounty

Git Source