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
  • Functions
  • Errors
  • Structs
  1. Contracts
  2. Technical Reference
  3. Modules
  4. Lib

LinkedIdList.sol

PreviousLibMetadata.solNextSafeMath.sol

Last updated 5 months ago

State Variables

_SENTINEL

Marks the beginning of the list.

Unrealistic to have that many ids.

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

Functions

validNewId

Modifier to guarantee the given new id is valid.

modifier validNewId(List storage self, uint id);

validId

Modifier to guarantee the given id is valid.

modifier validId(List storage self, uint id);

validPosition

Modifier to guarantee the given position is valid.

modifier validPosition(List storage self, uint id);

onlyConsecutiveIds

Modifier to guarantee the given ids are consecutive.

modifier onlyConsecutiveIds(List storage self, uint prevId, uint id);

validMoveParameter

prevId is checked by consecutiveId to be valid

modifier validMoveParameter(
    List storage self,
    uint id,
    uint prevId,
    uint idToPositionAfter
);

init

should never be called more than once

function init(List storage self) internal;

length

function length(List storage self) internal view returns (uint);

lastId

Returns the last id in

function lastId(List storage self) internal view returns (uint);

listIds

lists the ids contained in the linked list.

function listIds(List storage self) internal view returns (uint[] memory);

Parameters

Name
Type
Description

self

List

The linked List from where the ids should be listed.

Returns

Name
Type
Description

<none>

uint256[]

array of ids that are contained in the list

isExistingId

Returns whether id is in list and not Sentinel

function isExistingId(List storage self, uint id)
    internal
    view
    returns (bool);

Parameters

Name
Type
Description

self

List

The linked List from where the ids should be listed.

id

uint256

The id to check.

getPreviousId

Id and prevId can be _SENTINEL

function getPreviousId(List storage self, uint id)
    internal
    view
    validPosition(self, id)
    returns (uint prevId);

Parameters

Name
Type
Description

self

List

The linked List from where the ids should be listed.

id

uint256

The id to check.

getNextId

Id and nextId can be _SENTINEL

function getNextId(List storage self, uint id)
    internal
    view
    validPosition(self, id)
    returns (uint nextId);

Parameters

Name
Type
Description

self

List

The linked List from which to get the next id.

id

uint256

The id to check.

addId

Add To list at last position

function addId(List storage self, uint id) internal validNewId(self, id);

Parameters

Name
Type
Description

self

List

The linked List to which to add the id.

id

uint256

The id to add.

removeId

Remove Id from list and decrease size.

function removeId(List storage self, uint prevId, uint id)
    internal
    validId(self, id)
    onlyConsecutiveIds(self, prevId, id);

Parameters

Name
Type
Description

self

List

The linked List from which to remove the id.

prevId

uint256

The id of the previous id.

id

uint256

The id to remove.

moveIdInList

Move id in list

function moveIdInList(
    List storage self,
    uint id,
    uint prevId,
    uint idToPositionAfter
) internal validMoveParameter(self, id, prevId, idToPositionAfter);

Parameters

Name
Type
Description

self

List

The linked List in which to move the id.

id

uint256

The id to move.

prevId

uint256

The id of the previous id.

idToPositionAfter

uint256

The id to position after.

Errors

Library__LinkedIdList__InvalidId

Given id invalid.

error Library__LinkedIdList__InvalidId();

Library__LinkedIdList__InvalidNewId

Given new id invalid.

error Library__LinkedIdList__InvalidNewId();

Library__LinkedIdList__InvalidPosition

Given position in list is invalid.

error Library__LinkedIdList__InvalidPosition();

Library__LinkedIdList__IdNotConsecutive

Given ids are not consecutive.

error Library__LinkedIdList__IdNotConsecutive();

Library__LinkedIdList__InvalidIntermediatePosition

Given ids are not consecutive.

error Library__LinkedIdList__InvalidIntermediatePosition();

Structs

List

Struct used to store information about an element in the list.

struct List {
    uint size;
    uint last;
    mapping(uint => uint) list;
}

Properties

Name
Type
Description

size

uint256

last

uint256

list

mapping(uint256 => uint256)

Git Source