diff --git a/.github/workflows/scripts/list_all_errorcodes.sh b/.github/workflows/scripts/list_all_errorcodes.sh index 97319187..9f354ccb 100755 --- a/.github/workflows/scripts/list_all_errorcodes.sh +++ b/.github/workflows/scripts/list_all_errorcodes.sh @@ -1,4 +1,4 @@ #!/bin/bash printf "|Errorcode|File|\n|:--|:--|\n" -egrep -or "(ERROR\:[A-Z0-9_-]+\:[A-Z0-9_-]+)" contracts/* | sed -E "s/([^\:]+)\:(.+)/|\2|\1|/g" | sort +egrep -or "\"(ERROR\:[A-Z0-9_-]+\:[A-Z0-9_-]+)\"" contracts/* | sed -E "s/([^\:]+)\:\"(.+)\"/|\2|\1|/g" | sort diff --git a/.github/workflows/scripts/validate_errorcodes.sh b/.github/workflows/scripts/validate_errorcodes.sh index b0f076cc..f80e4809 100755 --- a/.github/workflows/scripts/validate_errorcodes.sh +++ b/.github/workflows/scripts/validate_errorcodes.sh @@ -1,6 +1,6 @@ #!/bin/bash -DUPES=`egrep -or "(ERROR\:[A-Z0-9_-]+)" contracts/* | sort | uniq -cd` +DUPES=`egrep -or "\"(ERROR\:[A-Z0-9_-]+)\"" contracts/* | sort | uniq -cd` if [ -z "$DUPES" ]; then echo "No duplicate error codes found" diff --git a/.gitignore b/.gitignore index 354cbe22..daedaec9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,9 @@ __pycache__ .history .hypothesis/ build/ +artifacts/ reports/ +cache/ dump_sources/ node_modules tmp/ @@ -14,3 +16,4 @@ tmp/ .vscode/launch.json etherisc*.tgz + diff --git a/contracts/Migrations.sol b/contracts/Migrations.sol index 4e0c8ad9..e57c581e 100644 --- a/contracts/Migrations.sol +++ b/contracts/Migrations.sol @@ -5,6 +5,9 @@ contract Migrations { address public owner; uint256 public last_completed_migration; // solhint-disable-line + /** + * @dev Constructor function that sets the contract owner to the address of the sender. + */ constructor() { owner = msg.sender; } @@ -13,10 +16,18 @@ contract Migrations { if (msg.sender == owner) _; } + /** + * @dev Sets the value of the last completed migration to the given value. + * @param _completed The new value for the last completed migration. + */ function setCompleted(uint256 _completed) public restricted { last_completed_migration = _completed; } + /** + * @dev Upgrades the Migrations contract to a new address. + * @param _newAddress The address of the new Migrations contract. + */ function upgrade(address _newAddress) public restricted { Migrations upgraded = Migrations(_newAddress); upgraded.setCompleted(last_completed_migration); diff --git a/contracts/examples/AyiiOracle.sol b/contracts/examples/AyiiOracle.sol index c6f60494..8b33bd12 100644 --- a/contracts/examples/AyiiOracle.sol +++ b/contracts/examples/AyiiOracle.sol @@ -27,6 +27,15 @@ contract AyiiOracle is uint256 aaay ); + /** + * @dev Constructor function for the ChainlinkOracle contract. + * @param _name The name of the oracle contract. + * @param _registry The address of the oracle registry contract. + * @param _chainLinkToken The address of the Chainlink token contract. + * @param _chainLinkOperator The address of the Chainlink oracle operator. + * @param _jobId The ID of the Chainlink job to be used. + * @param _payment The payment amount to be sent to the Chainlink oracle operator. + */ constructor( bytes32 _name, address _registry, @@ -44,6 +53,13 @@ contract AyiiOracle is _payment); } + /** + * @dev Update request details for Chainlink oracle job. + * @param _chainLinkToken The address of the Chainlink token contract. + * @param _chainLinkOperator The address of the Chainlink oracle operator. + * @param _jobId The job ID for the Chainlink oracle job. + * @param _payment The payment amount for the Chainlink oracle job. + */ function updateRequestDetails( address _chainLinkToken, address _chainLinkOperator, @@ -60,6 +76,14 @@ contract AyiiOracle is payment = _payment; } + /** + * @dev Sends a Chainlink request to retrieve data for a specific GIF request. + * @param gifRequestId The ID of the GIF request. + * @param input The encoded input data containing the project ID, UAI ID, and crop ID. + * The input must be in the following format: abi.encode([bytes32 projectId, bytes32 uaiId, bytes32 cropId]). + * @notice This function emits 1 events: + * - LogAyiiRequest + */ function request(uint256 gifRequestId, bytes calldata input) external override onlyQuery @@ -86,6 +110,16 @@ contract AyiiOracle is emit LogAyiiRequest(gifRequestId, chainlinkRequestId); } + /** + * @dev This function is used to fulfill a Chainlink request for the given parameters. + * @param chainlinkRequestId The ID of the Chainlink request to fulfill. + * @param projectId The ID of the project. + * @param uaiId The ID of the UAI. + * @param cropId The ID of the crop. + * @param aaay The amount of AAAY. + * @notice This function emits 1 events: + * - LogAyiiFulfill + */ function fulfill( bytes32 chainlinkRequestId, bytes32 projectId, @@ -103,6 +137,10 @@ contract AyiiOracle is emit LogAyiiFulfill(gifRequest, chainlinkRequestId, projectId, uaiId, cropId, aaay); } + /** + * @dev Cancels a Chainlink request. + * @param requestId The ID of the request to cancel. + */ function cancel(uint256 requestId) external override onlyOwner @@ -112,6 +150,15 @@ contract AyiiOracle is } // only used for testing of chainlink operator + /** + * @dev Encodes the parameters required for a Chainlink request fulfillment. + * @param chainlinkRequestId The ID of the Chainlink request. + * @param projectId The ID of the project. + * @param uaiId The ID of the UAI. + * @param cropId The ID of the crop. + * @param aaay The value of aaay. + * @return parameterData The encoded parameter data. + */ function encodeFulfillParameters( bytes32 chainlinkRequestId, bytes32 projectId, @@ -132,18 +179,34 @@ contract AyiiOracle is ); } + /** + * @dev Returns the Chainlink Job ID associated with this contract. + * @return chainlinkJobId The Chainlink Job ID as a bytes32 variable. + */ function getChainlinkJobId() external view returns(bytes32 chainlinkJobId) { return jobId; } + /** + * @dev Returns the payment amount for a Chainlink oracle request. + * @return paymentAmount The payment amount in uint256. + */ function getChainlinkPayment() external view returns(uint256 paymentAmount) { return payment; } + /** + * @dev Returns the address of the Chainlink token. + * @return linkTokenAddress The address of the Chainlink token. + */ function getChainlinkToken() external view returns(address linkTokenAddress) { return chainlinkTokenAddress(); } + /** + * @dev Returns the address of the Chainlink operator. + * @return operator The address of the Chainlink operator. + */ function getChainlinkOperator() external view returns(address operator) { return chainlinkOracleAddress(); } diff --git a/contracts/examples/AyiiProduct.sol b/contracts/examples/AyiiProduct.sol index 1f6b0e5b..8f3925fd 100644 --- a/contracts/examples/AyiiProduct.sol +++ b/contracts/examples/AyiiProduct.sol @@ -80,6 +80,15 @@ contract AyiiProduct is event LogTransferHelperInputValidation2Failed(uint256 balance, uint256 allowance); event LogTransferHelperCallFailed(bool callSuccess, uint256 returnDataLength, bytes returnData); + /** + * @dev Constructor function for creating a new instance of a Product contract. + * @param productName Name of the product. + * @param registry Address of the registry contract. + * @param token Address of the token contract. + * @param oracleId ID of the oracle. + * @param riskpoolId ID of the risk pool. + * @param insurer Address of the insurer. + */ constructor( bytes32 productName, address registry, @@ -97,6 +106,19 @@ contract AyiiProduct is _setupRole(INSURER_ROLE, insurer); } + /** + * @dev Creates a new risk for a project, UAI and crop with the specified parameters. + * @param projectId The ID of the project associated with the risk. + * @param uaiId The ID of the UAI associated with the risk. + * @param cropId The ID of the crop associated with the risk. + * @param trigger The trigger value for the risk. + * @param exit The exit value for the risk. + * @param tsi The total sum insured for the risk. + * @param aph The area per hectare for the crop. + * @return riskId The ID of the newly created risk. + * @notice This function emits 1 events: + * - LogAyiiRiskDataCreated + */ function createRisk( bytes32 projectId, bytes32 uaiId, @@ -136,6 +158,25 @@ contract AyiiProduct is risk.cropId); } + /** + * @dev Allows the insurer to adjust the parameters of an existing risk. + * @param riskId The ID of the risk to be adjusted. + * @param trigger The new trigger value for the risk. + * @param exit The new exit value for the risk. + * @param tsi The new total sum insured value for the risk. + * @param aph The new annual premium value for the risk. + * + * Emits a LogAyiiRiskDataBeforeAdjustment event with the risk's data before adjustment. + * Emits a LogAyiiRiskDataAfterAdjustment event with the risk's data after adjustment. + * + * Requirements: + * - The caller must have the INSURER_ROLE. + * - The risk must exist. + * - The risk must have no policies associated with it. + * @notice This function emits 2 events: + * - LogAyiiRiskDataAfterAdjustment + * - LogAyiiRiskDataBeforeAdjustment + */ function adjustRisk( bytes32 riskId, uint256 trigger, @@ -172,6 +213,13 @@ contract AyiiProduct is risk.aph); } + /** + * @dev Calculates the unique risk ID for a project, UAI and crop. + * @param projectId The bytes32 ID of the project. + * @param uaiId The bytes32 ID of the UAI. + * @param cropId The bytes32 ID of the crop. + * @return riskId The bytes32 ID of the unique risk. + */ function getRiskId( bytes32 projectId, bytes32 uaiId, @@ -185,6 +233,17 @@ contract AyiiProduct is } + /** + * @dev Creates a new policy application for a given policy holder and risk. + * @param policyHolder The address of the policy holder. + * @param premium The amount of premium to be paid for the policy. + * @param sumInsured The amount of coverage provided by the policy. + * @param riskId The unique identifier of the risk associated with the policy. + * @return processId The unique identifier of the newly created policy application. + * @notice This function emits 2 events: + * - LogAyiiPolicyApplicationCreated + * - LogAyiiPolicyCreated + */ function applyForPolicy( address policyHolder, uint256 premium, @@ -230,6 +289,15 @@ contract AyiiProduct is } } + /** + * @dev Allows the INSURER_ROLE to underwrite an insurance application for a given processId. + * @param processId The unique identifier of the insurance application. + * @return success A boolean indicating whether the underwriting process was successful or not. + * + * Emits a LogAyiiPolicyCreated event if the underwriting process is successful, containing the processId, the owner of the application, the premium amount and the sum insured amount. + * @notice This function emits 1 events: + * - LogAyiiPolicyCreated + */ function underwrite( bytes32 processId ) @@ -252,6 +320,13 @@ contract AyiiProduct is } } + /** + * @dev Collects the premium for a specific policy. + * @param policyId The ID of the policy for which to collect the premium. + * @return success A boolean indicating whether the premium was collected successfully. + * @return fee The fee collected by the insurer. + * @return netPremium The net premium collected by the insurer after deducting the fee. + */ function collectPremium(bytes32 policyId) external onlyRole(INSURER_ROLE) @@ -266,6 +341,15 @@ contract AyiiProduct is * the 2nd transfer transfers the amount from the customer to the riskpool wallet (and some * fees to the instance wallet) */ + /** + * @dev Collects premium from a policyholder for a specific policy. + * @param policyId The ID of the policy for which premium is being collected. + * @param from The address of the policyholder from whom the premium is being collected. + * @param amount The amount of premium being collected. + * @return success A boolean indicating whether the premium collection was successful or not. + * @return fee The fee charged for the premium collection. + * @return netPremium The net premium collected after deducting the fee. + */ function collectPremium(bytes32 policyId, address from, uint256 amount) external onlyRole(INSURER_ROLE) @@ -284,6 +368,12 @@ contract AyiiProduct is (success, fee, netPremium) = _collectPremium(policyId, amount); } + /** + * @dev Adjusts the premium and sum insured amounts for a given insurance process. + * @param processId The unique identifier of the insurance process. + * @param expectedPremiumAmount The expected premium amount for the insurance process. + * @param sumInsuredAmount The sum insured amount for the insurance process. + */ function adjustPremiumSumInsured( bytes32 processId, uint256 expectedPremiumAmount, @@ -295,6 +385,20 @@ contract AyiiProduct is _adjustPremiumSumInsured(processId, expectedPremiumAmount, sumInsuredAmount); } + /** + * @dev Triggers an oracle request for a specific process ID. + * @param processId The ID of the process to trigger the oracle request for. + * @return requestId The ID of the oracle request triggered. + * + * Emits a LogAyiiRiskDataRequested event with the requestId, risk ID, project ID, UAI ID and crop ID. + * + * Requirements: + * - Caller must have the INSURER_ROLE. + * - The risk must be defined. + * - The oracle must not have already responded to the request. + * @notice This function emits 1 events: + * - LogAyiiRiskDataRequested + */ function triggerOracle(bytes32 processId) external onlyRole(INSURER_ROLE) @@ -329,6 +433,20 @@ contract AyiiProduct is risk.cropId); } + /** + * @dev Allows the insurer to cancel a specific oracle request for a given process ID. + * @param processId The unique process ID associated with the risk. + * + * Emits a LogAyiiRiskDataRequestCancelled event indicating the cancellation of the oracle request. + * + * Requirements: + * - The caller must have the INSURER_ROLE. + * - The risk must exist in the _risks mapping. + * - The oracle request must have been triggered for the risk. + * - There must not be an existing callback for the oracle request. + * @notice This function emits 1 events: + * - LogAyiiRiskDataRequestCancelled + */ function cancelOracleRequest(bytes32 processId) external onlyRole(INSURER_ROLE) @@ -347,6 +465,18 @@ contract AyiiProduct is emit LogAyiiRiskDataRequestCancelled(processId, risk.requestId); } + /** + * @dev Callback function for the oracle to update the risk data for a project. + * @param requestId The ID of the oracle request. + * @param processId The ID of the oracle process. + * @param responseData The response data from the oracle, which is expected to be an ABI-encoded tuple containing the following fields: + * - projectId: The ID of the project. + * - uaiId: The ID of the UAI. + * - cropId: The ID of the crop. + * - aaay: The AAAY value for the project. + * @notice This function emits 1 events: + * - LogAyiiRiskDataReceived + */ function oracleCallback( uint256 requestId, bytes32 processId, @@ -393,6 +523,23 @@ contract AyiiProduct is aaay); } + /** + * @dev Process a batch of policies for a given risk. + * @param riskId ID of the risk to process policies for. + * @param batchSize Number of policies to process in a single batch. + * @return processedPolicies An array of policy IDs that were processed. + * Emits a LogAyiiRiskProcessed event with the processed batch size. + * Requirements: + * - Caller must have the INSURER_ROLE. + * - The risk must have a response from the oracle. + * - The policies set for the given risk must not be empty. + * - If batchSize is 0, processes all policies in a single batch. + * - If batchSize is greater than the number of policies, processes all policies in a single batch. + * - If batchSize is less than the number of policies, processes batchSize policies in a single batch. + * @notice This function emits 2 events: + * - LogAyiiRiskProcessed + * - LogAyiiRiskProcessed + */ function processPoliciesForRisk(bytes32 riskId, uint256 batchSize) external onlyRole(INSURER_ROLE) @@ -423,6 +570,14 @@ contract AyiiProduct is emit LogAyiiRiskProcessed(riskId, batchSize); } + /** + * @dev Processes a policy by calculating the claim amount, creating a new claim, and emitting events for the claim and payout. + * @param policyId The ID of the policy to be processed. + * @notice This function emits 3 events: + * - LogAyiiPayoutCreated + * - LogAyiiClaimCreated + * - LogAyiiPolicyProcessed + */ function processPolicy(bytes32 policyId) public onlyRole(INSURER_ROLE) @@ -465,6 +620,12 @@ contract AyiiProduct is emit LogAyiiPolicyProcessed(policyId); } + /** + * @dev Calculates the payout amount based on the payout percentage and sum insured amount. + * @param payoutPercentage The percentage of the sum insured amount that will be paid out. + * @param sumInsuredAmount The total amount that is insured. + * @return payoutAmount The calculated payout amount. + */ function calculatePayout(uint256 payoutPercentage, uint256 sumInsuredAmount) public pure @@ -473,6 +634,15 @@ contract AyiiProduct is payoutAmount = payoutPercentage * sumInsuredAmount / PERCENTAGE_MULTIPLIER; } + /** + * @dev Calculates the payout percentage based on the given parameters. + * @param tsi The maximum payout percentage. + * @param trigger The harvest ratio at and above which no payout is made. + * @param exit The harvest ratio at and below which the maximum payout is made. + * @param aph The average historical yield. + * @param aaay This season's yield. + * @return payoutPercentage The calculated payout percentage. + */ function calculatePayoutPercentage( uint256 tsi, // max payout percentage uint256 trigger,// at and above this harvest ratio no payout is made @@ -499,40 +669,97 @@ contract AyiiProduct is payoutPercentage = tsi * (trigger - harvestRatio) / (trigger - exit); } + /** + * @dev Returns the percentage multiplier used in calculations. + * @return multiplier The value of the percentage multiplier. + */ function getPercentageMultiplier() external pure returns(uint256 multiplier) { return PERCENTAGE_MULTIPLIER; } + /** + * @dev Returns the minimum value between two uint256 numbers. + * @param a The first uint256 number to compare. + * @param b The second uint256 number to compare. + * @return The minimum value between a and b. + */ function min(uint256 a, uint256 b) private pure returns (uint256) { return a <= b ? a : b; } + /** + * @dev Returns the number of risk ids in the _riskIds array. + * @return The length of the _riskIds array. + */ function risks() external view returns(uint256) { return _riskIds.length; } + /** + * @dev Returns the risk ID at the given index. + * @param idx The index of the risk ID to retrieve. + * @return riskId The risk ID at the given index. + */ function getRiskId(uint256 idx) external view returns(bytes32 riskId) { return _riskIds[idx]; } + /** + * @dev Returns the Risk struct associated with the given riskId. + * @param riskId The unique identifier of the Risk to retrieve. + * @return risk The Risk struct containing the details of the requested risk. + */ function getRisk(bytes32 riskId) external view returns(Risk memory risk) { return _risks[riskId]; } + /** + * @dev Returns the number of applications submitted. + * @return applicationCount The number of applications submitted. + */ function applications() external view returns(uint256 applicationCount) { return _applications.length; } + /** + * @dev Returns the process ID of a specific application. + * @param applicationIdx The index of the application in the array. + * @return processId The process ID of the application. + */ function getApplicationId(uint256 applicationIdx) external view returns(bytes32 processId) { return _applications[applicationIdx]; } + /** + * @dev Returns the number of policies for a given risk ID. + * @param riskId The ID of the risk. + * @return policyCount The number of policies for the given risk ID. + */ function policies(bytes32 riskId) external view returns(uint256 policyCount) { return EnumerableSet.length(_policies[riskId]); } + /** + * @dev Returns the processId of the policy at the specified index in the list of policies associated with the given riskId. + * @param riskId The unique identifier of the risk. + * @param policyIdx The index of the policy in the list of policies associated with the given riskId. + * @return processId The unique identifier of the process associated with the policy at the specified index. + */ function getPolicyId(bytes32 riskId, uint256 policyIdx) external view returns(bytes32 processId) { return EnumerableSet.at(_policies[riskId], policyIdx); } + /** + * @dev Returns the data structure of the application. + * @return dataStructure A string representing the data structure of the application, which consists of a single parameter: + * - riskId: A bytes32 value representing the unique identifier of the risk. + */ function getApplicationDataStructure() external override pure returns(string memory dataStructure) { return "(bytes32 riskId)"; } + /** + * @dev Validates the risk parameters for a new position. + * @param trigger The trigger percentage for the new position. + * @param exit The exit percentage for the new position. + * @param tsi The TSI (Time Since Inception) for the new position. + * @param aph The APH (Annual Premium Hours) for the new position. + * + */ function _validateRiskParameters( uint256 trigger, uint256 exit, @@ -551,6 +778,15 @@ contract AyiiProduct is require(aph <= RISK_APH_MAX, "ERROR:AYI-047:RISK_APH_TOO_LARGE"); } + /** + * @dev Processes a policy by calculating the claim amount, creating a claim, confirming it, creating a payout, processing it, and emitting events accordingly. + * @param policyId The ID of the policy to be processed. + * @param risk The Risk struct containing the payout percentage. + * @notice This function emits 3 events: + * - LogAyiiPolicyProcessed + * - LogAyiiPayoutCreated + * - LogAyiiClaimCreated + */ function _processPolicy(bytes32 policyId, Risk memory risk) internal { @@ -581,6 +817,11 @@ contract AyiiProduct is emit LogAyiiPolicyProcessed(policyId); } + /** + * @dev Returns the risk ID associated with a given process ID. + * @param processId The process ID for which to retrieve the risk ID. + * @return riskId The risk ID associated with the given process ID. + */ function _getRiskId(bytes32 processId) private view returns(bytes32 riskId) { IPolicy.Application memory application = _getApplication(processId); (riskId) = abi.decode(application.data, (bytes32)); diff --git a/contracts/examples/AyiiRiskpool.sol b/contracts/examples/AyiiRiskpool.sol index 292fa598..87385ca7 100644 --- a/contracts/examples/AyiiRiskpool.sol +++ b/contracts/examples/AyiiRiskpool.sol @@ -1,63 +1,87 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity 0.8.2; - -import "@openzeppelin/contracts/access/AccessControl.sol"; - -import "@etherisc/gif-interface/contracts/components/BasicRiskpool.sol"; -import "@etherisc/gif-interface/contracts/modules/IBundle.sol"; -import "@etherisc/gif-interface/contracts/modules/IPolicy.sol"; - -contract AyiiRiskpool is - BasicRiskpool, - AccessControl -{ - // 0x5614e11ca6d7673c9c8dcec913465d676494aad1151bb2c1cf40b9d99be4d935 - bytes32 public constant INVESTOR_ROLE = keccak256("INVESTOR"); - - // restricts the maximal sum of sum insured that are secured by gthe riskpool - uint256 public constant SUM_OF_SUM_INSURED_CAP = 10**24; - - constructor( - bytes32 name, - uint256 collateralization, - address erc20Token, - address wallet, - address registry - ) - BasicRiskpool(name, collateralization, SUM_OF_SUM_INSURED_CAP, erc20Token, wallet, registry) - { - - _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); - } - - - function grantInvestorRole(address investor) - external - onlyOwner - { - _setupRole(INVESTOR_ROLE, investor); - } - - - function createBundle(bytes memory filter, uint256 initialAmount) - public override - onlyRole(INVESTOR_ROLE) - returns(uint256 bundleId) - { - bundleId = super.createBundle(filter, initialAmount); - } - - - // trivial implementation that matches every application - function bundleMatchesApplication( - IBundle.Bundle memory bundle, - IPolicy.Application memory application - ) - public override - pure - returns(bool isMatching) - { - isMatching = true; - } - +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.2; + +import "@openzeppelin/contracts/access/AccessControl.sol"; + +import "@etherisc/gif-interface/contracts/components/BasicRiskpool.sol"; +import "@etherisc/gif-interface/contracts/modules/IBundle.sol"; +import "@etherisc/gif-interface/contracts/modules/IPolicy.sol"; + +contract AyiiRiskpool is + BasicRiskpool, + AccessControl +{ + // 0x5614e11ca6d7673c9c8dcec913465d676494aad1151bb2c1cf40b9d99be4d935 + bytes32 public constant INVESTOR_ROLE = keccak256("INVESTOR"); + + // restricts the maximal sum of sum insured that are secured by gthe riskpool + uint256 public constant SUM_OF_SUM_INSURED_CAP = 10**24; + + /** + * @dev Constructor for creating a new Riskpool with the given parameters. + * @param name The name of the Riskpool. + * @param collateralization The collateralization percentage of the Riskpool. + * @param erc20Token The address of the ERC20 token used for collateral. + * @param wallet The address of the wallet where the collateral will be held. + * @param registry The address of the registry contract. + */ + constructor( + bytes32 name, + uint256 collateralization, + address erc20Token, + address wallet, + address registry + ) + BasicRiskpool(name, collateralization, SUM_OF_SUM_INSURED_CAP, erc20Token, wallet, registry) + { + + _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); + } + + + /** + * @dev Grants the INVESTOR_ROLE to the specified address. + * @param investor The address to grant the INVESTOR_ROLE to. + */ + function grantInvestorRole(address investor) + external + onlyOwner + { + _setupRole(INVESTOR_ROLE, investor); + } + + + /** + * @dev Creates a new bundle with the specified filter and initial amount. + * @param filter The filter to be applied to the bundle. + * @param initialAmount The initial amount of tokens to be deposited into the bundle. + * @return bundleId The ID of the newly created bundle. + */ + function createBundle(bytes memory filter, uint256 initialAmount) + public override + onlyRole(INVESTOR_ROLE) + returns(uint256 bundleId) + { + bundleId = super.createBundle(filter, initialAmount); + } + + + // trivial implementation that matches every application + /** + * @dev Checks if a given bundle matches a given application. + * @param bundle The bundle to check. + * @param application The application to match against. + * @return isMatching Returns true if the bundle matches the application. + */ + function bundleMatchesApplication( + IBundle.Bundle memory bundle, + IPolicy.Application memory application + ) + public override + pure + returns(bool isMatching) + { + isMatching = true; + } + } \ No newline at end of file diff --git a/contracts/examples/mock/ChainlinkOperator.sol b/contracts/examples/mock/ChainlinkOperator.sol index 0b3f65da..9acc9a0a 100644 --- a/contracts/examples/mock/ChainlinkOperator.sol +++ b/contracts/examples/mock/ChainlinkOperator.sol @@ -48,12 +48,26 @@ contract ChainlinkOperator is _; } + /** + * @dev Constructor function that inherits from the Ownable contract. + */ constructor() Ownable() { } /** * @notice Sets the fulfillment permission for a given node. Use `true` to allow, `false` to disallow. * @param senders The addresses of the authorized Chainlink node */ + /** + * @dev Sets the authorized senders for the contract. Only the authorized sender setter can call this function. + * @param senders An array of addresses to be set as authorized senders. + * + * Requirements: + * - The length of the senders array must be greater than 0. + * + * Emits an {AuthorizedSendersChanged} event indicating the updated list of authorized senders and the address of the sender who called the function. + * @notice This function emits 1 events: + * - AuthorizedSendersChanged + */ function setAuthorizedSenders(address[] calldata senders) external validateAuthorizedSenderSetter @@ -74,6 +88,10 @@ contract ChainlinkOperator is } + /** + * @dev Returns an array of authorized senders. + * @return An array of addresses representing the authorized senders. + */ function getAuthorizedSenders() external view @@ -90,6 +108,12 @@ contract ChainlinkOperator is * @param amount Amount of LINK sent (specified in wei) * @param data Payload of the transaction */ + /** + * @dev This function is called when a token transfer occurs. It ensures that the correct sender and amount are passed in the data parameter, and then calls the oracleRequest function via delegatecall. + * @param sender The address of the token sender. + * @param amount The amount of tokens being sent. + * @param data The data payload for the token transfer, which must include the oracleRequest function signature and any additional data required for the function. + */ function onTokenTransfer( address sender, uint256 amount, @@ -124,6 +148,19 @@ contract ChainlinkOperator is * @param dataVersion The specified data version * @param data The extra request parameters */ + /** + * @dev Sends an oracle request with specified parameters to the oracle contract. + * @param sender The address of the requester. + * @param payment The amount of LINK sent as payment for the request. + * @param specId The ID of the job specification for the request. + * @param callbackAddress The address of the contract that will receive the response. + * @param callbackFunctionId The function ID of the function that will receive the response. + * @param nonce A unique identifier for the request. + * @param dataVersion The version of the data schema being used. + * @param data The data being sent as part of the request. + * @notice This function emits 1 events: + * - OracleRequest + */ function oracleRequest( address sender, uint256 payment, @@ -163,6 +200,19 @@ contract ChainlinkOperator is * @param data The data to return to the consuming contract * @return Status if the external call was successful */ + /** + * @dev Fulfill an oracle request by verifying it and processing the payment. Then emit an `OracleResponse` event. + * The function also checks if the consumer provided enough gas and calls the callback function. + * @param requestId The ID of the oracle request. + * @param payment The payment amount for the oracle request. + * @param callbackAddress The address of the contract to be called back. + * @param callbackFunctionId The function signature of the callback function. + * @param expiration The expiration time of the oracle request. + * @param data The data to be sent to the callback function. + * @return success A boolean value indicating whether the callback function was successfully called or not. + * @notice This function emits 1 events: + * - OracleResponse + */ function fulfillOracleRequest2( bytes32 requestId, uint256 payment, @@ -200,6 +250,17 @@ contract ChainlinkOperator is * @param callbackFunctionId The callback function ID for the response * @param nonce The nonce sent by the requester */ + /** + * @dev Verifies and processes an oracle request. + * @param sender The address of the sender making the request. + * @param payment The amount of payment to be made for the request. + * @param callbackAddress The address of the contract to receive the callback. + * @param callbackFunctionId The function signature of the callback function. + * @param nonce A unique identifier for the request. + * @param dataVersion The version of the data being requested. + * @return requestId The unique identifier for the request. + * @return expiration The expiration time for the request. + */ function _verifyAndProcessOracleRequest( address sender, uint256 payment, @@ -232,6 +293,15 @@ contract ChainlinkOperator is * @param callbackFunctionId The callback function ID to use for fulfillment * @param expiration The expiration that the node should respond by before the requester can cancel */ + /** + * @dev Verifies the oracle request and processes the payment. + * @param requestId The ID of the request. + * @param payment The amount of payment to be processed. + * @param callbackAddress The address of the callback function. + * @param callbackFunctionId The function ID of the callback function. + * @param expiration The expiration time of the request. + * @param dataVersion The version of the data. + */ function _verifyOracleRequestAndProcessPayment( bytes32 requestId, uint256 payment, @@ -258,6 +328,14 @@ contract ChainlinkOperator is * @param expiration The expiration that the node should respond by before the requester can cancel * @return hash bytes31 */ + /** + * @dev Generates a hash value based on the function parameters. + * @param payment The payment amount to be included in the hash. + * @param callbackAddress The address to be called back after the transaction. + * @param callbackFunctionId The function ID to be called back after the transaction. + * @param expiration The expiration time for the transaction. + * @return Hash value generated from the function parameters. + */ function _buildParamsHash( uint256 payment, address callbackAddress, @@ -273,6 +351,14 @@ contract ChainlinkOperator is * @param number uint256 * @return uint8 number */ + /** + * @dev Safely casts a uint256 to a uint8. + * @param number The uint256 number to cast. + * @return The uint8 representation of the number. + * + * Requirements: + * - number must be less than MAXIMUM_DATA_VERSION. + */ function _safeCastToUint8(uint256 number) internal pure returns (uint8) { require(number < MAXIMUM_DATA_VERSION, "number too big to cast"); return uint8(number); @@ -282,6 +368,10 @@ contract ChainlinkOperator is * @notice concrete implementation of AuthorizedReceiver * @return bool of whether sender is authorized */ + /** + * @dev Checks if the caller is the owner of the contract and can set authorized senders. + * @return A boolean indicating whether the caller is the owner of the contract. + */ function _canSetAuthorizedSenders() internal view returns (bool) { return owner() == msg.sender; } diff --git a/contracts/examples/mock/ChainlinkToken.sol b/contracts/examples/mock/ChainlinkToken.sol index efc43cf6..967dfc21 100644 --- a/contracts/examples/mock/ChainlinkToken.sol +++ b/contracts/examples/mock/ChainlinkToken.sol @@ -4,14 +4,32 @@ pragma solidity 0.8.2; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; abstract contract ERC677Receiver { + /** + * @dev This function is called when tokens are transferred to this contract. + * @param _sender The address of the sender. + * @param _value The amount of tokens being transferred. + * @param _data Additional data with no specified format. + */ function onTokenTransfer (address _sender, uint _value, bytes calldata _data) public virtual; } contract ChainlinkToken is ERC20 { + /** + * @dev Constructor function to initialize the Chainlink Dummy Token with the given owner and supply. + * @param owner The address of the owner of the token. + * @param supply The initial supply of the token. + */ constructor(address owner, uint256 supply) ERC20("Chainlink Dummy Token", "CDT"){ _mint(owner, supply); } + /** + * @dev Transfers tokens to a specified address and calls the recipient's function. + * @param _to The address of the recipient. + * @param _value The amount of tokens to send. + * @param _data Additional data to send to the recipient's function. + * @return success Returns true if the transfer was successful. + */ function transferAndCall(address _to, uint _value, bytes calldata _data) public returns (bool success){ super.transfer(_to, _value); // Transfer(msg.sender, _to, _value, _data); @@ -21,11 +39,22 @@ contract ChainlinkToken is ERC20 { return true; } + /** + * @dev Executes a contract fallback function. + * @param _to The address of the contract to execute the fallback function on. + * @param _value The amount of tokens being transferred. + * @param _data Additional data to be passed to the fallback function. + */ function contractFallback(address _to, uint _value, bytes calldata _data) private { ERC677Receiver receiver = ERC677Receiver(_to); receiver.onTokenTransfer(msg.sender, _value, _data); } + /** + * @dev Checks if the given address contains code. + * @param _addr The address to check. + * @return hasCode A boolean indicating whether the address contains code or not. + */ function isContract(address _addr) private view returns (bool hasCode) { uint length; assembly { length := extcodesize(_addr) } diff --git a/contracts/examples/strings.sol b/contracts/examples/strings.sol index 42c12ef0..0e7c636d 100644 --- a/contracts/examples/strings.sol +++ b/contracts/examples/strings.sol @@ -1,118 +1,137 @@ -// SPDX-License-Identifier: Apache2 - -// source: https://github.com/Arachnid/solidity-stringutils -/* - * @title String & slice utility library for Solidity contracts. - * @author Nick Johnson - * - * @dev Functionality in this library is largely implemented using an - * abstraction called a 'slice'. A slice represents a part of a string - - * anything from the entire string to a single character, or even no - * characters at all (a 0-length slice). Since a slice only has to specify - * an offset and a length, copying and manipulating slices is a lot less - * expensive than copying and manipulating the strings they reference. - * - * To further reduce gas costs, most functions on slice that need to return - * a slice modify the original one instead of allocating a new one; for - * instance, `s.split(".")` will return the text up to the first '.', - * modifying s to only contain the remainder of the string after the '.'. - * In situations where you do not want to modify the original slice, you - * can make a copy first with `.copy()`, for example: - * `s.copy().split(".")`. Try and avoid using this idiom in loops; since - * Solidity has no memory management, it will result in allocating many - * short-lived slices that are later discarded. - * - * Functions that return two slices come in two versions: a non-allocating - * version that takes the second slice as an argument, modifying it in - * place, and an allocating version that allocates and returns the second - * slice; see `nextRune` for example. - * - * Functions that have to copy string data will return strings rather than - * slices; these can be cast back to slices for further processing if - * required. - * - * For convenience, some functions are provided with non-modifying - * variants that create a new slice and return both; for instance, - * `s.splitNew('.')` leaves s unmodified, and returns two values - * corresponding to the left and right parts of the string. - */ -pragma solidity 0.8.2; - -library strings { - - struct slice { - uint _len; - uint _ptr; - } - - function memcpy(uint dest, uint src, uint len_) private pure { - // Copy word-length chunks while possible - for(; len_ >= 32; len_ -= 32) { - assembly { - mstore(dest, mload(src)) - } - dest += 32; - src += 32; - } - - // Copy remaining bytes - uint mask = type(uint).max; - if (len_ > 0) { - mask = 256 ** (32 - len_) - 1; - } - assembly { - let srcpart := and(mload(src), not(mask)) - let destpart := and(mload(dest), mask) - mstore(dest, or(destpart, srcpart)) - } - } - - /* - * @dev Returns the length of a null-terminated bytes32 string. - * @param self The value to find the length of. - * @return The length of the string, from 0 to 32. - */ - function len(bytes32 self) internal pure returns (uint) { - uint ret; - if (self == 0) - return 0; - if (uint(self) & type(uint128).max == 0) { - ret += 16; - self = bytes32(uint(self) / 0x100000000000000000000000000000000); - } - if (uint(self) & type(uint64).max == 0) { - ret += 8; - self = bytes32(uint(self) / 0x10000000000000000); - } - if (uint(self) & type(uint32).max == 0) { - ret += 4; - self = bytes32(uint(self) / 0x100000000); - } - if (uint(self) & type(uint16).max == 0) { - ret += 2; - self = bytes32(uint(self) / 0x10000); - } - if (uint(self) & type(uint8).max == 0) { - ret += 1; - } - return 32 - ret; - } - - // merge of toSliceB32 and toString of strings library - function toB32String(bytes32 self) internal pure returns (string memory) { - slice memory slc; - assembly { - let ptr := mload(0x40) - mstore(0x40, add(ptr, 0x20)) - mstore(ptr, self) - mstore(add(slc, 0x20), ptr) - } - slc._len = len(self); - - string memory ret = new string(slc._len); - uint retptr; - assembly { retptr := add(ret, 32) } - memcpy(retptr, slc._ptr, slc._len); - return ret; - } +// SPDX-License-Identifier: Apache2 + +// source: https://github.com/Arachnid/solidity-stringutils +/* + * @title String & slice utility library for Solidity contracts. + * @author Nick Johnson + * + * @dev Functionality in this library is largely implemented using an + * abstraction called a 'slice'. A slice represents a part of a string - + * anything from the entire string to a single character, or even no + * characters at all (a 0-length slice). Since a slice only has to specify + * an offset and a length, copying and manipulating slices is a lot less + * expensive than copying and manipulating the strings they reference. + * + * To further reduce gas costs, most functions on slice that need to return + * a slice modify the original one instead of allocating a new one; for + * instance, `s.split(".")` will return the text up to the first '.', + * modifying s to only contain the remainder of the string after the '.'. + * In situations where you do not want to modify the original slice, you + * can make a copy first with `.copy()`, for example: + * `s.copy().split(".")`. Try and avoid using this idiom in loops; since + * Solidity has no memory management, it will result in allocating many + * short-lived slices that are later discarded. + * + * Functions that return two slices come in two versions: a non-allocating + * version that takes the second slice as an argument, modifying it in + * place, and an allocating version that allocates and returns the second + * slice; see `nextRune` for example. + * + * Functions that have to copy string data will return strings rather than + * slices; these can be cast back to slices for further processing if + * required. + * + * For convenience, some functions are provided with non-modifying + * variants that create a new slice and return both; for instance, + * `s.splitNew('.')` leaves s unmodified, and returns two values + * corresponding to the left and right parts of the string. + */ +pragma solidity 0.8.2; + +library strings { + + struct slice { + uint _len; + uint _ptr; + } + + /** + * @dev Copies a specified number of bytes from one memory address to another. + * @param dest The destination memory address to copy to. + * @param src The source memory address to copy from. + * @param len_ The number of bytes to copy. + */ + function memcpy(uint dest, uint src, uint len_) private pure { + // Copy word-length chunks while possible + for(; len_ >= 32; len_ -= 32) { + assembly { + mstore(dest, mload(src)) + } + dest += 32; + src += 32; + } + + // Copy remaining bytes + uint mask = type(uint).max; + if (len_ > 0) { + mask = 256 ** (32 - len_) - 1; + } + assembly { + let srcpart := and(mload(src), not(mask)) + let destpart := and(mload(dest), mask) + mstore(dest, or(destpart, srcpart)) + } + } + + /* + * @dev Returns the length of a null-terminated bytes32 string. + * @param self The value to find the length of. + * @return The length of the string, from 0 to 32. + */ + /** + * @dev Calculates the length of a bytes32 variable. + * @param self The bytes32 variable to calculate the length of. + * @return ret The length of the bytes32 variable. + */ + function len(bytes32 self) internal pure returns (uint) { + uint ret; + if (self == 0) + return 0; + if (uint(self) & type(uint128).max == 0) { + ret += 16; + self = bytes32(uint(self) / 0x100000000000000000000000000000000); + } + if (uint(self) & type(uint64).max == 0) { + ret += 8; + self = bytes32(uint(self) / 0x10000000000000000); + } + if (uint(self) & type(uint32).max == 0) { + ret += 4; + self = bytes32(uint(self) / 0x100000000); + } + if (uint(self) & type(uint16).max == 0) { + ret += 2; + self = bytes32(uint(self) / 0x10000); + } + if (uint(self) & type(uint8).max == 0) { + ret += 1; + } + return 32 - ret; + } + + // merge of toSliceB32 and toString of strings library + /** + * @dev Converts a bytes32 value to a string. + * @param self The bytes32 value to be converted. + * @return ret The resulting string value. + * + * Converts a bytes32 value to a string by creating a slice of the bytes32 value and then copying it to a new string. + * The resulting string is then returned as the output of the function. + */ + function toB32String(bytes32 self) internal pure returns (string memory) { + slice memory slc; + assembly { + let ptr := mload(0x40) + mstore(0x40, add(ptr, 0x20)) + mstore(ptr, self) + mstore(add(slc, 0x20), ptr) + } + slc._len = len(self); + + string memory ret = new string(slc._len); + uint retptr; + assembly { retptr := add(ret, 32) } + memcpy(retptr, slc._ptr, slc._len); + return ret; + } } \ No newline at end of file diff --git a/contracts/flows/PolicyDefaultFlow.sol b/contracts/flows/PolicyDefaultFlow.sol index 931758cf..f430c8ad 100644 --- a/contracts/flows/PolicyDefaultFlow.sol +++ b/contracts/flows/PolicyDefaultFlow.sol @@ -67,11 +67,24 @@ contract PolicyDefaultFlow is // ComponentController private _component; // solhint-disable-next-line no-empty-blocks + /** + * @dev Constructor function that initializes the contract with a given registry address. + * @param _registry The address of the registry contract. + */ constructor(address _registry) WithRegistry(_registry) { } + /** + * @dev Creates a new insurance application and returns the process ID. + * @param owner The address of the owner of the new application. + * @param premiumAmount The amount of premium to be paid for the application. + * @param sumInsuredAmount The amount of insurance coverage requested for the application. + * @param metaData Additional metadata for the application. + * @param applicationData Additional data for the application. + * @return processId The unique process ID of the created application. + */ function newApplication( address owner, uint256 premiumAmount, @@ -94,6 +107,10 @@ contract PolicyDefaultFlow is applicationData); } + /** + * @dev Revokes an application for a specific processId. + * @param processId The unique identifier of the process. + */ function revoke(bytes32 processId) external onlyResponsibleProduct(processId) @@ -103,6 +120,15 @@ contract PolicyDefaultFlow is } /* success implies the successful creation of a policy */ + /** + * @dev Attempts to get the collateral to secure the policy. + * @param processId The unique identifier of the underwriting process. + * @return success A boolean indicating whether the underwriting was successful. + * + * If successful, creates a policy and transfers the premium amount. + * The premium collection part is a TODO and should be implemented on the product level. + * This function should only be called by a responsible product. + * */ function underwrite(bytes32 processId) external onlyResponsibleProduct(processId) @@ -132,6 +158,14 @@ contract PolicyDefaultFlow is * valid amounts need to be > 0 up to the full premium amount * if no fee structure is defined for the policy, this call will revert. */ + /** + * @dev Collects the premium for a given policy and updates the book keeping of the policy and the risk pool. + * @param processId The ID of the premium payment process. + * @param amount The amount of premium to be collected. + * @return success A boolean indicating whether the premium collection was successful or not. + * @return feeAmount The amount of fee collected by the treasury module. + * @return netPremiumAmount The net amount of premium collected after deducting the fee. + */ function collectPremium(bytes32 processId, uint256 amount) public notClosedPolicy(processId) @@ -156,6 +190,12 @@ contract PolicyDefaultFlow is } } + /** + * @dev Adjusts the premium and sum insured amounts of a policy. + * @param processId The ID of the policy process. + * @param expectedPremiumAmount The expected premium amount. + * @param sumInsuredAmount The sum insured amount. + */ function adjustPremiumSumInsured( bytes32 processId, uint256 expectedPremiumAmount, @@ -170,6 +210,10 @@ contract PolicyDefaultFlow is } + /** + * @dev Allows the responsible product to decline an application for a policy. + * @param processId The unique identifier of the application process. + */ function decline(bytes32 processId) onlyResponsibleProduct(processId) external @@ -178,6 +222,10 @@ contract PolicyDefaultFlow is policy.declineApplication(processId); } + /** + * @dev Expire the policy identified by the given process ID. + * @param processId The ID of the process corresponding to the policy to be expired. + */ function expire(bytes32 processId) external onlyActivePolicy(processId) @@ -187,6 +235,10 @@ contract PolicyDefaultFlow is policy.expirePolicy(processId); } + /** + * @dev Closes a policy and releases the corresponding funds from the pool. + * @param processId The ID of the policy to be closed. + */ function close(bytes32 processId) external onlyExpiredPolicy(processId) @@ -199,6 +251,13 @@ contract PolicyDefaultFlow is pool.release(processId); } + /** + * @dev Creates a new claim for a given process ID, claim amount and data. + * @param processId The ID of the process to create the claim for. + * @param claimAmount The amount of the claim to be created. + * @param data Additional data to be included with the claim. + * @return claimId The ID of the newly created claim. + */ function newClaim( bytes32 processId, uint256 claimAmount, @@ -215,6 +274,12 @@ contract PolicyDefaultFlow is data); } + /** + * @dev Confirms a claim for a specific process and claim ID, updating the confirmed amount. + * @param processId The ID of the process where the claim was made. + * @param claimId The ID of the claim to be confirmed. + * @param confirmedAmount The amount confirmed for the claim. + */ function confirmClaim( bytes32 processId, uint256 claimId, @@ -227,6 +292,11 @@ contract PolicyDefaultFlow is policy.confirmClaim(processId, claimId, confirmedAmount); } + /** + * @dev Allows the responsible product to decline a claim. + * @param processId The unique identifier of the claim process. + * @param claimId The unique identifier of the claim to be declined. + */ function declineClaim(bytes32 processId, uint256 claimId) external onlyResponsibleProduct(processId) @@ -235,6 +305,11 @@ contract PolicyDefaultFlow is policy.declineClaim(processId, claimId); } + /** + * @dev Closes a claim for a specific process and claim ID. + * @param processId The ID of the process to which the claim belongs. + * @param claimId The ID of the claim to be closed. + */ function closeClaim(bytes32 processId, uint256 claimId) external onlyResponsibleProduct(processId) @@ -243,6 +318,14 @@ contract PolicyDefaultFlow is policy.closeClaim(processId, claimId); } + /** + * @dev Creates a new payout for a specific claim. + * @param processId The ID of the process associated with the claim. + * @param claimId The ID of the claim for which the payout is being created. + * @param amount The amount of the payout to be created. + * @param data Additional data related to the payout. + * @return payoutId The ID of the newly created payout. + */ function newPayout( bytes32 processId, uint256 claimId, @@ -257,6 +340,14 @@ contract PolicyDefaultFlow is .createPayout(processId, claimId, amount, data); } + /** + * @dev Processes a payout for a specific process and payout ID. + * @param processId The ID of the process for which the payout is being processed. + * @param payoutId The ID of the payout being processed. + * @return success A boolean indicating whether the payout was successfully processed. + * @return feeAmount The amount of fees deducted from the payout. + * @return netPayoutAmount The net amount paid out to the policyholder after deducting fees. + */ function processPayout( bytes32 processId, uint256 payoutId @@ -280,6 +371,15 @@ contract PolicyDefaultFlow is pool.processPayout(processId, netPayoutAmount + feeAmount); } + /** + * @dev Sends a request to the query contract to initiate a new process. + * @param processId The ID of the process to be initiated. + * @param _input The input data for the process. + * @param _callbackMethodName The name of the callback method in the callback contract. + * @param _callbackContractAddress The address of the callback contract. + * @param _responsibleOracleId The ID of the oracle responsible for handling the request. + * @return _requestId The ID of the new request. + */ function request( bytes32 processId, bytes calldata _input, @@ -300,6 +400,10 @@ contract PolicyDefaultFlow is ); } + /** + * @dev Cancels a request with the given requestId. + * @param requestId The ID of the request to be cancelled. + */ function cancelRequest( uint256 requestId ) @@ -309,6 +413,11 @@ contract PolicyDefaultFlow is getQueryContract().cancel(requestId); } + /** + * @dev Returns the application data associated with the given process ID. + * @param processId The ID of the process. + * @return data The application data as bytes. + */ function getApplicationData(bytes32 processId) external view @@ -318,6 +427,12 @@ contract PolicyDefaultFlow is return policy.getApplication(processId).data; } + /** + * @dev Returns the claim data of a specific claim for a given process ID. + * @param processId The ID of the process the claim belongs to. + * @param claimId The ID of the claim. + * @return data The claim data as bytes. + */ function getClaimData(bytes32 processId, uint256 claimId) external view @@ -327,6 +442,12 @@ contract PolicyDefaultFlow is return policy.getClaim(processId, claimId).data; } + /** + * @dev Returns the payout data for a given process and payout ID. + * @param processId The ID of the process. + * @param payoutId The ID of the payout. + * @return data The payout data as a bytes array. + */ function getPayoutData(bytes32 processId, uint256 payoutId) external view @@ -336,22 +457,42 @@ contract PolicyDefaultFlow is return policy.getPayout(processId, payoutId).data; } + /** + * @dev Returns the ComponentController contract instance. + * @return The ComponentController contract instance. + */ function getComponentContract() internal view returns (ComponentController) { return ComponentController(getContractFromRegistry("Component")); } + /** + * @dev Returns the PoolController contract instance from the registry. + * @return poolController The PoolController contract instance. + */ function getPoolContract() internal view returns (PoolController) { return PoolController(getContractFromRegistry("Pool")); } + /** + * @dev Returns the PolicyController contract instance from the registry. + * @return The PolicyController contract instance. + */ function getPolicyContract() internal view returns (PolicyController) { return PolicyController(getContractFromRegistry("Policy")); } + /** + * @dev Returns the QueryModule contract instance from the registry. + * @return QueryModule instance. + */ function getQueryContract() internal view returns (QueryModule) { return QueryModule(getContractFromRegistry("Query")); } + /** + * @dev Retrieves the TreasuryModule contract instance. + * @return The instance of the TreasuryModule contract. + */ function getTreasuryContract() internal view returns (TreasuryModule) { return TreasuryModule(getContractFromRegistry("Treasury")); } diff --git a/contracts/flows/README.adoc b/contracts/flows/README.adoc new file mode 100644 index 00000000..20c8056f --- /dev/null +++ b/contracts/flows/README.adoc @@ -0,0 +1,8 @@ += Flows + +[.readme-notice] +NOTE: This document is better viewed at https://docs.etherisc.com/contracts/api/flows + +== Contracts + +{{PolicyDefaultFlow}} \ No newline at end of file diff --git a/contracts/modules/AccessController.sol b/contracts/modules/AccessController.sol index 9dbd8d8b..5b459e06 100644 --- a/contracts/modules/AccessController.sol +++ b/contracts/modules/AccessController.sol @@ -1,122 +1,216 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity 0.8.2; - -import "../shared/CoreController.sol"; - -import "@etherisc/gif-interface/contracts/modules/IAccess.sol"; - -import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; -import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; - - -contract AccessController is - IAccess, - CoreController, - AccessControlEnumerable - { - - // 0xe984cfd1d1fa34f80e24ddb2a60c8300359d79eee44555bc35c106eb020394cd - bytes32 public constant PRODUCT_OWNER_ROLE = keccak256("PRODUCT_OWNER_ROLE"); - - // 0xd26b4cd59ffa91e4599f3d18b02fcd5ffb06e03216f3ee5f25f68dc75cbbbaa2 - bytes32 public constant ORACLE_PROVIDER_ROLE = keccak256("ORACLE_PROVIDER_ROLE"); - - // 0x3c4cdb47519f2f89924ebeb1ee7a8a43b8b00120826915726460bb24576012fd - bytes32 public constant RISKPOOL_KEEPER_ROLE = keccak256("RISKPOOL_KEEPER_ROLE"); - - mapping(bytes32 => bool) public validRole; - - bool private _defaultAdminSet; - - function _afterInitialize() internal override { - // add product owner, oracle provider and riskpool keeper roles - _populateValidRoles(); - } - - function _getName() internal override pure returns(bytes32) { return "Access"; } - - // IMPORTANT check the setting of the default admin role - // after the deployment of a GIF instance. - // this method is called in the deployment of - // the instance operator proxy/controller - function setDefaultAdminRole(address defaultAdmin) - external - { - require(!_defaultAdminSet, "ERROR:ACL-001:ADMIN_ROLE_ALREADY_SET"); - _defaultAdminSet = true; - - _grantRole(DEFAULT_ADMIN_ROLE, defaultAdmin); - } - - //--- manage role ownership ---------------------------------------------// - function grantRole(bytes32 role, address principal) - public - override(IAccessControl, IAccess) - onlyInstanceOperator - { - require(validRole[role], "ERROR:ACL-002:ROLE_UNKNOWN_OR_INVALID"); - AccessControl.grantRole(role, principal); - } - - function revokeRole(bytes32 role, address principal) - public - override(IAccessControl, IAccess) - onlyInstanceOperator - { - AccessControl.revokeRole(role, principal); - } - - function renounceRole(bytes32 role, address principal) - public - override(IAccessControl, IAccess) - { - AccessControl.renounceRole(role, principal); - } - - //--- manage roles ------------------------------------------------------// - function addRole(bytes32 role) - public override - onlyInstanceOperator - { - require(!validRole[role], "ERROR:ACL-003:ROLE_EXISTING_AND_VALID"); - validRole[role] = true; - } - - function invalidateRole(bytes32 role) - public override - onlyInstanceOperator - { - require(validRole[role], "ERROR:ACL-004:ROLE_UNKNOWN_OR_INVALID"); - validRole[role] = false; - } - - function hasRole(bytes32 role, address principal) - public view - override(IAccessControl, IAccess) - returns(bool) - { - return super.hasRole(role, principal); - } - - function getDefaultAdminRole() public pure override returns(bytes32) { - return DEFAULT_ADMIN_ROLE; - } - - function getProductOwnerRole() public pure override returns(bytes32) { - return PRODUCT_OWNER_ROLE; - } - - function getOracleProviderRole() public pure override returns(bytes32) { - return ORACLE_PROVIDER_ROLE; - } - - function getRiskpoolKeeperRole() public pure override returns(bytes32) { - return RISKPOOL_KEEPER_ROLE; - } - - function _populateValidRoles() private { - validRole[PRODUCT_OWNER_ROLE] = true; - validRole[ORACLE_PROVIDER_ROLE] = true; - validRole[RISKPOOL_KEEPER_ROLE] = true; - } -} +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.2; + +import "../shared/CoreController.sol"; + +import "@etherisc/gif-interface/contracts/modules/IAccess.sol"; + +import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; +import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; + +/** + * @dev The provided smart contract is called "AccessController" and is written in Solidity. It implements the "IAccess" interface and inherits from the "CoreController" contract and the "AccessControlEnumerable" contract. The contract provides functionalities for access control and role management. + * + * Roles: + * + * The contract defines three role identifiers as bytes32 constants: + * 1. PRODUCT_OWNER_ROLE: Represents the role of a product owner. + * 2. ORACLE_PROVIDER_ROLE: Represents the role of an oracle provider. + * 3. RISKPOOL_KEEPER_ROLE: Represents the role of a risk pool keeper. + * + * State Variables: + * + * - `validRole`: A mapping that stores the validity of each role. It maps a role identifier (bytes32) to a boolean value indicating whether the role is valid. + * - `_defaultAdminSet`: A boolean flag indicating whether the default admin role has been set. + * + * Modifiers: + * + * - `onlyInstanceOperator`: A modifier that restricts access to functions to only instance operators. + * + * Overall, the contract provides a flexible access control mechanism by defining roles and + * allowing the assignment, revocation, and validation of roles by instance operators. + * It also sets a default admin role and manages the validity of roles through the `validRole` mapping. + */ + + +contract AccessController is + IAccess, + CoreController, + AccessControlEnumerable + { + + // 0xe984cfd1d1fa34f80e24ddb2a60c8300359d79eee44555bc35c106eb020394cd + bytes32 public constant PRODUCT_OWNER_ROLE = keccak256("PRODUCT_OWNER_ROLE"); + + // 0xd26b4cd59ffa91e4599f3d18b02fcd5ffb06e03216f3ee5f25f68dc75cbbbaa2 + bytes32 public constant ORACLE_PROVIDER_ROLE = keccak256("ORACLE_PROVIDER_ROLE"); + + // 0x3c4cdb47519f2f89924ebeb1ee7a8a43b8b00120826915726460bb24576012fd + bytes32 public constant RISKPOOL_KEEPER_ROLE = keccak256("RISKPOOL_KEEPER_ROLE"); + + mapping(bytes32 => bool) public validRole; + + bool private _defaultAdminSet; + + /** + * @dev This function is called after contract initialization and adds the product owner, oracle provider, and riskpool keeper roles. + */ + function _afterInitialize() internal override { + // add product owner, oracle provider and riskpool keeper roles + _populateValidRoles(); + } + + /** + * @dev Returns the name of the contract. + * @return The name of the contract as a bytes32 value. + */ + function _getName() internal override pure returns(bytes32) { return "Access"; } + + // IMPORTANT check the setting of the default admin role + // after the deployment of a GIF instance. + // this method is called in the deployment of + // the instance operator proxy/controller + /** + * @dev Sets the default admin role for the Access Control List (ACL). + * @param defaultAdmin The address of the account to be set as the default admin role. + * + * Requirements: + * - The default admin role must not have been set before. + * + * Emits a {RoleGranted} event. + */ + function setDefaultAdminRole(address defaultAdmin) + external + { + require(!_defaultAdminSet, "ERROR:ACL-001:ADMIN_ROLE_ALREADY_SET"); + _defaultAdminSet = true; + + _grantRole(DEFAULT_ADMIN_ROLE, defaultAdmin); + } + + //--- manage role ownership ---------------------------------------------// + /** + * @dev Grants a role to a principal. + * @param role The bytes32 identifier of the role to grant. + * @param principal The address of the principal to grant the role to. + * + * Requirements: + * - `role` must be a valid role identifier. + * - The caller must be an instance operator. + */ + function grantRole(bytes32 role, address principal) + public + override(IAccessControl, IAccess) + onlyInstanceOperator + { + require(validRole[role], "ERROR:ACL-002:ROLE_UNKNOWN_OR_INVALID"); + AccessControl.grantRole(role, principal); + } + + /** + * @dev Revokes the specified role from the specified principal. + * @param role The bytes32 identifier of the role to revoke. + * @param principal The address of the principal to revoke the role from. + */ + function revokeRole(bytes32 role, address principal) + public + override(IAccessControl, IAccess) + onlyInstanceOperator + { + AccessControl.revokeRole(role, principal); + } + + /** + * @dev Removes the specified `principal` from the `role` in the access control list (ACL) of the contract. + * @param role The bytes32 identifier of the role to remove the `principal` from. + * @param principal The address of the principal to remove from the `role`. + */ + function renounceRole(bytes32 role, address principal) + public + override(IAccessControl, IAccess) + { + AccessControl.renounceRole(role, principal); + } + + //--- manage roles ------------------------------------------------------// + /** + * @dev Adds a new role to the Access Control List. + * @param role The role to be added. + */ + function addRole(bytes32 role) + public override + onlyInstanceOperator + { + require(!validRole[role], "ERROR:ACL-003:ROLE_EXISTING_AND_VALID"); + validRole[role] = true; + } + + /** + * @dev Invalidates a role. + * @param role The role to invalidate. + */ + function invalidateRole(bytes32 role) + public override + onlyInstanceOperator + { + require(validRole[role], "ERROR:ACL-004:ROLE_UNKNOWN_OR_INVALID"); + validRole[role] = false; + } + + /** + * @dev Checks if a given principal has a specific role. + * @param role The bytes32 representation of the role to check. + * @param principal The address of the principal to check. + * @return Returns true if the principal has the specified role, false otherwise. + */ + function hasRole(bytes32 role, address principal) + public view + override(IAccessControl, IAccess) + returns(bool) + { + return super.hasRole(role, principal); + } + + /** + * @dev Returns the default admin role. + * @return The DEFAULT_ADMIN_ROLE. + */ + function getDefaultAdminRole() public pure override returns(bytes32) { + return DEFAULT_ADMIN_ROLE; + } + + /** + * @dev Returns the bytes32 value of the PRODUCT_OWNER_ROLE. + * @return PRODUCT_OWNER_ROLE The bytes32 value of the PRODUCT_OWNER_ROLE. + */ + function getProductOwnerRole() public pure override returns(bytes32) { + return PRODUCT_OWNER_ROLE; + } + + /** + * @dev Returns the bytes32 identifier of the Oracle Provider role. + * @return ORACLE_PROVIDER_ROLE The bytes32 identifier of the Oracle Provider role. + */ + function getOracleProviderRole() public pure override returns(bytes32) { + return ORACLE_PROVIDER_ROLE; + } + + /** + * @dev Returns the bytes32 value of the RISKPOOL_KEEPER_ROLE. + * @return RISKPOOL_KEEPER_ROLE The bytes32 value of the RISKPOOL_KEEPER_ROLE. + */ + function getRiskpoolKeeperRole() public pure override returns(bytes32) { + return RISKPOOL_KEEPER_ROLE; + } + + /** + * @dev Populates the validRole mapping with the roles that are considered valid for the contract. + * + * + */ + function _populateValidRoles() private { + validRole[PRODUCT_OWNER_ROLE] = true; + validRole[ORACLE_PROVIDER_ROLE] = true; + validRole[RISKPOOL_KEEPER_ROLE] = true; + } +} diff --git a/contracts/modules/BundleController.sol b/contracts/modules/BundleController.sol index 917a001e..7ca278e7 100644 --- a/contracts/modules/BundleController.sol +++ b/contracts/modules/BundleController.sol @@ -9,7 +9,18 @@ import "@etherisc/gif-interface/contracts/components/IProduct.sol"; import "@etherisc/gif-interface/contracts/modules/IBundle.sol"; import "./PoolController.sol"; - +/** + * @dev The smart contract is used to manage bundles, which are collections of policies. + * + * - The contract imports other Solidity contracts such as `PolicyController.sol`, `CoreController.sol`, and `BundleToken.sol`. + * - The contract implements the `IBundle` interface and extends the `CoreController` contract. + * - It defines several mappings to store information about bundles, active policies, locked capital per policy, and the number of unburt bundles for each risk pool. + * - There is a private variable `_bundleCount` to keep track of the number of bundles created. + * - The contract includes modifiers to restrict access to certain functions, such as `onlyRiskpoolService` and `onlyFundableBundle`. + * + * The contract includes various modifiers and event emitters to enforce access control and emit relevant events. + * Overall, the `BundleController` contract provides functionality to manage bundles and their associated policies, including creating, funding, locking, unlocking, closing, burning, collateralizing, and releasing policies within a bundle. + */ contract BundleController is IBundle, CoreController @@ -44,11 +55,26 @@ contract BundleController is _; } + /** + * @dev Performs internal operations after the contract initialization. + * + * + */ function _afterInitialize() internal override onlyInitializing { _policy = PolicyController(_getContractAddress("Policy")); _token = BundleToken(_getContractAddress("BundleToken")); } + /** + * @dev Creates a new bundle and mints a corresponding NFT token. Only callable by the RiskpoolService contract. + * @param owner_ The address of the bundle owner. + * @param riskpoolId_ The ID of the riskpool associated with the bundle. + * @param filter_ The filter used for the bundle. + * @param amount_ The amount of capital allocated to the bundle. + * @return bundleId The ID of the newly created bundle. + * @notice This function emits 1 events: + * - LogBundleCreated + */ function create(address owner_, uint riskpoolId_, bytes calldata filter_, uint256 amount_) external override onlyRiskpoolService @@ -81,6 +107,13 @@ contract BundleController is } + /** + * @dev Adds funds to a bundle's capital and balance. + * @param bundleId The ID of the bundle to add funds to. + * @param amount The amount of funds to add to the bundle. + * @notice This function emits 1 events: + * - LogBundleCapitalProvided + */ function fund(uint256 bundleId, uint256 amount) external override onlyRiskpoolService @@ -98,6 +131,13 @@ contract BundleController is } + /** + * @dev Allows the Riskpool service to withdraw `amount` from the `bundleId` Bundle. + * @param bundleId The ID of the Bundle to be defunded. + * @param amount The amount of tokens to be withdrawn. + * @notice This function emits 1 events: + * - LogBundleCapitalWithdrawn + */ function defund(uint256 bundleId, uint256 amount) external override onlyRiskpoolService @@ -120,6 +160,10 @@ contract BundleController is emit LogBundleCapitalWithdrawn(bundleId, _msgSender(), amount, capacityAmount); } + /** + * @dev Locks a bundle of assets. + * @param bundleId The ID of the bundle to be locked. + */ function lock(uint256 bundleId) external override onlyRiskpoolService @@ -127,6 +171,10 @@ contract BundleController is _changeState(bundleId, BundleState.Locked); } + /** + * @dev Unlocks a bundle, changing its state to active. + * @param bundleId The ID of the bundle to be unlocked. + */ function unlock(uint256 bundleId) external override onlyRiskpoolService @@ -134,6 +182,10 @@ contract BundleController is _changeState(bundleId, BundleState.Active); } + /** + * @dev Closes a bundle of policies. + * @param bundleId The ID of the bundle to close. + */ function close(uint256 bundleId) external override onlyRiskpoolService @@ -142,6 +194,16 @@ contract BundleController is _changeState(bundleId, BundleState.Closed); } + /** + * @dev Burns a bundle and changes its state to Burned. + * @param bundleId The ID of the bundle to be burned. + * + * Requirements: + * - The bundle must be in the Closed state. + * - The bundle must have a balance of 0. + * + * Emits a {BundleStateChanged} event with BundleState.Burned. + */ function burn(uint256 bundleId) external override onlyRiskpoolService @@ -157,6 +219,23 @@ contract BundleController is _changeState(bundleId, BundleState.Burned); } + /** + * @dev Collateralizes a policy by locking a specific amount of capital in the corresponding bundle. + * @param bundleId The ID of the bundle to collateralize. + * @param processId The ID of the policy to collateralize. + * @param amount The amount of capital to lock in the bundle. + * + * Requirements: + * - Caller must be the riskpool service. + * - The bundle must belong to the riskpool that controls the product of the policy. + * - The bundle must exist and be in an active state. + * - The capacity of the bundle must be enough to lock the amount of capital. + * - The policy must not have been previously collateralized. + * + * Emits a {LogBundlePolicyCollateralized} event with the bundle ID, policy ID, amount of capital locked, and the remaining capacity of the bundle. + * @notice This function emits 1 events: + * - LogBundlePolicyCollateralized + */ function collateralizePolicy(uint256 bundleId, bytes32 processId, uint256 amount) external override onlyRiskpoolService @@ -182,6 +261,22 @@ contract BundleController is } + /** + * @dev Process the premium payment for a given bundle and update its balance. + * @param bundleId The ID of the bundle to process the premium payment for. + * @param processId The ID of the process associated with the policy. + * @param amount The amount of premium to be processed. + * + * Requirements: + * - The caller must be the riskpool service. + * - The bundle must exist and be fundable. + * - The policy associated with the process must not be closed. + * - The bundle must exist. + * + * Effects: + * - Increases the balance of the bundle by the amount processed. + * - Updates the updatedAt timestamp of the bundle. + */ function processPremium(uint256 bundleId, bytes32 processId, uint256 amount) external override onlyRiskpoolService @@ -201,6 +296,16 @@ contract BundleController is } + /** + * @dev Processes a payout for a policy from a bundle. + * @param bundleId The ID of the bundle. + * @param processId The ID of the policy process. + * @param amount The amount of the payout. + * + * Emits a LogBundlePayoutProcessed event. + * @notice This function emits 1 events: + * - LogBundlePayoutProcessed + */ function processPayout(uint256 bundleId, bytes32 processId, uint256 amount) external override onlyRiskpoolService @@ -236,6 +341,14 @@ contract BundleController is } + /** + * @dev Release a policy and update the bundle capital. + * @param bundleId The ID of the bundle. + * @param processId The ID of the process. + * @return remainingCollateralAmount The remaining collateral amount after releasing the policy. + * @notice This function emits 1 events: + * - LogBundlePolicyReleased + */ function releasePolicy(uint256 bundleId, bytes32 processId) external override onlyRiskpoolService @@ -271,54 +384,113 @@ contract BundleController is emit LogBundlePolicyReleased(bundleId, processId, lockedForPolicyAmount, capacityAmount); } + /** + * @dev Returns the address of the owner of the token associated with the given bundle ID. + * @param bundleId The ID of the bundle. + * @return The address of the owner of the token. + */ function getOwner(uint256 bundleId) public view returns(address) { uint256 tokenId = getBundle(bundleId).tokenId; return _token.ownerOf(tokenId); } + /** + * @dev Returns the state of the bundle with the given ID. + * @param bundleId The ID of the bundle to retrieve the state from. + * @return The state of the bundle with the given ID. + */ function getState(uint256 bundleId) public view returns(BundleState) { return getBundle(bundleId).state; } + /** + * @dev Returns the filter of a given bundle. + * @param bundleId The ID of the bundle to get the filter from. + * @return The filter of the bundle as a bytes array. + */ function getFilter(uint256 bundleId) public view returns(bytes memory) { return getBundle(bundleId).filter; } + /** + * @dev Returns the available capacity of a bundle. + * @param bundleId The ID of the bundle to get the capacity from. + * @return The available capacity of the bundle. + */ function getCapacity(uint256 bundleId) public view returns(uint256) { Bundle memory bundle = getBundle(bundleId); return bundle.capital - bundle.lockedCapital; } + /** + * @dev Returns the total value locked in a particular bundle. + * @param bundleId The ID of the bundle. + * @return lockedCapital The total value locked in the bundle. + */ function getTotalValueLocked(uint256 bundleId) public view returns(uint256) { return getBundle(bundleId).lockedCapital; } + /** + * @dev Returns the balance of a specific bundle. + * @param bundleId The ID of the bundle to query. + * @return The balance of the specified bundle. + */ function getBalance(uint256 bundleId) public view returns(uint256) { return getBundle(bundleId).balance; } + /** + * @dev Returns the BundleToken contract instance. + * @return _token The BundleToken contract instance. + */ function getToken() external view returns(BundleToken) { return _token; } + /** + * @dev Returns the bundle with the specified bundle ID. + * @param bundleId The ID of the bundle to retrieve. + * @return bundle The bundle with the specified ID. + */ function getBundle(uint256 bundleId) public view returns(Bundle memory) { Bundle memory bundle = _bundles[bundleId]; require(bundle.createdAt > 0, "ERROR:BUC-060:BUNDLE_DOES_NOT_EXIST"); return bundle; } + /** + * @dev Returns the number of bundles created. + * @return _bundleCount The number of bundles created. + */ function bundles() public view returns(uint256) { return _bundleCount; } + /** + * @dev Returns the number of unburnt bundles for a given riskpool ID. + * @param riskpoolId The ID of the riskpool. + * @return The number of unburnt bundles for the given riskpool ID. + */ function unburntBundles(uint256 riskpoolId) external view returns(uint256) { return _unburntBundlesForRiskpoolId[riskpoolId]; } + /** + * @dev Returns the pool controller contract instance. + * @return _poolController The pool controller contract instance. + */ function _getPoolController() internal view returns (PoolController _poolController) { _poolController = PoolController(_getContractAddress("Pool")); } + /** + * @dev Changes the state of a bundle. + * @param bundleId The ID of the bundle to change the state of. + * @param newState The new state to set for the bundle. + * @notice This function emits 1 events: + * - LogBundleStateChanged + */ function _changeState(uint256 bundleId, BundleState newState) internal { BundleState oldState = getState(bundleId); @@ -329,11 +501,32 @@ contract BundleController is emit LogBundleStateChanged(bundleId, oldState, newState); } + /** + * @dev Sets the state and updated timestamp of a given bundle. + * @param bundleId The ID of the bundle to update. + * @param newState The new state of the bundle. + */ function _setState(uint256 bundleId, BundleState newState) internal { _bundles[bundleId].state = newState; _bundles[bundleId].updatedAt = block.timestamp; } + /** + * @dev Checks if a state transition is valid. + * @param oldState The previous state of the bundle. + * @param newState The new state of the bundle. + * + * Requirements: + * - The oldState must be Active, Locked, Closed, or Burned. + * - The newState must be Locked, Active, Closed, or Burned, depending on the oldState. + * + * Error messages: + * - ERROR:BUC-070:ACTIVE_INVALID_TRANSITION if the oldState is Active and the newState is not Locked or Closed. + * - ERROR:BUC-071:LOCKED_INVALID_TRANSITION if the oldState is Locked and the newState is not Active or Closed. + * - ERROR:BUC-072:CLOSED_INVALID_TRANSITION if the oldState is Closed and the newState is not Burned. + * - ERROR:BUC-073:BURNED_IS_FINAL_STATE if the oldState is Burned. + * - ERROR:BOC-074:INITIAL_STATE_NOT_HANDLED if the oldState is not Active, Locked, Closed, or Burned. + */ function _checkStateTransition(BundleState oldState, BundleState newState) internal pure diff --git a/contracts/modules/ComponentController.sol b/contracts/modules/ComponentController.sol index fa8552cb..0646bc13 100644 --- a/contracts/modules/ComponentController.sol +++ b/contracts/modules/ComponentController.sol @@ -1,304 +1,513 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity 0.8.2; - -import "../shared/CoreController.sol"; -import "@etherisc/gif-interface/contracts/components/IComponent.sol"; -import "@etherisc/gif-interface/contracts/components/IOracle.sol"; -import "@etherisc/gif-interface/contracts/components/IProduct.sol"; -import "@etherisc/gif-interface/contracts/components/IRiskpool.sol"; -import "@etherisc/gif-interface/contracts/modules/IComponentEvents.sol"; -import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; - -contract ComponentController is - IComponentEvents, - CoreController - { - using EnumerableSet for EnumerableSet.UintSet; - - mapping(uint256 => IComponent) private _componentById; - mapping(bytes32 => uint256) private _componentIdByName; - mapping(address => uint256) private _componentIdByAddress; - - mapping(uint256 => IComponent.ComponentState) private _componentState; - - EnumerableSet.UintSet private _products; - EnumerableSet.UintSet private _oracles; - EnumerableSet.UintSet private _riskpools; - uint256 private _componentCount; - - mapping(uint256 /* product id */ => address /* policy flow address */) private _policyFlowByProductId; - - modifier onlyComponentOwnerService() { - require( - _msgSender() == _getContractAddress("ComponentOwnerService"), - "ERROR:CCR-001:NOT_COMPONENT_OWNER_SERVICE"); - _; - } - - modifier onlyInstanceOperatorService() { - require( - _msgSender() == _getContractAddress("InstanceOperatorService"), - "ERROR:CCR-002:NOT_INSTANCE_OPERATOR_SERVICE"); - _; - } - - function propose(IComponent component) - external - onlyComponentOwnerService - { - // input validation - require(_componentIdByAddress[address(component)] == 0, "ERROR:CCR-003:COMPONENT_ALREADY_EXISTS"); - require(_componentIdByName[component.getName()] == 0, "ERROR:CCR-004:COMPONENT_NAME_ALREADY_EXISTS"); - - // assigning id and persisting component - uint256 id = _persistComponent(component); - - // log entry for successful proposal - emit LogComponentProposed( - component.getName(), - component.getType(), - address(component), - id); - - // inform component about successful proposal - component.proposalCallback(); - } - - function _persistComponent(IComponent component) - internal - returns(uint256 id) - { - // fetch next component id - _componentCount++; - id = _componentCount; - - // update component state - _changeState(id, IComponent.ComponentState.Proposed); - component.setId(id); - - // update controller book keeping - _componentById[id] = component; - _componentIdByName[component.getName()] = id; - _componentIdByAddress[address(component)] = id; - - // type specific book keeping - if (component.isProduct()) { EnumerableSet.add(_products, id); } - else if (component.isOracle()) { EnumerableSet.add(_oracles, id); } - else if (component.isRiskpool()) { EnumerableSet.add(_riskpools, id); } - } - - function exists(uint256 id) public view returns(bool) { - IComponent component = _componentById[id]; - return (address(component) != address(0)); - } - - function approve(uint256 id) - external - onlyInstanceOperatorService - { - _changeState(id, IComponent.ComponentState.Active); - IComponent component = getComponent(id); - - if (isProduct(id)) { - _policyFlowByProductId[id] = IProduct(address(component)).getPolicyFlow(); - } - - emit LogComponentApproved(id); - - // inform component about successful approval - component.approvalCallback(); - } - - function decline(uint256 id) - external - onlyInstanceOperatorService - { - _changeState(id, IComponent.ComponentState.Declined); - emit LogComponentDeclined(id); - - // inform component about decline - IComponent component = getComponent(id); - component.declineCallback(); - } - - function suspend(uint256 id) - external - onlyInstanceOperatorService - { - _changeState(id, IComponent.ComponentState.Suspended); - emit LogComponentSuspended(id); - - // inform component about suspending - IComponent component = getComponent(id); - component.suspendCallback(); - } - - function resume(uint256 id) - external - onlyInstanceOperatorService - { - _changeState(id, IComponent.ComponentState.Active); - emit LogComponentResumed(id); - - // inform component about resuming - IComponent component = getComponent(id); - component.resumeCallback(); - } - - function pause(uint256 id) - external - onlyComponentOwnerService - { - _changeState(id, IComponent.ComponentState.Paused); - emit LogComponentPaused(id); - - // inform component about pausing - IComponent component = getComponent(id); - component.pauseCallback(); - } - - function unpause(uint256 id) - external - onlyComponentOwnerService - { - _changeState(id, IComponent.ComponentState.Active); - emit LogComponentUnpaused(id); - - // inform component about unpausing - IComponent component = getComponent(id); - component.unpauseCallback(); - } - - function archiveFromComponentOwner(uint256 id) - external - onlyComponentOwnerService - { - _changeState(id, IComponent.ComponentState.Archived); - emit LogComponentArchived(id); - - // inform component about archiving - IComponent component = getComponent(id); - component.archiveCallback(); - } - - function archiveFromInstanceOperator(uint256 id) - external - onlyInstanceOperatorService - { - _changeState(id, IComponent.ComponentState.Archived); - emit LogComponentArchived(id); - - // inform component about archiving - IComponent component = getComponent(id); - component.archiveCallback(); - } - - function getComponent(uint256 id) public view returns (IComponent component) { - component = _componentById[id]; - require(address(component) != address(0), "ERROR:CCR-005:INVALID_COMPONENT_ID"); - } - - function getComponentId(address componentAddress) public view returns (uint256 id) { - require(componentAddress != address(0), "ERROR:CCR-006:COMPONENT_ADDRESS_ZERO"); - id = _componentIdByAddress[componentAddress]; - - require(id > 0, "ERROR:CCR-007:COMPONENT_UNKNOWN"); - } - - function getComponentType(uint256 id) public view returns (IComponent.ComponentType componentType) { - if (EnumerableSet.contains(_products, id)) { - return IComponent.ComponentType.Product; - } else if (EnumerableSet.contains(_oracles, id)) { - return IComponent.ComponentType.Oracle; - } else if (EnumerableSet.contains(_riskpools, id)) { - return IComponent.ComponentType.Riskpool; - } else { - revert("ERROR:CCR-008:INVALID_COMPONENT_ID"); - } - } - - function getComponentState(uint256 id) public view returns (IComponent.ComponentState componentState) { - return _componentState[id]; - } - - function getOracleId(uint256 idx) public view returns (uint256 oracleId) { - return EnumerableSet.at(_oracles, idx); - } - - function getRiskpoolId(uint256 idx) public view returns (uint256 riskpoolId) { - return EnumerableSet.at(_riskpools, idx); - } - - function getProductId(uint256 idx) public view returns (uint256 productId) { - return EnumerableSet.at(_products, idx); - } - - function getRequiredRole(IComponent.ComponentType componentType) external view returns (bytes32) { - if (componentType == IComponent.ComponentType.Product) { return _access.getProductOwnerRole(); } - else if (componentType == IComponent.ComponentType.Oracle) { return _access.getOracleProviderRole(); } - else if (componentType == IComponent.ComponentType.Riskpool) { return _access.getRiskpoolKeeperRole(); } - else { revert("ERROR:CCR-010:COMPONENT_TYPE_UNKNOWN"); } - } - - function components() public view returns (uint256 count) { return _componentCount; } - function products() public view returns (uint256 count) { return EnumerableSet.length(_products); } - function oracles() public view returns (uint256 count) { return EnumerableSet.length(_oracles); } - function riskpools() public view returns (uint256 count) { return EnumerableSet.length(_riskpools); } - - function isProduct(uint256 id) public view returns (bool) { return EnumerableSet.contains(_products, id); } - - function isOracle(uint256 id) public view returns (bool) { return EnumerableSet.contains(_oracles, id); } - - function isRiskpool(uint256 id) public view returns (bool) { return EnumerableSet.contains(_riskpools, id); } - - function getPolicyFlow(uint256 productId) public view returns (address _policyFlow) { - require(isProduct(productId), "ERROR:CCR-011:UNKNOWN_PRODUCT_ID"); - _policyFlow = _policyFlowByProductId[productId]; - } - - function _changeState(uint256 componentId, IComponent.ComponentState newState) internal { - IComponent.ComponentState oldState = _componentState[componentId]; - - _checkStateTransition(oldState, newState); - _componentState[componentId] = newState; - - // log entry for successful component state change - emit LogComponentStateChanged(componentId, oldState, newState); - } - - function _checkStateTransition( - IComponent.ComponentState oldState, - IComponent.ComponentState newState - ) - internal - pure - { - require(newState != oldState, - "ERROR:CCR-020:SOURCE_AND_TARGET_STATE_IDENTICAL"); - - if (oldState == IComponent.ComponentState.Created) { - require(newState == IComponent.ComponentState.Proposed, - "ERROR:CCR-021:CREATED_INVALID_TRANSITION"); - } else if (oldState == IComponent.ComponentState.Proposed) { - require(newState == IComponent.ComponentState.Active - || newState == IComponent.ComponentState.Declined, - "ERROR:CCR-22:PROPOSED_INVALID_TRANSITION"); - } else if (oldState == IComponent.ComponentState.Declined) { - revert("ERROR:CCR-023:DECLINED_IS_FINAL_STATE"); - } else if (oldState == IComponent.ComponentState.Active) { - require(newState == IComponent.ComponentState.Paused - || newState == IComponent.ComponentState.Suspended, - "ERROR:CCR-024:ACTIVE_INVALID_TRANSITION"); - } else if (oldState == IComponent.ComponentState.Paused) { - require(newState == IComponent.ComponentState.Active - || newState == IComponent.ComponentState.Archived, - "ERROR:CCR-025:PAUSED_INVALID_TRANSITION"); - } else if (oldState == IComponent.ComponentState.Suspended) { - require(newState == IComponent.ComponentState.Active - || newState == IComponent.ComponentState.Archived, - "ERROR:CCR-026:SUSPENDED_INVALID_TRANSITION"); - } else { - revert("ERROR:CCR-027:INITIAL_STATE_NOT_HANDLED"); - } - } -} +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.2; + +import "../shared/CoreController.sol"; +import "@etherisc/gif-interface/contracts/components/IComponent.sol"; +import "@etherisc/gif-interface/contracts/components/IOracle.sol"; +import "@etherisc/gif-interface/contracts/components/IProduct.sol"; +import "@etherisc/gif-interface/contracts/components/IRiskpool.sol"; +import "@etherisc/gif-interface/contracts/modules/IComponentEvents.sol"; +import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; + +/** + * @dev The smart contract provides functionality to manage and control components in a system. + * The contract defines several mappings and sets to store information about components, such as their addresses, IDs, states, and types. + * It also includes modifiers to restrict access to certain functions based on the caller's role. + * + * The contract also includes various modifiers (`onlyComponentOwnerService` and `onlyInstanceOperatorService`) to ensure that only authorized callers can access certain functions. + * + * The contract imports several Solidity files from external dependencies and uses the `EnumerableSet` library from the OpenZeppelin library for set operations. + */ + + + +contract ComponentController is + IComponentEvents, + CoreController + { + using EnumerableSet for EnumerableSet.UintSet; + + mapping(uint256 => IComponent) private _componentById; + mapping(bytes32 => uint256) private _componentIdByName; + mapping(address => uint256) private _componentIdByAddress; + + mapping(uint256 => IComponent.ComponentState) private _componentState; + + EnumerableSet.UintSet private _products; + EnumerableSet.UintSet private _oracles; + EnumerableSet.UintSet private _riskpools; + uint256 private _componentCount; + + mapping(uint256 /* product id */ => address /* policy flow address */) private _policyFlowByProductId; + + modifier onlyComponentOwnerService() { + require( + _msgSender() == _getContractAddress("ComponentOwnerService"), + "ERROR:CCR-001:NOT_COMPONENT_OWNER_SERVICE"); + _; + } + + modifier onlyInstanceOperatorService() { + require( + _msgSender() == _getContractAddress("InstanceOperatorService"), + "ERROR:CCR-002:NOT_INSTANCE_OPERATOR_SERVICE"); + _; + } + + /** + * @dev Proposes a new component to the system. + * @param component The component to be proposed. + * + * Emits a LogComponentProposed event with the name, type, address and id of the proposed component. + * Calls the proposalCallback function of the proposed component to inform it about the successful proposal. + * + * Requirements: + * - The caller must be the owner service of the component. + * - The component must not already exist in the system. + * - The component name must not already exist in the system. + * @notice This function emits 1 events: + * - LogComponentProposed + */ + function propose(IComponent component) + external + onlyComponentOwnerService + { + // input validation + require(_componentIdByAddress[address(component)] == 0, "ERROR:CCR-003:COMPONENT_ALREADY_EXISTS"); + require(_componentIdByName[component.getName()] == 0, "ERROR:CCR-004:COMPONENT_NAME_ALREADY_EXISTS"); + + // assigning id and persisting component + uint256 id = _persistComponent(component); + + // log entry for successful proposal + emit LogComponentProposed( + component.getName(), + component.getType(), + address(component), + id); + + // inform component about successful proposal + component.proposalCallback(); + } + + /** + * @dev Persists a new component into the system. + * @param component The component to be persisted. + * @return id The id of the newly persisted component. + * + * - Fetches the next component id. + * - Updates component state to Proposed. + * - Sets the id of the component. + * - Updates controller book keeping with the new component id. + * - Updates type specific book keeping. + */ + function _persistComponent(IComponent component) + internal + returns(uint256 id) + { + // fetch next component id + _componentCount++; + id = _componentCount; + + // update component state + _changeState(id, IComponent.ComponentState.Proposed); + component.setId(id); + + // update controller book keeping + _componentById[id] = component; + _componentIdByName[component.getName()] = id; + _componentIdByAddress[address(component)] = id; + + // type specific book keeping + if (component.isProduct()) { EnumerableSet.add(_products, id); } + else if (component.isOracle()) { EnumerableSet.add(_oracles, id); } + else if (component.isRiskpool()) { EnumerableSet.add(_riskpools, id); } + } + + /** + * @dev Checks if a component with the given ID exists. + * @param id The ID of the component to check. + * @return True if a component with the given ID exists, false otherwise. + */ + function exists(uint256 id) public view returns(bool) { + IComponent component = _componentById[id]; + return (address(component) != address(0)); + } + + /** + * @dev Approves a component with the given id. + * @param id The id of the component to be approved. + * + * Emits a LogComponentApproved event and informs the component about the successful approval by calling the approvalCallback function. + * If the component is a product, sets the policy flow in the _policyFlowByProductId mapping. + * @notice This function emits 1 events: + * - LogComponentApproved + */ + function approve(uint256 id) + external + onlyInstanceOperatorService + { + _changeState(id, IComponent.ComponentState.Active); + IComponent component = getComponent(id); + + if (isProduct(id)) { + _policyFlowByProductId[id] = IProduct(address(component)).getPolicyFlow(); + } + + emit LogComponentApproved(id); + + // inform component about successful approval + component.approvalCallback(); + } + + /** + * @dev Changes the state of a component with the given ID to "Declined" and emits a LogComponentDeclined event. + * Calls the declineCallback function of the component with the given ID. + * + * @param id The ID of the component to decline. + * @notice This function emits 1 events: + * - LogComponentDeclined + */ + function decline(uint256 id) + external + onlyInstanceOperatorService + { + _changeState(id, IComponent.ComponentState.Declined); + emit LogComponentDeclined(id); + + // inform component about decline + IComponent component = getComponent(id); + component.declineCallback(); + } + + /** + * @dev Suspends a component with the given ID. + * + * @param id The ID of the component to suspend. + * + * @notice This function emits 1 events: + * - LogComponentSuspended + */ + function suspend(uint256 id) + external + onlyInstanceOperatorService + { + _changeState(id, IComponent.ComponentState.Suspended); + emit LogComponentSuspended(id); + + // inform component about suspending + IComponent component = getComponent(id); + component.suspendCallback(); + } + + /** + * @dev Resumes a component by changing its state to Active and emitting an event. + * It also calls the resumeCallback() function of the component to inform it about the resuming. + * + * @param id The ID of the component to be resumed. + * @notice This function emits 1 events: + * - LogComponentResumed + */ + function resume(uint256 id) + external + onlyInstanceOperatorService + { + _changeState(id, IComponent.ComponentState.Active); + emit LogComponentResumed(id); + + // inform component about resuming + IComponent component = getComponent(id); + component.resumeCallback(); + } + + /** + * @dev Pauses the component with the given ID. + * @param id The ID of the component to be paused. + * @notice This function emits 1 events: + * - LogComponentPaused + */ + function pause(uint256 id) + external + onlyComponentOwnerService + { + _changeState(id, IComponent.ComponentState.Paused); + emit LogComponentPaused(id); + + // inform component about pausing + IComponent component = getComponent(id); + component.pauseCallback(); + } + + /** + * @dev Unpauses a component with the given id. + * + * @param id The id of the component to unpause. + * + * @notice This function emits 1 events: + * - LogComponentUnpaused + */ + function unpause(uint256 id) + external + onlyComponentOwnerService + { + _changeState(id, IComponent.ComponentState.Active); + emit LogComponentUnpaused(id); + + // inform component about unpausing + IComponent component = getComponent(id); + component.unpauseCallback(); + } + + /** + * @dev Archives a component with the given ID, changing its state to "Archived" and emitting a LogComponentArchived event. + * Also calls the archiveCallback function of the component with the given ID, informing it about the archiving. + * + * @param id The ID of the component to be archived. + * @notice This function emits 1 events: + * - LogComponentArchived + */ + function archiveFromComponentOwner(uint256 id) + external + onlyComponentOwnerService + { + _changeState(id, IComponent.ComponentState.Archived); + emit LogComponentArchived(id); + + // inform component about archiving + IComponent component = getComponent(id); + component.archiveCallback(); + } + + /** + * @dev Archives a component instance with the given ID. + * @param id The ID of the component instance to be archived. + * + * @notice This function emits 1 events: + * - LogComponentArchived + */ + function archiveFromInstanceOperator(uint256 id) + external + onlyInstanceOperatorService + { + _changeState(id, IComponent.ComponentState.Archived); + emit LogComponentArchived(id); + + // inform component about archiving + IComponent component = getComponent(id); + component.archiveCallback(); + } + + /** + * @dev Returns the component with the given ID. + * @param id The ID of the component to retrieve. + * @return component The component with the given ID. + */ + function getComponent(uint256 id) public view returns (IComponent component) { + component = _componentById[id]; + require(address(component) != address(0), "ERROR:CCR-005:INVALID_COMPONENT_ID"); + } + + /** + * @dev Returns the ID of a registered component given its address. + * @param componentAddress The address of the component. + * @return id The ID of the component. + */ + function getComponentId(address componentAddress) public view returns (uint256 id) { + require(componentAddress != address(0), "ERROR:CCR-006:COMPONENT_ADDRESS_ZERO"); + id = _componentIdByAddress[componentAddress]; + + require(id > 0, "ERROR:CCR-007:COMPONENT_UNKNOWN"); + } + + /** + * @dev Returns the component type of a given component ID. + * @param id The ID of the component. + * @return componentType The type of the component (Product, Oracle or Riskpool). + * @notice If the component ID is not found, reverts with an error message. + */ + function getComponentType(uint256 id) public view returns (IComponent.ComponentType componentType) { + if (EnumerableSet.contains(_products, id)) { + return IComponent.ComponentType.Product; + } else if (EnumerableSet.contains(_oracles, id)) { + return IComponent.ComponentType.Oracle; + } else if (EnumerableSet.contains(_riskpools, id)) { + return IComponent.ComponentType.Riskpool; + } else { + revert("ERROR:CCR-008:INVALID_COMPONENT_ID"); + } + } + + /** + * @dev Returns the state of the component with the given ID. + * @param id The ID of the component. + * @return componentState The state of the component. + */ + function getComponentState(uint256 id) public view returns (IComponent.ComponentState componentState) { + return _componentState[id]; + } + + /** + * @dev Returns the oracle ID at the given index. + * @param idx The index of the oracle ID to retrieve. + * @return oracleId The oracle ID at the given index. + */ + function getOracleId(uint256 idx) public view returns (uint256 oracleId) { + return EnumerableSet.at(_oracles, idx); + } + + /** + * @dev Returns the riskpool ID at the specified index. + * @param idx The index of the riskpool ID to retrieve. + * @return riskpoolId The ID of the riskpool at the specified index. + */ + function getRiskpoolId(uint256 idx) public view returns (uint256 riskpoolId) { + return EnumerableSet.at(_riskpools, idx); + } + + /** + * @dev Returns the product ID at the given index in the _products set. + * @param idx The index of the product ID to retrieve. + * @return productId The product ID at the given index. + */ + function getProductId(uint256 idx) public view returns (uint256 productId) { + return EnumerableSet.at(_products, idx); + } + + /** + * @dev Returns the required role for a given component type. + * @param componentType The type of component for which to retrieve the required role. + * @return The required role as a bytes32 value. + * + * Requirements: + * - The component type must be a valid value from the IComponent.ComponentType enum. + * - If the component type is not recognized, the function reverts with an error message. + */ + function getRequiredRole(IComponent.ComponentType componentType) external view returns (bytes32) { + if (componentType == IComponent.ComponentType.Product) { return _access.getProductOwnerRole(); } + else if (componentType == IComponent.ComponentType.Oracle) { return _access.getOracleProviderRole(); } + else if (componentType == IComponent.ComponentType.Riskpool) { return _access.getRiskpoolKeeperRole(); } + else { revert("ERROR:CCR-010:COMPONENT_TYPE_UNKNOWN"); } + } + + /** + * @dev Returns the number of components currently stored in the contract. + * @return count The number of components stored. + */ + function components() public view returns (uint256 count) { return _componentCount; } + /** + * @dev Returns the number of products in the set '_products'. + * @return count The number of products in the set '_products'. + */ + function products() public view returns (uint256 count) { return EnumerableSet.length(_products); } + /** + * @dev Returns the number of oracles registered in the _oracles set. + * @return count The number of oracles registered in the _oracles set. + */ + function oracles() public view returns (uint256 count) { return EnumerableSet.length(_oracles); } + /** + * @dev Returns the number of risk pools in the EnumerableSet. + * @return count The number of risk pools in the EnumerableSet. + */ + function riskpools() public view returns (uint256 count) { return EnumerableSet.length(_riskpools); } + + /** + * @dev Check if a product exists in the set of products. + * @param id The ID of the product to check. + * @return Returns true if the product exists in the set, false otherwise. + */ + function isProduct(uint256 id) public view returns (bool) { return EnumerableSet.contains(_products, id); } + + /** + * @dev Checks if an oracle with a given ID exists. + * @param id The ID of the oracle to check. + * @return A boolean indicating whether the oracle exists or not. + */ + function isOracle(uint256 id) public view returns (bool) { return EnumerableSet.contains(_oracles, id); } + + /** + * @dev Checks if a given ID is a riskpool. + * @param id The ID to check. + * @return A boolean value indicating if the given ID is a riskpool. + */ + function isRiskpool(uint256 id) public view returns (bool) { return EnumerableSet.contains(_riskpools, id); } + + /** + * @dev Returns the address of the policy flow for a given product ID. + * @param productId The ID of the product to retrieve the policy flow for. + * @return _policyFlow The address of the policy flow for the given product ID. + */ + function getPolicyFlow(uint256 productId) public view returns (address _policyFlow) { + require(isProduct(productId), "ERROR:CCR-011:UNKNOWN_PRODUCT_ID"); + _policyFlow = _policyFlowByProductId[productId]; + } + + /** + * @dev Changes the state of a component. + * @param componentId The ID of the component to change the state of. + * @param newState The new state to set for the component. + * + * Emits a LogComponentStateChanged event upon successful state change. + * @notice This function emits 1 events: + * - LogComponentStateChanged + */ + function _changeState(uint256 componentId, IComponent.ComponentState newState) internal { + IComponent.ComponentState oldState = _componentState[componentId]; + + _checkStateTransition(oldState, newState); + _componentState[componentId] = newState; + + // log entry for successful component state change + emit LogComponentStateChanged(componentId, oldState, newState); + } + + /** + * @dev Checks if the state transition is valid. + * @param oldState The current state of the component. + * @param newState The state to which the component will transition. + * + * + * @dev Throws an error if the newState is the same as the oldState. + * @dev Throws an error if the transition from Created state is not to Proposed state. + * @dev Throws an error if the transition from Proposed state is not to Active or Declined state. + * @dev Throws an error if the transition from Declined state is attempted. + * @dev Throws an error if the transition from Active state is not to Paused or Suspended state. + * @dev Throws an error if the transition from Paused state is not to Active or Archived state. + * @dev Throws an error if the transition from Suspended state is not to Active or Archived state. + * @dev Throws an error if the initial state is not handled. + */ + function _checkStateTransition( + IComponent.ComponentState oldState, + IComponent.ComponentState newState + ) + internal + pure + { + require(newState != oldState, + "ERROR:CCR-020:SOURCE_AND_TARGET_STATE_IDENTICAL"); + + if (oldState == IComponent.ComponentState.Created) { + require(newState == IComponent.ComponentState.Proposed, + "ERROR:CCR-021:CREATED_INVALID_TRANSITION"); + } else if (oldState == IComponent.ComponentState.Proposed) { + require(newState == IComponent.ComponentState.Active + || newState == IComponent.ComponentState.Declined, + "ERROR:CCR-22:PROPOSED_INVALID_TRANSITION"); + } else if (oldState == IComponent.ComponentState.Declined) { + revert("ERROR:CCR-023:DECLINED_IS_FINAL_STATE"); + } else if (oldState == IComponent.ComponentState.Active) { + require(newState == IComponent.ComponentState.Paused + || newState == IComponent.ComponentState.Suspended, + "ERROR:CCR-024:ACTIVE_INVALID_TRANSITION"); + } else if (oldState == IComponent.ComponentState.Paused) { + require(newState == IComponent.ComponentState.Active + || newState == IComponent.ComponentState.Archived, + "ERROR:CCR-025:PAUSED_INVALID_TRANSITION"); + } else if (oldState == IComponent.ComponentState.Suspended) { + require(newState == IComponent.ComponentState.Active + || newState == IComponent.ComponentState.Archived, + "ERROR:CCR-026:SUSPENDED_INVALID_TRANSITION"); + } else { + revert("ERROR:CCR-027:INITIAL_STATE_NOT_HANDLED"); + } + } +} diff --git a/contracts/modules/LicenseController.sol b/contracts/modules/LicenseController.sol index 6516325c..eb399a98 100644 --- a/contracts/modules/LicenseController.sol +++ b/contracts/modules/LicenseController.sol @@ -8,6 +8,18 @@ import "@etherisc/gif-interface/contracts/components/IComponent.sol"; import "@etherisc/gif-interface/contracts/components/IProduct.sol"; import "@etherisc/gif-interface/contracts/modules/ILicense.sol"; +/** + * @dev The smart contract serves as a controller contract for managing licenses related to products in an insurance ecosystem. + * The contract implements the `ILicense` interface and extends the `CoreController` contract. + * + * The contract imports two other contracts: `ComponentController.sol` and `CoreController.sol`, which are expected to be located in specific file paths. + * It also imports several interfaces from the "etherisc/gif-interface" library, including `IComponent.sol`, `IProduct.sol`, and `ILicense.sol`. + * The contract includes a private variable `_component` of type `ComponentController`, which is used to interact with the `ComponentController` contract. + * + * Overall, the `LicenseController` contract serves as a controller for managing licenses and provides functions to check the authorization status and activity of products within an insurance ecosystem. + */ + + contract LicenseController is ILicense, @@ -16,11 +28,22 @@ contract LicenseController is ComponentController private _component; + /** + * @dev This function is called after the contract is initialized and sets the `_component` variable to the address of the `ComponentController` contract. + * + */ function _afterInitialize() internal override onlyInitializing { _component = ComponentController(_getContractAddress("Component")); } // ensures that calling component (productAddress) is a product + /** + * @dev Returns the authorization status of a given product address. + * @param productAddress The address of the product to check authorization status for. + * @return productId The ID of the product. + * @return isAuthorized A boolean indicating whether the product is authorized or not. + * @return policyFlow The address of the policy flow associated with the product. + */ function getAuthorizationStatus(address productAddress) public override view @@ -31,10 +54,20 @@ contract LicenseController is policyFlow = _component.getPolicyFlow(productId); } + /** + * @dev Checks if a product is currently active. + * @param productId The ID of the product to check. + * @return A boolean indicating if the product is active or not. + */ function _isValidCall(uint256 productId) internal view returns (bool) { return _component.getComponentState(productId) == IComponent.ComponentState.Active; } + /** + * @dev Returns the product associated with the given ID. + * @param id The ID of the product to retrieve. + * @return product The product associated with the given ID. + */ function _getProduct(uint256 id) internal view returns (IProduct product) { require(_component.isProduct(id), "ERROR:LIC-001:COMPONENT_NOT_PRODUCT"); IComponent cmp = _component.getComponent(id); diff --git a/contracts/modules/PolicyController.sol b/contracts/modules/PolicyController.sol index f8e1c28d..39e95204 100644 --- a/contracts/modules/PolicyController.sol +++ b/contracts/modules/PolicyController.sol @@ -5,6 +5,27 @@ import "../shared/CoreController.sol"; import "./ComponentController.sol"; import "@etherisc/gif-interface/contracts/modules/IPolicy.sol"; +/** + * @dev The smart contract implements functions for policy operations, including creation, update, cancellation, and retrieval. + * It also provides functions for claim creation, confirmation, decline, closure, and payout creation. + * Additionally, it includes functions to process payouts, retrieve metadata and application information, and get the number of claims and payouts associated with a policy. + * The contract inherits from the `IPolicy` interface and the `CoreController` contract. + * + * State Variables: + * + * - `metadata`: A mapping that stores metadata associated with policy flows. + * - `applications`: A mapping that stores insurance applications associated with policy flows. + * - `policies`: A mapping that stores policies associated with policy flows. + * - `claims`: A nested mapping that stores claims associated with policies. + * - `payouts`: A nested mapping that stores payouts associated with policies. + * - `payoutCount`: A mapping that stores the count of payouts for each policy flow. + * - `_assigendProcessIds`: A counter variable for assigning unique process IDs. + * - `_component`: A reference to the `ComponentController` contract. + * + * Overall, these functions provide functionality for creating, managing, and processing claims and payouts within the insurance policy contract. + */ + + contract PolicyController is IPolicy, CoreController @@ -32,11 +53,24 @@ contract PolicyController is ComponentController private _component; + /** + * @dev Internal function that sets the _component variable to the address of the ComponentController contract. + * + */ function _afterInitialize() internal override onlyInitializing { _component = ComponentController(_getContractAddress("Component")); } /* Metadata */ + /** + * @dev Creates a new policy flow for a given owner and product. + * @param owner The address of the owner of the policy flow. + * @param productId The ID of the product associated with the policy flow. + * @param data Additional data associated with the policy flow. + * @return processId The ID of the newly created policy flow. + * @notice This function emits 1 events: + * - LogMetadataCreated + */ function createPolicyFlow( address owner, uint256 productId, @@ -66,6 +100,25 @@ contract PolicyController is } /* Application */ + /** + * @dev Creates a new insurance application for a given process ID. + * @param processId The unique process ID associated with the insurance application. + * @param premiumAmount The amount of premium to be paid for the insurance. + * @param sumInsuredAmount The amount of coverage provided by the insurance. + * @param data Additional data associated with the insurance application. + * + * Emits a LogApplicationCreated event with the process ID, premium amount, and sum insured amount. + * + * Requirements: + * - The metadata for the process ID must exist. + * - An application for the process ID must not already exist. + * - The premium amount must be greater than zero. + * - The sum insured amount must be greater than the premium amount. + * - Only the PolicyFlow contract can call this function. + * @notice This function emits 2 events: + * - LogApplicationCreated + * - LogMetadataStateChanged + */ function createApplication( bytes32 processId, uint256 premiumAmount, @@ -98,6 +151,19 @@ contract PolicyController is emit LogApplicationCreated(processId, premiumAmount, sumInsuredAmount); } + /** + * @dev Collects premium for a policy. + * @param processId The unique identifier of the policy. + * @param amount The amount of premium to be collected. + * + * Requirements: + * - The policy must exist. + * - The amount to be collected must not exceed the expected premium amount. + * + * Emits a {LogPremiumCollected} event. + * @notice This function emits 1 events: + * - LogPremiumCollected + */ function collectPremium(bytes32 processId, uint256 amount) external override { @@ -111,6 +177,13 @@ contract PolicyController is emit LogPremiumCollected(processId, amount); } + /** + * @dev Revokes an application with the given process ID. + * @param processId The process ID of the application to be revoked. + * @notice This function emits 2 events: + * - LogApplicationRevoked + * - LogMetadataStateChanged + */ function revokeApplication(bytes32 processId) external override onlyPolicyFlow("Policy") @@ -132,6 +205,14 @@ contract PolicyController is emit LogApplicationRevoked(processId); } + /** + * @dev Changes the state of an application to underwritten. + * @param processId The unique ID of the application process. + * + * Emits a LogApplicationUnderwritten event. + * @notice This function emits 1 events: + * - LogApplicationUnderwritten + */ function underwriteApplication(bytes32 processId) external override onlyPolicyFlow("Policy") @@ -146,6 +227,27 @@ contract PolicyController is emit LogApplicationUnderwritten(processId); } + /** + * @dev Declines an application for a policy flow. + * @param processId The unique identifier of the policy flow process. + * + * + * Emits a LogMetadataStateChanged event with the updated metadata state. + * Emits a LogApplicationDeclined event with the declined application's process ID. + * + * Requirements: + * - The function can only be called by a "Policy" policy flow. + * - The metadata for the given process ID must exist. + * - The application for the given process ID must exist and be in the "Applied" state. + * + * Effects: + * - Updates the state of the application to "Declined". + * - Updates the state of the metadata to "Finished". + * - Updates the updatedAt timestamps for both the application and metadata. + * @notice This function emits 2 events: + * - LogApplicationDeclined + * - LogMetadataStateChanged + */ function declineApplication(bytes32 processId) external override onlyPolicyFlow("Policy") @@ -168,6 +270,20 @@ contract PolicyController is } /* Policy */ + /** + * @dev Creates a new policy for a given application process ID. + * @param processId The ID of the application process. + * + * + * Emits a `LogPolicyCreated` event. + * + * Requirements: + * - The caller must have the 'Policy' role. + * - The application must exist and be in the 'Underwritten' state. + * - The policy must not already exist for the given process ID. + * @notice This function emits 1 events: + * - LogPolicyCreated + */ function createPolicy(bytes32 processId) external override onlyPolicyFlow("Policy") @@ -187,6 +303,17 @@ contract PolicyController is emit LogPolicyCreated(processId); } + /** + * @dev This function adjusts the premium and sum insured amount of an insurance policy application. + * @param processId The unique identifier of the insurance policy application. + * @param expectedPremiumAmount The expected premium amount for the insurance policy. + * @param sumInsuredAmount The sum insured amount for the insurance policy. + * + * @notice This function emits 3 events: + * - LogApplicationPremiumAdjusted + * - LogPolicyPremiumAdjusted + * - LogApplicationSumInsuredAdjusted + */ function adjustPremiumSumInsured( bytes32 processId, uint256 expectedPremiumAmount, @@ -237,6 +364,14 @@ contract PolicyController is } } + /** + * @dev This function expires a policy with the given process ID. + * + * @param processId The process ID of the policy to be expired. + * + * @notice This function emits 1 events: + * - LogPolicyExpired + */ function expirePolicy(bytes32 processId) external override onlyPolicyFlow("Policy") @@ -251,6 +386,23 @@ contract PolicyController is emit LogPolicyExpired(processId); } + /** + * @dev Closes a policy that has expired and has no open claims. + * @param processId The unique identifier of the policy. + * + * + * Emits a LogMetadataStateChanged event with the updated metadata state. + * Emits a LogPolicyClosed event with the unique identifier of the closed policy. + * + * Requirements: + * - The metadata for the given processId must exist. + * - The policy for the given processId must exist. + * - The state of the policy must be 'Expired'. + * - The policy must have no open claims. + * @notice This function emits 2 events: + * - LogMetadataStateChanged + * - LogPolicyClosed + */ function closePolicy(bytes32 processId) external override onlyPolicyFlow("Policy") @@ -274,6 +426,25 @@ contract PolicyController is } /* Claim */ + /** + * @dev Creates a new claim for a given policy. + * @param processId The ID of the policy. + * @param claimAmount The amount of the claim. + * @param data Additional data related to the claim. + * @return claimId The ID of the newly created claim. + * + * Emits a LogClaimCreated event. + * + * Requirements: + * - The caller must be authorized to create claims for the policy. + * - The policy must exist and be in an active state. + * - The sum of the payout amount and the claim amount must not exceed the maximum payout amount. + * - The claim must not already exist. + * + * Note: The function allows claims with amount 0 to be created, which can be useful for parametric insurance. + * @notice This function emits 1 events: + * - LogClaimCreated + */ function createClaim( bytes32 processId, uint256 claimAmount, @@ -307,6 +478,24 @@ contract PolicyController is emit LogClaimCreated(processId, claimId, claimAmount); } + /** + * @dev Confirms a claim for a policy, updating the claim state to Confirmed and setting the confirmed amount. + * @param processId The ID of the policy the claim belongs to. + * @param claimId The ID of the claim to confirm. + * @param confirmedAmount The amount to confirm for the claim. + * + * Requirements: + * - Only the Policy contract can call this function. + * - The policy must exist. + * - The policy must have at least one open claim. + * - The sum of the policy's payout amount and the confirmed amount must not exceed the policy's maximum payout amount. + * - The claim must exist. + * - The claim state must be Applied. + * + * Emits a LogClaimConfirmed event with the process ID, claim ID, and confirmed amount. + * @notice This function emits 1 events: + * - LogClaimConfirmed + */ function confirmClaim( bytes32 processId, uint256 claimId, @@ -335,6 +524,15 @@ contract PolicyController is emit LogClaimConfirmed(processId, claimId, confirmedAmount); } + /** + * @dev This function allows the Policy contract to decline a claim. + * @param processId The ID of the process to which the policy belongs. + * @param claimId The ID of the claim to be declined. + * + * Emits a LogClaimDeclined event. + * @notice This function emits 1 events: + * - LogClaimDeclined + */ function declineClaim(bytes32 processId, uint256 claimId) external override onlyPolicyFlow("Policy") @@ -355,6 +553,14 @@ contract PolicyController is emit LogClaimDeclined(processId, claimId); } + /** + * @dev Closes a claim for a given policy. + * @param processId The ID of the policy process. + * @param claimId The ID of the claim to be closed. + * + * @notice This function emits 1 events: + * - LogClaimClosed + */ function closeClaim(bytes32 processId, uint256 claimId) external override onlyPolicyFlow("Policy") @@ -386,6 +592,26 @@ contract PolicyController is } /* Payout */ + /** + * @dev Creates a new payout for a confirmed claim in a policy. + * @param processId The ID of the policy. + * @param claimId The ID of the claim associated with the payout. + * @param payoutAmount The amount of the payout. + * @param data Additional data related to the payout. + * @return payoutId The ID of the newly created payout. + * + * Emits a LogPayoutCreated event with the processId, claimId, payoutId, and payoutAmount. + * + * Requirements: + * - The caller must have the onlyPolicyFlow modifier with "Policy" as the argument. + * - The policy with the given processId must exist. + * - The claim with the given claimId must exist and be in the Confirmed state. + * - The payoutAmount must be greater than zero. + * - The sum of the paidAmount of the claim and the payoutAmount must not exceed the claimAmount of the claim. + * - A payout with the given processId and payoutId must not already exist. + * @notice This function emits 1 events: + * - LogPayoutCreated + */ function createPayout( bytes32 processId, uint256 claimId, @@ -425,6 +651,33 @@ contract PolicyController is emit LogPayoutCreated(processId, claimId, payoutId, payoutAmount); } + /** + * @dev Processes a payout for a policy and claim. + * @param processId The ID of the policy to process the payout for. + * @param payoutId The ID of the payout to process. + * + * Emits a LogPayoutProcessed event. + * If the claim is fully paid, emits a LogClaimClosed event. + * + * Requirements: + * - The caller must have the onlyPolicyFlow modifier with the "Policy" role. + * - The policy with the given processId must exist. + * - The policy with the given processId must have at least one open claim. + * - The payout with the given payoutId must exist. + * - The payout with the given payoutId must be in the Expected state. + * + * Effects: + * - Changes the state of the payout to PaidOut. + * - Updates the updatedAt timestamp of the payout. + * - Increases the paidAmount of the claim associated with the payout. + * - Updates the updatedAt timestamp of the claim. + * - If the claim is fully paid, changes the state of the claim to Closed. + * - Decreases the openClaimsCount of the policy associated with the claim. + * - Updates the updatedAt timestamp of the policy. + * @notice This function emits 2 events: + * - LogClaimClosed + * - LogPayoutProcessed + */ function processPayout( bytes32 processId, uint256 payoutId @@ -460,6 +713,14 @@ contract PolicyController is } } + /** + * @dev Returns the metadata for the given process ID. + * @param processId The ID of the process to retrieve metadata for. + * @return _metadata The metadata information for the given process ID. + * + * Requirements: + * - The metadata for the given process ID must exist. + */ function getMetadata(bytes32 processId) public view @@ -469,6 +730,11 @@ contract PolicyController is require(_metadata.createdAt > 0, "ERROR:POC-100:METADATA_DOES_NOT_EXIST"); } + /** + * @dev Returns the application associated with the provided process ID. + * @param processId The ID of the process for which to retrieve the application. + * @return application The application associated with the provided process ID. + */ function getApplication(bytes32 processId) public view @@ -478,14 +744,29 @@ contract PolicyController is require(application.createdAt > 0, "ERROR:POC-101:APPLICATION_DOES_NOT_EXIST"); } + /** + * @dev Returns the number of claims associated with a given process ID. + * @param processId The ID of the process for which to retrieve the number of claims. + * @return numberOfClaims The number of claims associated with the given process ID. + */ function getNumberOfClaims(bytes32 processId) external view returns(uint256 numberOfClaims) { numberOfClaims = getPolicy(processId).claimsCount; } + /** + * @dev Returns the number of payouts for a given process ID. + * @param processId The ID of the process. + * @return numberOfPayouts The number of payouts for the given process ID. + */ function getNumberOfPayouts(bytes32 processId) external view returns(uint256 numberOfPayouts) { numberOfPayouts = payoutCount[processId]; } + /** + * @dev Returns the policy associated with the given process ID. + * @param processId The ID of the process for which to retrieve the policy. + * @return policy The policy object associated with the given process ID. + */ function getPolicy(bytes32 processId) public view @@ -495,6 +776,14 @@ contract PolicyController is require(policy.createdAt > 0, "ERROR:POC-102:POLICY_DOES_NOT_EXIST"); } + /** + * @dev Returns the claim with the given ID for the specified process. + * @param processId The ID of the process. + * @param claimId The ID of the claim. + * @return claim The claim object with the given ID. + * @notice This function can only be called in read-only mode. + * @notice Throws an error if the claim with the given ID does not exist. + */ function getClaim(bytes32 processId, uint256 claimId) public view @@ -504,6 +793,13 @@ contract PolicyController is require(claim.createdAt > 0, "ERROR:POC-103:CLAIM_DOES_NOT_EXIST"); } + /** + * @dev Retrieves a specific payout from a process. + * @param processId The ID of the process. + * @param payoutId The ID of the payout to retrieve. + * @return payout The payout object with the specified ID. + * @notice Throws an error if the payout does not exist. + */ function getPayout(bytes32 processId, uint256 payoutId) public view @@ -513,10 +809,18 @@ contract PolicyController is require(payout.createdAt > 0, "ERROR:POC-104:PAYOUT_DOES_NOT_EXIST"); } + /** + * @dev Returns the number of process IDs that have been assigned. + * @return _assigendProcessIds The number of process IDs that have been assigned. + */ function processIds() external view returns (uint256) { return _assigendProcessIds; } + /** + * @dev Generates a unique process ID for the next process. + * @return processId The generated process ID. + */ function _generateNextProcessId() private returns(bytes32 processId) { _assigendProcessIds++; diff --git a/contracts/modules/PoolController.sol b/contracts/modules/PoolController.sol index ec45911a..f7dac98c 100644 --- a/contracts/modules/PoolController.sol +++ b/contracts/modules/PoolController.sol @@ -13,6 +13,21 @@ import "@etherisc/gif-interface/contracts/components/IRiskpool.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; +/** + * @dev The smart contract manages riskpools, their registration, funding, defunding, collateralization, and other related operations. + * + * - The contract implements the IPool interface and extends the CoreController contract. + * - It imports other contracts such as ComponentController, PolicyController, BundleController, and CoreController. + * - It uses the EnumerableSet library from OpenZeppelin for managing sets of bundle IDs. + * - The contract defines constants for full collateralization level, collateralization level cap, and default maximum number of active bundles. + * - It maintains mappings to store riskpool information, riskpool IDs for products, maximum number of active bundles for riskpools, and active bundle IDs for riskpools. + * - The contract has a private array to store riskpool IDs. + * - It has references to other contracts: ComponentController, PolicyController, and BundleController. + * - The contract defines modifiers for access control to specific functions. + * + * Overall, the PoolController contract provides functionality to manage riskpools, register riskpools, collateralize policies, process premium payments, process payouts, and release collaterals. It acts as an intermediary between the PolicyController, ComponentController, and BundleController contracts to coordinate these operations. + */ + contract PoolController is IPool, CoreController @@ -80,6 +95,11 @@ contract PoolController is _; } + /** + * @dev This function is called after the contract is initialized and sets the addresses of the ComponentController, PolicyController, and BundleController contracts. + * + * + */ function _afterInitialize() internal override onlyInitializing { _component = ComponentController(_getContractAddress("Component")); _policy = PolicyController(_getContractAddress("Policy")); @@ -87,6 +107,16 @@ contract PoolController is } + /** + * @dev Registers a new riskpool with the given parameters. + * @param riskpoolId The ID of the riskpool to be registered. + * @param wallet The address of the wallet associated with the riskpool. + * @param erc20Token The address of the ERC20 token associated with the riskpool. + * @param collateralizationLevel The collateralization level of the riskpool. + * @param sumOfSumInsuredCap The sum of sum insured cap of the riskpool. + * @notice This function emits 1 events: + * - LogRiskpoolRegistered + */ function registerRiskpool( uint256 riskpoolId, address wallet, @@ -125,6 +155,18 @@ contract PoolController is emit LogRiskpoolRegistered(riskpoolId, wallet, erc20Token, collateralizationLevel, sumOfSumInsuredCap); } + /** + * @dev Sets the riskpool ID for a given product ID. + * @param productId The ID of the product. + * @param riskpoolId The ID of the riskpool to be set for the product. + * + * Emits a {RiskpoolForProductSet} event indicating the riskpool has been set for the product. + * Requirements: + * - The caller must have the `INSTANCE_OPERATOR` permission. + * - The product ID must exist. + * - The riskpool ID must exist. + * - The riskpool ID must not have already been set for the product. + */ function setRiskpoolForProduct(uint256 productId, uint256 riskpoolId) external override onlyInstanceOperatorService @@ -136,6 +178,11 @@ contract PoolController is _riskpoolIdForProductId[productId] = riskpoolId; } + /** + * @dev Adds funds to a specific riskpool. + * @param riskpoolId The ID of the riskpool that will receive the funds. + * @param amount The amount of funds to be added to the riskpool. + */ function fund(uint256 riskpoolId, uint256 amount) external onlyRiskpoolService @@ -147,6 +194,11 @@ contract PoolController is pool.updatedAt = block.timestamp; } + /** + * @dev Allows the Riskpool service to defund the specified Riskpool by the given amount. + * @param riskpoolId The ID of the Riskpool to defund. + * @param amount The amount of funds to be defunded from the Riskpool. + */ function defund(uint256 riskpoolId, uint256 amount) external onlyRiskpoolService @@ -161,6 +213,19 @@ contract PoolController is pool.updatedAt = block.timestamp; } + /** + * @dev Underwrites a policy application by calculating the required collateral amount and asking the responsible riskpool to secure the application. + * @param processId The ID of the policy application process. + * @return success A boolean indicating whether the collateralization process was successful or not. + * + * Emits a LogRiskpoolRequiredCollateral event with the sum insured amount and calculated collateral amount. + * Throws an error if the application state is not "Applied" or if the riskpool's sum insured cap would be exceeded by underwriting this application. + * Emits a LogRiskpoolCollateralizationSucceeded event if the collateralization process was successful, and a LogRiskpoolCollateralizationFailed event otherwise. + * @notice This function emits 3 events: + * - LogRiskpoolCollateralizationFailed + * - LogRiskpoolCollateralizationSucceeded + * - LogRiskpoolRequiredCollateral + */ function underwrite(bytes32 processId) external override onlyPolicyFlow("Pool") @@ -208,6 +273,12 @@ contract PoolController is } + /** + * @dev Calculates the required collateral amount for a given riskpool and sum insured amount. + * @param riskpoolId The ID of the riskpool. + * @param sumInsuredAmount The sum insured amount. + * @return collateralAmount The required collateral amount. + */ function calculateCollateral(uint256 riskpoolId, uint256 sumInsuredAmount) public view @@ -229,6 +300,11 @@ contract PoolController is } + /** + * @dev Processes the premium payment for a policy. + * @param processId The ID of the process. + * @param amount The amount of premium paid. + */ function processPremium(bytes32 processId, uint256 amount) external override onlyPolicyFlow("Pool") @@ -245,6 +321,22 @@ contract PoolController is } + /** + * @dev Process a payout for a policy flow in the Pool. + * @param processId The ID of the process to be paid out. + * @param amount The amount to be paid out. + * + * Emits a {PolicyPayoutProcessed} event. + * + * Requirements: + * - Caller must be the Pool contract. + * - Pool must be active for the given process. + * - Riskpool ID must be valid. + * - Pool capital must be greater than or equal to the payout amount. + * - Pool locked capital must be greater than or equal to the payout amount. + * - Pool balance must be greater than or equal to the payout amount. + * + */ function processPayout(bytes32 processId, uint256 amount) external override onlyPolicyFlow("Pool") @@ -268,6 +360,15 @@ contract PoolController is } + /** + * @dev Releases a policy's collateral from the riskpool. + * @param processId The unique identifier of the policy. + * + * + * Emits a LogRiskpoolCollateralReleased event. + * @notice This function emits 1 events: + * - LogRiskpoolCollateralReleased + */ function release(bytes32 processId) external override onlyPolicyFlow("Pool") @@ -297,6 +398,11 @@ contract PoolController is emit LogRiskpoolCollateralReleased(riskpoolId, processId, remainingCollateralAmount); } + /** + * @dev Sets the maximum number of active bundles for a given riskpool ID. + * @param riskpoolId The ID of the riskpool. + * @param maxNumberOfActiveBundles The maximum number of active bundles to be set. + */ function setMaximumNumberOfActiveBundles(uint256 riskpoolId, uint256 maxNumberOfActiveBundles) external onlyRiskpoolService @@ -305,26 +411,58 @@ contract PoolController is _maxmimumNumberOfActiveBundlesForRiskpoolId[riskpoolId] = maxNumberOfActiveBundles; } + /** + * @dev Returns the maximum number of active bundles for a given riskpool ID. + * @param riskpoolId The ID of the riskpool. + * @return maximumNumberOfActiveBundles The maximum number of active bundles for the given riskpool ID. + */ function getMaximumNumberOfActiveBundles(uint256 riskpoolId) public view returns(uint256 maximumNumberOfActiveBundles) { return _maxmimumNumberOfActiveBundlesForRiskpoolId[riskpoolId]; } + /** + * @dev Returns the number of risk pools created. + * @return idx The number of risk pools as a uint256. + */ function riskpools() external view returns(uint256 idx) { return _riskpoolIds.length; } + /** + * @dev Returns the risk pool data for a given risk pool ID. + * @param riskpoolId The ID of the risk pool to retrieve. + * @return riskPool The risk pool data, returned as a Pool struct. + * + * Throws a POL-040 error if the risk pool is not registered. + */ function getRiskpool(uint256 riskpoolId) public view returns(IPool.Pool memory riskPool) { riskPool = _riskpools[riskpoolId]; require(riskPool.createdAt > 0, "ERROR:POL-040:RISKPOOL_NOT_REGISTERED"); } + /** + * @dev Returns the risk pool ID associated with the given product ID. + * @param productId The ID of the product for which to retrieve the risk pool ID. + * @return riskpoolId The ID of the risk pool associated with the given product ID. + */ function getRiskPoolForProduct(uint256 productId) external view returns (uint256 riskpoolId) { return _riskpoolIdForProductId[productId]; } + /** + * @dev Returns the number of active bundles for a given risk pool ID. + * @param riskpoolId The ID of the risk pool to get the number of active bundles for. + * @return numberOfActiveBundles The number of active bundles for the given risk pool ID. + */ function activeBundles(uint256 riskpoolId) external view returns(uint256 numberOfActiveBundles) { return EnumerableSet.length(_activeBundleIdsForRiskpoolId[riskpoolId]); } + /** + * @dev Returns the active bundle ID at the specified index for the given risk pool ID. + * @param riskpoolId The ID of the risk pool. + * @param bundleIdx The index of the active bundle ID to be returned. + * @return bundleId The active bundle ID at the specified index. + */ function getActiveBundleId(uint256 riskpoolId, uint256 bundleIdx) external view returns(uint256 bundleId) { require( bundleIdx < EnumerableSet.length(_activeBundleIdsForRiskpoolId[riskpoolId]), @@ -334,6 +472,11 @@ contract PoolController is return EnumerableSet.at(_activeBundleIdsForRiskpoolId[riskpoolId], bundleIdx); } + /** + * @dev Adds a bundle ID to the active set for a specific riskpool ID. + * @param riskpoolId The ID of the riskpool. + * @param bundleId The ID of the bundle to be added to the active set. + */ function addBundleIdToActiveSet(uint256 riskpoolId, uint256 bundleId) external onlyRiskpoolService @@ -350,6 +493,11 @@ contract PoolController is EnumerableSet.add(_activeBundleIdsForRiskpoolId[riskpoolId], bundleId); } + /** + * @dev Removes a bundle ID from the active set for a given risk pool ID. + * @param riskpoolId The ID of the risk pool. + * @param bundleId The ID of the bundle to be removed from the active set. + */ function removeBundleIdFromActiveSet(uint256 riskpoolId, uint256 bundleId) external onlyRiskpoolService @@ -362,10 +510,19 @@ contract PoolController is EnumerableSet.remove(_activeBundleIdsForRiskpoolId[riskpoolId], bundleId); } + /** + * @dev Returns the full collateralization level of the contract. + * @return FULL_COLLATERALIZATION_LEVEL The full collateralization level of the contract. + */ function getFullCollateralizationLevel() external pure returns (uint256) { return FULL_COLLATERALIZATION_LEVEL; } + /** + * @dev Returns the Riskpool contract instance associated with the given policy metadata. + * @param metadata The metadata of the policy. + * @return riskpool The Riskpool contract instance. + */ function _getRiskpoolComponent(IPolicy.Metadata memory metadata) internal view returns (IRiskpool riskpool) { uint256 riskpoolId = _riskpoolIdForProductId[metadata.productId]; require(riskpoolId > 0, "ERROR:POL-045:RISKPOOL_DOES_NOT_EXIST"); @@ -373,6 +530,11 @@ contract PoolController is riskpool = _getRiskpoolForId(riskpoolId); } + /** + * @dev Returns the Riskpool contract instance for a given riskpoolId. + * @param riskpoolId The ID of the riskpool to retrieve the Riskpool contract instance for. + * @return riskpool The Riskpool contract instance. + */ function _getRiskpoolForId(uint256 riskpoolId) internal view returns (IRiskpool riskpool) { require(_component.isRiskpool(riskpoolId), "ERROR:POL-046:COMPONENT_NOT_RISKPOOL"); diff --git a/contracts/modules/QueryModule.sol b/contracts/modules/QueryModule.sol index ae21ac4b..b6ad1629 100644 --- a/contracts/modules/QueryModule.sol +++ b/contracts/modules/QueryModule.sol @@ -9,6 +9,25 @@ import "@etherisc/gif-interface/contracts/components/IOracle.sol"; import "@etherisc/gif-interface/contracts/modules/IQuery.sol"; import "@etherisc/gif-interface/contracts/services/IInstanceService.sol"; +/** + * @dev The smart contract implements the "IQuery" interface and extends the "CoreController" contract. + * The contract imports several external contracts from the "etherisc/gif-interface" repository, including "IComponent.sol", "IOracle.sol", "IQuery.sol", and "IInstanceService.sol". + * It also imports two local contracts, "ComponentController.sol" and "CoreController.sol". + * + * The contract defines a private variable `_component` of type "ComponentController" and an array `_oracleRequests` of type "OracleRequest[]". + * + * The contract includes two modifiers: + * + * 1. `onlyOracleService`: It requires that the caller must be the contract with the address specified by the "OracleService" contract address stored in the CoreController. + * 2. `onlyResponsibleOracle`: It checks if the oracle specified by the `responder` address is responsible for the given `requestId`. + * + * The contract emits the following events: + * + * 1. `LogOracleRequested`: Indicates the creation of a new oracle request and includes the process ID, request ID, and responsible oracle ID. + * 2. `LogOracleResponded`: Indicates the response to an oracle request and includes the process ID, request ID, responder address, and success status. + * 3. `LogOracleCanceled`: Indicates the cancellation of an oracle request and includes the request ID. + */ + contract QueryModule is IQuery, @@ -42,6 +61,10 @@ contract QueryModule is _; } + /** + * @dev Internal function that sets the `_component` variable to the `ComponentController` contract address. + * + */ function _afterInitialize() internal override onlyInitializing { _component = ComponentController(_getContractAddress("Component")); } @@ -50,6 +73,17 @@ contract QueryModule is // request only works for active oracles // function call _getOracle reverts if oracle is not active // as a result all request call on oracles that are not active will revert + /** + * @dev Creates a new oracle request for a given process with the specified input data and callback information. + * @param processId The ID of the process. + * @param input The input data for the request. + * @param callbackMethodName The name of the callback method to be called upon completion of the request. + * @param callbackContractAddress The address of the contract to be called upon completion of the request. + * @param responsibleOracleId The ID of the oracle responsible for handling the request. + * @return requestId The ID of the newly created oracle request. + * @notice This function emits 1 events: + * - LogOracleRequested + */ function request( bytes32 processId, bytes calldata input, @@ -94,6 +128,14 @@ contract QueryModule is // modifier onlyResponsibleOracle contains a function call to _getOracle // which reverts if oracle is not active // as a result, all response calls by oracles that are not active will revert + /** + * @dev Responds to an oracle request with the given requestId, responder address, and data. + * @param requestId The ID of the oracle request. + * @param responder The address of the oracle responder. + * @param data The data to be sent to the oracle contract. + * @notice This function emits 1 events: + * - LogOracleResponded + */ function respond( uint256 requestId, address responder, @@ -129,6 +171,12 @@ contract QueryModule is emit LogOracleResponded(processId, requestId, responder, success); } + /** + * @dev Cancels an oracle request. + * @param requestId The ID of the oracle request to be canceled. + * @notice This function emits 1 events: + * - LogOracleCanceled + */ function cancel(uint256 requestId) external override onlyPolicyFlow("Query") @@ -140,6 +188,11 @@ contract QueryModule is } + /** + * @dev Returns the process ID associated with a given request ID. + * @param requestId The ID of the request to retrieve the process ID for. + * @return processId The process ID associated with the given request ID. + */ function getProcessId(uint256 requestId) external view @@ -151,10 +204,22 @@ contract QueryModule is } + /** + * @dev Returns the number of oracle requests made. + * @return _count The number of oracle requests made. + */ function getOracleRequestCount() public view returns (uint256 _count) { return _oracleRequests.length; } + /** + * @dev Returns the Oracle component with the specified ID. + * @param id The ID of the Oracle component to retrieve. + * @return oracle The Oracle component retrieved. + * + * Throws a 'COMPONENT_NOT_ORACLE' error if the component with the specified ID is not an Oracle component. + * Throws an 'ORACLE_NOT_ACTIVE' error if the retrieved Oracle component is not in an active state. + */ function _getOracle(uint256 id) internal view returns (IOracle oracle) { IComponent cmp = _component.getComponent(id); oracle = IOracle(address(cmp)); diff --git a/contracts/modules/README.adoc b/contracts/modules/README.adoc new file mode 100644 index 00000000..ee1a849b --- /dev/null +++ b/contracts/modules/README.adoc @@ -0,0 +1,86 @@ += Modules + +[.readme-notice] +NOTE: This document is better viewed at https://docs.etherisc.com/contracts/api/modules + +== Contracts + +{{AccessController}} +The "AccessController" smart contract is a Solidity implementation that provides access control and role management functionalities. +It inherits from other contracts and implements the "IAccess" interface. +It defines three role identifiers: PRODUCT_OWNER_ROLE, ORACLE_PROVIDER_ROLE, and RISKPOOL_KEEPER_ROLE. +The contract has state variables to store role validity and a flag to indicate if the default admin role is set. +It includes functions to grant, revoke, and renounce roles, as well as add and invalidate roles. +t also has functions to check role membership and retrieve role identifiers. +The contract ensures that only instance operators can access certain functions. +Overall, it offers a flexible access control mechanism for managing roles and permissions. + + +{{BundleController}} +The "BundleController" smart contract is designed to manage bundles, which are collections of policies. +It imports other Solidity contracts, implements the "IBundle" interface, and extends the "CoreController" contract. +The contract includes mappings to store information about bundles, active policies, locked capital, and unburt bundles. +It has functions to create bundles, fund and defund them, lock and unlock assets, close and burn bundles, and collateralize and release policies. +The contract includes modifiers and event emitters for access control and important events. +Overall, it provides comprehensive functionality for managing bundles and their associated policies. + + +{{ComponentController}} +The "Component Controller" smart contract provides functionality to manage and control components within a system. +It includes mappings and sets to store information about components, such as addresses, IDs, states, and types. +The contract allows component owners to propose new components, and the contract owner can approve, decline, suspend, resume, pause, unpause, or archive components. +Functions are available to retrieve component information, such as ID, type, state, and required role. +The contract includes modifiers to restrict access to authorized callers, and it utilizes external dependencies and libraries for set operations. +Overall, the contract enables efficient management and control of components in a system. + + +{{LicenseController}} +The "LicenseController" smart contract serves as a controller for managing licenses in an insurance ecosystem. +It implements the ILicense interface and extends the CoreController contract. +The contract interacts with the ComponentController contract to retrieve information about products and their authorization status. +Functions are available to check the authorization status of a product, validate if a product is active, and retrieve product information. +The contract plays a crucial role in managing licenses within the insurance ecosystem. + + +{{PolicyController}} +The "PolicyController" smart contract implements functions for policy operations, such as creation, update, cancellation, and retrieval. +It also handles claim creation, confirmation, decline, closure, and payout creation. +The contract includes mappings to store policies, claims, payouts, and metadata associated with policy flows. +It inherits from the IPolicy interface and the CoreController contract. +The functions validate inputs, update states, and emit events to manage the lifecycle of policies, claims, and payouts. +The contract provides comprehensive functionality for managing insurance policies and associated operations. + + +{{PoolController}} +The "PoolController" smart contract manages riskpools and their operations, including registration, funding, defunding, collateralization, and more. +It interacts with other contracts such as ComponentController, PolicyController, and BundleController. +The contract maintains mappings to store riskpool information and handles functions for funding, defunding, underwriting, calculating collateral, processing premiums and payouts, and releasing collateral. +It ensures access control through modifiers and emits events to track the success or failure of operations. +The PoolController contract acts as a central component for coordinating riskpool-related operations within the ecosystem. + + +{{QueryModule}} +The "QueryModule" smart contract implements the IQuery interface and extends the CoreController contract. +It interacts with external contracts such as IComponent.sol, IOracle.sol, IQuery.sol, and IInstanceService.sol. +The contract allows the creation of oracle requests, enables oracles to respond to requests, cancels requests, and provides functions to retrieve information about requests and oracles. +It ensures access control through modifiers and emits events to track the creation, response, and cancellation of oracle requests. +The QueryModule contract acts as a module for managing oracle queries within the ecosystem. + + +{{RegistryController}} +The "RegistryController" smart contract implements the IRegistry interface and inherits from the CoreController contract. +It facilitates the registration, deregistration, and access of contracts within different releases. +The contract maintains mappings and sets to store contract names and addresses in various releases. +It provides functions to register and deregister contracts, retrieve contract addresses, and manage releases. +The contract ensures sender verification and emits events to track contract registration and deregistration. +The RegistryController contract serves as a centralized registry for managing contracts in different releases within the ecosystem. + +{{TreasuryModule}} +The "TreasuryModule" smart contract implements the ITreasury interface and inherits from the CoreController and Pausable contracts. +It imports various contracts and interfaces to handle treasury operations. +The contract defines state variables, including constants, wallet addresses, fee specifications, and instances of other contracts. +It includes modifiers to enforce conditions for function execution. +The contract provides functions to set token and wallet addresses, create fee specifications, process premium payments, and manage suspension/resumption. +It also calculates fee amounts and net amounts. +The TreasuryModule contract serves as a central component for managing fees and treasury operations, interacting with other controllers and contracts within the system. + diff --git a/contracts/modules/RegistryController.sol b/contracts/modules/RegistryController.sol index 46a55303..43ad95db 100644 --- a/contracts/modules/RegistryController.sol +++ b/contracts/modules/RegistryController.sol @@ -9,6 +9,22 @@ import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; +/** + * @dev The smart contract implements the `IRegistry` interface and inherits from the `CoreController` contract. + * The contract provides functionality for registering, deregistering, and accessing contracts within different releases. It maintains mappings and sets to store contract names and addresses in different releases. + * + * - `MAX_CONTRACTS`: A constant variable set to 100, representing the maximum number of contracts allowed in a release. + * - `release`: A bytes32 variable representing the current release identifier. + * - `startBlock`: An unsigned integer storing the block number at which the contract was deployed. + * - `_contracts`: A nested mapping that stores contract addresses based on the release and contract name. + * - `_contractsInRelease`: A mapping that keeps track of the number of contracts in each release. + * - `_contractNames`: A private EnumerableSet that stores the names of contracts in a specific release. + * + * The contract emits various events such as `LogContractRegistered` and `LogContractDeregistered` to notify when contracts are registered or deregistered. + * + * Overall, the `RegistryController` contract provides a mechanism to manage and track contracts within different releases, allowing for controlled registration and deregistration of contracts. + */ + contract RegistryController is IRegistry, @@ -34,6 +50,10 @@ contract RegistryController is mapping(bytes32 /* release */ => uint256 /* number of contracts in release */) public _contractsInRelease; mapping(bytes32 /* release */ => EnumerableSet.Bytes32Set /* contract names */) private _contractNames; + /** + * @dev Initializes the GIF registry with an initial release and sets the deployment block for reading logs. + * @param _initialRelease The initial release of the GIF instance. + */ function initializeRegistry(bytes32 _initialRelease) public initializer { // _setupRegistry(address(this)); _registry = this; @@ -52,6 +72,12 @@ contract RegistryController is startBlock = block.number; } + /** + * @dev Verifies if the provided 'sender' address matches the address of the contract with the given '_contractName' in the current release. + * @param sender The address to be verified. + * @param _contractName The name of the contract to compare the 'sender' address with. + * @return _senderMatches A boolean indicating whether the 'sender' address matches the address of the contract with the given '_contractName'. + */ function ensureSender(address sender, bytes32 _contractName) external view override returns(bool _senderMatches) @@ -62,6 +88,10 @@ contract RegistryController is /** * @dev get current release */ + /** + * @dev Returns the current release identifier. + * @return _release The release identifier. + */ function getRelease() external override view returns (bytes32 _release) @@ -72,6 +102,11 @@ contract RegistryController is /** * @dev Get contract's address in the current release */ + /** + * @dev Returns the address of a contract by its name. + * @param _contractName The name of the contract. + * @return _addr The address of the contract. + */ function getContract(bytes32 _contractName) public override view returns (address _addr) @@ -82,6 +117,12 @@ contract RegistryController is /** * @dev Register contract in the current release */ + /** + * @dev Registers a contract with a given name and address. + * + * @param _contractName The name of the contract to register. + * @param _contractAddress The address of the contract to register. + */ function register(bytes32 _contractName, address _contractAddress) external override onlyInstanceOperator @@ -92,6 +133,10 @@ contract RegistryController is /** * @dev Deregister contract in the current release */ + /** + * @dev Deregisters a contract from the current release. + * @param _contractName The name of the contract to be deregistered. + */ function deregister(bytes32 _contractName) external override onlyInstanceOperator @@ -102,6 +147,12 @@ contract RegistryController is /** * @dev Get contract's address in certain release */ + /** + * @dev Returns the address of a specific contract within a given release. + * @param _release The release identifier. + * @param _contractName The name of the contract to retrieve. + * @return _addr The address of the contract. + */ function getContractInRelease(bytes32 _release, bytes32 _contractName) external override view returns (address _addr) @@ -112,6 +163,12 @@ contract RegistryController is /** * @dev Register contract in certain release */ + /** + * @dev Registers a contract in a specific release. + * @param _release The release identifier. + * @param _contractName The name of the contract to register. + * @param _contractAddress The address of the contract to register. + */ function registerInRelease(bytes32 _release, bytes32 _contractName, address _contractAddress) external override onlyInstanceOperator @@ -119,6 +176,11 @@ contract RegistryController is _registerInRelease(_release, false, _contractName, _contractAddress); } + /** + * @dev Deregisters a contract name from a specific release. + * @param _release The release from which to deregister the contract name. + * @param _contractName The contract name to deregister. + */ function deregisterInRelease(bytes32 _release, bytes32 _contractName) external override onlyInstanceOperator @@ -129,6 +191,18 @@ contract RegistryController is /** * @dev Create new release, copy contracts from previous release */ + /** + * @dev Prepares a new release by copying all contracts from the current release to the new one. + * @param _newRelease The name of the new release. + * + * Requirements: + * - The current release must not be empty. + * - The new release must be empty. + * + * Emits a {LogReleasePrepared} event. + * @notice This function emits 1 events: + * - LogReleasePrepared + */ function prepareRelease(bytes32 _newRelease) external override onlyInstanceOperator @@ -157,10 +231,20 @@ contract RegistryController is emit LogReleasePrepared(release); } + /** + * @dev Returns the number of contracts in the current release. + * + * @return _numberOfContracts The total number of contracts in the current release. + */ function contracts() external override view returns (uint256 _numberOfContracts) { _numberOfContracts = EnumerableSet.length(_contractNames[release]); } + /** + * @dev Returns the name of the contract at the specified index in the contractNames set. + * @param idx The index of the contract name to retrieve. + * @return _contractName The name of the contract at the specified index in the contractNames set. + */ function contractName(uint256 idx) external override view returns (bytes32 _contractName) { _contractName = EnumerableSet.at(_contractNames[release], idx); } @@ -168,6 +252,12 @@ contract RegistryController is /** * @dev Get contract's address in certain release */ + /** + * @dev Returns the address of a contract in a specific release. + * @param _release The release identifier. + * @param _contractName The name of the contract to retrieve. + * @return _addr The address of the requested contract. + */ function _getContractInRelease(bytes32 _release, bytes32 _contractName) internal view returns (address _addr) @@ -178,6 +268,25 @@ contract RegistryController is /** * @dev Register contract in certain release */ + /** + * @dev Registers a contract in a release. + * @param _release The release identifier. + * @param isNewRelease True if the release is new, false otherwise. + * @param _contractName The name of the contract. + * @param _contractAddress The address of the contract. + * + * Requirements: + * - The number of registered contracts must be less than MAX_CONTRACTS. + * - The release must be known, unless it is a new release. + * - The contract name must not be empty. + * - The contract name must not already exist in the release, unless it is the 'InstanceOperatorService' contract and it is registered with the owner address. + * - The contract address must not be zero. + * - The number of registered contracts must match the number of contract names in the release. + * + * Emits a LogContractRegistered event with the release identifier, contract name, contract address and a boolean indicating if the contract is new. + * @notice This function emits 1 events: + * - LogContractRegistered + */ function _registerInRelease( bytes32 _release, bool isNewRelease, @@ -228,6 +337,21 @@ contract RegistryController is /** * @dev Deregister contract in certain release */ + /** + * @dev Internal function to deregister a contract in a specific release. + * @param _release The release identifier. + * @param _contractName The name of the contract to be deregistered. + * + * Requirements: + * - The function can only be called by the instance operator. + * - The contract to be deregistered must exist in the specified release. + * + * Removes the contract name from the set of contract names in the specified release, + * removes the contract from the mapping of contracts in the specified release, + * and emits a LogContractDeregistered event. + * @notice This function emits 1 events: + * - LogContractDeregistered + */ function _deregisterInRelease(bytes32 _release, bytes32 _contractName) internal onlyInstanceOperator diff --git a/contracts/modules/TreasuryModule.sol b/contracts/modules/TreasuryModule.sol index 74943089..c0da0ea9 100644 --- a/contracts/modules/TreasuryModule.sol +++ b/contracts/modules/TreasuryModule.sol @@ -17,6 +17,40 @@ import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; +/** + * @dev The smart contract implements the ITreasury interface and inherits from the CoreController and Pausable contracts. + * The contract imports several other contracts and interfaces, including ComponentController.sol, PolicyController.sol, BundleController.sol, PoolController.sol, CoreController.sol, TransferHelper.sol, and various interfaces from the "etherisc/gif-interface" and "openzeppelin/contracts" libraries. + * + * The contract defines several state variables, including: + * + * - FRACTION_FULL_UNIT: a constant representing the full unit value (10^18). + * - FRACTIONAL_FEE_MAX: a constant representing the maximum fractional fee value (25%). + * - event LogTransferHelperInputValidation1Failed: an event that logs a failed input validation. + * - event LogTransferHelperInputValidation2Failed: an event that logs a failed input validation. + * - event LogTransferHelperCallFailed: an event that logs a failed external call. + * - _instanceWalletAddress: a private variable representing the address of the instance wallet. + * - _riskpoolWallet: a mapping of riskpool IDs to wallet addresses. + * - _fees: a mapping of component IDs to FeeSpecification structs. + * - _componentToken: a mapping of product IDs/riskpool IDs to ERC20 token addresses. + * - _bundle: an instance of the BundleController contract. + * - _component: an instance of the ComponentController contract. + * - _policy: an instance of the PolicyController contract. + * - _pool: an instance of the PoolController contract. + * + * The contract includes several modifiers that enforce certain conditions on function execution, such as the instanceWalletDefined modifier, which requires the instance wallet address to be defined; + * the riskpoolWalletDefinedForProcess modifier, which requires the riskpool wallet address to be defined for a given process ID; + * the riskpoolWalletDefinedForBundle modifier, which requires the riskpool wallet address to be defined for a given bundle ID; + * the whenNotSuspended modifier, which requires the contract to not be paused; and the onlyRiskpoolService modifier, which restricts access to the RiskpoolService contract. + * + * The contract contains various functions for managing the treasury, such as setting the product token address, setting the instance wallet address, setting the riskpool wallet address, creating fee specifications, and setting premium and capital fees for components. + * There are also functions for suspending and resuming the treasury contract. + * + * The contract includes a function to calculate the fee amount and net amount for a given component ID and amount. + * It also includes functions to process premium payments for policies, either for the remaining premium amount or for a specific amount. + * + * Overall, the TreasuryModule contract provides functionality for managing fees, processing premium payments, and interacting with other controllers and contracts in the system. + */ + contract TreasuryModule is ITreasury, CoreController, @@ -76,6 +110,11 @@ contract TreasuryModule is _; } + /** + * @dev Sets the addresses of the BundleController, ComponentController, PolicyController, and PoolController contracts. + * + * + */ function _afterInitialize() internal override onlyInitializing { _bundle = BundleController(_getContractAddress("Bundle")); _component = ComponentController(_getContractAddress("Component")); @@ -83,6 +122,13 @@ contract TreasuryModule is _pool = PoolController(_getContractAddress("Pool")); } + /** + * @dev Suspends the treasury contract, preventing any further transfers or withdrawals. + * Can only be called by the instance operator. + * + * @notice This function emits 1 events: + * - LogTreasurySuspended + */ function suspend() external onlyInstanceOperator @@ -91,6 +137,13 @@ contract TreasuryModule is emit LogTreasurySuspended(); } + /** + * @dev Resumes the treasury contract after it has been paused. + * + * + * @notice This function emits 1 events: + * - LogTreasuryResumed + */ function resume() external onlyInstanceOperator @@ -99,6 +152,22 @@ contract TreasuryModule is emit LogTreasuryResumed(); } + /** + * @dev Sets the ERC20 token address for a given product ID and its associated risk pool. + * @param productId The ID of the product for which the token address is being set. + * @param erc20Address The address of the ERC20 token to be set. + * + * Emits a LogTreasuryProductTokenSet event with the product ID, risk pool ID, and ERC20 token address. + * + * Requirements: + * - The ERC20 token address must not be zero. + * - The product must exist. + * - The product token must not have already been set. + * - The product token address must match the token address of the corresponding product. + * - If the risk pool token address has already been set, it must match the product token address. + * @notice This function emits 1 events: + * - LogTreasuryProductTokenSet + */ function setProductToken(uint256 productId, address erc20Address) external override whenNotSuspended @@ -125,6 +194,14 @@ contract TreasuryModule is emit LogTreasuryProductTokenSet(productId, riskpoolId, erc20Address); } + /** + * @dev Sets the address of the instance wallet. + * @param instanceWalletAddress The address of the instance wallet to be set. + * + * Emits a LogTreasuryInstanceWalletSet event. + * @notice This function emits 1 events: + * - LogTreasuryInstanceWalletSet + */ function setInstanceWallet(address instanceWalletAddress) external override whenNotSuspended @@ -136,6 +213,20 @@ contract TreasuryModule is emit LogTreasuryInstanceWalletSet (instanceWalletAddress); } + /** + * @dev Sets the wallet address for a specific riskpool. + * @param riskpoolId The ID of the riskpool. + * @param riskpoolWalletAddress The wallet address to set for the riskpool. + * + * Requirements: + * - The caller must be the instance operator. + * - The riskpool must exist. + * - The wallet address cannot be the zero address. + * + * Emits a {LogTreasuryRiskpoolWalletSet} event. + * @notice This function emits 1 events: + * - LogTreasuryRiskpoolWalletSet + */ function setRiskpoolWallet(uint256 riskpoolId, address riskpoolWalletAddress) external override whenNotSuspended @@ -149,6 +240,14 @@ contract TreasuryModule is emit LogTreasuryRiskpoolWalletSet (riskpoolId, riskpoolWalletAddress); } + /** + * @dev Creates a fee specification for a given component. + * @param componentId The ID of the component for which to create the fee specification. + * @param fixedFee The fixed fee amount in wei. + * @param fractionalFee The fractional fee amount as a percentage of the total value. + * @param feeCalculationData Additional data required for calculating the fee. + * @return Returns a FeeSpecification struct containing the fee details. + */ function createFeeSpecification( uint256 componentId, uint256 fixedFee, @@ -172,6 +271,23 @@ contract TreasuryModule is ); } + /** + * @dev Sets the premium fees for a specific component. + * @param feeSpec The fee specification for the component. + * Includes the component ID, fixed fee, and fractional fee. + * + * Emits a LogTreasuryPremiumFeesSet event with the following parameters: + * - componentId: The ID of the component for which the fees were set. + * - fixedFee: The fixed fee for the component. + * - fractionalFee: The fractional fee for the component. + * + * Requirements: + * - The caller must be the instance operator. + * - The component ID must correspond to a valid product. + * - The contract must not be suspended. + * @notice This function emits 1 events: + * - LogTreasuryPremiumFeesSet + */ function setPremiumFees(FeeSpecification calldata feeSpec) external override whenNotSuspended @@ -195,6 +311,14 @@ contract TreasuryModule is } + /** + * @dev Sets the fee specification for a given component, which includes the fixed and fractional fees. + * @param feeSpec The fee specification struct containing the component ID, fixed fee, and fractional fee. + * + * Emits a {LogTreasuryCapitalFeesSet} event with the component ID, fixed fee, and fractional fee. + * @notice This function emits 1 events: + * - LogTreasuryCapitalFeesSet + */ function setCapitalFees(FeeSpecification calldata feeSpec) external override whenNotSuspended @@ -218,6 +342,13 @@ contract TreasuryModule is } + /** + * @dev Calculates the fee amount and net amount for a given component ID and amount. + * @param componentId The ID of the component for which the fee is being calculated. + * @param amount The amount for which the fee is being calculated. + * @return feeAmount The amount of the fee calculated. + * @return netAmount The net amount after the fee has been deducted. + */ function calculateFee(uint256 componentId, uint256 amount) public view @@ -235,6 +366,13 @@ contract TreasuryModule is * then transfering the fees to the instance wallet and the net premium remaining to the riskpool. * This will revert if no fee structure is defined. */ + /** + * @dev Processes the premium for a given policy process ID. + * @param processId The process ID of the policy to process the premium for. + * @return success A boolean indicating whether the premium was successfully processed or not. + * @return feeAmount The amount of fees charged for processing the premium. + * @return netPremiumAmount The net amount of premium received after deducting fees. + */ function processPremium(bytes32 processId) external override whenNotSuspended @@ -258,6 +396,35 @@ contract TreasuryModule is * then transfering the fees to the instance wallet and the net premium to the riskpool. * This will revert if no fee structure is defined. */ + /** + * @dev Processes a premium payment for a policy. + * @param processId The ID of the policy process. + * @param amount The amount of premium to be processed. + * @return success A boolean indicating whether the premium payment was successful or not. + * @return feeAmount The amount of fees collected from the premium payment. + * @return netAmount The net amount of premium transferred to the riskpool wallet. + * + * Requirements: + * - The policy process must exist. + * - The premium payment amount must not exceed the expected premium amount. + * - The caller must have sufficient allowance to transfer the requested amount of tokens. + * - The instance wallet and riskpool wallet must be defined for the policy process. + * - The caller must be authorized to perform the action. + * + * Emits: + * - LogTreasuryFeesTransferred: When the fees are successfully transferred to the instance wallet. + * - LogTreasuryPremiumTransferred: When the net premium amount is successfully transferred to the riskpool wallet. + * - LogTreasuryPremiumProcessed: When the premium payment is successfully processed. + * + * Throws: + * - "ERROR:TRS-030:AMOUNT_TOO_BIG": If the premium payment amount exceeds the expected premium amount. + * - "ERROR:TRS-031:FEE_TRANSFER_FAILED": If the transfer of fees to the instance wallet fails. + * - "ERROR:TRS-032:PREMIUM_TRANSFER_FAILED": If the transfer of net premium to the riskpool wallet fails. + * @notice This function emits 3 events: + * - LogTreasuryPremiumProcessed + * - LogTreasuryPremiumTransferred + * - LogTreasuryFeesTransferred + */ function processPremium(bytes32 processId, uint256 amount) public override whenNotSuspended @@ -304,6 +471,16 @@ contract TreasuryModule is } + /** + * @dev Processes a payout for a specific process and payout ID. + * @param processId The ID of the process for which the payout is being processed. + * @param payoutId The ID of the payout being processed. + * @return feeAmount The amount of fees deducted from the payout. + * @return netPayoutAmount The net payout amount after fees have been deducted. + * @notice This function emits 2 events: + * - LogTreasuryPayoutTransferred + * - LogTreasuryPayoutProcessed + */ function processPayout(bytes32 processId, uint256 payoutId) external override whenNotSuspended @@ -340,6 +517,17 @@ contract TreasuryModule is emit LogTreasuryPayoutProcessed(riskpoolId, metadata.owner, payout.amount); } + /** + * @dev Processes capital for a given bundle ID and calculates fees. Transfers fees to the instance wallet and net capital to the riskpool wallet. + * @param bundleId The ID of the bundle for which to process capital. + * @param capitalAmount The amount of capital to be processed. + * @return feeAmount The amount of fees calculated and transferred to the instance wallet. + * @return netCapitalAmount The amount of net capital transferred to the riskpool wallet. + * @notice This function emits 3 events: + * - LogTreasuryFeesTransferred + * - LogTreasuryCapitalProcessed + * - LogTreasuryCapitalTransferred + */ function processCapital(uint256 bundleId, uint256 capitalAmount) external override whenNotSuspended @@ -384,6 +572,29 @@ contract TreasuryModule is emit LogTreasuryCapitalProcessed(bundle.riskpoolId, bundleId, capitalAmount); } + /** + * @dev Processes a withdrawal of a specified amount from a bundle, transferring the funds to the bundle owner's wallet. + * @param bundleId The ID of the bundle from which the withdrawal is made. + * @param amount The amount of tokens to withdraw. + * @return feeAmount The amount of fees charged for the withdrawal. + * @return netAmount The net amount of tokens transferred to the bundle owner's wallet. + * + * Requirements: + * - The function can only be called when the contract is not suspended. + * - The instance wallet must be defined. + * - The riskpool wallet must be defined for the specified bundle. + * - Only the riskpool service can call this function. + * - The bundle must have sufficient capacity or balance to cover the withdrawal. + * - The riskpool wallet must have sufficient balance of the token to cover the withdrawal. + * - The contract must have sufficient allowance to withdraw the token from the riskpool wallet. + * - The withdrawal transfer must be successful. + * + * Emits a {LogTreasuryWithdrawalTransferred} event indicating the transfer of the withdrawn tokens to the bundle owner's wallet. + * Emits a {LogTreasuryWithdrawalProcessed} event indicating the successful processing of the withdrawal. + * @notice This function emits 2 events: + * - LogTreasuryWithdrawalTransferred + * - LogTreasuryWithdrawalProcessed + */ function processWithdrawal(uint256 bundleId, uint256 amount) external override whenNotSuspended @@ -430,6 +641,11 @@ contract TreasuryModule is } + /** + * @dev Returns the ERC20 token address associated with the given component ID. + * @param componentId The ID of the component to retrieve the token address for. + * @return token The ERC20 token address associated with the component ID. + */ function getComponentToken(uint256 componentId) public override view @@ -439,23 +655,48 @@ contract TreasuryModule is return _componentToken[componentId]; } + /** + * @dev Returns the fee specification of a given component. + * @param componentId The ID of the component. + * @return fees The fee specification of the component. + */ function getFeeSpecification(uint256 componentId) public override view returns(FeeSpecification memory) { return _fees[componentId]; } + /** + * @dev Returns the value of the constant FRACTION_FULL_UNIT. + * @return The value of FRACTION_FULL_UNIT as an unsigned integer. + */ function getFractionFullUnit() public override pure returns(uint256) { return FRACTION_FULL_UNIT; } + /** + * @dev Returns the address of the instance wallet. + * @return The address of the instance wallet. + */ function getInstanceWallet() public override view returns(address) { return _instanceWalletAddress; } + /** + * @dev Returns the wallet address of the specified risk pool. + * @param riskpoolId The unique identifier of the risk pool. + * @return The wallet address associated with the specified risk pool. + */ function getRiskpoolWallet(uint256 riskpoolId) public override view returns(address) { return _riskpoolWallet[riskpoolId]; } + /** + * @dev Calculates the premium fee for a given fee specification and process ID. + * @param feeSpec The fee specification to be used for the calculation. + * @param processId The process ID of the application for which the fee is being calculated. + * @return application The application object retrieved from the policy contract. + * @return feeAmount The amount of the premium fee calculated based on the fee specification and premium amount of the application. + */ function _calculatePremiumFee( FeeSpecification memory feeSpec, bytes32 processId @@ -472,6 +713,12 @@ contract TreasuryModule is } + /** + * @dev Calculates the fee amount based on the given fee specification and the transaction amount. + * @param feeSpec The fee specification in the form of a FeeSpecification struct. + * @param amount The transaction amount to calculate the fee for. + * @return feeAmount The calculated fee amount. + */ function _calculateFee( FeeSpecification memory feeSpec, uint256 amount @@ -496,6 +743,12 @@ contract TreasuryModule is require(feeAmount < amount, "ERROR:TRS-091:FEE_TOO_BIG"); } + /** + * @dev Returns the riskpool ID and wallet address for a given process ID. + * @param processId The ID of the process. + * @return riskpoolId The ID of the riskpool associated with the process. + * @return riskpoolWalletAddress The wallet address of the riskpool associated with the process. + */ function _getRiskpoolWallet(bytes32 processId) internal view diff --git a/contracts/services/ComponentOwnerService.sol b/contracts/services/ComponentOwnerService.sol index 9adb2d54..1d1faa4c 100644 --- a/contracts/services/ComponentOwnerService.sol +++ b/contracts/services/ComponentOwnerService.sol @@ -1,84 +1,113 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity 0.8.2; - -import "../modules/ComponentController.sol"; -// TODO ComponentOwnerService should not know of the PoolController - if we have a better idea how to build this, it should be changed. -import "../modules/PoolController.sol"; -import "../shared/CoreController.sol"; - -import "@etherisc/gif-interface/contracts/components/IComponent.sol"; -import "@etherisc/gif-interface/contracts/services/IComponentOwnerService.sol"; - -contract ComponentOwnerService is - IComponentOwnerService, - CoreController -{ - ComponentController private _component; - - modifier onlyOwnerWithRoleFromComponent(IComponent component) { - address owner = component.getOwner(); - bytes32 requiredRole = _component.getRequiredRole(component.getType()); - require(_msgSender() == owner, "ERROR:COS-001:NOT_OWNER"); - require(_access.hasRole(requiredRole, owner), "ERROR:COS-002:REQUIRED_ROLE_MISSING"); - _; - } - - modifier onlyOwnerWithRole(uint256 id) { - IComponent component = _component.getComponent(id); - require(address(component) != address(0), "ERROR:COS-003:COMPONENT_ID_INVALID"); - - address owner = component.getOwner(); - bytes32 requiredRole = _component.getRequiredRole(_component.getComponentType(id)); - - require(_msgSender() == owner, "ERROR:COS-004:NOT_OWNER"); - require(_access.hasRole(requiredRole, owner), "ERROR:COS-005:REQUIRED_ROLE_MISSING"); - _; - } - - function _afterInitialize() internal override onlyInitializing { - _component = ComponentController(_getContractAddress("Component")); - } - - function propose(IComponent component) - external override - onlyOwnerWithRoleFromComponent(component) - { - _component.propose(component); - } - - function stake(uint256 id) - external override - onlyOwnerWithRole(id) - { - revert("ERROR:COS-006:IMPLEMENATION_MISSING"); - } - - function withdraw(uint256 id) - external override - onlyOwnerWithRole(id) - { - revert("ERROR:COS-007:IMPLEMENATION_MISSING"); - } - - - function pause(uint256 id) - external override - onlyOwnerWithRole(id) - { - _component.pause(id); - } - - function unpause(uint256 id) - external override - onlyOwnerWithRole(id) - { - _component.unpause(id); - } - - function archive(uint256 id) - external override - onlyOwnerWithRole(id) - { - _component.archiveFromComponentOwner(id); - } +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.2; + +import "../modules/ComponentController.sol"; +// TODO ComponentOwnerService should not know of the PoolController - if we have a better idea how to build this, it should be changed. +import "../modules/PoolController.sol"; +import "../shared/CoreController.sol"; + +import "@etherisc/gif-interface/contracts/components/IComponent.sol"; +import "@etherisc/gif-interface/contracts/services/IComponentOwnerService.sol"; + +contract ComponentOwnerService is + IComponentOwnerService, + CoreController +{ + ComponentController private _component; + + modifier onlyOwnerWithRoleFromComponent(IComponent component) { + address owner = component.getOwner(); + bytes32 requiredRole = _component.getRequiredRole(component.getType()); + require(_msgSender() == owner, "ERROR:COS-001:NOT_OWNER"); + require(_access.hasRole(requiredRole, owner), "ERROR:COS-002:REQUIRED_ROLE_MISSING"); + _; + } + + modifier onlyOwnerWithRole(uint256 id) { + IComponent component = _component.getComponent(id); + require(address(component) != address(0), "ERROR:COS-003:COMPONENT_ID_INVALID"); + + address owner = component.getOwner(); + bytes32 requiredRole = _component.getRequiredRole(_component.getComponentType(id)); + + require(_msgSender() == owner, "ERROR:COS-004:NOT_OWNER"); + require(_access.hasRole(requiredRole, owner), "ERROR:COS-005:REQUIRED_ROLE_MISSING"); + _; + } + + /** + * @dev This function is called after the contract is initialized and can only be called once. It sets the component controller contract address. + */ + function _afterInitialize() internal override onlyInitializing { + _component = ComponentController(_getContractAddress("Component")); + } + + /** + * @dev Propose a new component to be added to the system. + * @param component The component to be proposed. + */ + function propose(IComponent component) + external override + onlyOwnerWithRoleFromComponent(component) + { + _component.propose(component); + } + + /** + * @dev Stake function allows the owner to stake a specific id. + * + * @param id The id of the stake. + * + */ + function stake(uint256 id) + external override + onlyOwnerWithRole(id) + { + revert("ERROR:COS-006:IMPLEMENATION_MISSING"); + } + + /** + * @dev Allows the owner to withdraw a specific asset by its ID. + * @param id The ID of the asset to be withdrawn. + */ + function withdraw(uint256 id) + external override + onlyOwnerWithRole(id) + { + revert("ERROR:COS-007:IMPLEMENATION_MISSING"); + } + + + /** + * @dev Pauses a specific component with the given ID. + * @param id The ID of the component to be paused. + */ + function pause(uint256 id) + external override + onlyOwnerWithRole(id) + { + _component.pause(id); + } + + /** + * @dev Unpauses a component with the specified ID. + * @param id The ID of the component to unpause. + */ + function unpause(uint256 id) + external override + onlyOwnerWithRole(id) + { + _component.unpause(id); + } + + /** + * @dev Archives a component with the given ID from the component owner's inventory. + * @param id The ID of the component to be archived. + */ + function archive(uint256 id) + external override + onlyOwnerWithRole(id) + { + _component.archiveFromComponentOwner(id); + } } \ No newline at end of file diff --git a/contracts/services/InstanceOperatorService.sol b/contracts/services/InstanceOperatorService.sol index debe06f3..70c9ae56 100644 --- a/contracts/services/InstanceOperatorService.sol +++ b/contracts/services/InstanceOperatorService.sol @@ -32,6 +32,13 @@ contract InstanceOperatorService is _; } + /** + * @dev Performs the necessary setup after contract initialization. + * - Sets the component, pool, and treasury contracts. + * - Transfers ownership to the message sender. + * - Links the bundle module to the bundle token. + * - Sets the default admin role. + */ function _afterInitialize() internal override onlyInitializing { _component = ComponentController(_getContractAddress("Component")); _pool = PoolController(_getContractAddress("Pool")); @@ -42,11 +49,19 @@ contract InstanceOperatorService is _setDefaultAdminRole(); } + /** + * @dev Sets the default admin role for the contract calling this function. + * + * + */ function _setDefaultAdminRole() private { AccessController access = AccessController(_getContractAddress("Access")); access.setDefaultAdminRole(address(this)); } + /** + * @dev Links the Bundle module to the BundleToken contract. + */ function _linkBundleModuleToBundleToken() private { BundleToken token = BundleToken(_getContractAddress("BundleToken")); address bundleAddress = _getContractAddress("Bundle"); @@ -54,6 +69,13 @@ contract InstanceOperatorService is } /* registry */ + /** + * @dev Prepares a new release by calling the prepareRelease function from the Registry contract. + * @param _newRelease The hash of the new release. + * + * Requirements: + * - Caller must be the instance operator address. + */ function prepareRelease(bytes32 _newRelease) external override onlyInstanceOperatorAddress @@ -61,6 +83,11 @@ contract InstanceOperatorService is _registry.prepareRelease(_newRelease); } + /** + * @dev Registers a contract in the registry. + * @param _contractName The name of the contract to be registered. + * @param _contractAddress The address of the contract to be registered. + */ function register(bytes32 _contractName, address _contractAddress) external override onlyInstanceOperatorAddress @@ -68,6 +95,10 @@ contract InstanceOperatorService is _registry.register(_contractName, _contractAddress); } + /** + * @dev Deregisters a contract from the registry. + * @param _contractName The name of the contract to be deregistered. + */ function deregister(bytes32 _contractName) external override onlyInstanceOperatorAddress @@ -75,6 +106,12 @@ contract InstanceOperatorService is _registry.deregister(_contractName); } + /** + * @dev Registers a contract in a specific release. + * @param _release The release identifier where the contract will be registered. + * @param _contractName The name of the contract to be registered. + * @param _contractAddress The address of the contract to be registered. + */ function registerInRelease( bytes32 _release, bytes32 _contractName, @@ -86,6 +123,11 @@ contract InstanceOperatorService is _registry.registerInRelease(_release, _contractName, _contractAddress); } + /** + * @dev Deregisters a contract from a specific release in the registry. + * @param _release The identifier of the release to deregister the contract from. + * @param _contractName The name of the contract to be deregistered. + */ function deregisterInRelease(bytes32 _release, bytes32 _contractName) external override onlyInstanceOperatorAddress @@ -94,6 +136,10 @@ contract InstanceOperatorService is } /* access */ + /** + * @dev Adds a new role to the access control contract. + * @param _role The name of the new role to be added. + */ function createRole(bytes32 _role) external override onlyInstanceOperatorAddress @@ -101,6 +147,10 @@ contract InstanceOperatorService is _access.addRole(_role); } + /** + * @dev Invalidates a role. + * @param _role The role to invalidate. + */ function invalidateRole(bytes32 _role) external override onlyInstanceOperatorAddress @@ -108,6 +158,11 @@ contract InstanceOperatorService is _access.invalidateRole(_role); } + /** + * @dev Grants a role to a principal. + * @param role The role to be granted. + * @param principal The address of the principal to whom the role is granted. + */ function grantRole(bytes32 role, address principal) external override onlyInstanceOperatorAddress @@ -115,6 +170,11 @@ contract InstanceOperatorService is _access.grantRole(role, principal); } + /** + * @dev Revokes a role from a principal. + * @param role The role to revoke. + * @param principal The address of the principal to revoke the role from. + */ function revokeRole(bytes32 role, address principal) external override onlyInstanceOperatorAddress @@ -123,6 +183,10 @@ contract InstanceOperatorService is } /* component */ + /** + * @dev Approves a component with the given ID and sets its corresponding riskpool ID in the pool contract. + * @param id The ID of the component to be approved. + */ function approve(uint256 id) external override onlyInstanceOperatorAddress @@ -139,6 +203,10 @@ contract InstanceOperatorService is } } + /** + * @dev Declines a component with the specified ID. + * @param id The ID of the component to decline. + */ function decline(uint256 id) external override onlyInstanceOperatorAddress @@ -146,6 +214,10 @@ contract InstanceOperatorService is _component.decline(id); } + /** + * @dev Suspends the component with the given ID. + * @param id The ID of the component to be suspended. + */ function suspend(uint256 id) external override onlyInstanceOperatorAddress @@ -153,6 +225,10 @@ contract InstanceOperatorService is _component.suspend(id); } + /** + * @dev Resumes the execution of a paused component instance. + * @param id The ID of the component instance to be resumed. + */ function resume(uint256 id) external override onlyInstanceOperatorAddress @@ -160,6 +236,10 @@ contract InstanceOperatorService is _component.resume(id); } + /** + * @dev Archives a component with the given ID from the instance operator's address. + * @param id The ID of the component to be archived. + */ function archive(uint256 id) external override onlyInstanceOperatorAddress @@ -169,6 +249,11 @@ contract InstanceOperatorService is // service staking // TODO implement setDefaultStaking staking + /** + * @dev Sets the default staking for a specific component type. + * @param componentType The type of component to set the default staking for. + * @param data The data containing the default staking information. + */ function setDefaultStaking( uint16 componentType, bytes calldata data @@ -180,6 +265,11 @@ contract InstanceOperatorService is } // TODO implement adjustStakingRequirements staking + /** + * @dev Adjusts the staking requirements for a specific instance operator by providing the operator ID and the new staking requirements. + * @param id The ID of the instance operator whose staking requirements are being adjusted. + * @param data The new staking requirements encoded as bytes. + */ function adjustStakingRequirements( uint256 id, bytes calldata data @@ -191,6 +281,11 @@ contract InstanceOperatorService is } /* treasury */ + /** + * @dev Suspends the treasury functionality. + * + * + */ function suspendTreasury() external override onlyInstanceOperatorAddress @@ -198,6 +293,11 @@ contract InstanceOperatorService is _treasury.suspend(); } + /** + * @dev Resumes the treasury contract. + * + * + */ function resumeTreasury() external override onlyInstanceOperatorAddress @@ -205,6 +305,10 @@ contract InstanceOperatorService is _treasury.resume(); } + /** + * @dev Sets the wallet address of the instance operator. + * @param walletAddress The address of the wallet to be set. + */ function setInstanceWallet(address walletAddress) external override onlyInstanceOperatorAddress @@ -212,6 +316,11 @@ contract InstanceOperatorService is _treasury.setInstanceWallet(walletAddress); } + /** + * @dev Sets the wallet address for a specific risk pool. + * @param riskpoolId The ID of the risk pool to set the wallet address for. + * @param riskpoolWalletAddress The address of the wallet to set for the specified risk pool. + */ function setRiskpoolWallet(uint256 riskpoolId, address riskpoolWalletAddress) external override onlyInstanceOperatorAddress @@ -219,6 +328,11 @@ contract InstanceOperatorService is _treasury.setRiskpoolWallet(riskpoolId, riskpoolWalletAddress); } + /** + * @dev Sets the ERC20 token address for a given product ID. + * @param productId The ID of the product to set the token address for. + * @param erc20Address The address of the ERC20 token to set. + */ function setProductToken(uint256 productId, address erc20Address) external override onlyInstanceOperatorAddress @@ -226,6 +340,14 @@ contract InstanceOperatorService is _treasury.setProductToken(productId, erc20Address); } + /** + * @dev Returns a FeeSpecification object created with the given parameters. + * @param componentId The ID of the component for which the fee is being created. + * @param fixedFee The fixed fee amount to be charged for the component. + * @param fractionalFee The fractional fee to be charged for the component. + * @param feeCalculationData The data required for calculating the fee. + * @return Returns a FeeSpecification object with the given parameters. + */ function createFeeSpecification( uint256 componentId, uint256 fixedFee, @@ -244,6 +366,13 @@ contract InstanceOperatorService is ); } + /** + * @dev Sets the premium fees for the treasury. + * @param feeSpec The fee specification struct containing the following parameters: + * - feeType: The type of fee (e.g. premium fee). + * - numerator: The numerator of the fee percentage. + * - denominator: The denominator of the fee percentage. + */ function setPremiumFees(ITreasury.FeeSpecification calldata feeSpec) external override onlyInstanceOperatorAddress @@ -251,6 +380,10 @@ contract InstanceOperatorService is _treasury.setPremiumFees(feeSpec); } + /** + * @dev Sets the fee specification for capital fees in the treasury contract. + * @param feeSpec The fee specification struct containing the details of the capital fees. + */ function setCapitalFees(ITreasury.FeeSpecification calldata feeSpec) external override onlyInstanceOperatorAddress diff --git a/contracts/services/InstanceService.sol b/contracts/services/InstanceService.sol index 29b21378..4a273735 100644 --- a/contracts/services/InstanceService.sol +++ b/contracts/services/InstanceService.sol @@ -50,6 +50,10 @@ contract InstanceService is mapping(uint256 /* chain id */ => string /* chain name */) private _chainName; + /** + * @dev Internal function that is called after initialization is complete. It sets the bundle, component, policy, pool, and treasury controllers by retrieving their contract addresses. It also sets the chain names. + * + */ function _afterInitialize() internal override onlyInitializing { _bundle = BundleController(_getContractAddress(BUNDLE_NAME)); _component = ComponentController(_getContractAddress(COMPONENT_NAME)); @@ -60,6 +64,11 @@ contract InstanceService is _setChainNames(); } + /** + * @dev Sets the names for several blockchain networks by assigning them to their respective chain IDs. + * + * Sets the names for the Ethereum Mainnet/ETH, Goerli/ETH, Ganache, Gnosis/xDai, Sokol/SPOA, Polygon Mainnet/MATIC, Mumbai/MATIC, Avalanche C-Chain/AVAX and Avalanche Fuji Testnet/AVAX blockchain networks by assigning them to their respective chain IDs. + */ function _setChainNames() internal { _chainName[1] = "Ethereum Mainnet/ETH"; _chainName[5] = "Goerli/ETH"; @@ -73,14 +82,28 @@ contract InstanceService is } /* instance service */ + /** + * @dev Returns the chain ID of the current blockchain. + * @return chainId The ID of the current blockchain. + */ function getChainId() public override view returns(uint256 chainId) { chainId = block.chainid; } + /** + * @dev Returns the name of the chain based on its ID. + * + * @return chainName The name of the chain as a string. + */ function getChainName() public override view returns(string memory chainName) { chainName = _chainName[block.chainid]; } + /** + * @dev Returns the instance ID of the contract, which is a hash of the chain ID and the registry address. + * + * @return instanceId The instance ID of the contract. + */ function getInstanceId() public override view returns(bytes32 instanceId) { instanceId = keccak256( abi.encodePacked( @@ -88,62 +111,122 @@ contract InstanceService is address(_registry))); } + /** + * @dev Returns the address of the current instance operator. + * @return The address of the instance operator. + */ function getInstanceOperator() external override view returns(address) { InstanceOperatorService ios = InstanceOperatorService(_getContractAddress(INSTANCE_OPERATOR_SERVICE_NAME)); return ios.owner(); } /* registry */ + /** + * @dev Returns the address of the Component Owner Service contract. + * @return service The Component Owner Service contract address. + */ function getComponentOwnerService() external override view returns(IComponentOwnerService service) { return IComponentOwnerService(_getContractAddress(COMPONENT_OWNER_SERVICE_NAME)); } + /** + * @dev Returns the instance operator service contract address. + * @return service The instance operator service contract address. + */ function getInstanceOperatorService() external override view returns(IInstanceOperatorService service) { return IInstanceOperatorService(_getContractAddress(INSTANCE_OPERATOR_SERVICE_NAME)); } + /** + * @dev Returns the Oracle Service contract instance. + * @return service The instance of the Oracle Service contract. + */ function getOracleService() external override view returns(IOracleService service) { return IOracleService(_getContractAddress(ORACLE_SERVICE_NAME)); } + /** + * @dev Returns the address of the Product Service contract. + * @return service The Product Service contract address. + */ function getProductService() external override view returns(IProductService service) { return IProductService(_getContractAddress(PRODUCT_SERVICE_NAME)); } + /** + * @dev Returns the IRiskpoolService contract instance. + * @return service The IRiskpoolService contract instance. + */ function getRiskpoolService() external override view returns(IRiskpoolService service) { return IRiskpoolService(_getContractAddress(RISKPOOL_SERVICE_NAME)); } /* registry */ + /** + * @dev Returns the current instance of the IRegistry contract. + * @return service The IRegistry contract instance. + */ function getRegistry() external view returns(IRegistry service) { return _registry; } + /** + * @dev Returns the number of contracts registered in the registry. + * @return numberOfContracts The total number of contracts registered in the registry. + */ function contracts() external view override returns (uint256 numberOfContracts) { numberOfContracts = _registry.contracts(); } + /** + * @dev Returns the name of the contract at the specified index in the registry. + * @param idx The index of the contract. + * @return name The name of the contract as a bytes32 value. + */ function contractName(uint256 idx) external view override returns (bytes32 name) { name = _registry.contractName(idx); } /* access */ + /** + * @dev Returns the default admin role for the AccessControl contract. + * + * @return The default admin role as a bytes32 value. + */ function getDefaultAdminRole() external override view returns(bytes32) { return _access.getDefaultAdminRole(); } + /** + * @dev Returns the role identifier of the product owner role. + * @return The role identifier of the product owner role. + */ function getProductOwnerRole() external override view returns(bytes32) { return _access.getProductOwnerRole(); } + /** + * @dev Returns the role identifier for the oracle provider role. + * @return The role identifier for the oracle provider role. + */ function getOracleProviderRole() external override view returns(bytes32) { return _access.getOracleProviderRole(); } + /** + * @dev Returns the role identifier for the Riskpool Keeper role. + * @return The role identifier for the Riskpool Keeper role as a bytes32 value. + */ function getRiskpoolKeeperRole() external override view returns(bytes32) { return _access.getRiskpoolKeeperRole(); } + /** + * @dev Checks if an address has a specific role. + * @param role The bytes32 identifier of the role being checked. + * @param principal The address of the account being checked for the role. + * @return A boolean indicating whether the address has the specified role or not. + */ function hasRole(bytes32 role, address principal) external override view returns(bool) @@ -152,22 +235,44 @@ contract InstanceService is } /* component */ + /** + * @dev Returns the number of products in the component contract. + * @return products The number of products in the component contract. + */ function products() external override view returns(uint256) { return _component.products(); } + /** + * @dev Returns the number of oracles registered in the component. + * @return The number of oracles registered in the component. + */ function oracles() external override view returns(uint256) { return _component.oracles(); } + /** + * @dev Returns the number of risk pools in the component. + * @return The number of risk pools as an unsigned integer. + */ function riskpools() external override view returns(uint256) { return _component.riskpools(); } + /** + * @dev Returns the component ID of a given component address. + * @param componentAddress The address of the component. + * @return componentId The ID of the component. + */ function getComponentId(address componentAddress) external override view returns(uint256 componentId) { return _component.getComponentId(componentAddress); } + /** + * @dev Returns the type of a component given its ID. + * @param componentId The ID of the component. + * @return componentType The type of the component. + */ function getComponentType(uint256 componentId) external override view @@ -176,6 +281,11 @@ contract InstanceService is return _component.getComponentType(componentId); } + /** + * @dev Returns the current state of a specific component. + * @param componentId The ID of the component to retrieve the state for. + * @return componentState The current state of the specified component. + */ function getComponentState(uint256 componentId) external override view @@ -184,23 +294,48 @@ contract InstanceService is componentState = _component.getComponentState(componentId); } + /** + * @dev Returns the component with the specified ID. + * @param id The ID of the component to retrieve. + * @return The component with the specified ID. + */ function getComponent(uint256 id) external override view returns(IComponent) { return _component.getComponent(id); } + /** + * @dev Returns the oracle ID at the specified index. + * @param idx The index of the oracle ID to retrieve. + * @return oracleId The ID of the oracle at the specified index. + */ function getOracleId(uint256 idx) public view returns (uint256 oracleId) { return _component.getOracleId(idx); } + /** + * @dev Returns the riskpool ID for the given index. + * @param idx The index of the riskpool ID to retrieve. + * @return riskpoolId The ID of the riskpool. + */ function getRiskpoolId(uint256 idx) public view returns (uint256 riskpoolId) { return _component.getRiskpoolId(idx); } + /** + * @dev Returns the product ID of the component at the given index. + * @param idx The index of the component. + * @return productId The product ID of the component. + */ function getProductId(uint256 idx) public view returns (uint256 productId) { return _component.getProductId(idx); } /* service staking */ + /** + * @dev Returns the staking requirements for a specific ID. + * @param id The ID of the staking requirements to retrieve. + * @return data The staking requirements data as a bytes array. + */ function getStakingRequirements(uint256 id) external override pure @@ -209,6 +344,11 @@ contract InstanceService is revert("ERROR:IS-001:IMPLEMENATION_MISSING"); } + /** + * @dev Returns the staked assets for a given ID. + * @param id The ID of the staked assets. + * @return data The staked assets data in bytes format. + */ function getStakedAssets(uint256 id) external override pure @@ -218,110 +358,239 @@ contract InstanceService is } /* policy */ + /** + * @dev Returns the number of process IDs in the policy contract. + * @return numberOfProcessIds The number of process IDs. + */ function processIds() external override view returns(uint256 numberOfProcessIds) { numberOfProcessIds = _policy.processIds(); } + /** + * @dev Returns the metadata associated with a given business process key. + * @param bpKey The business process key for which to retrieve the metadata. + * @return metadata The metadata associated with the given business process key. + */ function getMetadata(bytes32 bpKey) external override view returns(IPolicy.Metadata memory metadata) { metadata = _policy.getMetadata(bpKey); } + /** + * @dev Returns the application data associated with the given process ID. + * @param processId The ID of the process to retrieve the application data for. + * @return application The application data associated with the given process ID. + */ function getApplication(bytes32 processId) external override view returns(IPolicy.Application memory application) { application = _policy.getApplication(processId); } + /** + * @dev Returns the policy associated with the given process ID. + * @param processId The ID of the process. + * @return policy The policy associated with the given process ID. + */ function getPolicy(bytes32 processId) external override view returns(IPolicy.Policy memory policy) { policy = _policy.getPolicy(processId); } + /** + * @dev Returns the number of claims associated with a given process ID. + * @param processId The ID of the process to retrieve the number of claims for. + * @return numberOfClaims The number of claims associated with the given process ID. + */ function claims(bytes32 processId) external override view returns(uint256 numberOfClaims) { numberOfClaims = _policy.getNumberOfClaims(processId); } + /** + * @dev Returns the number of payouts for a given processId. + * @param processId The unique identifier of the process. + * @return numberOfPayouts The total number of payouts for the given processId. + */ function payouts(bytes32 processId) external override view returns(uint256 numberOfPayouts) { numberOfPayouts = _policy.getNumberOfPayouts(processId); } + /** + * @dev Returns the claim with the given claimId for the specified processId. + * @param processId The unique identifier of the process. + * @param claimId The unique identifier of the claim. + * @return claim The claim data, including the claimId, processId, claimant, amount, and status. + */ function getClaim(bytes32 processId, uint256 claimId) external override view returns (IPolicy.Claim memory claim) { claim = _policy.getClaim(processId, claimId); } + /** + * @dev Returns the information of a specific payout. + * @param processId The ID of the process. + * @param payoutId The ID of the payout. + * @return payout The payout information, including the ID, amount, and recipient. + */ function getPayout(bytes32 processId, uint256 payoutId) external override view returns (IPolicy.Payout memory payout) { payout = _policy.getPayout(processId, payoutId); } /* riskpool */ + /** + * @dev Returns the risk pool with the given ID. + * @param riskpoolId The ID of the risk pool to retrieve. + * @return riskPool The risk pool with the given ID. + */ function getRiskpool(uint256 riskpoolId) external override view returns(IPool.Pool memory riskPool) { return _pool.getRiskpool(riskpoolId); } + /** + * @dev Returns the full collateralization level of the pool. + * @return The full collateralization level as a uint256 value. + */ function getFullCollateralizationLevel() external override view returns (uint256) { return _pool.getFullCollateralizationLevel(); } + /** + * @dev Returns the capital amount of a given risk pool. + * @param riskpoolId The ID of the risk pool to retrieve the capital amount from. + * @return capitalAmount The amount of capital in the risk pool. + */ function getCapital(uint256 riskpoolId) external override view returns(uint256 capitalAmount) { return _pool.getRiskpool(riskpoolId).capital; } + /** + * @dev Returns the total value locked in a specific risk pool. + * @param riskpoolId The ID of the risk pool to query. + * @return totalValueLockedAmount The amount of tokens locked in the specified risk pool. + */ function getTotalValueLocked(uint256 riskpoolId) external override view returns(uint256 totalValueLockedAmount) { return _pool.getRiskpool(riskpoolId).lockedCapital; } + /** + * @dev Returns the available capacity of a risk pool. + * @param riskpoolId The ID of the risk pool to get the capacity for. + * @return capacityAmount The available capacity of the risk pool. + */ function getCapacity(uint256 riskpoolId) external override view returns(uint256 capacityAmount) { IPool.Pool memory pool = _pool.getRiskpool(riskpoolId); return pool.capital - pool.lockedCapital; } + /** + * @dev Returns the balance amount of a specific risk pool. + * @param riskpoolId The ID of the risk pool to get the balance amount from. + * @return balanceAmount The balance amount of the specified risk pool. + */ function getBalance(uint256 riskpoolId) external override view returns(uint256 balanceAmount) { return _pool.getRiskpool(riskpoolId).balance; } + /** + * @dev Returns the number of active bundles for a given risk pool. + * @param riskpoolId The ID of the risk pool. + * @return numberOfActiveBundles The number of active bundles for the specified risk pool. + */ function activeBundles(uint256 riskpoolId) external override view returns(uint256 numberOfActiveBundles) { return _pool.activeBundles(riskpoolId); } + /** + * @dev Returns the active bundle ID for a given risk pool and bundle index. + * @param riskpoolId The ID of the risk pool. + * @param bundleIdx The index of the bundle within the risk pool. + * @return bundleId The ID of the active bundle. + */ function getActiveBundleId(uint256 riskpoolId, uint256 bundleIdx) external override view returns(uint256 bundleId) { return _pool.getActiveBundleId(riskpoolId, bundleIdx); } + /** + * @dev Returns the maximum number of active bundles for a given risk pool ID. + * @param riskpoolId The ID of the risk pool to query. + * @return maximumNumberOfActiveBundles The maximum number of active bundles for the given risk pool ID. + */ function getMaximumNumberOfActiveBundles(uint256 riskpoolId) external override view returns(uint256 maximumNumberOfActiveBundles) { return _pool.getMaximumNumberOfActiveBundles(riskpoolId); } /* bundle */ + /** + * @dev Returns the bundle token contract address. + * @return token The bundle token contract address. + */ function getBundleToken() external override view returns(IBundleToken token) { BundleToken bundleToken = _bundle.getToken(); token = IBundleToken(bundleToken); } + /** + * @dev Returns the bundle with the given ID. + * @param bundleId The ID of the bundle to retrieve. + * @return bundle The bundle with the given ID. + */ function getBundle(uint256 bundleId) external override view returns (IBundle.Bundle memory bundle) { bundle = _bundle.getBundle(bundleId); } + /** + * @dev Returns the number of bundles in the `_bundle` contract. + * @return The number of bundles as a uint256 value. + */ function bundles() external override view returns (uint256) { return _bundle.bundles(); } + /** + * @dev Returns the number of unburnt bundles for a given risk pool ID. + * @param riskpoolId The ID of the risk pool to check. + * @return numberOfUnburntBundles The number of unburnt bundles for the given risk pool ID. + */ function unburntBundles(uint256 riskpoolId) external override view returns(uint256 numberOfUnburntBundles) { numberOfUnburntBundles = _bundle.unburntBundles(riskpoolId); } /* treasury */ + /** + * @dev Returns the address of the treasury contract. + * + * @return The address of the treasury contract. + */ function getTreasuryAddress() external override view returns(address) { return address(_treasury); } + /** + * @dev Returns the address of the instance wallet associated with the treasury. + * + * @return The address of the instance wallet. + */ function getInstanceWallet() external override view returns(address) { return _treasury.getInstanceWallet(); } + /** + * @dev Returns the wallet address of the specified riskpool. + * @param riskpoolId The ID of the riskpool to retrieve the wallet address for. + * @return The address of the wallet associated with the specified riskpool. + */ function getRiskpoolWallet(uint256 riskpoolId) external override view returns(address) { return _treasury.getRiskpoolWallet(riskpoolId); } + /** + * @dev Returns the IERC20 token associated with the given component ID. + * @param componentId The ID of the component for which to get the associated token. + * @return The IERC20 token associated with the given component ID. + */ function getComponentToken(uint256 componentId) external override view returns(IERC20) { return _treasury.getComponentToken(componentId); } + /** + * @dev Returns the fraction of the treasury fee expressed in full units. + * + * @return The fraction of the treasury fee expressed in full units. + */ function getFeeFractionFullUnit() external override view returns(uint256) { return _treasury.getFractionFullUnit(); } diff --git a/contracts/services/OracleService.sol b/contracts/services/OracleService.sol index 00125225..96ae5fe1 100644 --- a/contracts/services/OracleService.sol +++ b/contracts/services/OracleService.sol @@ -13,10 +13,18 @@ contract OracleService is { IQuery private _query; + /** + * @dev Sets the `_query` variable to an instance of the `IQuery` contract. + */ function _afterInitialize() internal override onlyInitializing { _query = IQuery(_getContractAddress("Query")); } + /** + * @dev Allows a registered oracle to respond to a data request. + * @param _requestId The ID of the data request. + * @param _data The data requested by the smart contract. + */ function respond(uint256 _requestId, bytes calldata _data) external override { // function below enforces msg.sender to be a registered oracle _query.respond(_requestId, _msgSender(), _data); diff --git a/contracts/services/ProductService.sol b/contracts/services/ProductService.sol index cbdf790d..8478edde 100644 --- a/contracts/services/ProductService.sol +++ b/contracts/services/ProductService.sol @@ -15,8 +15,15 @@ contract ProductService is bytes32 public constant NAME = "ProductService"; // solhint-disable-next-line no-empty-blocks + /** + * @dev Constructor function that initializes the contract with a registry address. + * @param _registry The address of the registry contract. + */ constructor(address _registry) WithRegistry(_registry) {} + /** + * @dev Fallback function that ensures the caller is a registered product and authorized to execute the delegated policy flow. + */ fallback() external { // getAuthorizationStatus enforces msg.sender to be a registered product (,bool isAuthorized, address policyFlow) = _license().getAuthorizationStatus(_msgSender()); @@ -35,6 +42,10 @@ contract ProductService is * This function is a 1:1 copy of _delegate from * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.6/contracts/proxy/Proxy.sol */ + /** + * @dev Delegates the current call to `implementation`. + * @param implementation Address of the contract to delegatecall. + */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly @@ -60,6 +71,11 @@ contract ProductService is } } + /** + * @dev Returns the instance of the License contract. + * + * @return license An instance of the ILicense interface representing the License contract. + */ function _license() internal view returns (ILicense) { return ILicense(registry.getContract("License")); } diff --git a/contracts/services/README.adoc b/contracts/services/README.adoc new file mode 100644 index 00000000..3cbee757 --- /dev/null +++ b/contracts/services/README.adoc @@ -0,0 +1,18 @@ += Services + +[.readme-notice] +NOTE: This document is better viewed at https://docs.etherisc.com/contracts/api/services + +== Contracts + +{{ComponentOwnerService}} + +{{InstanceOperatorService}} + +{{InstanceService}} + +{{OracleService}} + +{{ProductService}} + +{{RiskpoolService}} diff --git a/contracts/services/RiskpoolService.sol b/contracts/services/RiskpoolService.sol index bd0aaafa..42edf50d 100644 --- a/contracts/services/RiskpoolService.sol +++ b/contracts/services/RiskpoolService.sol @@ -85,6 +85,11 @@ contract RiskpoolService is } + /** + * @dev Sets the addresses of the BundleController, ComponentController, PoolController, and TreasuryModule contracts. + * + * + */ function _afterInitialize() internal override onlyInitializing @@ -96,6 +101,13 @@ contract RiskpoolService is } + /** + * @dev Registers a new risk pool with the given parameters. + * @param wallet The address of the wallet that will hold the collateral for the risk pool. + * @param erc20Token The address of the ERC20 token that will be used as collateral. + * @param collateralizationLevel The percentage of collateral required for the risk pool. + * @param sumOfSumInsuredCap The maximum sum of all insured amounts for the risk pool. + */ function registerRiskpool( address wallet, address erc20Token, @@ -115,6 +127,13 @@ contract RiskpoolService is ); } + /** + * @dev Creates a new bundle with the given parameters and adds it to the active set of the riskpool. + * @param owner The address of the owner of the bundle. + * @param filter The filter applied to the bundle. + * @param initialCapital The initial capital of the bundle. + * @return bundleId The ID of the newly created bundle. + */ function createBundle( address owner, bytes calldata filter, @@ -136,6 +155,12 @@ contract RiskpoolService is } + /** + * @dev This function allows a user to fund a bundle with a specified amount. + * @param bundleId The ID of the bundle to be funded. + * @param amount The amount of tokens to be funded. + * @return netAmount The net amount of tokens that were funded after deducting fees. + */ function fundBundle(uint256 bundleId, uint256 amount) external override onlyOwningRiskpool(bundleId, true) @@ -156,6 +181,12 @@ contract RiskpoolService is } + /** + * @dev Defunds a bundle by withdrawing a specified amount of tokens from it. + * @param bundleId The ID of the bundle to be defunded. + * @param amount The amount of tokens to be withdrawn from the bundle. + * @return netAmount The net amount of tokens withdrawn from the bundle after deducting any fees. + */ function defundBundle(uint256 bundleId, uint256 amount) external override onlyOwningRiskpool(bundleId, true) @@ -176,6 +207,10 @@ contract RiskpoolService is } + /** + * @dev Locks a bundle, preventing it from being traded or redeemed. + * @param bundleId The ID of the bundle to be locked. + */ function lockBundle(uint256 bundleId) external override onlyOwningRiskpool(bundleId, true) @@ -186,6 +221,10 @@ contract RiskpoolService is } + /** + * @dev Unlocks a bundle for trading by adding its ID to the active set of a risk pool and unlocking the bundle. + * @param bundleId The ID of the bundle to be unlocked. + */ function unlockBundle(uint256 bundleId) external override onlyOwningRiskpool(bundleId, true) @@ -196,6 +235,10 @@ contract RiskpoolService is } + /** + * @dev Closes a bundle and removes it from the active set of the owning riskpool. + * @param bundleId The ID of the bundle to be closed. + */ function closeBundle(uint256 bundleId) external override onlyOwningRiskpool(bundleId, true) @@ -209,6 +252,10 @@ contract RiskpoolService is _bundle.close(bundleId); } + /** + * @dev Burns a closed bundle, withdrawing its remaining balance and defunding it from the riskpool and the pool. + * @param bundleId The ID of the bundle to burn. + */ function burnBundle(uint256 bundleId) external override onlyOwningRiskpool(bundleId, true) @@ -226,6 +273,12 @@ contract RiskpoolService is _bundle.burn(bundleId); } + /** + * @dev Collateralizes a policy by locking a specified amount of collateral for a given bundle and process ID. + * @param bundleId The ID of the bundle to which the policy belongs. + * @param processId The ID of the process associated with the policy. + * @param collateralAmount The amount of collateral to be locked for the policy. + */ function collateralizePolicy(uint256 bundleId, bytes32 processId, uint256 collateralAmount) external override onlyOwningRiskpool(bundleId, true) @@ -233,6 +286,12 @@ contract RiskpoolService is _bundle.collateralizePolicy(bundleId, processId, collateralAmount); } + /** + * @dev Processes a premium payment for a specific bundle. + * @param bundleId The ID of the bundle for which the premium is being paid. + * @param processId The ID of the premium payment process. + * @param amount The amount of the premium payment in wei. + */ function processPremium(uint256 bundleId, bytes32 processId, uint256 amount) external override onlyOwningRiskpool(bundleId, true) @@ -240,6 +299,12 @@ contract RiskpoolService is _bundle.processPremium(bundleId, processId, amount); } + /** + * @dev Processes a payout for a specific bundle. + * @param bundleId The ID of the bundle for which to process the payout. + * @param processId The ID of the payout process. + * @param amount The amount to be paid out. + */ function processPayout(uint256 bundleId, bytes32 processId, uint256 amount) external override onlyOwningRiskpool(bundleId, true) @@ -247,6 +312,12 @@ contract RiskpoolService is _bundle.processPayout(bundleId, processId, amount); } + /** + * @dev Releases a policy for a given bundle and process ID. + * @param bundleId The ID of the bundle containing the policy to be released. + * @param processId The ID of the process associated with the policy to be released. + * @return collateralAmount The amount of collateral released for the policy. + */ function releasePolicy(uint256 bundleId, bytes32 processId) external override onlyOwningRiskpool(bundleId, false) @@ -255,6 +326,11 @@ contract RiskpoolService is collateralAmount = _bundle.releasePolicy(bundleId, processId); } + /** + * @dev Sets the maximum number of active bundles for a given riskpool. + * @param riskpoolId The ID of the riskpool. + * @param maxNumberOfActiveBundles The maximum number of active bundles to be set. + */ function setMaximumNumberOfActiveBundles(uint256 riskpoolId, uint256 maxNumberOfActiveBundles) external override onlyOwningRiskpoolId(riskpoolId, true) diff --git a/contracts/shared/CoreController.sol b/contracts/shared/CoreController.sol index ef1ce491..fa115f43 100644 --- a/contracts/shared/CoreController.sol +++ b/contracts/shared/CoreController.sol @@ -14,6 +14,9 @@ contract CoreController is IRegistry internal _registry; IAccess internal _access; + /** + * @dev Constructor function that disables initializers. + */ constructor () { _disableInitializers(); } @@ -40,6 +43,10 @@ contract CoreController is _; } + /** + * @dev Initializes the contract with the provided registry address. + * @param registry The address of the registry contract. + */ function initialize(address registry) public initializer { _registry = IRegistry(registry); if (_getName() != "Access") { _access = IAccess(_getContractAddress("Access")); } @@ -47,10 +54,23 @@ contract CoreController is _afterInitialize(); } + /** + * @dev Returns the name of the contract. + * @return name The name of the contract as a bytes32 value. + */ function _getName() internal virtual pure returns(bytes32) { return ""; } + /** + * @dev This function is called after the contract is initialized and can be used to perform additional setup. + * @notice This function should only be called internally by the contract during initialization. + */ function _afterInitialize() internal virtual onlyInitializing {} + /** + * @dev Returns the address of a registered contract by its name. + * @param contractName The name of the contract to retrieve. + * @return contractAddress The address of the requested contract. + */ function _getContractAddress(bytes32 contractName) internal view returns (address contractAddress) { contractAddress = _registry.getContract(contractName); require( diff --git a/contracts/shared/CoreProxy.sol b/contracts/shared/CoreProxy.sol index c5ffae26..b096c295 100644 --- a/contracts/shared/CoreProxy.sol +++ b/contracts/shared/CoreProxy.sol @@ -1,43 +1,59 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity 0.8.2; - - -import "@etherisc/gif-interface/contracts/shared/ICoreProxy.sol"; -import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; - -contract CoreProxy is - ICoreProxy, - ERC1967Proxy -{ - - modifier onlyAdmin() { - require( - msg.sender == _getAdmin(), - "ERROR:CRP-001:NOT_ADMIN"); - _; - } - - constructor(address _controller, bytes memory encoded_initializer) - ERC1967Proxy(_controller, encoded_initializer) - { - _changeAdmin(msg.sender); - } - - function implementation() external view returns (address) { - return _implementation(); - } - - function upgradeToAndCall(address newImplementation, bytes calldata data) - external - payable - onlyAdmin - { - address oldImplementation = _implementation(); - - _upgradeToAndCall(newImplementation, data, true); - - emit LogCoreContractUpgraded( - oldImplementation, - newImplementation); - } -} +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.2; + + +import "@etherisc/gif-interface/contracts/shared/ICoreProxy.sol"; +import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; + +contract CoreProxy is + ICoreProxy, + ERC1967Proxy +{ + + modifier onlyAdmin() { + require( + msg.sender == _getAdmin(), + "ERROR:CRP-001:NOT_ADMIN"); + _; + } + + /** + * @dev Constructor function that creates a new instance of the contract. + * @param _controller The address of the controller contract. + * @param encoded_initializer The encoded initializer data. + */ + constructor(address _controller, bytes memory encoded_initializer) + ERC1967Proxy(_controller, encoded_initializer) + { + _changeAdmin(msg.sender); + } + + /** + * @dev Returns the address of the current implementation contract. + * @return implementation The address of the current implementation contract. + */ + function implementation() external view returns (address) { + return _implementation(); + } + + /** + * @dev Upgrades the contract to a new implementation and forwards a function call to it. + * @param newImplementation The address of the new implementation contract. + * @param data The data payload to be forwarded to the new implementation. + * @notice This function emits 1 events: + * - LogCoreContractUpgraded + */ + function upgradeToAndCall(address newImplementation, bytes calldata data) + external + payable + onlyAdmin + { + address oldImplementation = _implementation(); + + _upgradeToAndCall(newImplementation, data, true); + + emit LogCoreContractUpgraded( + oldImplementation, + newImplementation); + } +} diff --git a/contracts/shared/README.adoc b/contracts/shared/README.adoc new file mode 100644 index 00000000..edbed26c --- /dev/null +++ b/contracts/shared/README.adoc @@ -0,0 +1,14 @@ += Shared + +[.readme-notice] +NOTE: This document is better viewed at https://docs.etherisc.com/contracts/api/shared + +== Contracts + +{{CoreController}} + +{{CoreProxy}} + +{{TransferHelper}} + +{{WithRegistry}} diff --git a/contracts/shared/TransferHelper.sol b/contracts/shared/TransferHelper.sol index 558e1dd7..a405673a 100644 --- a/contracts/shared/TransferHelper.sol +++ b/contracts/shared/TransferHelper.sol @@ -15,6 +15,22 @@ library TransferHelper { event LogTransferHelperInputValidation2Failed(uint256 balance, uint256 allowance); event LogTransferHelperCallFailed(bool callSuccess, uint256 returnDataLength, bytes returnData); + /** + * @dev Executes a transferFrom function call on an ERC20 token contract, after performing input validation. + * @param token The ERC20 token contract to transfer from. + * @param from The address to transfer tokens from. + * @param to The address to transfer tokens to. + * @param value The amount of tokens to transfer. + * @return success A boolean indicating whether the transfer was successful or not. + * + * Emits a LogTransferHelperInputValidation1Failed event if the input validation step 1 fails. + * Emits a LogTransferHelperInputValidation2Failed event if the input validation step 2 fails. + * Emits a LogTransferHelperCallFailed event if the low-level call to transferFrom fails. + * @notice This function emits 3 events: + * - LogTransferHelperInputValidation1Failed + * - LogTransferHelperInputValidation2Failed + * - LogTransferHelperCallFailed + */ function unifiedTransferFrom( IERC20 token, address from, diff --git a/contracts/shared/WithRegistry.sol b/contracts/shared/WithRegistry.sol index 831b6c88..cb8561a9 100644 --- a/contracts/shared/WithRegistry.sol +++ b/contracts/shared/WithRegistry.sol @@ -45,10 +45,21 @@ contract WithRegistry { _; } + /** + * @dev Constructor function that sets the address of the registry contract. + * @param _registry The address of the registry contract. + */ constructor(address _registry) { registry = IRegistry(_registry); } + /** + * @dev Returns the address of a contract registered in the registry by its name. + * + * @param _contractName The name of the contract to retrieve. + * + * @return _addr The address of the contract. + */ function getContractFromRegistry(bytes32 _contractName) public // override @@ -58,6 +69,12 @@ contract WithRegistry { _addr = registry.getContract(_contractName); } + /** + * @dev Returns the address of a contract with a given name in a specific release of the registry. + * @param _release The release version of the registry where the contract is stored. + * @param _contractName The name of the contract to retrieve. + * @return _addr The address of the contract in the given release. + */ function getContractInReleaseFromRegistry(bytes32 _release, bytes32 _contractName) internal view @@ -66,6 +83,10 @@ contract WithRegistry { _addr = registry.getContractInRelease(_release, _contractName); } + /** + * @dev Returns the current release identifier from the registry. + * @return _release The release identifier as a bytes32 value. + */ function getReleaseFromRegistry() internal view returns (bytes32 _release) { _release = registry.getRelease(); } diff --git a/contracts/test/README.adoc b/contracts/test/README.adoc new file mode 100644 index 00000000..d48cc873 --- /dev/null +++ b/contracts/test/README.adoc @@ -0,0 +1,24 @@ += Test + +[.readme-notice] +NOTE: This document is better viewed at https://docs.etherisc.com/contracts/api/test + +== Contracts + +{{TestCoin}} + +{{TestCoinAlternativeImplementation}} + +{{TestCompromisedProduct}} + +{{TestOracle}} + +{{TestProduct}} + +{{TestRegistryCompromisedController}} + +{{TestRegistryControllerUpdated}} + +{{TestRiskpool}} + +{{TestTransferFrom}} \ No newline at end of file diff --git a/contracts/test/TestCoin.sol b/contracts/test/TestCoin.sol index 460d58fe..7fab36f3 100644 --- a/contracts/test/TestCoin.sol +++ b/contracts/test/TestCoin.sol @@ -1,38 +1,44 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity 0.8.2; - -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; - -contract TestCoin is ERC20 { - - string public constant NAME = "Test Dummy"; - string public constant SYMBOL = "TDY"; - - uint256 public constant INITIAL_SUPPLY = 10**24; - - constructor() - ERC20(NAME, SYMBOL) - { - _mint( - _msgSender(), - INITIAL_SUPPLY - ); - } -} - -contract TestCoinX is ERC20 { - - string public constant NAME = "Test Dummy X"; - string public constant SYMBOL = "TDX"; - - uint256 public constant INITIAL_SUPPLY = 10**24; - - constructor() - ERC20(NAME, SYMBOL) - { - _mint( - _msgSender(), - INITIAL_SUPPLY - ); - } -} +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.2; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; + +contract TestCoin is ERC20 { + + string public constant NAME = "Test Dummy"; + string public constant SYMBOL = "TDY"; + + uint256 public constant INITIAL_SUPPLY = 10**24; + + /** + * @dev Constructor function that initializes the ERC20 token with a given name, symbol, and initial supply. + */ + constructor() + ERC20(NAME, SYMBOL) + { + _mint( + _msgSender(), + INITIAL_SUPPLY + ); + } +} + +contract TestCoinX is ERC20 { + + string public constant NAME = "Test Dummy X"; + string public constant SYMBOL = "TDX"; + + uint256 public constant INITIAL_SUPPLY = 10**24; + + /** + * @dev Constructor function that creates a new instance of the ERC20 token with the given name and symbol. It also mints the initial supply and assigns it to the deployer's address. + */ + constructor() + ERC20(NAME, SYMBOL) + { + _mint( + _msgSender(), + INITIAL_SUPPLY + ); + } +} diff --git a/contracts/test/TestCoinAlternativeImplementation.sol b/contracts/test/TestCoinAlternativeImplementation.sol index 5d444416..36b21f28 100644 --- a/contracts/test/TestCoinAlternativeImplementation.sol +++ b/contracts/test/TestCoinAlternativeImplementation.sol @@ -1,38 +1,54 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity 0.8.2; - -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; - -contract TestCoinAlternativeImplementation is ERC20 { - - string public constant NAME = "Test Alternative Coin"; - string public constant SYMBOL = "TAC"; - - uint256 public constant INITIAL_SUPPLY = 10**24; - - constructor() - ERC20(NAME, SYMBOL) - { - _mint( - _msgSender(), - INITIAL_SUPPLY - ); - } - - // inspired by ZRX transfer implementation - // see https://soliditydeveloper.com/safe-erc20 - function transferFrom(address _from, address _to, uint _value) - public virtual override returns (bool) - { - if (balanceOf(_from) >= _value // check sufficient balance - && allowance(_from, msg.sender) >= _value // check sufficient allowance - && balanceOf(_to) + _value >= balanceOf(_to) // check overflow - && _from != address(0) // sender not zero address - && _to != address(0)) // recipient not zero address - { - return super.transferFrom(_from, _to, _value); // should never fail now - } else { - return false; - } - } -} +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.2; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; + +contract TestCoinAlternativeImplementation is ERC20 { + + string public constant NAME = "Test Alternative Coin"; + string public constant SYMBOL = "TAC"; + + uint256 public constant INITIAL_SUPPLY = 10**24; + + /** + * @dev Constructor function that creates a new ERC20 token with the given name and symbol, and mints the initial supply to the sender. + */ + constructor() + ERC20(NAME, SYMBOL) + { + _mint( + _msgSender(), + INITIAL_SUPPLY + ); + } + + // inspired by ZRX transfer implementation + // see https://soliditydeveloper.com/safe-erc20 + /** + * @dev Transfer tokens from one address to another. + * @param _from The address from which to transfer the tokens. + * @param _to The address to which to transfer the tokens. + * @param _value The amount of tokens to transfer. + * @return A boolean value indicating whether the transfer was successful or not. + * + * Requirements: + * - The sender must have a balance of at least `_value`. + * - The sender must have allowance for `_spender`'s tokens of at least `_value`. + * - The balance of `_to` must not be less than the sum of the balance and `_value`. + * - Neither `_from` nor `_to` can be the zero address. + */ + function transferFrom(address _from, address _to, uint _value) + public virtual override returns (bool) + { + if (balanceOf(_from) >= _value // check sufficient balance + && allowance(_from, msg.sender) >= _value // check sufficient allowance + && balanceOf(_to) + _value >= balanceOf(_to) // check overflow + && _from != address(0) // sender not zero address + && _to != address(0)) // recipient not zero address + { + return super.transferFrom(_from, _to, _value); // should never fail now + } else { + return false; + } + } +} diff --git a/contracts/test/TestCompromisedProduct.sol b/contracts/test/TestCompromisedProduct.sol index 6d2ecbc2..754a7ed7 100644 --- a/contracts/test/TestCompromisedProduct.sol +++ b/contracts/test/TestCompromisedProduct.sol @@ -1,183 +1,327 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity 0.8.2; - -import "@etherisc/gif-interface/contracts/components/IComponent.sol"; -import "@etherisc/gif-interface/contracts/components/IProduct.sol"; - -import "@etherisc/gif-interface/contracts/modules/IAccess.sol"; -import "@etherisc/gif-interface/contracts/modules/IPolicy.sol"; -import "@etherisc/gif-interface/contracts/modules/IRegistry.sol"; - -import "@etherisc/gif-interface/contracts/services/IComponentOwnerService.sol"; -import "@etherisc/gif-interface/contracts/services/IProductService.sol"; -import "@etherisc/gif-interface/contracts/services/IInstanceService.sol"; - -import "@openzeppelin/contracts/access/Ownable.sol"; -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; - -/* -the TestCompromisedProduct claims to be an existing product that connects to an existing -riskpool with the goal to create fraud claims that lead to fraud payouts whith the intention -to drain the riskpool. - -for this the compromised product claims -- to be a product -- to be in state active (independent of an approval step by the instance operator) -*/ -contract TestCompromisedProduct is - IProduct, - Ownable -{ - IComponent.ComponentState public constant FAKE_STATE = IComponent.ComponentState.Active; - - bytes32 public constant POLICY_FLOW = "PolicyDefaultFlow"; - - bytes32 private _componentName; - address private _tokenAddress; - uint256 private _componentId; - uint256 private _riskpoolId; - - IRegistry private _registry; - IAccess private _access; - IComponentOwnerService private _componentOwnerService; - IInstanceService private _instanceService; - address private _policyFlow; - IProductService private _productService; - - uint256 private _policies; - uint256 private _claims; - - modifier onlyPolicyHolder(bytes32 policyId) { - address policyHolder = _instanceService.getMetadata(policyId).owner; - require( - _msgSender() == policyHolder, - "ERROR:TCP-1:INVALID_POLICY_OR_HOLDER" - ); - _; - } - - constructor( - bytes32 fakeProductName, - address tokenAddress, - uint256 fakeComponentId, - uint256 fakeRiskpoolId, - address registryAddress - ) - Ownable() - { - _componentName = fakeProductName; - _tokenAddress = tokenAddress; - _componentId = fakeComponentId; - _riskpoolId = fakeRiskpoolId; - - _registry = IRegistry(registryAddress); - _access = _getAccess(); - _componentOwnerService = _getComponentOwnerService(); - _instanceService = _getInstanceService(); - _policyFlow = _getContractAddress(POLICY_FLOW); - _productService = _getProductService(); - } - - function applyForPolicy( - uint256 premium, - uint256 sumInsured, - bytes calldata metaData, - bytes calldata applicationData - ) - external - payable - returns (bytes32 processId) - { - address payable policyHolder = payable(_msgSender()); - - // Create and underwrite new application - processId = _productService.newApplication( - policyHolder, - premium, - sumInsured, - metaData, - applicationData); - - _productService.underwrite(processId); - } - - function collectPremium(bytes32 policyId) - external - { - IPolicy.Policy memory policy = _instanceService.getPolicy(policyId); - _productService.collectPremium(policyId, policy.premiumExpectedAmount); - } - - function submitClaim(bytes32 policyId, uint256 claimAmount) - external - onlyPolicyHolder(policyId) - { - // increase claims counter - _claims += 1; - - // create claim and confirm it - uint256 claimId = _productService.newClaim(policyId, claimAmount, abi.encode(0)); - _productService.confirmClaim(policyId, claimId, claimAmount); - - // create payout record - uint256 payoutId = _productService.newPayout(policyId, claimId, claimAmount, abi.encode(0)); - _productService.processPayout(policyId, payoutId); - } - - //--- product service access --------------------------------------------// - - //--- iproduct ----------------------------------------------------------// - function getToken() external override view returns(address token) { return _tokenAddress; } - function getPolicyFlow() external override view returns(address policyFlow) { return _getContractAddress(POLICY_FLOW); } - function getRiskpoolId() external override view returns(uint256 riskpoolId) { return _riskpoolId; } - - function getApplicationDataStructure() external override view returns(string memory dataStructure) { return ""; } - function getClaimDataStructure() external override view returns(string memory dataStructure) { return ""; } - function getPayoutDataStructure() external override view returns(string memory dataStructure) { return ""; } - - function riskPoolCapacityCallback(uint256 capacity) external override {} - - //--- icomponent --------------------------------------------------------// - function setId(uint256 id) external override {} // does not care about id - - function getName() external override view returns(bytes32) { return _componentName; } - function getId() external override view returns(uint256) { return _componentId; } - function getType() external override view returns(ComponentType) { return IComponent.ComponentType.Product; } - function getState() external override view returns(ComponentState) { return IComponent.ComponentState.Active; } - function getOwner() external override view returns(address) { return owner(); } - function getRegistry() external override view returns(IRegistry) { return _registry; } - - function isProduct() public override view returns(bool) { return true; } - function isOracle() public override view returns(bool) { return false; } - function isRiskpool() public override view returns(bool) { return false; } - - function proposalCallback() external override {} - function approvalCallback() external override {} - function declineCallback() external override {} - function suspendCallback() external override {} - function resumeCallback() external override {} - function pauseCallback() external override {} - function unpauseCallback() external override {} - function archiveCallback() external override {} - - function _getAccess() private view returns (IAccess) { - return IAccess(_getContractAddress("Access")); - } - - function _getInstanceService() private view returns (IInstanceService) { - return IInstanceService(_getContractAddress("InstanceService")); - } - - function _getComponentOwnerService() private view returns (IComponentOwnerService) { - return IComponentOwnerService(_getContractAddress("ComponentOwnerService")); - } - - function _getProductService() private view returns (IProductService) { - return IProductService(_getContractAddress("ProductService")); - } - - function _getContractAddress(bytes32 contractName) private view returns (address) { - return _registry.getContract(contractName); - } - +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.2; + +import "@etherisc/gif-interface/contracts/components/IComponent.sol"; +import "@etherisc/gif-interface/contracts/components/IProduct.sol"; + +import "@etherisc/gif-interface/contracts/modules/IAccess.sol"; +import "@etherisc/gif-interface/contracts/modules/IPolicy.sol"; +import "@etherisc/gif-interface/contracts/modules/IRegistry.sol"; + +import "@etherisc/gif-interface/contracts/services/IComponentOwnerService.sol"; +import "@etherisc/gif-interface/contracts/services/IProductService.sol"; +import "@etherisc/gif-interface/contracts/services/IInstanceService.sol"; + +import "@openzeppelin/contracts/access/Ownable.sol"; +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; + +/* +the TestCompromisedProduct claims to be an existing product that connects to an existing +riskpool with the goal to create fraud claims that lead to fraud payouts whith the intention +to drain the riskpool. + +for this the compromised product claims +- to be a product +- to be in state active (independent of an approval step by the instance operator) +*/ +contract TestCompromisedProduct is + IProduct, + Ownable +{ + IComponent.ComponentState public constant FAKE_STATE = IComponent.ComponentState.Active; + + bytes32 public constant POLICY_FLOW = "PolicyDefaultFlow"; + + bytes32 private _componentName; + address private _tokenAddress; + uint256 private _componentId; + uint256 private _riskpoolId; + + IRegistry private _registry; + IAccess private _access; + IComponentOwnerService private _componentOwnerService; + IInstanceService private _instanceService; + address private _policyFlow; + IProductService private _productService; + + uint256 private _policies; + uint256 private _claims; + + modifier onlyPolicyHolder(bytes32 policyId) { + address policyHolder = _instanceService.getMetadata(policyId).owner; + require( + _msgSender() == policyHolder, + "ERROR:TCP-1:INVALID_POLICY_OR_HOLDER" + ); + _; + } + + /** + * @dev Constructor function to initialize the component with the given parameters. + * @param fakeProductName The name of the component. + * @param tokenAddress The address of the token used for the component. + * @param fakeComponentId The ID of the component. + * @param fakeRiskpoolId The ID of the risk pool associated with the component. + * @param registryAddress The address of the registry contract. + */ + constructor( + bytes32 fakeProductName, + address tokenAddress, + uint256 fakeComponentId, + uint256 fakeRiskpoolId, + address registryAddress + ) + Ownable() + { + _componentName = fakeProductName; + _tokenAddress = tokenAddress; + _componentId = fakeComponentId; + _riskpoolId = fakeRiskpoolId; + + _registry = IRegistry(registryAddress); + _access = _getAccess(); + _componentOwnerService = _getComponentOwnerService(); + _instanceService = _getInstanceService(); + _policyFlow = _getContractAddress(POLICY_FLOW); + _productService = _getProductService(); + } + + /** + * @dev Allows a policy holder to apply for a new policy by submitting an application with the specified premium, sum insured, metaData, and applicationData. + * @param premium The amount of premium to be paid for the policy. + * @param sumInsured The amount of coverage provided by the policy. + * @param metaData Additional metadata related to the policy application. + * @param applicationData Additional data related to the policy application. + * @return processId The process ID of the new policy application. + */ + function applyForPolicy( + uint256 premium, + uint256 sumInsured, + bytes calldata metaData, + bytes calldata applicationData + ) + external + payable + returns (bytes32 processId) + { + address payable policyHolder = payable(_msgSender()); + + // Create and underwrite new application + processId = _productService.newApplication( + policyHolder, + premium, + sumInsured, + metaData, + applicationData); + + _productService.underwrite(processId); + } + + /** + * @dev Collects the premium for a given policy. + * @param policyId The ID of the policy to collect the premium for. + */ + function collectPremium(bytes32 policyId) + external + { + IPolicy.Policy memory policy = _instanceService.getPolicy(policyId); + _productService.collectPremium(policyId, policy.premiumExpectedAmount); + } + + /** + * @dev Allows a policy holder to submit a claim for the specified policy. + * @param policyId The ID of the policy for which the claim is being submitted. + * @param claimAmount The amount of the claim being submitted. + * + * Emits a ClaimSubmitted event and creates a new claim and payout record. + */ + function submitClaim(bytes32 policyId, uint256 claimAmount) + external + onlyPolicyHolder(policyId) + { + // increase claims counter + _claims += 1; + + // create claim and confirm it + uint256 claimId = _productService.newClaim(policyId, claimAmount, abi.encode(0)); + _productService.confirmClaim(policyId, claimId, claimAmount); + + // create payout record + uint256 payoutId = _productService.newPayout(policyId, claimId, claimAmount, abi.encode(0)); + _productService.processPayout(policyId, payoutId); + } + + //--- product service access --------------------------------------------// + + //--- iproduct ----------------------------------------------------------// + /** + * @dev Returns the address of the token used by this contract. + * @return token The address of the token used by this contract. + */ + function getToken() external override view returns(address token) { return _tokenAddress; } + /** + * @dev Returns the address of the policy flow contract. + * @return policyFlow The address of the policy flow contract. + */ + function getPolicyFlow() external override view returns(address policyFlow) { return _getContractAddress(POLICY_FLOW); } + /** + * @dev Returns the ID of the risk pool. + * @return riskpoolId The ID of the risk pool. + */ + function getRiskpoolId() external override view returns(uint256 riskpoolId) { return _riskpoolId; } + + /** + * @dev Returns the data structure of the application. + * @return dataStructure The string representing the data structure of the application. + */ + function getApplicationDataStructure() external override view returns(string memory dataStructure) { return ""; } + /** + * @dev Returns the data structure of the claim data. + * @return dataStructure The data structure of the claim data as a string. + */ + function getClaimDataStructure() external override view returns(string memory dataStructure) { return ""; } + /** + * @dev Returns the data structure of the payout information. + * @return dataStructure The string representation of the payout data structure. + */ + function getPayoutDataStructure() external override view returns(string memory dataStructure) { return ""; } + + /** + * @dev Callback function to update the risk pool's capacity. + * @param capacity The new capacity of the risk pool. + */ + function riskPoolCapacityCallback(uint256 capacity) external override {} + + //--- icomponent --------------------------------------------------------// + /** + * @dev Sets the ID of the contract. + * @param id The ID to be set. + */ + function setId(uint256 id) external override {} // does not care about id + + /** + * @dev Returns the name of the component. + * @return _componentName The name of the component as a bytes32 value. + */ + function getName() external override view returns(bytes32) { return _componentName; } + /** + * @dev Returns the ID of the component. + * @return The ID of the component as a uint256 value. + */ + function getId() external override view returns(uint256) { return _componentId; } + /** + * @dev Returns the ComponentType of the product. + * @return The ComponentType of the product. + */ + function getType() external override view returns(ComponentType) { return IComponent.ComponentType.Product; } + /** + * @dev Returns the current state of the component. + * @return state The current state of the component as a ComponentState enum value. + */ + function getState() external override view returns(ComponentState) { return IComponent.ComponentState.Active; } + /** + * @dev Returns the address of the contract owner. + * @return The address of the contract owner. + */ + function getOwner() external override view returns(address) { return owner(); } + /** + * @dev Returns the current registry contract instance. + * @return _registry The current registry contract instance. + */ + function getRegistry() external override view returns(IRegistry) { return _registry; } + + /** + * @dev Checks if the contract is a product. + * @return Returns a boolean value indicating if the contract is a product. + */ + function isProduct() public override view returns(bool) { return true; } + /** + * @dev Returns a boolean value indicating whether the contract is an oracle. + * @return A boolean value indicating whether the contract is an oracle. + */ + function isOracle() public override view returns(bool) { return false; } + /** + * @dev Check if the contract is a risk pool. + * @return {bool} Returns a boolean indicating if the contract is a risk pool. + */ + function isRiskpool() public override view returns(bool) { return false; } + + /** + * @dev This function is a callback function for proposals. + * + * Returns: None + */ + function proposalCallback() external override {} + /** + * @dev This function is a callback function that is called after an approval has been made. + */ + function approvalCallback() external override {} + /** + * @dev This function is called when a user declines a transaction in the dApp. + */ + function declineCallback() external override {} + /** + * @dev Suspends the callback function. + */ + function suspendCallback() external override {} + /** + * @dev This function is a callback function that is triggered when a paused contract is resumed. + * + */ + function resumeCallback() external override {} + /** + * @dev Callback function that is called when the contract is paused. This function does not take any parameters. + */ + function pauseCallback() external override {} + /** + * @dev This function is called by the owner of the contract to unpause the contract after it has been paused. + */ + function unpauseCallback() external override {} + /** + * @dev This function is a callback function that is executed when a contract is archived. + * + */ + function archiveCallback() external override {} + + /** + * @dev Returns the instance of the IAccess contract. + * @return access Returns the instance of the IAccess contract. + */ + function _getAccess() private view returns (IAccess) { + return IAccess(_getContractAddress("Access")); + } + + /** + * @dev Returns the instance service contract. + * @return instanceService The instance service contract. + */ + function _getInstanceService() private view returns (IInstanceService) { + return IInstanceService(_getContractAddress("InstanceService")); + } + + /** + * @dev Returns the instance of the ComponentOwnerService contract. + * @return The ComponentOwnerService contract instance. + */ + function _getComponentOwnerService() private view returns (IComponentOwnerService) { + return IComponentOwnerService(_getContractAddress("ComponentOwnerService")); + } + + /** + * @dev Returns the ProductService contract instance. + * @return productService The ProductService contract instance. + */ + function _getProductService() private view returns (IProductService) { + return IProductService(_getContractAddress("ProductService")); + } + + /** + * @dev Returns the address of a registered contract with the given name. + * @param contractName The name of the contract to retrieve the address for. + * @return The address of the registered contract with the given name. + */ + function _getContractAddress(bytes32 contractName) private view returns (address) { + return _registry.getContract(contractName); + } + } \ No newline at end of file diff --git a/contracts/test/TestOracle.sol b/contracts/test/TestOracle.sol index aed410a4..490cc5d4 100644 --- a/contracts/test/TestOracle.sol +++ b/contracts/test/TestOracle.sol @@ -1,55 +1,86 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity 0.8.2; - -import "@etherisc/gif-interface/contracts/components/Oracle.sol"; - -contract TestOracle is Oracle { - - constructor( - bytes32 oracleName, - address registry - ) - Oracle(oracleName, registry) - { } - - function request(uint256 requestId, bytes calldata input) external override onlyQuery { - // decode oracle input data - (uint256 counter, bool immediateResponse) = abi.decode(input, (uint256, bool)); - - if (immediateResponse) { - // obtain data from oracle given the request data (counter) - // for off chain oracles this happens outside the request - // call in a separate asynchronous transaction - bool isLossEvent = _oracleCalculation(counter); - respond(requestId, isLossEvent); - } - } - - function cancel(uint256 requestId) - external override - onlyOwner - { - // TODO mid/low priority - // cancelChainlinkRequest(_requestId, _payment, _callbackFunctionId, _expiration); - } - - // usually called by off-chain oracle (and not internally) - // in which case the function modifier should be changed - // to external - function respond(uint256 requestId, bool isLossEvent) - public - { - // encode data obtained from oracle - bytes memory output = abi.encode(bool(isLossEvent)); - - // trigger inherited response handling - _respond(requestId, output); - } - - // dummy implementation - // "real" oracles will get the output from some off-chain - // component providing the outcome of the business logic - function _oracleCalculation(uint256 counter) internal returns (bool isLossEvent) { - isLossEvent = (counter % 2 == 1); - } +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.2; + +import "@etherisc/gif-interface/contracts/components/Oracle.sol"; + +contract TestOracle is Oracle { + + /** + * @dev Constructor function for creating an Oracle contract. + * @param oracleName The name of the Oracle contract. + * @param registry The address of the registry contract. + */ + constructor( + bytes32 oracleName, + address registry + ) + Oracle(oracleName, registry) + { } + + /** + * @dev Requests data from the oracle contract. + * @param requestId The unique identifier of the request. + * @param input The input data to be decoded by the oracle. + * It is a tuple containing a uint256 counter and a bool immediateResponse. + * + * This function decodes the input data and calls the _oracleCalculation function + * to obtain data from the oracle given the request data (counter). + * If immediateResponse is true, the function responds with the result obtained from the oracle. + * Otherwise, the response is handled outside the function in a separate asynchronous transaction. + * The response is sent back to the contract through the respond function. + */ + function request(uint256 requestId, bytes calldata input) external override onlyQuery { + // decode oracle input data + (uint256 counter, bool immediateResponse) = abi.decode(input, (uint256, bool)); + + if (immediateResponse) { + // obtain data from oracle given the request data (counter) + // for off chain oracles this happens outside the request + // call in a separate asynchronous transaction + bool isLossEvent = _oracleCalculation(counter); + respond(requestId, isLossEvent); + } + } + + /** + * @dev Cancels a Chainlink request. + * @param requestId The ID of the Chainlink request to be cancelled. + */ + function cancel(uint256 requestId) + external override + onlyOwner + { + // TODO mid/low priority + // cancelChainlinkRequest(_requestId, _payment, _callbackFunctionId, _expiration); + } + + // usually called by off-chain oracle (and not internally) + // in which case the function modifier should be changed + // to external + /** + * @dev Responds to an oracle request with a boolean value indicating whether a loss event occurred. + * @param requestId The ID of the oracle request being responded to. + * @param isLossEvent A boolean value indicating whether a loss event occurred. + */ + function respond(uint256 requestId, bool isLossEvent) + public + { + // encode data obtained from oracle + bytes memory output = abi.encode(bool(isLossEvent)); + + // trigger inherited response handling + _respond(requestId, output); + } + + // dummy implementation + // "real" oracles will get the output from some off-chain + // component providing the outcome of the business logic + /** + * @dev Performs an oracle calculation to determine if a loss event occurred. + * @param counter The counter value used in the calculation. + * @return isLossEvent A boolean indicating if a loss event occurred. + */ + function _oracleCalculation(uint256 counter) internal returns (bool isLossEvent) { + isLossEvent = (counter % 2 == 1); + } } \ No newline at end of file diff --git a/contracts/test/TestProduct.sol b/contracts/test/TestProduct.sol index c020bea8..d3acf0f9 100644 --- a/contracts/test/TestProduct.sol +++ b/contracts/test/TestProduct.sol @@ -1,362 +1,535 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity 0.8.2; - -import "@etherisc/gif-interface/contracts/modules/IPolicy.sol"; -import "@etherisc/gif-interface/contracts/services/IProductService.sol"; -import "@etherisc/gif-interface/contracts/services/IInstanceService.sol"; -import "@etherisc/gif-interface/contracts/components/Product.sol"; - -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; - -contract TestProduct is - Product -{ - bytes32 public constant POLICY_FLOW = "PolicyDefaultFlow"; - string public constant ORACLE_CALLBACK_METHOD_NAME = "oracleCallback"; - - address private _capitalOwner; - uint256 private _testOracleId; - uint256 private _testRiskpoolId; - - bytes32 [] private _applications; - bytes32 [] private _policies; - uint256 private _claims; - - mapping(bytes32 => uint256) private _policyIdToClaimId; - mapping(bytes32 => uint256) private _policyIdToPayoutId; - - event LogTestProductFundingReceived(address sender, uint256 amount); - event LogTestOracleCallbackReceived(uint256 requestId, bytes32 policyId, bytes response); - - constructor( - bytes32 productName, - address tokenAddress, - address capitalOwner, - uint256 oracleId, - uint256 riskpoolId, - address registryAddress - ) - Product(productName, tokenAddress, POLICY_FLOW, riskpoolId, registryAddress) - { - require(tokenAddress != address(0), "ERROR:TI-2:TOKEN_ADDRESS_ZERO"); - _capitalOwner = capitalOwner; - _testOracleId = oracleId; - _testRiskpoolId = riskpoolId; - } - - function applyForPolicy( - uint256 premium, - uint256 sumInsured, - bytes calldata metaData, - bytes calldata applicationData - ) - external - payable - returns (bytes32 processId) - { - address payable policyHolder = payable(_msgSender()); - - processId = _newApplication( - policyHolder, - premium, - sumInsured, - metaData, - applicationData); - - _applications.push(processId); - - bool success = _underwrite(processId); - if (success) { - _policies.push(processId); - } - } - - function applyForPolicy( - address payable policyHolder, - uint256 premium, - uint256 sumInsured, - bytes calldata metaData, - bytes calldata applicationData - ) - external - payable - returns (bytes32 processId) - { - processId = _newApplication( - policyHolder, - premium, - sumInsured, - metaData, - applicationData); - - _applications.push(processId); - - bool success = _underwrite(processId); - if (success) { - _policies.push(processId); - } - } - - - function newAppliation( - uint256 premium, - uint256 sumInsured, - bytes calldata metaData, - bytes calldata applicationData - ) - external - payable - returns (bytes32 processId) - { - address payable policyHolder = payable(_msgSender()); - - processId = _newApplication( - policyHolder, - premium, - sumInsured, - metaData, - applicationData); - - _applications.push(processId); - } - - - function revoke(bytes32 processId) external onlyPolicyHolder(processId) { - _revoke(processId); - } - - function decline(bytes32 processId) external onlyOwner { - _decline(processId); - } - - function underwrite(bytes32 processId) external onlyOwner { - bool success = _underwrite(processId); - if (success) { - _policies.push(processId); - } - } - - function collectPremium(bytes32 policyId) - external onlyOwner - returns(bool success, uint256 fee, uint256 netPremium) - { - (success, fee, netPremium) = _collectPremium(policyId); - } - - function collectPremium(bytes32 policyId, uint256 amount) - external onlyOwner - returns(bool success, uint256 fee, uint256 netPremium) - { - (success, fee, netPremium) = _collectPremium(policyId, amount); - } - - function adjustPremiumSumInsured( - bytes32 processId, - uint256 expectedPremiumAmount, - uint256 sumInsuredAmount - ) - external - { - _adjustPremiumSumInsured(processId, expectedPremiumAmount, sumInsuredAmount); - } - - function expire(bytes32 policyId) external onlyOwner { - _expire(policyId); - } - - function close(bytes32 policyId) external onlyOwner { - _close(policyId); - } - - function submitClaim(bytes32 policyId, uint256 claimAmount) - external - onlyPolicyHolder(policyId) - returns(uint256 claimId) - { - - // increase claims counter - // the oracle business logic will use this counter value - // to determine if the claim is linked to a loss event or not - _claims++; - - // claim application - claimId = _newClaim(policyId, claimAmount, ""); - _policyIdToClaimId[policyId] = claimId; - - // Request response to greeting via oracle call - bool immediateResponse = true; - bytes memory queryData = abi.encode(_claims, immediateResponse); - _request( - policyId, - queryData, - ORACLE_CALLBACK_METHOD_NAME, - _testOracleId - ); - } - - function submitClaimNoOracle(bytes32 policyId, uint256 claimAmount) - external - onlyPolicyHolder(policyId) - returns(uint256 claimId) - { - - // increase claims counter - // the oracle business logic will use this counter value - // to determine if the claim is linked to a loss event or not - _claims++; - - // claim application - claimId = _newClaim(policyId, claimAmount, ""); - _policyIdToClaimId[policyId] = claimId; - } - - function submitClaimWithDeferredResponse(bytes32 policyId, uint256 claimAmount) - external - onlyPolicyHolder(policyId) - returns(uint256 claimId, uint256 requestId) - { - - // increase claims counter - // the oracle business logic will use this counter value - // to determine if the claim is linked to a loss event or not - _claims++; - - // claim application - claimId = _newClaim(policyId, claimAmount, ""); - _policyIdToClaimId[policyId] = claimId; - - // Request response to greeting via oracle call - bool immediateResponse = false; - bytes memory queryData = abi.encode(_claims, immediateResponse); - requestId = _request( - policyId, - queryData, - ORACLE_CALLBACK_METHOD_NAME, - _testOracleId - ); - } - - function confirmClaim( - bytes32 policyId, - uint256 claimId, - uint256 confirmedAmount - ) - external - onlyOwner - { - _confirmClaim(policyId, claimId, confirmedAmount); - } - - function declineClaim( - bytes32 policyId, - uint256 claimId - ) - external - onlyOwner - { - _declineClaim(policyId, claimId); - } - - function closeClaim( - bytes32 policyId, - uint256 claimId - ) - external - onlyOwner - { - _closeClaim(policyId, claimId); - } - - function createPayout( - bytes32 policyId, - uint256 claimId, - uint256 payoutAmount - ) - external - onlyOwner - returns(uint256 payoutId) - { - payoutId = _newPayout( - policyId, - claimId, - payoutAmount, - abi.encode(0)); - - _processPayout(policyId, payoutId); - } - - function newPayout( - bytes32 policyId, - uint256 claimId, - uint256 payoutAmount - ) - external - onlyOwner - returns(uint256 payoutId) - { - payoutId = _newPayout( - policyId, - claimId, - payoutAmount, - abi.encode(0)); - } - - function processPayout( - bytes32 policyId, - uint256 payoutId - ) - external - onlyOwner - { - _processPayout(policyId, payoutId); - } - - function oracleCallback( - uint256 requestId, - bytes32 policyId, - bytes calldata responseData - ) - external - onlyOracle - { - emit LogTestOracleCallbackReceived(requestId, policyId, responseData); - - // get oracle response data - (bool isLossEvent) = abi.decode(responseData, (bool)); - uint256 claimId = _policyIdToClaimId[policyId]; - - // claim handling if there is a loss - if (isLossEvent) { - // get policy and claims info for oracle response - _getApplication(policyId); - - IPolicy.Claim memory claim - = _getClaim(policyId, claimId); - - // specify payout data - uint256 confirmedAmount = claim.claimAmount; - _confirmClaim(policyId, claimId, confirmedAmount); - - // create payout record - uint256 payoutAmount = confirmedAmount; - bytes memory payoutData = abi.encode(0); - uint256 payoutId = _newPayout(policyId, claimId, payoutAmount, payoutData); - _policyIdToPayoutId[policyId] = payoutId; - - _processPayout(policyId, payoutId); - - // TODO refactor to payout using erc-20 token - // actual transfer of funds for payout of claim - // failing requires not visible when called via .call in querycontroller - // policyHolder.transfer(payoutAmount); - } else { - _declineClaim(policyId, claimId); - } - } - - function getClaimId(bytes32 policyId) external view returns (uint256) { return _policyIdToClaimId[policyId]; } - function getPayoutId(bytes32 policyId) external view returns (uint256) { return _policyIdToPayoutId[policyId]; } - function applications() external view returns (uint256) { return _applications.length; } - function policies() external view returns (uint256) { return _policies.length; } - function claims() external view returns (uint256) { return _claims; } +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.2; + +import "@etherisc/gif-interface/contracts/modules/IPolicy.sol"; +import "@etherisc/gif-interface/contracts/services/IProductService.sol"; +import "@etherisc/gif-interface/contracts/services/IInstanceService.sol"; +import "@etherisc/gif-interface/contracts/components/Product.sol"; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; + +contract TestProduct is + Product +{ + bytes32 public constant POLICY_FLOW = "PolicyDefaultFlow"; + string public constant ORACLE_CALLBACK_METHOD_NAME = "oracleCallback"; + + address private _capitalOwner; + uint256 private _testOracleId; + uint256 private _testRiskpoolId; + + bytes32 [] private _applications; + bytes32 [] private _policies; + uint256 private _claims; + + mapping(bytes32 => uint256) private _policyIdToClaimId; + mapping(bytes32 => uint256) private _policyIdToPayoutId; + + event LogTestProductFundingReceived(address sender, uint256 amount); + event LogTestOracleCallbackReceived(uint256 requestId, bytes32 policyId, bytes response); + + /** + * @dev Constructor function for creating a new instance of the Product contract. + * @param productName The name of the product. + * @param tokenAddress The address of the token used for the product. + * @param capitalOwner The address of the capital owner. + * @param oracleId The ID of the oracle used for the product. + * @param riskpoolId The ID of the riskpool used for the product. + * @param registryAddress The address of the registry contract. + */ + constructor( + bytes32 productName, + address tokenAddress, + address capitalOwner, + uint256 oracleId, + uint256 riskpoolId, + address registryAddress + ) + Product(productName, tokenAddress, POLICY_FLOW, riskpoolId, registryAddress) + { + require(tokenAddress != address(0), "ERROR:TI-2:TOKEN_ADDRESS_ZERO"); + _capitalOwner = capitalOwner; + _testOracleId = oracleId; + _testRiskpoolId = riskpoolId; + } + + /** + * @dev Allows a policy holder to apply for a new insurance policy by submitting an application with the specified premium, sum insured, metadata and application data. + * @param premium The amount of premium to be paid by the policy holder. + * @param sumInsured The sum insured for the new policy. + * @param metaData Additional metadata associated with the application. + * @param applicationData Additional application data. + * @return processId The unique identifier of the new policy application process. + */ + function applyForPolicy( + uint256 premium, + uint256 sumInsured, + bytes calldata metaData, + bytes calldata applicationData + ) + external + payable + returns (bytes32 processId) + { + address payable policyHolder = payable(_msgSender()); + + processId = _newApplication( + policyHolder, + premium, + sumInsured, + metaData, + applicationData); + + _applications.push(processId); + + bool success = _underwrite(processId); + if (success) { + _policies.push(processId); + } + } + + /** + * @dev Creates a new insurance application and underwrites it if possible. + * @param policyHolder The address of the policy holder. + * @param premium The amount of premium paid by the policy holder. + * @param sumInsured The amount of coverage requested by the policy holder. + * @param metaData Additional metadata associated with the application. + * @param applicationData The application data submitted by the policy holder. + * @return processId The identifier of the new insurance application. + */ + function applyForPolicy( + address payable policyHolder, + uint256 premium, + uint256 sumInsured, + bytes calldata metaData, + bytes calldata applicationData + ) + external + payable + returns (bytes32 processId) + { + processId = _newApplication( + policyHolder, + premium, + sumInsured, + metaData, + applicationData); + + _applications.push(processId); + + bool success = _underwrite(processId); + if (success) { + _policies.push(processId); + } + } + + + /** + * @dev Creates a new insurance application. + * @param premium The amount of premium to be paid for the insurance policy. + * @param sumInsured The amount of coverage for the insurance policy. + * @param metaData Metadata to be associated with the application. + * @param applicationData Additional data related to the application. + * @return processId The unique identifier for the new application process. + */ + function newAppliation( + uint256 premium, + uint256 sumInsured, + bytes calldata metaData, + bytes calldata applicationData + ) + external + payable + returns (bytes32 processId) + { + address payable policyHolder = payable(_msgSender()); + + processId = _newApplication( + policyHolder, + premium, + sumInsured, + metaData, + applicationData); + + _applications.push(processId); + } + + + /** + * @dev Revokes a process identified by its processId. Only the policy holder can revoke a process. + * @param processId The unique identifier of the process to be revoked. + */ + function revoke(bytes32 processId) external onlyPolicyHolder(processId) { + _revoke(processId); + } + + /** + * @dev Declines a specific process by its ID. + * @param processId The ID of the process to be declined. + */ + function decline(bytes32 processId) external onlyOwner { + _decline(processId); + } + + /** + * @dev Underwrites a policy for a given process ID. + * @param processId The ID of the process to underwrite a policy for. + */ + function underwrite(bytes32 processId) external onlyOwner { + bool success = _underwrite(processId); + if (success) { + _policies.push(processId); + } + } + + /** + * @dev Collects the premium for a specific policy. + * @param policyId The ID of the policy for which the premium will be collected. + * @return success A boolean indicating whether the premium collection was successful. + * @return fee The amount of fee collected by the insurer. + * @return netPremium The net amount of premium collected by the insurer after deducting the fee. + */ + function collectPremium(bytes32 policyId) + external onlyOwner + returns(bool success, uint256 fee, uint256 netPremium) + { + (success, fee, netPremium) = _collectPremium(policyId); + } + + /** + * @dev Collects the premium for a specific policy. + * @param policyId The unique identifier of the policy. + * @param amount The amount of the premium to be collected. + * @return success A boolean indicating whether the premium collection was successful. + * @return fee The fee charged for collecting the premium. + * @return netPremium The net amount of premium collected after deducting the fee. + */ + function collectPremium(bytes32 policyId, uint256 amount) + external onlyOwner + returns(bool success, uint256 fee, uint256 netPremium) + { + (success, fee, netPremium) = _collectPremium(policyId, amount); + } + + /** + * @dev Adjusts the premium and sum insured amounts for a given process ID. + * @param processId The ID of the process to adjust. + * @param expectedPremiumAmount The expected premium amount for the process. + * @param sumInsuredAmount The sum insured amount for the process. + */ + function adjustPremiumSumInsured( + bytes32 processId, + uint256 expectedPremiumAmount, + uint256 sumInsuredAmount + ) + external + { + _adjustPremiumSumInsured(processId, expectedPremiumAmount, sumInsuredAmount); + } + + /** + * @dev Expire a policy by its ID. + * @param policyId The ID of the policy to expire. + */ + function expire(bytes32 policyId) external onlyOwner { + _expire(policyId); + } + + /** + * @dev Closes a policy with the given ID. + * @param policyId The ID of the policy to be closed. + */ + function close(bytes32 policyId) external onlyOwner { + _close(policyId); + } + + /** + * @dev Allows a policy holder to submit a claim for a specific policy. + * @param policyId The ID of the policy for which the claim is being submitted. + * @param claimAmount The amount of the claim being submitted. + * @return claimId The ID of the submitted claim. + * + * Increases the claims counter and creates a new claim application. + * The oracle business logic will use the claims counter value to determine if the claim is linked to a loss event or not. + * The function also requests a response to the greeting via oracle call. + */ + function submitClaim(bytes32 policyId, uint256 claimAmount) + external + onlyPolicyHolder(policyId) + returns(uint256 claimId) + { + + // increase claims counter + // the oracle business logic will use this counter value + // to determine if the claim is linked to a loss event or not + _claims++; + + // claim application + claimId = _newClaim(policyId, claimAmount, ""); + _policyIdToClaimId[policyId] = claimId; + + // Request response to greeting via oracle call + bool immediateResponse = true; + bytes memory queryData = abi.encode(_claims, immediateResponse); + _request( + policyId, + queryData, + ORACLE_CALLBACK_METHOD_NAME, + _testOracleId + ); + } + + /** + * @dev Allows a policy holder to submit a claim without the need for an oracle. + * @param policyId The ID of the policy for which the claim is being submitted. + * @param claimAmount The amount being claimed by the policy holder. + * @return claimId The ID of the claim created. + */ + function submitClaimNoOracle(bytes32 policyId, uint256 claimAmount) + external + onlyPolicyHolder(policyId) + returns(uint256 claimId) + { + + // increase claims counter + // the oracle business logic will use this counter value + // to determine if the claim is linked to a loss event or not + _claims++; + + // claim application + claimId = _newClaim(policyId, claimAmount, ""); + _policyIdToClaimId[policyId] = claimId; + } + + /** + * @dev Submits a claim for a specific policy with a deferred response from the oracle. + * Increases the claims counter and creates a new claim application. + * Then, requests a response from the oracle via an external call with encoded query data. + * @param policyId The ID of the policy the claim is being made against. + * @param claimAmount The amount of the claim being made. + * @return claimId The ID of the newly created claim. + * @return requestId The ID of the oracle request made to retrieve the response. + */ + function submitClaimWithDeferredResponse(bytes32 policyId, uint256 claimAmount) + external + onlyPolicyHolder(policyId) + returns(uint256 claimId, uint256 requestId) + { + + // increase claims counter + // the oracle business logic will use this counter value + // to determine if the claim is linked to a loss event or not + _claims++; + + // claim application + claimId = _newClaim(policyId, claimAmount, ""); + _policyIdToClaimId[policyId] = claimId; + + // Request response to greeting via oracle call + bool immediateResponse = false; + bytes memory queryData = abi.encode(_claims, immediateResponse); + requestId = _request( + policyId, + queryData, + ORACLE_CALLBACK_METHOD_NAME, + _testOracleId + ); + } + + /** + * @dev Confirms the amount to be paid out for a specific claim. + * @param policyId The ID of the policy the claim belongs to. + * @param claimId The ID of the claim to be confirmed. + * @param confirmedAmount The amount to be paid out for the claim. + */ + function confirmClaim( + bytes32 policyId, + uint256 claimId, + uint256 confirmedAmount + ) + external + onlyOwner + { + _confirmClaim(policyId, claimId, confirmedAmount); + } + + /** + * @dev Allows the owner of the contract to decline a claim. + * @param policyId The ID of the policy related to the claim. + * @param claimId The ID of the claim to be declined. + */ + function declineClaim( + bytes32 policyId, + uint256 claimId + ) + external + onlyOwner + { + _declineClaim(policyId, claimId); + } + + /** + * @dev Closes a specific claim for a given policy. + * @param policyId The ID of the policy the claim belongs to. + * @param claimId The ID of the claim to be closed. + */ + function closeClaim( + bytes32 policyId, + uint256 claimId + ) + external + onlyOwner + { + _closeClaim(policyId, claimId); + } + + /** + * @dev Creates a new payout for a specific policy and claim. + * @param policyId The ID of the policy associated with the payout. + * @param claimId The ID of the claim associated with the payout. + * @param payoutAmount The amount of the payout to be created. + * @return payoutId The ID of the newly created payout. + */ + function createPayout( + bytes32 policyId, + uint256 claimId, + uint256 payoutAmount + ) + external + onlyOwner + returns(uint256 payoutId) + { + payoutId = _newPayout( + policyId, + claimId, + payoutAmount, + abi.encode(0)); + + _processPayout(policyId, payoutId); + } + + /** + * @dev Creates a new payout for a claim under a policy. + * @param policyId The ID of the policy. + * @param claimId The ID of the claim. + * @param payoutAmount The amount to be paid out for the claim. + * @return payoutId The ID of the newly created payout. + */ + function newPayout( + bytes32 policyId, + uint256 claimId, + uint256 payoutAmount + ) + external + onlyOwner + returns(uint256 payoutId) + { + payoutId = _newPayout( + policyId, + claimId, + payoutAmount, + abi.encode(0)); + } + + /** + * @dev Processes a payout for a specific policy. + * @param policyId The ID of the policy to process the payout for. + * @param payoutId The ID of the payout to process. + */ + function processPayout( + bytes32 policyId, + uint256 payoutId + ) + external + onlyOwner + { + _processPayout(policyId, payoutId); + } + + /** + * @dev This function is called by the oracle to provide the response data for a specified policy ID and request ID. + * @param requestId The ID of the request made by the oracle. + * @param policyId The ID of the policy associated with the oracle request. + * @param responseData The response data provided by the oracle. + * + * Emits a LogTestOracleCallbackReceived event with the provided request ID, policy ID, and response data. + * + * Decodes the response data to obtain the isLossEvent boolean value and the claim ID associated with the policy ID. + * + * If the event is a loss event, retrieves the policy and claim information, confirms the claim, creates a payout record, and processes the payout. + * + * If the event is not a loss event, declines the claim. + * @notice This function emits 1 events: + * - LogTestOracleCallbackReceived + */ + function oracleCallback( + uint256 requestId, + bytes32 policyId, + bytes calldata responseData + ) + external + onlyOracle + { + emit LogTestOracleCallbackReceived(requestId, policyId, responseData); + + // get oracle response data + (bool isLossEvent) = abi.decode(responseData, (bool)); + uint256 claimId = _policyIdToClaimId[policyId]; + + // claim handling if there is a loss + if (isLossEvent) { + // get policy and claims info for oracle response + _getApplication(policyId); + + IPolicy.Claim memory claim + = _getClaim(policyId, claimId); + + // specify payout data + uint256 confirmedAmount = claim.claimAmount; + _confirmClaim(policyId, claimId, confirmedAmount); + + // create payout record + uint256 payoutAmount = confirmedAmount; + bytes memory payoutData = abi.encode(0); + uint256 payoutId = _newPayout(policyId, claimId, payoutAmount, payoutData); + _policyIdToPayoutId[policyId] = payoutId; + + _processPayout(policyId, payoutId); + + // TODO refactor to payout using erc-20 token + // actual transfer of funds for payout of claim + // failing requires not visible when called via .call in querycontroller + // policyHolder.transfer(payoutAmount); + } else { + _declineClaim(policyId, claimId); + } + } + + /** + * @dev Returns the claim ID associated with a given policy ID. + * @param policyId The policy ID for which the claim ID is requested. + * @return The claim ID associated with the given policy ID. + */ + function getClaimId(bytes32 policyId) external view returns (uint256) { return _policyIdToClaimId[policyId]; } + /** + * @dev Returns the payout ID associated with a given policy ID. + * @param policyId The ID of the policy. + * @return The payout ID associated with the given policy ID. + */ + function getPayoutId(bytes32 policyId) external view returns (uint256) { return _policyIdToPayoutId[policyId]; } + /** + * @dev Returns the number of applications that have been submitted. + * @return The number of applications as a uint256 value. + */ + function applications() external view returns (uint256) { return _applications.length; } + /** + * @dev Returns the number of policies in the _policies array. + * @return The length of the _policies array. + */ + function policies() external view returns (uint256) { return _policies.length; } + /** + * @dev Returns the number of claims made by users. + * @return _claims The total number of claims made by users. + */ + function claims() external view returns (uint256) { return _claims; } } \ No newline at end of file diff --git a/contracts/test/TestRegistryCompromisedController.sol b/contracts/test/TestRegistryCompromisedController.sol index 2587773c..9f5168ec 100644 --- a/contracts/test/TestRegistryCompromisedController.sol +++ b/contracts/test/TestRegistryCompromisedController.sol @@ -1,28 +1,38 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity 0.8.2; - -contract TestRegistryCompromisedController { - - bytes32 public constant POLICY = bytes32("Policy"); - bytes32 public constant QUERY = bytes32("Query"); - - mapping(bytes32 => address) public contracts; - - function getContract(bytes32 contractName) - external - view - returns (address moduleAddress) - { - moduleAddress = contracts[contractName]; - } - - function upgradeToV2( - address compromisedPolicyModuleAddress, - address originalQueryModuleAddress - ) - public - { - contracts[POLICY] = compromisedPolicyModuleAddress; - contracts[QUERY] = originalQueryModuleAddress; - } -} +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.2; + +contract TestRegistryCompromisedController { + + bytes32 public constant POLICY = bytes32("Policy"); + bytes32 public constant QUERY = bytes32("Query"); + + mapping(bytes32 => address) public contracts; + + /** + * @dev Returns the address of a registered contract. + * @param contractName The name of the contract to retrieve. + * @return moduleAddress The address of the requested contract. + */ + function getContract(bytes32 contractName) + external + view + returns (address moduleAddress) + { + moduleAddress = contracts[contractName]; + } + + /** + * @dev Upgrades the Policy Manager contract to version 2. + * @param compromisedPolicyModuleAddress The new address of the compromised policy module. + * @param originalQueryModuleAddress The new address of the original query module. + */ + function upgradeToV2( + address compromisedPolicyModuleAddress, + address originalQueryModuleAddress + ) + public + { + contracts[POLICY] = compromisedPolicyModuleAddress; + contracts[QUERY] = originalQueryModuleAddress; + } +} diff --git a/contracts/test/TestRegistryControllerUpdated.sol b/contracts/test/TestRegistryControllerUpdated.sol index c194d4b1..1a897c94 100644 --- a/contracts/test/TestRegistryControllerUpdated.sol +++ b/contracts/test/TestRegistryControllerUpdated.sol @@ -1,21 +1,33 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity 0.8.2; - -import "../modules/RegistryController.sol"; - - -contract TestRegistryControllerUpdated is RegistryController { - - string message; - bool upgradeV2; - - function setMessage(string memory _message) public onlyInstanceOperator { message = _message; } - function getMessage() public view returns (string memory) { return message; } - - function upgradeToV2(string memory _message) public { - require(!upgradeV2, "ERROR:REC-102:UPGRADE_ONCE_OMLY"); - upgradeV2 = true; - - setMessage(_message); - } -} +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.2; + +import "../modules/RegistryController.sol"; + + +contract TestRegistryControllerUpdated is RegistryController { + + string message; + bool upgradeV2; + + /** + * @dev Sets the message variable to a given string. + * @param _message The string to be set as the message. + */ + function setMessage(string memory _message) public onlyInstanceOperator { message = _message; } + /** + * @dev Returns the current message stored in the contract. + * @return message The current message stored in the contract. + */ + function getMessage() public view returns (string memory) { return message; } + + /** + * @dev Upgrades the contract to version 2. + * @param _message The message to set for the upgraded contract. + */ + function upgradeToV2(string memory _message) public { + require(!upgradeV2, "ERROR:REC-102:UPGRADE_ONCE_OMLY"); + upgradeV2 = true; + + setMessage(_message); + } +} diff --git a/contracts/test/TestRiskpool.sol b/contracts/test/TestRiskpool.sol index 26acd259..3c88f9d8 100644 --- a/contracts/test/TestRiskpool.sol +++ b/contracts/test/TestRiskpool.sol @@ -1,34 +1,48 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity 0.8.2; - -import "@etherisc/gif-interface/contracts/components/BasicRiskpool.sol"; -import "@etherisc/gif-interface/contracts/modules/IBundle.sol"; -import "@etherisc/gif-interface/contracts/modules/IPolicy.sol"; - -contract TestRiskpool is BasicRiskpool { - - uint256 public constant SUM_OF_SUM_INSURED_CAP = 10**24; - - constructor( - bytes32 name, - uint256 collateralization, - address erc20Token, - address wallet, - address registry - ) - BasicRiskpool(name, collateralization, SUM_OF_SUM_INSURED_CAP, erc20Token, wallet, registry) - { } - - // trivial implementation that matches every application - function bundleMatchesApplication( - IBundle.Bundle memory bundle, - IPolicy.Application memory application - ) - public override - pure - returns(bool isMatching) - { - isMatching = true; - } - +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.2; + +import "@etherisc/gif-interface/contracts/components/BasicRiskpool.sol"; +import "@etherisc/gif-interface/contracts/modules/IBundle.sol"; +import "@etherisc/gif-interface/contracts/modules/IPolicy.sol"; + +contract TestRiskpool is BasicRiskpool { + + uint256 public constant SUM_OF_SUM_INSURED_CAP = 10**24; + + /** + * @dev Constructor function for the Riskpool contract. + * @param name The name of the Riskpool. + * @param collateralization The collateralization ratio for the Riskpool. + * @param erc20Token The address of the ERC20 token used for collateral. + * @param wallet The address of the wallet that holds the collateral. + * @param registry The address of the registry contract. + */ + constructor( + bytes32 name, + uint256 collateralization, + address erc20Token, + address wallet, + address registry + ) + BasicRiskpool(name, collateralization, SUM_OF_SUM_INSURED_CAP, erc20Token, wallet, registry) + { } + + // trivial implementation that matches every application + /** + * @dev This function checks if a given bundle matches a given application. + * @param bundle The bundle to check. + * @param application The application to check against. + * @return isMatching A boolean indicating whether the bundle matches the application. + */ + function bundleMatchesApplication( + IBundle.Bundle memory bundle, + IPolicy.Application memory application + ) + public override + pure + returns(bool isMatching) + { + isMatching = true; + } + } \ No newline at end of file diff --git a/contracts/test/TestTransferFrom.sol b/contracts/test/TestTransferFrom.sol index 28b6dbcc..da135fcf 100644 --- a/contracts/test/TestTransferFrom.sol +++ b/contracts/test/TestTransferFrom.sol @@ -1,26 +1,34 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity 0.8.2; - -import "../shared/TransferHelper.sol"; - -import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; - -contract TestTransferFrom { - - event LogTransferHelperInputValidation1Failed(bool tokenIsContract, address from, address to); - event LogTransferHelperInputValidation2Failed(uint256 balance, uint256 allowance); - event LogTransferHelperCallFailed(bool callSuccess, uint256 returnDataLength, bytes returnData); - - function unifiedTransferFrom( - IERC20 token, - address from, - address to, - uint256 amount - ) - external - returns(bool) - { - return TransferHelper.unifiedTransferFrom(token, from, to, amount); - } - -} +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.2; + +import "../shared/TransferHelper.sol"; + +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +contract TestTransferFrom { + + event LogTransferHelperInputValidation1Failed(bool tokenIsContract, address from, address to); + event LogTransferHelperInputValidation2Failed(uint256 balance, uint256 allowance); + event LogTransferHelperCallFailed(bool callSuccess, uint256 returnDataLength, bytes returnData); + + /** + * @dev Transfers tokens from a specified address to another specified address using the TransferHelper library. + * @param token The address of the ERC20 token to transfer. + * @param from The address from which to transfer tokens. + * @param to The address to which to transfer tokens. + * @param amount The amount of tokens to transfer. + * @return Returns a boolean indicating whether the transfer was successful or not. + */ + function unifiedTransferFrom( + IERC20 token, + address from, + address to, + uint256 amount + ) + external + returns(bool) + { + return TransferHelper.unifiedTransferFrom(token, from, to, amount); + } + +} diff --git a/contracts/tokens/BundleToken.sol b/contracts/tokens/BundleToken.sol index 3e0283a9..1798089e 100644 --- a/contracts/tokens/BundleToken.sol +++ b/contracts/tokens/BundleToken.sol @@ -24,8 +24,21 @@ contract BundleToken is _; } + /** + * @dev Constructor function for the ERC721 token contract. It sets the name and symbol of the token and initializes the Ownable contract. + */ constructor() ERC721(NAME, SYMBOL) Ownable() { } + /** + * @dev Sets the bundle module address. + * @param bundleModule The address of the bundle module to be set. + * + * Emits a {BundleModuleSet} event. + * + * Requirements: + * - The bundle module address must not have already been set. + * - The bundle module address must not be the zero address. + */ function setBundleModule(address bundleModule) external { @@ -35,6 +48,14 @@ contract BundleToken is } + /** + * @dev Mints a new bundle token and assigns ownership to the specified address. + * @param bundleId The ID of the bundle to which the token belongs. + * @param to The address that will receive ownership of the newly minted token. + * @return tokenId The ID of the newly minted token. + * @notice This function emits 1 events: + * - LogBundleTokenMinted + */ function mint(uint256 bundleId, address to) external onlyBundleModule @@ -50,6 +71,12 @@ contract BundleToken is } + /** + * @dev Burns a bundle token. + * @param tokenId The ID of the token to be burned. + * @notice This function emits 1 events: + * - LogBundleTokenBurned + */ function burn(uint256 tokenId) external onlyBundleModule @@ -60,6 +87,11 @@ contract BundleToken is emit LogBundleTokenBurned(bundleIdForTokenId[tokenId], tokenId); } + /** + * @dev Checks if a token has been burned. + * @param tokenId The ID of the token to check. + * @return isBurned Returns true if the token has been burned, false otherwise. + */ function burned(uint tokenId) external override view @@ -68,9 +100,27 @@ contract BundleToken is isBurned = tokenId <= _totalSupply && !_exists(tokenId); } + /** + * @dev Returns the bundle ID associated with a given token ID. + * @param tokenId The ID of the token to query. + * @return The bundle ID associated with the given token ID. + */ function getBundleId(uint256 tokenId) external override view returns(uint256) { return bundleIdForTokenId[tokenId]; } + /** + * @dev Returns the address of the bundle module. + * @return _bundleModule The address of the bundle module. + */ function getBundleModuleAddress() external view returns(address) { return _bundleModule; } + /** + * @dev Checks if a given token ID exists. + * @param tokenId The ID of the token to check. + * @return A boolean indicating whether the token exists or not. + */ function exists(uint256 tokenId) external override view returns(bool) { return tokenId <= _totalSupply; } + /** + * @dev Returns the total number of tokens in circulation. + * @return tokenCount The total number of tokens in circulation. + */ function totalSupply() external override view returns(uint256 tokenCount) { return _totalSupply; } } diff --git a/contracts/tokens/README.adoc b/contracts/tokens/README.adoc new file mode 100644 index 00000000..16591ee8 --- /dev/null +++ b/contracts/tokens/README.adoc @@ -0,0 +1,10 @@ += Tokens + +[.readme-notice] +NOTE: This document is better viewed at https://docs.etherisc.com/contracts/api/tokens + +== Contracts + +{{BundleToken}} + +{{RiskpoolToken}} \ No newline at end of file diff --git a/contracts/tokens/RiskpoolToken.sol b/contracts/tokens/RiskpoolToken.sol index c3ebde2d..e7b7a11e 100644 --- a/contracts/tokens/RiskpoolToken.sol +++ b/contracts/tokens/RiskpoolToken.sol @@ -9,6 +9,9 @@ contract RiskpoolToken is string public constant NAME = "GIF Riskpool Token"; string public constant SYMBOL = "RPT"; + /** + * @dev Constructor function that sets the name and symbol of the ERC20 token. + */ constructor() ERC20(NAME, SYMBOL) { diff --git a/docs/antora.yml b/docs/antora.yml new file mode 100644 index 00000000..3c6dbe13 --- /dev/null +++ b/docs/antora.yml @@ -0,0 +1,6 @@ +name: contracts +title: Contracts +version: 2.x +nav: + - modules/ROOT/nav.adoc + - modules/api/nav.adoc diff --git a/docs/config.js b/docs/config.js new file mode 100644 index 00000000..fbea3e2d --- /dev/null +++ b/docs/config.js @@ -0,0 +1,22 @@ +const path = require('path'); +const fs = require('fs'); + +/** @type import('solidity-docgen/dist/config').UserConfig */ +module.exports = { + outputDir: 'docs/modules/api/pages', + templates: 'docs/templates', + exclude: ['mocks'], + pageExtension: '.adoc', + pages: (_, file, config) => { + // For each contract file, find the closest README.adoc and return its location as the output page path. + const sourcesDir = path.resolve(config.root, config.sourcesDir); + let dir = path.resolve(config.root, file.absolutePath); + while (dir.startsWith(sourcesDir)) { + dir = path.dirname(dir); + if (fs.existsSync(path.join(dir, 'README.adoc'))) { + const result = path.relative(sourcesDir, dir) + config.pageExtension; + return result; + } + } + }, +}; diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc new file mode 100644 index 00000000..6e115007 --- /dev/null +++ b/docs/modules/ROOT/nav.adoc @@ -0,0 +1,21 @@ +* xref:index.adoc[Overview] +//// +* xref:extending-contracts.adoc[Extending Contracts] +* xref:upgradeable.adoc[Using with Upgrades] + +* xref:releases-stability.adoc[Releases & Stability] + +* xref:access-control.adoc[Access Control] + +* xref:tokens.adoc[Tokens] +** xref:erc20.adoc[ERC20] +*** xref:erc20-supply.adoc[Creating Supply] +** xref:erc721.adoc[ERC721] +** xref:erc777.adoc[ERC777] +** xref:erc1155.adoc[ERC1155] + +* xref:gsn.adoc[Gas Station Network] +** xref:gsn-strategies.adoc[Strategies] + +* xref:utilities.adoc[Utilities] +//// \ No newline at end of file diff --git a/docs/modules/ROOT/pages/errorCodes.adoc b/docs/modules/ROOT/pages/errorCodes.adoc new file mode 100644 index 00000000..9172878a --- /dev/null +++ b/docs/modules/ROOT/pages/errorCodes.adoc @@ -0,0 +1,1289 @@ +// [.contract-item] +// [[AccessController-addRole-bytes32-]] +// ==== `[.contract-item-name]#++addRole++#++(bytes32 role)++` [.item-kind]#public# +// += Error Codes + +== Error Codes + +Test + +=== Test + +[.hljs-theme-light.nopadding] + +Test + +-- + + +[.contract-item] +==== `[.contract-item-name]#++ERROR:ACL-001:ADMIN_ROLE_ALREADY_SET++ `#x#x# +Contract: modules/AccessController.sol + +Thrown if you try to set the admin role twice. + +[.contract-item] +==== `[.contract-item-name]#+++ERROR:ACL-002:ROLE_UNKNOWN_OR_INVALID+++ `### +Contract: modules/AccessController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:ACL-003:ROLE_EXISTING_AND_VALID+++ `### +Contract: modules/AccessController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:ACL-004:ROLE_UNKNOWN_OR_INVALID+++ `### +Contract: modules/AccessController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:ACM-001:NOT_INSTANCE_OPERATOR+++ `### +Contract: shared/WithRegistry.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:ACM-004:NOT_ORACLE_SERVICE+++ `### +Contract: shared/WithRegistry.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:ACM-005:NOT_ORACLE_OWNER+++ `### +Contract: shared/WithRegistry.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:ACM-006:NOT_PRODUCT_OWNER+++ `### +Contract: shared/WithRegistry.sol + +Thrown if + + +==== `[.contract-item-name]#+++ERROR:BOC-074:INITIAL_STATE_NOT_HANDLED+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BTK-001:NOT_INITIALIZED+++ `### +Contract: tokens/BundleToken.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BTK-002:NOT_BUNDLE_MODULE+++ `### +Contract: tokens/BundleToken.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BTK-003:BUNDLE_MODULE_ALREADY_DEFINED+++ `### +Contract: tokens/BundleToken.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BTK-004:INVALID_BUNDLE_MODULE_ADDRESS+++ `### +Contract: tokens/BundleToken.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BTK-005:TOKEN_ID_INVALID+++ `### +Contract: tokens/BundleToken.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-001:NOT_RISKPOOL_SERVICE+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-002:BUNDLE_DOES_NOT_EXIST+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-003:BUNDLE_BURNED_OR_CLOSED+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-010:BUNDLE_ALREADY_EXISTS+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-011:BUNDLE_DOES_NOT_EXIST+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-012:BUNDLE_CLOSED+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-013:BUNDLE_DOES_NOT_EXIST+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-014:CAPACITY_OR_BALANCE_TOO_LOW+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-015:BUNDLE_WITH_ACTIVE_POLICIES+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-016:BUNDLE_NOT_CLOSED+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-017:BUNDLE_HAS_BALANCE+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-019:BUNDLE_NOT_IN_RISKPOOL+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-020:BUNDLE_DOES_NOT_EXIST+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-021:BUNDLE_NOT_ACTIVE+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-022:CAPACITY_TOO_LOW+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-023:INCREMENTAL_COLLATERALIZATION_NOT_IMPLEMENTED+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-031:BUNDLE_DOES_NOT_EXIST+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-041:NO_ACTIVE_POLICIES_FOR_BUNDLE+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-042:COLLATERAL_INSUFFICIENT_FOR_POLICY+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-043:BUNDLE_DOES_NOT_EXIST+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-044:BUNDLE_STATE_INVALID+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-045:CAPITAL_TOO_LOW+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-046:LOCKED_CAPITAL_TOO_LOW+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-047:BALANCE_TOO_LOW+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-051:BUNDLE_DOES_NOT_EXIST+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-052:NO_ACTIVE_POLICIES_FOR_BUNDLE+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-060:BUNDLE_DOES_NOT_EXIST+++ `### +Contract: modules/BundleController.sol + +Thrown if you ... and bundle doesn't exist + +==== `[.contract-item-name]#+++ERROR:BUC-070:ACTIVE_INVALID_TRANSITION+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-071:LOCKED_INVALID_TRANSITION+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-072:CLOSED_INVALID_TRANSITION+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:BUC-073:BURNED_IS_FINAL_STATE+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-001:NOT_COMPONENT_OWNER_SERVICE+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-002:NOT_INSTANCE_OPERATOR_SERVICE+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-003:COMPONENT_ALREADY_EXISTS+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-004:COMPONENT_NAME_ALREADY_EXISTS+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-005:INVALID_COMPONENT_ID+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-006:COMPONENT_ADDRESS_ZERO+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-007:COMPONENT_UNKNOWN+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-008:INVALID_COMPONENT_ID+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-010:COMPONENT_TYPE_UNKNOWN+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-011:UNKNOWN_PRODUCT_ID+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-020:SOURCE_AND_TARGET_STATE_IDENTICAL+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-021:CREATED_INVALID_TRANSITION+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-023:DECLINED_IS_FINAL_STATE+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-024:ACTIVE_INVALID_TRANSITION+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-025:PAUSED_INVALID_TRANSITION+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-026:SUSPENDED_INVALID_TRANSITION+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-027:INITIAL_STATE_NOT_HANDLED+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CCR-22:PROPOSED_INVALID_TRANSITION+++ `### +Contract: modules/ComponentController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:COS-001:NOT_OWNER+++ `### +Contract: services/ComponentOwnerService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:COS-002:REQUIRED_ROLE_MISSING+++ `### +Contract: services/ComponentOwnerService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:COS-003:COMPONENT_ID_INVALID+++ `### +Contract: services/ComponentOwnerService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:COS-004:NOT_OWNER+++ `### +Contract: services/ComponentOwnerService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:COS-005:REQUIRED_ROLE_MISSING+++ `### +Contract: services/ComponentOwnerService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:COS-006:IMPLEMENATION_MISSING+++ `### +Contract: services/ComponentOwnerService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:COS-007:IMPLEMENATION_MISSING+++ `### +Contract: services/ComponentOwnerService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CRC-001:NOT_INSTANCE_OPERATOR+++ `### +Contract: shared/CoreController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CRC-001:NOT_ORACLE_SERVICE+++ `### +Contract: modules/QueryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CRC-002:NOT_ON_STORAGE+++ `### +Contract: shared/CoreController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CRC-003:NOT_PRODUCT_SERVICE+++ `### +Contract: shared/CoreController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CRC-004:CONTRACT_NOT_REGISTERED+++ `### +Contract: shared/CoreController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:CRP-001:NOT_ADMIN+++ `### +Contract: shared/CoreProxy.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:IOS-001:NOT_INSTANCE_OPERATOR+++ `### +Contract: services/InstanceOperatorService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:IOS-010:IMPLEMENATION_MISSING+++ `### +Contract: services/InstanceOperatorService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:IOS-011:IMPLEMENATION_MISSING+++ `### +Contract: services/InstanceOperatorService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:IS-001:IMPLEMENATION_MISSING+++ `### +Contract: services/InstanceService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:IS-002:IMPLEMENATION_MISSING+++ `### +Contract: services/InstanceService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:LIC-001:COMPONENT_NOT_PRODUCT+++ `### +Contract: modules/LicenseController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:PFD-001:POLICY_NOT_ACTIVE+++ `### +Contract: flows/PolicyDefaultFlow.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:PFD-002:POLICY_NOT_EXPIRED+++ `### +Contract: flows/PolicyDefaultFlow.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:PFD-003:POLICY_CLOSED+++ `### +Contract: flows/PolicyDefaultFlow.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:PFD-004:PROCESSID_PRODUCT_MISMATCH+++ `### +Contract: flows/PolicyDefaultFlow.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:PFD-005:REQUESTID_PRODUCT_MISMATCH+++ `### +Contract: flows/PolicyDefaultFlow.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-004:METADATA_ALREADY_EXISTS+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-010:METADATA_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-011:APPLICATION_ALREADY_EXISTS+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-012:PREMIUM_AMOUNT_ZERO+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-013:SUM_INSURED_AMOUNT_TOO_SMALL+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-014:METADATA_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-015:APPLICATION_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-016:APPLICATION_STATE_INVALID+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-017:APPLICATION_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-018:APPLICATION_STATE_INVALID+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-019:METADATA_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-020:APPLICATION_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-021:APPLICATION_STATE_INVALID+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-022:APPLICATION_ACCESS_INVALID+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-023:POLICY_ALREADY_EXISTS+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-024:APPLICATION_ACCESS_INVALID+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-025:APPLICATION_PREMIUM_INVALID+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-026:APPLICATION_SUM_INSURED_INCREASE_INVALID+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-027:POLICY_ACCESS_INVALID+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-028:POLICY_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-029:APPLICATION_STATE_INVALID+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-030:METADATA_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-031:POLICY_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-032:POLICY_STATE_INVALID+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-033:POLICY_HAS_OPEN_CLAIMS+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-040:POLICY_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-041:POLICY_NOT_ACTIVE+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-042:CLAIM_AMOUNT_EXCEEDS_MAX_PAYOUT+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-043:CLAIM_ALREADY_EXISTS+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-050:POLICY_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-051:POLICY_WITHOUT_OPEN_CLAIMS+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-052:PAYOUT_MAX_AMOUNT_EXCEEDED+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-053:CLAIM_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-054:CLAIM_STATE_INVALID+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-060:POLICY_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-061:POLICY_WITHOUT_OPEN_CLAIMS+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-062:CLAIM_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-063:CLAIM_STATE_INVALID+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-070:POLICY_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-071:POLICY_WITHOUT_OPEN_CLAIMS+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-072:CLAIM_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-073:CLAIM_STATE_INVALID+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-074:CLAIM_WITH_UNPAID_PAYOUTS+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-080:POLICY_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-081:CLAIM_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-082:CLAIM_NOT_CONFIRMED+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-083:PAYOUT_AMOUNT_ZERO_INVALID+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-084:PAYOUT_AMOUNT_TOO_BIG+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-085:PAYOUT_ALREADY_EXISTS+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-090:POLICY_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-091:POLICY_WITHOUT_OPEN_CLAIMS+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-092:PAYOUT_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-093:PAYOUT_ALREADY_PAIDOUT+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-100:METADATA_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-101:APPLICATION_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-102:POLICY_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-103:CLAIM_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-104:PAYOUT_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-110:POLICY_DOES_NOT_EXIST+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POC-111:AMOUNT_TOO_BIG+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-001:INVALID_OWNER+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-001:NOT_INSTANCE_OPERATOR+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-002:INVALID_PRODUCT+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-002:NOT_RISKPOOL_SERVICE+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-003:PRODUCT_NOT_ACTIVE+++ `### +Contract: modules/PolicyController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-003:RISKPOOL_NOT_ACTIVE+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-004:RISKPOOL_NOT_ACTIVE+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-005:RISKPOOL_ALREADY_REGISTERED+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-006:WALLET_ADDRESS_ZERO+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-007:ERC20_ADDRESS_ZERO+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-008:COLLATERALIZATION_+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-009:SUM_OF_SUM_INSURED_CAP_ZERO+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-010:NOT_PRODUCT+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-011:NOT_RISKPOOL+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-012:RISKPOOL_ALREADY_SET+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-020:APPLICATION_STATE_INVALID+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-022:RISKPOOL_SUM_INSURED_CAP_EXCEEDED+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-025:POLICY_STATE_INVALID+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-026:RISKPOOL_ID_INVALID+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-027:CAPITAL_TOO_LOW+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-028:LOCKED_CAPITAL_TOO_LOW+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-029:BALANCE_TOO_LOW+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-030:POLICY_STATE_INVALID+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-032:MAX_NUMBER_OF_ACTIVE_BUNDLES_INVALID+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-040:POLICY_STATE_INVALID+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-040:RISKPOOL_NOT_REGISTERED+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-041:BUNDLE_IDX_TOO_LARGE+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-042:BUNDLE_ID_ALREADY_IN_SET+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-043:MAXIMUM_NUMBER_OF_ACTIVE_BUNDLES_REACHED+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-044:BUNDLE_ID_NOT_IN_SET+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-045:RISKPOOL_DOES_NOT_EXIST+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-046:COMPONENT_NOT_RISKPOOL+++ `### +Contract: modules/PoolController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:POL-050:POLICY_STATE_INVALID+++ `### +Contract: modules/BundleController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:PRS-001:NOT_AUTHORIZED+++ `### +Contract: services/ProductService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:PRS-002:POLICY_FLOW_NOT_RESOLVED+++ `### +Contract: services/ProductService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:QUC-002:REQUEST_ID_INVALID+++ `### +Contract: modules/QueryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:QUC-003:ORACLE_NOT_RESPONSIBLE+++ `### +Contract: modules/QueryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:QUC-010:CALLBACK_ADDRESS_IS_NOT_PRODUCT+++ `### +Contract: modules/QueryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:QUC-020:PRODUCT_CALLBACK_UNSUCCESSFUL+++ `### +Contract: modules/QueryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:QUC-030:REQUEST_ID_INVALID+++ `### +Contract: modules/QueryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:QUC-040:REQUEST_ID_INVALID+++ `### +Contract: modules/QueryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:QUC-041:COMPONENT_NOT_ORACLE+++ `### +Contract: modules/QueryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:QUC-042:ORACLE_NOT_ACTIVE+++ `### +Contract: modules/QueryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:REC-001:EMPTY_RELEASE+++ `### +Contract: modules/RegistryController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:REC-002:NEW_RELEASE_NOT_EMPTY+++ `### +Contract: modules/RegistryController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:REC-010:MAX_CONTRACTS_LIMIT+++ `### +Contract: modules/RegistryController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:REC-011:RELEASE_UNKNOWN+++ `### +Contract: modules/RegistryController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:REC-012:CONTRACT_NAME_EMPTY+++ `### +Contract: modules/RegistryController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:REC-013:CONTRACT_NAME_EXISTS+++ `### +Contract: modules/RegistryController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:REC-014:CONTRACT_ADDRESS_ZERO+++ `### +Contract: modules/RegistryController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:REC-015:CONTRACT_NUMBER_MISMATCH+++ `### +Contract: modules/RegistryController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:REC-020:CONTRACT_UNKNOWN+++ `### +Contract: modules/RegistryController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:REC-021:CONTRACT_NUMBER_MISMATCH+++ `### +Contract: modules/RegistryController.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:REC-102:UPGRADE_ONCE_OMLY+++ `### +Contract: test/TestRegistryControllerUpdated.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:RPS-001:SENDER_NOT_RISKPOOL+++ `### +Contract: services/RiskpoolService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:RPS-002:RISKPOOL_NOT_PROPOSED+++ `### +Contract: services/RiskpoolService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:RPS-003:SENDER_NOT_RISKPOOL+++ `### +Contract: services/RiskpoolService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:RPS-004:RISKPOOL_NOT_ACTIVE+++ `### +Contract: services/RiskpoolService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:RPS-005:SENDER_NOT_RISKPOOL+++ `### +Contract: services/RiskpoolService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:RPS-006:BUNDLE_RISKPOOL_MISMATCH+++ `### +Contract: services/RiskpoolService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:RPS-007:RISKPOOL_NOT_ACTIVE+++ `### +Contract: services/RiskpoolService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:RPS-008:SENDER_NOT_OWNING_RISKPOOL+++ `### +Contract: services/RiskpoolService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:RPS-009:RISKPOOL_NOT_ACTIVE+++ `### +Contract: services/RiskpoolService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:RPS-010:BUNDLE_CLOSED_OR_BURNED+++ `### +Contract: services/RiskpoolService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:RPS-011:BUNDLE_BURNED+++ `### +Contract: services/RiskpoolService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:RPS-013:UNEXPECTED_FEE_SUBTRACTION+++ `### +Contract: services/RiskpoolService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:RPS-020:BUNDLE_NOT_CLOSED+++ `### +Contract: services/RiskpoolService.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TCP-1:INVALID_POLICY_OR_HOLDER+++ `### +Contract: test/TestCompromisedProduct.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TI-2:TOKEN_ADDRESS_ZERO+++ `### +Contract: test/TestProduct.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-001:INSTANCE_WALLET_UNDEFINED+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-002:RISKPOOL_WALLET_UNDEFINED+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-003:RISKPOOL_WALLET_UNDEFINED+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-004:TREASURY_SUSPENDED+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-005:NOT_RISKPOOL_SERVICE+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-010:TOKEN_ADDRESS_ZERO+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-011:NOT_PRODUCT+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-012:PRODUCT_TOKEN_ALREADY_SET+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-013:PRODUCT_TOKEN_ADDRESS_NOT_MATCHING+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-014:RISKPOOL_TOKEN_ADDRESS_NOT_MACHING+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-015:WALLET_ADDRESS_ZERO+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-016:NOT_RISKPOOL+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-017:WALLET_ADDRESS_ZERO+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-020:ID_NOT_PRODUCT_OR_RISKPOOL+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-021:FRACIONAL_FEE_TOO_BIG+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-022:NOT_PRODUCT+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-023:NOT_RISKPOOL+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-024:FEE_SPEC_UNDEFINED+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-030:AMOUNT_TOO_BIG+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-031:FEE_TRANSFER_FAILED+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-032:PREMIUM_TRANSFER_FAILED+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-042:RISKPOOL_WALLET_BALANCE_TOO_SMALL+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-043:PAYOUT_ALLOWANCE_TOO_SMALL+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-044:PAYOUT_TRANSFER_FAILED+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-050:FEE_SPEC_UNDEFINED+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-052:BALANCE_TOO_SMALL+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-053:CAPITAL_TRANSFER_ALLOWANCE_TOO_SMALL+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-054:FEE_TRANSFER_FAILED+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-055:CAPITAL_TRANSFER_FAILED+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-060:CAPACITY_OR_BALANCE_SMALLER_THAN_WITHDRAWAL+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-061:RISKPOOL_WALLET_BALANCE_TOO_SMALL+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-062:WITHDRAWAL_ALLOWANCE_TOO_SMALL+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-063:WITHDRAWAL_TRANSFER_FAILED+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-070:NOT_PRODUCT_OR_RISKPOOL+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-090:FEE_CALCULATION_DATA_NOT_SUPPORTED+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-091:FEE_TOO_BIG+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if + +==== `[.contract-item-name]#+++ERROR:TRS-092:PRODUCT_WITHOUT_RISKPOOL+++ `### +Contract: modules/TreasuryModule.sol + +Thrown if +Contract: + +-- \ No newline at end of file diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc new file mode 100644 index 00000000..caea2420 --- /dev/null +++ b/docs/modules/ROOT/pages/index.adoc @@ -0,0 +1,78 @@ += GIF Contracts + +*Secure and audited smart contracts to develop decentralized insurance applications.* + + * GIF Contracts is a library of smart contracts for decentralized insurance applications. + + + +== Overview + +[[install]] +=== Installation + +```console +$ npm install @etherisc/gif-contracts +``` + +Etherisc GIF Contracts features a xref:releases-stability.adoc#api-stability[stable API], which means your contracts won't break unexpectedly when upgrading to a newer minor version. + +[[usage]] +=== Usage + +Once installed, you can use the contracts in the library by importing them: + +[source,solidity] +---- +// contracts/MyProduct.sol +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.2; + +import "@etherisc/gif-interface/contracts/components/Product.sol"; + +contract MyProduct is Product { + + bytes32 public constant POLICY_FLOW = "PolicyDefaultFlow"; + + constructor( + bytes32 productName, + address token, + address registry, + uint256 riskpoolId, + ) + Product(productName, token, POLICY_FLOW, riskpoolId, registry) + { + } +} +---- + +TIP: If you're new to smart contract development, head to ... +// TODO: Add resource here +to learn about creating a new project and compiling your contracts. + +To keep your system secure, you should **always** use the installed code as-is, and neither copy-paste it from online sources, nor modify it yourself. The library is designed so that only the contracts and functions you use are deployed, so you don't need to worry about it needlessly increasing gas costs. + +== Error Codes + +Each error has a 7-letter identifier of the form `XXX-\###`. The first three letters indicate the component where the error occurred, and the last three letters indicate the error number within that component. +A list of the error codes with explanations / conditions is available in the xref:errorCodes.adoc[Errors] section. + +[[next-steps]] +== Learn More + +The guides in the sidebar will teach about different concepts, and how to use the related contracts that GIF Contracts provides: + +//// +* xref:access-control.adoc[Access Control]: decide who can perform each of the actions on your system. +* xref:tokens.adoc[Tokens]: create tradable assets or collectibles, like the well known xref:erc20.adoc[ERC20] and xref:erc721.adoc[ERC721] standards. +* xref:gsn.adoc[Gas Station Network]: let your users interact with your contracts without having to pay for gas themselves. +* xref:utilities.adoc[Utilities]: generic useful tools, including non-overflowing math, signature verification, and trustless paying systems. + +The xref:api:token/ERC20.adoc[full API] is also thoroughly documented, and serves as a great reference when developing your smart contract application. You can also ask for help or follow Contracts' development in the https://forum.openzeppelin.com[community forum]. + +Finally, you may want to take a look at the https://blog.openzeppelin.com/guides/[guides on our blog], which cover several common use cases and good practices.. The following articles provide great background reading, though please note, some of the referenced tools have changed as the tooling in the ecosystem continues to rapidly evolve. + +* https://blog.openzeppelin.com/the-hitchhikers-guide-to-smart-contracts-in-ethereum-848f08001f05[The Hitchhiker’s Guide to Smart Contracts in Ethereum] will help you get an overview of the various tools available for smart contract development, and help you set up your environment. +* https://blog.openzeppelin.com/a-gentle-introduction-to-ethereum-programming-part-1-783cc7796094[A Gentle Introduction to Ethereum Programming, Part 1] provides very useful information on an introductory level, including many basic concepts from the Ethereum platform. +* For a more in-depth dive, you may read the guide https://blog.openzeppelin.com/designing-the-architecture-for-your-ethereum-application-9cec086f8317[Designing the architecture for your Ethereum application], which discusses how to better structure your application and its relationship to the real world. +//// diff --git a/docs/modules/api/nav.adoc b/docs/modules/api/nav.adoc new file mode 100644 index 00000000..1191f469 --- /dev/null +++ b/docs/modules/api/nav.adoc @@ -0,0 +1,7 @@ +.API +* xref:flows.adoc[Flows] +* xref:modules.adoc[Modules] +* xref:services.adoc[Services] +* xref:shared.adoc[Shared] +* xref:test.adoc[Test] +* xref:tokens.adoc[Tokens] diff --git a/docs/modules/api/pages/flows.adoc b/docs/modules/api/pages/flows.adoc new file mode 100644 index 00000000..a744f41d --- /dev/null +++ b/docs/modules/api/pages/flows.adoc @@ -0,0 +1,299 @@ +:github-icon: pass:[] +:xref-PolicyDefaultFlow-onlyActivePolicy-bytes32-: xref:flows.adoc#PolicyDefaultFlow-onlyActivePolicy-bytes32- +:xref-PolicyDefaultFlow-onlyExpiredPolicy-bytes32-: xref:flows.adoc#PolicyDefaultFlow-onlyExpiredPolicy-bytes32- +:xref-PolicyDefaultFlow-notClosedPolicy-bytes32-: xref:flows.adoc#PolicyDefaultFlow-notClosedPolicy-bytes32- +:xref-PolicyDefaultFlow-onlyResponsibleProduct-bytes32-: xref:flows.adoc#PolicyDefaultFlow-onlyResponsibleProduct-bytes32- +:xref-PolicyDefaultFlow-onlyMatchingProduct-uint256-: xref:flows.adoc#PolicyDefaultFlow-onlyMatchingProduct-uint256- +:xref-PolicyDefaultFlow-constructor-address-: xref:flows.adoc#PolicyDefaultFlow-constructor-address- +:xref-PolicyDefaultFlow-newApplication-address-uint256-uint256-bytes-bytes-: xref:flows.adoc#PolicyDefaultFlow-newApplication-address-uint256-uint256-bytes-bytes- +:xref-PolicyDefaultFlow-revoke-bytes32-: xref:flows.adoc#PolicyDefaultFlow-revoke-bytes32- +:xref-PolicyDefaultFlow-underwrite-bytes32-: xref:flows.adoc#PolicyDefaultFlow-underwrite-bytes32- +:xref-PolicyDefaultFlow-collectPremium-bytes32-uint256-: xref:flows.adoc#PolicyDefaultFlow-collectPremium-bytes32-uint256- +:xref-PolicyDefaultFlow-adjustPremiumSumInsured-bytes32-uint256-uint256-: xref:flows.adoc#PolicyDefaultFlow-adjustPremiumSumInsured-bytes32-uint256-uint256- +:xref-PolicyDefaultFlow-decline-bytes32-: xref:flows.adoc#PolicyDefaultFlow-decline-bytes32- +:xref-PolicyDefaultFlow-expire-bytes32-: xref:flows.adoc#PolicyDefaultFlow-expire-bytes32- +:xref-PolicyDefaultFlow-close-bytes32-: xref:flows.adoc#PolicyDefaultFlow-close-bytes32- +:xref-PolicyDefaultFlow-newClaim-bytes32-uint256-bytes-: xref:flows.adoc#PolicyDefaultFlow-newClaim-bytes32-uint256-bytes- +:xref-PolicyDefaultFlow-confirmClaim-bytes32-uint256-uint256-: xref:flows.adoc#PolicyDefaultFlow-confirmClaim-bytes32-uint256-uint256- +:xref-PolicyDefaultFlow-declineClaim-bytes32-uint256-: xref:flows.adoc#PolicyDefaultFlow-declineClaim-bytes32-uint256- +:xref-PolicyDefaultFlow-closeClaim-bytes32-uint256-: xref:flows.adoc#PolicyDefaultFlow-closeClaim-bytes32-uint256- +:xref-PolicyDefaultFlow-newPayout-bytes32-uint256-uint256-bytes-: xref:flows.adoc#PolicyDefaultFlow-newPayout-bytes32-uint256-uint256-bytes- +:xref-PolicyDefaultFlow-processPayout-bytes32-uint256-: xref:flows.adoc#PolicyDefaultFlow-processPayout-bytes32-uint256- +:xref-PolicyDefaultFlow-request-bytes32-bytes-string-address-uint256-: xref:flows.adoc#PolicyDefaultFlow-request-bytes32-bytes-string-address-uint256- +:xref-PolicyDefaultFlow-cancelRequest-uint256-: xref:flows.adoc#PolicyDefaultFlow-cancelRequest-uint256- +:xref-PolicyDefaultFlow-getApplicationData-bytes32-: xref:flows.adoc#PolicyDefaultFlow-getApplicationData-bytes32- +:xref-PolicyDefaultFlow-getClaimData-bytes32-uint256-: xref:flows.adoc#PolicyDefaultFlow-getClaimData-bytes32-uint256- +:xref-PolicyDefaultFlow-getPayoutData-bytes32-uint256-: xref:flows.adoc#PolicyDefaultFlow-getPayoutData-bytes32-uint256- +:xref-PolicyDefaultFlow-getComponentContract--: xref:flows.adoc#PolicyDefaultFlow-getComponentContract-- +:xref-PolicyDefaultFlow-getPoolContract--: xref:flows.adoc#PolicyDefaultFlow-getPoolContract-- +:xref-PolicyDefaultFlow-getPolicyContract--: xref:flows.adoc#PolicyDefaultFlow-getPolicyContract-- +:xref-PolicyDefaultFlow-getQueryContract--: xref:flows.adoc#PolicyDefaultFlow-getQueryContract-- +:xref-PolicyDefaultFlow-getTreasuryContract--: xref:flows.adoc#PolicyDefaultFlow-getTreasuryContract-- +:xref-WithRegistry-getContractFromRegistry-bytes32-: xref:shared.adoc#WithRegistry-getContractFromRegistry-bytes32- +:xref-WithRegistry-getContractInReleaseFromRegistry-bytes32-bytes32-: xref:shared.adoc#WithRegistry-getContractInReleaseFromRegistry-bytes32-bytes32- +:xref-WithRegistry-getReleaseFromRegistry--: xref:shared.adoc#WithRegistry-getReleaseFromRegistry-- += Flows + +[.readme-notice] +NOTE: This document is better viewed at https://docs.etherisc.com/contracts/api/flows + +== Contracts + +:NAME: pass:normal[xref:#PolicyDefaultFlow-NAME-bytes32[`++NAME++`]] +:onlyActivePolicy: pass:normal[xref:#PolicyDefaultFlow-onlyActivePolicy-bytes32-[`++onlyActivePolicy++`]] +:onlyExpiredPolicy: pass:normal[xref:#PolicyDefaultFlow-onlyExpiredPolicy-bytes32-[`++onlyExpiredPolicy++`]] +:notClosedPolicy: pass:normal[xref:#PolicyDefaultFlow-notClosedPolicy-bytes32-[`++notClosedPolicy++`]] +:onlyResponsibleProduct: pass:normal[xref:#PolicyDefaultFlow-onlyResponsibleProduct-bytes32-[`++onlyResponsibleProduct++`]] +:onlyMatchingProduct: pass:normal[xref:#PolicyDefaultFlow-onlyMatchingProduct-uint256-[`++onlyMatchingProduct++`]] +:constructor: pass:normal[xref:#PolicyDefaultFlow-constructor-address-[`++constructor++`]] +:newApplication: pass:normal[xref:#PolicyDefaultFlow-newApplication-address-uint256-uint256-bytes-bytes-[`++newApplication++`]] +:revoke: pass:normal[xref:#PolicyDefaultFlow-revoke-bytes32-[`++revoke++`]] +:underwrite: pass:normal[xref:#PolicyDefaultFlow-underwrite-bytes32-[`++underwrite++`]] +:collectPremium: pass:normal[xref:#PolicyDefaultFlow-collectPremium-bytes32-uint256-[`++collectPremium++`]] +:adjustPremiumSumInsured: pass:normal[xref:#PolicyDefaultFlow-adjustPremiumSumInsured-bytes32-uint256-uint256-[`++adjustPremiumSumInsured++`]] +:decline: pass:normal[xref:#PolicyDefaultFlow-decline-bytes32-[`++decline++`]] +:expire: pass:normal[xref:#PolicyDefaultFlow-expire-bytes32-[`++expire++`]] +:close: pass:normal[xref:#PolicyDefaultFlow-close-bytes32-[`++close++`]] +:newClaim: pass:normal[xref:#PolicyDefaultFlow-newClaim-bytes32-uint256-bytes-[`++newClaim++`]] +:confirmClaim: pass:normal[xref:#PolicyDefaultFlow-confirmClaim-bytes32-uint256-uint256-[`++confirmClaim++`]] +:declineClaim: pass:normal[xref:#PolicyDefaultFlow-declineClaim-bytes32-uint256-[`++declineClaim++`]] +:closeClaim: pass:normal[xref:#PolicyDefaultFlow-closeClaim-bytes32-uint256-[`++closeClaim++`]] +:newPayout: pass:normal[xref:#PolicyDefaultFlow-newPayout-bytes32-uint256-uint256-bytes-[`++newPayout++`]] +:processPayout: pass:normal[xref:#PolicyDefaultFlow-processPayout-bytes32-uint256-[`++processPayout++`]] +:request: pass:normal[xref:#PolicyDefaultFlow-request-bytes32-bytes-string-address-uint256-[`++request++`]] +:cancelRequest: pass:normal[xref:#PolicyDefaultFlow-cancelRequest-uint256-[`++cancelRequest++`]] +:getApplicationData: pass:normal[xref:#PolicyDefaultFlow-getApplicationData-bytes32-[`++getApplicationData++`]] +:getClaimData: pass:normal[xref:#PolicyDefaultFlow-getClaimData-bytes32-uint256-[`++getClaimData++`]] +:getPayoutData: pass:normal[xref:#PolicyDefaultFlow-getPayoutData-bytes32-uint256-[`++getPayoutData++`]] +:getComponentContract: pass:normal[xref:#PolicyDefaultFlow-getComponentContract--[`++getComponentContract++`]] +:getPoolContract: pass:normal[xref:#PolicyDefaultFlow-getPoolContract--[`++getPoolContract++`]] +:getPolicyContract: pass:normal[xref:#PolicyDefaultFlow-getPolicyContract--[`++getPolicyContract++`]] +:getQueryContract: pass:normal[xref:#PolicyDefaultFlow-getQueryContract--[`++getQueryContract++`]] +:getTreasuryContract: pass:normal[xref:#PolicyDefaultFlow-getTreasuryContract--[`++getTreasuryContract++`]] + +[.contract] +[[PolicyDefaultFlow]] +=== `++PolicyDefaultFlow++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/flows/PolicyDefaultFlow.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/flows/PolicyDefaultFlow.sol"; +``` + +[.contract-index] +.Modifiers +-- +* {xref-PolicyDefaultFlow-onlyActivePolicy-bytes32-}[`++onlyActivePolicy(processId)++`] +* {xref-PolicyDefaultFlow-onlyExpiredPolicy-bytes32-}[`++onlyExpiredPolicy(processId)++`] +* {xref-PolicyDefaultFlow-notClosedPolicy-bytes32-}[`++notClosedPolicy(processId)++`] +* {xref-PolicyDefaultFlow-onlyResponsibleProduct-bytes32-}[`++onlyResponsibleProduct(processId)++`] +* {xref-PolicyDefaultFlow-onlyMatchingProduct-uint256-}[`++onlyMatchingProduct(requestId)++`] +-- + +[.contract-index] +.Functions +-- +* {xref-PolicyDefaultFlow-constructor-address-}[`++constructor(_registry)++`] +* {xref-PolicyDefaultFlow-newApplication-address-uint256-uint256-bytes-bytes-}[`++newApplication(owner, premiumAmount, sumInsuredAmount, metaData, applicationData)++`] +* {xref-PolicyDefaultFlow-revoke-bytes32-}[`++revoke(processId)++`] +* {xref-PolicyDefaultFlow-underwrite-bytes32-}[`++underwrite(processId)++`] +* {xref-PolicyDefaultFlow-collectPremium-bytes32-uint256-}[`++collectPremium(processId, amount)++`] +* {xref-PolicyDefaultFlow-adjustPremiumSumInsured-bytes32-uint256-uint256-}[`++adjustPremiumSumInsured(processId, expectedPremiumAmount, sumInsuredAmount)++`] +* {xref-PolicyDefaultFlow-decline-bytes32-}[`++decline(processId)++`] +* {xref-PolicyDefaultFlow-expire-bytes32-}[`++expire(processId)++`] +* {xref-PolicyDefaultFlow-close-bytes32-}[`++close(processId)++`] +* {xref-PolicyDefaultFlow-newClaim-bytes32-uint256-bytes-}[`++newClaim(processId, claimAmount, data)++`] +* {xref-PolicyDefaultFlow-confirmClaim-bytes32-uint256-uint256-}[`++confirmClaim(processId, claimId, confirmedAmount)++`] +* {xref-PolicyDefaultFlow-declineClaim-bytes32-uint256-}[`++declineClaim(processId, claimId)++`] +* {xref-PolicyDefaultFlow-closeClaim-bytes32-uint256-}[`++closeClaim(processId, claimId)++`] +* {xref-PolicyDefaultFlow-newPayout-bytes32-uint256-uint256-bytes-}[`++newPayout(processId, claimId, amount, data)++`] +* {xref-PolicyDefaultFlow-processPayout-bytes32-uint256-}[`++processPayout(processId, payoutId)++`] +* {xref-PolicyDefaultFlow-request-bytes32-bytes-string-address-uint256-}[`++request(processId, _input, _callbackMethodName, _callbackContractAddress, _responsibleOracleId)++`] +* {xref-PolicyDefaultFlow-cancelRequest-uint256-}[`++cancelRequest(requestId)++`] +* {xref-PolicyDefaultFlow-getApplicationData-bytes32-}[`++getApplicationData(processId)++`] +* {xref-PolicyDefaultFlow-getClaimData-bytes32-uint256-}[`++getClaimData(processId, claimId)++`] +* {xref-PolicyDefaultFlow-getPayoutData-bytes32-uint256-}[`++getPayoutData(processId, payoutId)++`] +* {xref-PolicyDefaultFlow-getComponentContract--}[`++getComponentContract()++`] +* {xref-PolicyDefaultFlow-getPoolContract--}[`++getPoolContract()++`] +* {xref-PolicyDefaultFlow-getPolicyContract--}[`++getPolicyContract()++`] +* {xref-PolicyDefaultFlow-getQueryContract--}[`++getQueryContract()++`] +* {xref-PolicyDefaultFlow-getTreasuryContract--}[`++getTreasuryContract()++`] + +[.contract-subindex-inherited] +.WithRegistry +* {xref-WithRegistry-getContractFromRegistry-bytes32-}[`++getContractFromRegistry(_contractName)++`] +* {xref-WithRegistry-getContractInReleaseFromRegistry-bytes32-bytes32-}[`++getContractInReleaseFromRegistry(_release, _contractName)++`] +* {xref-WithRegistry-getReleaseFromRegistry--}[`++getReleaseFromRegistry()++`] + +-- + +[.contract-item] +[[PolicyDefaultFlow-onlyActivePolicy-bytes32-]] +==== `[.contract-item-name]#++onlyActivePolicy++#++(bytes32 processId)++` [.item-kind]#modifier# + +[.contract-item] +[[PolicyDefaultFlow-onlyExpiredPolicy-bytes32-]] +==== `[.contract-item-name]#++onlyExpiredPolicy++#++(bytes32 processId)++` [.item-kind]#modifier# + +[.contract-item] +[[PolicyDefaultFlow-notClosedPolicy-bytes32-]] +==== `[.contract-item-name]#++notClosedPolicy++#++(bytes32 processId)++` [.item-kind]#modifier# + +[.contract-item] +[[PolicyDefaultFlow-onlyResponsibleProduct-bytes32-]] +==== `[.contract-item-name]#++onlyResponsibleProduct++#++(bytes32 processId)++` [.item-kind]#modifier# + +[.contract-item] +[[PolicyDefaultFlow-onlyMatchingProduct-uint256-]] +==== `[.contract-item-name]#++onlyMatchingProduct++#++(uint256 requestId)++` [.item-kind]#modifier# + +[.contract-item] +[[PolicyDefaultFlow-constructor-address-]] +==== `[.contract-item-name]#++constructor++#++(address _registry)++` [.item-kind]#public# + +Constructor function that initializes the contract with a given registry address. + +[.contract-item] +[[PolicyDefaultFlow-newApplication-address-uint256-uint256-bytes-bytes-]] +==== `[.contract-item-name]#++newApplication++#++(address owner, uint256 premiumAmount, uint256 sumInsuredAmount, bytes metaData, bytes applicationData) → bytes32 processId++` [.item-kind]#external# + +Creates a new insurance application and returns the process ID. + +[.contract-item] +[[PolicyDefaultFlow-revoke-bytes32-]] +==== `[.contract-item-name]#++revoke++#++(bytes32 processId)++` [.item-kind]#external# + +Revokes an application for a specific processId. + +[.contract-item] +[[PolicyDefaultFlow-underwrite-bytes32-]] +==== `[.contract-item-name]#++underwrite++#++(bytes32 processId) → bool success++` [.item-kind]#external# + +Attempts to get the collateral to secure the policy. + +[.contract-item] +[[PolicyDefaultFlow-collectPremium-bytes32-uint256-]] +==== `[.contract-item-name]#++collectPremium++#++(bytes32 processId, uint256 amount) → bool success, uint256 feeAmount, uint256 netPremiumAmount++` [.item-kind]#public# + +Collects the premium for a given policy and updates the book keeping of the policy and the risk pool. + +[.contract-item] +[[PolicyDefaultFlow-adjustPremiumSumInsured-bytes32-uint256-uint256-]] +==== `[.contract-item-name]#++adjustPremiumSumInsured++#++(bytes32 processId, uint256 expectedPremiumAmount, uint256 sumInsuredAmount)++` [.item-kind]#external# + +Adjusts the premium and sum insured amounts of a policy. + +[.contract-item] +[[PolicyDefaultFlow-decline-bytes32-]] +==== `[.contract-item-name]#++decline++#++(bytes32 processId)++` [.item-kind]#external# + +Allows the responsible product to decline an application for a policy. + +[.contract-item] +[[PolicyDefaultFlow-expire-bytes32-]] +==== `[.contract-item-name]#++expire++#++(bytes32 processId)++` [.item-kind]#external# + +Expire the policy identified by the given process ID. + +[.contract-item] +[[PolicyDefaultFlow-close-bytes32-]] +==== `[.contract-item-name]#++close++#++(bytes32 processId)++` [.item-kind]#external# + +Closes a policy and releases the corresponding funds from the pool. + +[.contract-item] +[[PolicyDefaultFlow-newClaim-bytes32-uint256-bytes-]] +==== `[.contract-item-name]#++newClaim++#++(bytes32 processId, uint256 claimAmount, bytes data) → uint256 claimId++` [.item-kind]#external# + +Creates a new claim for a given process ID, claim amount and data. + +[.contract-item] +[[PolicyDefaultFlow-confirmClaim-bytes32-uint256-uint256-]] +==== `[.contract-item-name]#++confirmClaim++#++(bytes32 processId, uint256 claimId, uint256 confirmedAmount)++` [.item-kind]#external# + +Confirms a claim for a specific process and claim ID, updating the confirmed amount. + +[.contract-item] +[[PolicyDefaultFlow-declineClaim-bytes32-uint256-]] +==== `[.contract-item-name]#++declineClaim++#++(bytes32 processId, uint256 claimId)++` [.item-kind]#external# + +Allows the responsible product to decline a claim. + +[.contract-item] +[[PolicyDefaultFlow-closeClaim-bytes32-uint256-]] +==== `[.contract-item-name]#++closeClaim++#++(bytes32 processId, uint256 claimId)++` [.item-kind]#external# + +Closes a claim for a specific process and claim ID. + +[.contract-item] +[[PolicyDefaultFlow-newPayout-bytes32-uint256-uint256-bytes-]] +==== `[.contract-item-name]#++newPayout++#++(bytes32 processId, uint256 claimId, uint256 amount, bytes data) → uint256 payoutId++` [.item-kind]#external# + +Creates a new payout for a specific claim. + +[.contract-item] +[[PolicyDefaultFlow-processPayout-bytes32-uint256-]] +==== `[.contract-item-name]#++processPayout++#++(bytes32 processId, uint256 payoutId) → bool success, uint256 feeAmount, uint256 netPayoutAmount++` [.item-kind]#external# + +Processes a payout for a specific process and payout ID. + +[.contract-item] +[[PolicyDefaultFlow-request-bytes32-bytes-string-address-uint256-]] +==== `[.contract-item-name]#++request++#++(bytes32 processId, bytes _input, string _callbackMethodName, address _callbackContractAddress, uint256 _responsibleOracleId) → uint256 _requestId++` [.item-kind]#external# + +Sends a request to the query contract to initiate a new process. + +[.contract-item] +[[PolicyDefaultFlow-cancelRequest-uint256-]] +==== `[.contract-item-name]#++cancelRequest++#++(uint256 requestId)++` [.item-kind]#external# + +Cancels a request with the given requestId. + +[.contract-item] +[[PolicyDefaultFlow-getApplicationData-bytes32-]] +==== `[.contract-item-name]#++getApplicationData++#++(bytes32 processId) → bytes++` [.item-kind]#external# + +Returns the application data associated with the given process ID. + +[.contract-item] +[[PolicyDefaultFlow-getClaimData-bytes32-uint256-]] +==== `[.contract-item-name]#++getClaimData++#++(bytes32 processId, uint256 claimId) → bytes++` [.item-kind]#external# + +Returns the claim data of a specific claim for a given process ID. + +[.contract-item] +[[PolicyDefaultFlow-getPayoutData-bytes32-uint256-]] +==== `[.contract-item-name]#++getPayoutData++#++(bytes32 processId, uint256 payoutId) → bytes++` [.item-kind]#external# + +Returns the payout data for a given process and payout ID. + +[.contract-item] +[[PolicyDefaultFlow-getComponentContract--]] +==== `[.contract-item-name]#++getComponentContract++#++() → contract ComponentController++` [.item-kind]#internal# + +Returns the ComponentController contract instance. + +[.contract-item] +[[PolicyDefaultFlow-getPoolContract--]] +==== `[.contract-item-name]#++getPoolContract++#++() → contract PoolController++` [.item-kind]#internal# + +Returns the PoolController contract instance from the registry. + +[.contract-item] +[[PolicyDefaultFlow-getPolicyContract--]] +==== `[.contract-item-name]#++getPolicyContract++#++() → contract PolicyController++` [.item-kind]#internal# + +Returns the PolicyController contract instance from the registry. + +[.contract-item] +[[PolicyDefaultFlow-getQueryContract--]] +==== `[.contract-item-name]#++getQueryContract++#++() → contract QueryModule++` [.item-kind]#internal# + +Returns the QueryModule contract instance from the registry. + +[.contract-item] +[[PolicyDefaultFlow-getTreasuryContract--]] +==== `[.contract-item-name]#++getTreasuryContract++#++() → contract TreasuryModule++` [.item-kind]#internal# + +Retrieves the TreasuryModule contract instance. + diff --git a/docs/modules/api/pages/modules.adoc b/docs/modules/api/pages/modules.adoc new file mode 100644 index 00000000..3d8fa051 --- /dev/null +++ b/docs/modules/api/pages/modules.adoc @@ -0,0 +1,2436 @@ +:github-icon: pass:[] +:xref-AccessController-_afterInitialize--: xref:modules.adoc#AccessController-_afterInitialize-- +:xref-AccessController-_getName--: xref:modules.adoc#AccessController-_getName-- +:xref-AccessController-setDefaultAdminRole-address-: xref:modules.adoc#AccessController-setDefaultAdminRole-address- +:xref-AccessController-grantRole-bytes32-address-: xref:modules.adoc#AccessController-grantRole-bytes32-address- +:xref-AccessController-revokeRole-bytes32-address-: xref:modules.adoc#AccessController-revokeRole-bytes32-address- +:xref-AccessController-renounceRole-bytes32-address-: xref:modules.adoc#AccessController-renounceRole-bytes32-address- +:xref-AccessController-addRole-bytes32-: xref:modules.adoc#AccessController-addRole-bytes32- +:xref-AccessController-invalidateRole-bytes32-: xref:modules.adoc#AccessController-invalidateRole-bytes32- +:xref-AccessController-hasRole-bytes32-address-: xref:modules.adoc#AccessController-hasRole-bytes32-address- +:xref-AccessController-getDefaultAdminRole--: xref:modules.adoc#AccessController-getDefaultAdminRole-- +:xref-AccessController-getProductOwnerRole--: xref:modules.adoc#AccessController-getProductOwnerRole-- +:xref-AccessController-getOracleProviderRole--: xref:modules.adoc#AccessController-getOracleProviderRole-- +:xref-AccessController-getRiskpoolKeeperRole--: xref:modules.adoc#AccessController-getRiskpoolKeeperRole-- +:xref-CoreController-initialize-address-: xref:shared.adoc#CoreController-initialize-address- +:xref-CoreController-_getContractAddress-bytes32-: xref:shared.adoc#CoreController-_getContractAddress-bytes32- +:xref-BundleController-onlyRiskpoolService--: xref:modules.adoc#BundleController-onlyRiskpoolService-- +:xref-BundleController-onlyFundableBundle-uint256-: xref:modules.adoc#BundleController-onlyFundableBundle-uint256- +:xref-BundleController-_afterInitialize--: xref:modules.adoc#BundleController-_afterInitialize-- +:xref-BundleController-create-address-uint256-bytes-uint256-: xref:modules.adoc#BundleController-create-address-uint256-bytes-uint256- +:xref-BundleController-fund-uint256-uint256-: xref:modules.adoc#BundleController-fund-uint256-uint256- +:xref-BundleController-defund-uint256-uint256-: xref:modules.adoc#BundleController-defund-uint256-uint256- +:xref-BundleController-lock-uint256-: xref:modules.adoc#BundleController-lock-uint256- +:xref-BundleController-unlock-uint256-: xref:modules.adoc#BundleController-unlock-uint256- +:xref-BundleController-close-uint256-: xref:modules.adoc#BundleController-close-uint256- +:xref-BundleController-burn-uint256-: xref:modules.adoc#BundleController-burn-uint256- +:xref-BundleController-collateralizePolicy-uint256-bytes32-uint256-: xref:modules.adoc#BundleController-collateralizePolicy-uint256-bytes32-uint256- +:xref-BundleController-processPremium-uint256-bytes32-uint256-: xref:modules.adoc#BundleController-processPremium-uint256-bytes32-uint256- +:xref-BundleController-processPayout-uint256-bytes32-uint256-: xref:modules.adoc#BundleController-processPayout-uint256-bytes32-uint256- +:xref-BundleController-releasePolicy-uint256-bytes32-: xref:modules.adoc#BundleController-releasePolicy-uint256-bytes32- +:xref-BundleController-getOwner-uint256-: xref:modules.adoc#BundleController-getOwner-uint256- +:xref-BundleController-getState-uint256-: xref:modules.adoc#BundleController-getState-uint256- +:xref-BundleController-getFilter-uint256-: xref:modules.adoc#BundleController-getFilter-uint256- +:xref-BundleController-getCapacity-uint256-: xref:modules.adoc#BundleController-getCapacity-uint256- +:xref-BundleController-getTotalValueLocked-uint256-: xref:modules.adoc#BundleController-getTotalValueLocked-uint256- +:xref-BundleController-getBalance-uint256-: xref:modules.adoc#BundleController-getBalance-uint256- +:xref-BundleController-getToken--: xref:modules.adoc#BundleController-getToken-- +:xref-BundleController-getBundle-uint256-: xref:modules.adoc#BundleController-getBundle-uint256- +:xref-BundleController-bundles--: xref:modules.adoc#BundleController-bundles-- +:xref-BundleController-unburntBundles-uint256-: xref:modules.adoc#BundleController-unburntBundles-uint256- +:xref-BundleController-_getPoolController--: xref:modules.adoc#BundleController-_getPoolController-- +:xref-BundleController-_changeState-uint256-enum-IBundle-BundleState-: xref:modules.adoc#BundleController-_changeState-uint256-enum-IBundle-BundleState- +:xref-BundleController-_setState-uint256-enum-IBundle-BundleState-: xref:modules.adoc#BundleController-_setState-uint256-enum-IBundle-BundleState- +:xref-BundleController-_checkStateTransition-enum-IBundle-BundleState-enum-IBundle-BundleState-: xref:modules.adoc#BundleController-_checkStateTransition-enum-IBundle-BundleState-enum-IBundle-BundleState- +:xref-CoreController-initialize-address-: xref:shared.adoc#CoreController-initialize-address- +:xref-CoreController-_getName--: xref:shared.adoc#CoreController-_getName-- +:xref-CoreController-_getContractAddress-bytes32-: xref:shared.adoc#CoreController-_getContractAddress-bytes32- +:xref-ComponentController-onlyComponentOwnerService--: xref:modules.adoc#ComponentController-onlyComponentOwnerService-- +:xref-ComponentController-onlyInstanceOperatorService--: xref:modules.adoc#ComponentController-onlyInstanceOperatorService-- +:xref-ComponentController-propose-contract-IComponent-: xref:modules.adoc#ComponentController-propose-contract-IComponent- +:xref-ComponentController-_persistComponent-contract-IComponent-: xref:modules.adoc#ComponentController-_persistComponent-contract-IComponent- +:xref-ComponentController-exists-uint256-: xref:modules.adoc#ComponentController-exists-uint256- +:xref-ComponentController-approve-uint256-: xref:modules.adoc#ComponentController-approve-uint256- +:xref-ComponentController-decline-uint256-: xref:modules.adoc#ComponentController-decline-uint256- +:xref-ComponentController-suspend-uint256-: xref:modules.adoc#ComponentController-suspend-uint256- +:xref-ComponentController-resume-uint256-: xref:modules.adoc#ComponentController-resume-uint256- +:xref-ComponentController-pause-uint256-: xref:modules.adoc#ComponentController-pause-uint256- +:xref-ComponentController-unpause-uint256-: xref:modules.adoc#ComponentController-unpause-uint256- +:xref-ComponentController-archiveFromComponentOwner-uint256-: xref:modules.adoc#ComponentController-archiveFromComponentOwner-uint256- +:xref-ComponentController-archiveFromInstanceOperator-uint256-: xref:modules.adoc#ComponentController-archiveFromInstanceOperator-uint256- +:xref-ComponentController-getComponent-uint256-: xref:modules.adoc#ComponentController-getComponent-uint256- +:xref-ComponentController-getComponentId-address-: xref:modules.adoc#ComponentController-getComponentId-address- +:xref-ComponentController-getComponentType-uint256-: xref:modules.adoc#ComponentController-getComponentType-uint256- +:xref-ComponentController-getComponentState-uint256-: xref:modules.adoc#ComponentController-getComponentState-uint256- +:xref-ComponentController-getOracleId-uint256-: xref:modules.adoc#ComponentController-getOracleId-uint256- +:xref-ComponentController-getRiskpoolId-uint256-: xref:modules.adoc#ComponentController-getRiskpoolId-uint256- +:xref-ComponentController-getProductId-uint256-: xref:modules.adoc#ComponentController-getProductId-uint256- +:xref-ComponentController-getRequiredRole-enum-IComponent-ComponentType-: xref:modules.adoc#ComponentController-getRequiredRole-enum-IComponent-ComponentType- +:xref-ComponentController-components--: xref:modules.adoc#ComponentController-components-- +:xref-ComponentController-products--: xref:modules.adoc#ComponentController-products-- +:xref-ComponentController-oracles--: xref:modules.adoc#ComponentController-oracles-- +:xref-ComponentController-riskpools--: xref:modules.adoc#ComponentController-riskpools-- +:xref-ComponentController-isProduct-uint256-: xref:modules.adoc#ComponentController-isProduct-uint256- +:xref-ComponentController-isOracle-uint256-: xref:modules.adoc#ComponentController-isOracle-uint256- +:xref-ComponentController-isRiskpool-uint256-: xref:modules.adoc#ComponentController-isRiskpool-uint256- +:xref-ComponentController-getPolicyFlow-uint256-: xref:modules.adoc#ComponentController-getPolicyFlow-uint256- +:xref-ComponentController-_changeState-uint256-enum-IComponent-ComponentState-: xref:modules.adoc#ComponentController-_changeState-uint256-enum-IComponent-ComponentState- +:xref-ComponentController-_checkStateTransition-enum-IComponent-ComponentState-enum-IComponent-ComponentState-: xref:modules.adoc#ComponentController-_checkStateTransition-enum-IComponent-ComponentState-enum-IComponent-ComponentState- +:xref-CoreController-initialize-address-: xref:shared.adoc#CoreController-initialize-address- +:xref-CoreController-_getName--: xref:shared.adoc#CoreController-_getName-- +:xref-CoreController-_afterInitialize--: xref:shared.adoc#CoreController-_afterInitialize-- +:xref-CoreController-_getContractAddress-bytes32-: xref:shared.adoc#CoreController-_getContractAddress-bytes32- +:xref-LicenseController-_afterInitialize--: xref:modules.adoc#LicenseController-_afterInitialize-- +:xref-LicenseController-getAuthorizationStatus-address-: xref:modules.adoc#LicenseController-getAuthorizationStatus-address- +:xref-LicenseController-_isValidCall-uint256-: xref:modules.adoc#LicenseController-_isValidCall-uint256- +:xref-LicenseController-_getProduct-uint256-: xref:modules.adoc#LicenseController-_getProduct-uint256- +:xref-CoreController-initialize-address-: xref:shared.adoc#CoreController-initialize-address- +:xref-CoreController-_getName--: xref:shared.adoc#CoreController-_getName-- +:xref-CoreController-_getContractAddress-bytes32-: xref:shared.adoc#CoreController-_getContractAddress-bytes32- +:xref-PolicyController-_afterInitialize--: xref:modules.adoc#PolicyController-_afterInitialize-- +:xref-PolicyController-createPolicyFlow-address-uint256-bytes-: xref:modules.adoc#PolicyController-createPolicyFlow-address-uint256-bytes- +:xref-PolicyController-createApplication-bytes32-uint256-uint256-bytes-: xref:modules.adoc#PolicyController-createApplication-bytes32-uint256-uint256-bytes- +:xref-PolicyController-collectPremium-bytes32-uint256-: xref:modules.adoc#PolicyController-collectPremium-bytes32-uint256- +:xref-PolicyController-revokeApplication-bytes32-: xref:modules.adoc#PolicyController-revokeApplication-bytes32- +:xref-PolicyController-underwriteApplication-bytes32-: xref:modules.adoc#PolicyController-underwriteApplication-bytes32- +:xref-PolicyController-declineApplication-bytes32-: xref:modules.adoc#PolicyController-declineApplication-bytes32- +:xref-PolicyController-createPolicy-bytes32-: xref:modules.adoc#PolicyController-createPolicy-bytes32- +:xref-PolicyController-adjustPremiumSumInsured-bytes32-uint256-uint256-: xref:modules.adoc#PolicyController-adjustPremiumSumInsured-bytes32-uint256-uint256- +:xref-PolicyController-expirePolicy-bytes32-: xref:modules.adoc#PolicyController-expirePolicy-bytes32- +:xref-PolicyController-closePolicy-bytes32-: xref:modules.adoc#PolicyController-closePolicy-bytes32- +:xref-PolicyController-createClaim-bytes32-uint256-bytes-: xref:modules.adoc#PolicyController-createClaim-bytes32-uint256-bytes- +:xref-PolicyController-confirmClaim-bytes32-uint256-uint256-: xref:modules.adoc#PolicyController-confirmClaim-bytes32-uint256-uint256- +:xref-PolicyController-declineClaim-bytes32-uint256-: xref:modules.adoc#PolicyController-declineClaim-bytes32-uint256- +:xref-PolicyController-closeClaim-bytes32-uint256-: xref:modules.adoc#PolicyController-closeClaim-bytes32-uint256- +:xref-PolicyController-createPayout-bytes32-uint256-uint256-bytes-: xref:modules.adoc#PolicyController-createPayout-bytes32-uint256-uint256-bytes- +:xref-PolicyController-processPayout-bytes32-uint256-: xref:modules.adoc#PolicyController-processPayout-bytes32-uint256- +:xref-PolicyController-getMetadata-bytes32-: xref:modules.adoc#PolicyController-getMetadata-bytes32- +:xref-PolicyController-getApplication-bytes32-: xref:modules.adoc#PolicyController-getApplication-bytes32- +:xref-PolicyController-getNumberOfClaims-bytes32-: xref:modules.adoc#PolicyController-getNumberOfClaims-bytes32- +:xref-PolicyController-getNumberOfPayouts-bytes32-: xref:modules.adoc#PolicyController-getNumberOfPayouts-bytes32- +:xref-PolicyController-getPolicy-bytes32-: xref:modules.adoc#PolicyController-getPolicy-bytes32- +:xref-PolicyController-getClaim-bytes32-uint256-: xref:modules.adoc#PolicyController-getClaim-bytes32-uint256- +:xref-PolicyController-getPayout-bytes32-uint256-: xref:modules.adoc#PolicyController-getPayout-bytes32-uint256- +:xref-PolicyController-processIds--: xref:modules.adoc#PolicyController-processIds-- +:xref-CoreController-initialize-address-: xref:shared.adoc#CoreController-initialize-address- +:xref-CoreController-_getName--: xref:shared.adoc#CoreController-_getName-- +:xref-CoreController-_getContractAddress-bytes32-: xref:shared.adoc#CoreController-_getContractAddress-bytes32- +:xref-PoolController-onlyInstanceOperatorService--: xref:modules.adoc#PoolController-onlyInstanceOperatorService-- +:xref-PoolController-onlyRiskpoolService--: xref:modules.adoc#PoolController-onlyRiskpoolService-- +:xref-PoolController-onlyActivePool-uint256-: xref:modules.adoc#PoolController-onlyActivePool-uint256- +:xref-PoolController-onlyActivePoolForProcess-bytes32-: xref:modules.adoc#PoolController-onlyActivePoolForProcess-bytes32- +:xref-PoolController-_afterInitialize--: xref:modules.adoc#PoolController-_afterInitialize-- +:xref-PoolController-registerRiskpool-uint256-address-address-uint256-uint256-: xref:modules.adoc#PoolController-registerRiskpool-uint256-address-address-uint256-uint256- +:xref-PoolController-setRiskpoolForProduct-uint256-uint256-: xref:modules.adoc#PoolController-setRiskpoolForProduct-uint256-uint256- +:xref-PoolController-fund-uint256-uint256-: xref:modules.adoc#PoolController-fund-uint256-uint256- +:xref-PoolController-defund-uint256-uint256-: xref:modules.adoc#PoolController-defund-uint256-uint256- +:xref-PoolController-underwrite-bytes32-: xref:modules.adoc#PoolController-underwrite-bytes32- +:xref-PoolController-calculateCollateral-uint256-uint256-: xref:modules.adoc#PoolController-calculateCollateral-uint256-uint256- +:xref-PoolController-processPremium-bytes32-uint256-: xref:modules.adoc#PoolController-processPremium-bytes32-uint256- +:xref-PoolController-processPayout-bytes32-uint256-: xref:modules.adoc#PoolController-processPayout-bytes32-uint256- +:xref-PoolController-release-bytes32-: xref:modules.adoc#PoolController-release-bytes32- +:xref-PoolController-setMaximumNumberOfActiveBundles-uint256-uint256-: xref:modules.adoc#PoolController-setMaximumNumberOfActiveBundles-uint256-uint256- +:xref-PoolController-getMaximumNumberOfActiveBundles-uint256-: xref:modules.adoc#PoolController-getMaximumNumberOfActiveBundles-uint256- +:xref-PoolController-riskpools--: xref:modules.adoc#PoolController-riskpools-- +:xref-PoolController-getRiskpool-uint256-: xref:modules.adoc#PoolController-getRiskpool-uint256- +:xref-PoolController-getRiskPoolForProduct-uint256-: xref:modules.adoc#PoolController-getRiskPoolForProduct-uint256- +:xref-PoolController-activeBundles-uint256-: xref:modules.adoc#PoolController-activeBundles-uint256- +:xref-PoolController-getActiveBundleId-uint256-uint256-: xref:modules.adoc#PoolController-getActiveBundleId-uint256-uint256- +:xref-PoolController-addBundleIdToActiveSet-uint256-uint256-: xref:modules.adoc#PoolController-addBundleIdToActiveSet-uint256-uint256- +:xref-PoolController-removeBundleIdFromActiveSet-uint256-uint256-: xref:modules.adoc#PoolController-removeBundleIdFromActiveSet-uint256-uint256- +:xref-PoolController-getFullCollateralizationLevel--: xref:modules.adoc#PoolController-getFullCollateralizationLevel-- +:xref-PoolController-_getRiskpoolComponent-struct-IPolicy-Metadata-: xref:modules.adoc#PoolController-_getRiskpoolComponent-struct-IPolicy-Metadata- +:xref-PoolController-_getRiskpoolForId-uint256-: xref:modules.adoc#PoolController-_getRiskpoolForId-uint256- +:xref-CoreController-initialize-address-: xref:shared.adoc#CoreController-initialize-address- +:xref-CoreController-_getName--: xref:shared.adoc#CoreController-_getName-- +:xref-CoreController-_getContractAddress-bytes32-: xref:shared.adoc#CoreController-_getContractAddress-bytes32- +:xref-QueryModule-onlyOracleService--: xref:modules.adoc#QueryModule-onlyOracleService-- +:xref-QueryModule-onlyResponsibleOracle-uint256-address-: xref:modules.adoc#QueryModule-onlyResponsibleOracle-uint256-address- +:xref-QueryModule-_afterInitialize--: xref:modules.adoc#QueryModule-_afterInitialize-- +:xref-QueryModule-request-bytes32-bytes-string-address-uint256-: xref:modules.adoc#QueryModule-request-bytes32-bytes-string-address-uint256- +:xref-QueryModule-respond-uint256-address-bytes-: xref:modules.adoc#QueryModule-respond-uint256-address-bytes- +:xref-QueryModule-cancel-uint256-: xref:modules.adoc#QueryModule-cancel-uint256- +:xref-QueryModule-getProcessId-uint256-: xref:modules.adoc#QueryModule-getProcessId-uint256- +:xref-QueryModule-getOracleRequestCount--: xref:modules.adoc#QueryModule-getOracleRequestCount-- +:xref-QueryModule-_getOracle-uint256-: xref:modules.adoc#QueryModule-_getOracle-uint256- +:xref-CoreController-initialize-address-: xref:shared.adoc#CoreController-initialize-address- +:xref-CoreController-_getName--: xref:shared.adoc#CoreController-_getName-- +:xref-CoreController-_getContractAddress-bytes32-: xref:shared.adoc#CoreController-_getContractAddress-bytes32- +:xref-RegistryController-initializeRegistry-bytes32-: xref:modules.adoc#RegistryController-initializeRegistry-bytes32- +:xref-RegistryController-ensureSender-address-bytes32-: xref:modules.adoc#RegistryController-ensureSender-address-bytes32- +:xref-RegistryController-getRelease--: xref:modules.adoc#RegistryController-getRelease-- +:xref-RegistryController-getContract-bytes32-: xref:modules.adoc#RegistryController-getContract-bytes32- +:xref-RegistryController-register-bytes32-address-: xref:modules.adoc#RegistryController-register-bytes32-address- +:xref-RegistryController-deregister-bytes32-: xref:modules.adoc#RegistryController-deregister-bytes32- +:xref-RegistryController-getContractInRelease-bytes32-bytes32-: xref:modules.adoc#RegistryController-getContractInRelease-bytes32-bytes32- +:xref-RegistryController-registerInRelease-bytes32-bytes32-address-: xref:modules.adoc#RegistryController-registerInRelease-bytes32-bytes32-address- +:xref-RegistryController-deregisterInRelease-bytes32-bytes32-: xref:modules.adoc#RegistryController-deregisterInRelease-bytes32-bytes32- +:xref-RegistryController-prepareRelease-bytes32-: xref:modules.adoc#RegistryController-prepareRelease-bytes32- +:xref-RegistryController-contracts--: xref:modules.adoc#RegistryController-contracts-- +:xref-RegistryController-contractName-uint256-: xref:modules.adoc#RegistryController-contractName-uint256- +:xref-RegistryController-_getContractInRelease-bytes32-bytes32-: xref:modules.adoc#RegistryController-_getContractInRelease-bytes32-bytes32- +:xref-RegistryController-_registerInRelease-bytes32-bool-bytes32-address-: xref:modules.adoc#RegistryController-_registerInRelease-bytes32-bool-bytes32-address- +:xref-RegistryController-_deregisterInRelease-bytes32-bytes32-: xref:modules.adoc#RegistryController-_deregisterInRelease-bytes32-bytes32- +:xref-CoreController-initialize-address-: xref:shared.adoc#CoreController-initialize-address- +:xref-CoreController-_getName--: xref:shared.adoc#CoreController-_getName-- +:xref-CoreController-_afterInitialize--: xref:shared.adoc#CoreController-_afterInitialize-- +:xref-CoreController-_getContractAddress-bytes32-: xref:shared.adoc#CoreController-_getContractAddress-bytes32- +:xref-TreasuryModule-instanceWalletDefined--: xref:modules.adoc#TreasuryModule-instanceWalletDefined-- +:xref-TreasuryModule-riskpoolWalletDefinedForProcess-bytes32-: xref:modules.adoc#TreasuryModule-riskpoolWalletDefinedForProcess-bytes32- +:xref-TreasuryModule-riskpoolWalletDefinedForBundle-uint256-: xref:modules.adoc#TreasuryModule-riskpoolWalletDefinedForBundle-uint256- +:xref-TreasuryModule-whenNotSuspended--: xref:modules.adoc#TreasuryModule-whenNotSuspended-- +:xref-TreasuryModule-onlyRiskpoolService--: xref:modules.adoc#TreasuryModule-onlyRiskpoolService-- +:xref-TreasuryModule-_afterInitialize--: xref:modules.adoc#TreasuryModule-_afterInitialize-- +:xref-TreasuryModule-suspend--: xref:modules.adoc#TreasuryModule-suspend-- +:xref-TreasuryModule-resume--: xref:modules.adoc#TreasuryModule-resume-- +:xref-TreasuryModule-setProductToken-uint256-address-: xref:modules.adoc#TreasuryModule-setProductToken-uint256-address- +:xref-TreasuryModule-setInstanceWallet-address-: xref:modules.adoc#TreasuryModule-setInstanceWallet-address- +:xref-TreasuryModule-setRiskpoolWallet-uint256-address-: xref:modules.adoc#TreasuryModule-setRiskpoolWallet-uint256-address- +:xref-TreasuryModule-createFeeSpecification-uint256-uint256-uint256-bytes-: xref:modules.adoc#TreasuryModule-createFeeSpecification-uint256-uint256-uint256-bytes- +:xref-TreasuryModule-setPremiumFees-struct-ITreasury-FeeSpecification-: xref:modules.adoc#TreasuryModule-setPremiumFees-struct-ITreasury-FeeSpecification- +:xref-TreasuryModule-setCapitalFees-struct-ITreasury-FeeSpecification-: xref:modules.adoc#TreasuryModule-setCapitalFees-struct-ITreasury-FeeSpecification- +:xref-TreasuryModule-calculateFee-uint256-uint256-: xref:modules.adoc#TreasuryModule-calculateFee-uint256-uint256- +:xref-TreasuryModule-processPremium-bytes32-: xref:modules.adoc#TreasuryModule-processPremium-bytes32- +:xref-TreasuryModule-processPremium-bytes32-uint256-: xref:modules.adoc#TreasuryModule-processPremium-bytes32-uint256- +:xref-TreasuryModule-processPayout-bytes32-uint256-: xref:modules.adoc#TreasuryModule-processPayout-bytes32-uint256- +:xref-TreasuryModule-processCapital-uint256-uint256-: xref:modules.adoc#TreasuryModule-processCapital-uint256-uint256- +:xref-TreasuryModule-processWithdrawal-uint256-uint256-: xref:modules.adoc#TreasuryModule-processWithdrawal-uint256-uint256- +:xref-TreasuryModule-getComponentToken-uint256-: xref:modules.adoc#TreasuryModule-getComponentToken-uint256- +:xref-TreasuryModule-getFeeSpecification-uint256-: xref:modules.adoc#TreasuryModule-getFeeSpecification-uint256- +:xref-TreasuryModule-getFractionFullUnit--: xref:modules.adoc#TreasuryModule-getFractionFullUnit-- +:xref-TreasuryModule-getInstanceWallet--: xref:modules.adoc#TreasuryModule-getInstanceWallet-- +:xref-TreasuryModule-getRiskpoolWallet-uint256-: xref:modules.adoc#TreasuryModule-getRiskpoolWallet-uint256- +:xref-TreasuryModule-_calculatePremiumFee-struct-ITreasury-FeeSpecification-bytes32-: xref:modules.adoc#TreasuryModule-_calculatePremiumFee-struct-ITreasury-FeeSpecification-bytes32- +:xref-TreasuryModule-_calculateFee-struct-ITreasury-FeeSpecification-uint256-: xref:modules.adoc#TreasuryModule-_calculateFee-struct-ITreasury-FeeSpecification-uint256- +:xref-TreasuryModule-_getRiskpoolWallet-bytes32-: xref:modules.adoc#TreasuryModule-_getRiskpoolWallet-bytes32- +:xref-CoreController-initialize-address-: xref:shared.adoc#CoreController-initialize-address- +:xref-CoreController-_getName--: xref:shared.adoc#CoreController-_getName-- +:xref-CoreController-_getContractAddress-bytes32-: xref:shared.adoc#CoreController-_getContractAddress-bytes32- +:xref-TreasuryModule-LogTransferHelperInputValidation1Failed-bool-address-address-: xref:modules.adoc#TreasuryModule-LogTransferHelperInputValidation1Failed-bool-address-address- +:xref-TreasuryModule-LogTransferHelperInputValidation2Failed-uint256-uint256-: xref:modules.adoc#TreasuryModule-LogTransferHelperInputValidation2Failed-uint256-uint256- +:xref-TreasuryModule-LogTransferHelperCallFailed-bool-uint256-bytes-: xref:modules.adoc#TreasuryModule-LogTransferHelperCallFailed-bool-uint256-bytes- += Modules + +[.readme-notice] +NOTE: This document is better viewed at https://docs.etherisc.com/contracts/api/modules + +== Contracts + +:PRODUCT_OWNER_ROLE: pass:normal[xref:#AccessController-PRODUCT_OWNER_ROLE-bytes32[`++PRODUCT_OWNER_ROLE++`]] +:ORACLE_PROVIDER_ROLE: pass:normal[xref:#AccessController-ORACLE_PROVIDER_ROLE-bytes32[`++ORACLE_PROVIDER_ROLE++`]] +:RISKPOOL_KEEPER_ROLE: pass:normal[xref:#AccessController-RISKPOOL_KEEPER_ROLE-bytes32[`++RISKPOOL_KEEPER_ROLE++`]] +:validRole: pass:normal[xref:#AccessController-validRole-mapping-bytes32----bool-[`++validRole++`]] +:_afterInitialize: pass:normal[xref:#AccessController-_afterInitialize--[`++_afterInitialize++`]] +:_getName: pass:normal[xref:#AccessController-_getName--[`++_getName++`]] +:setDefaultAdminRole: pass:normal[xref:#AccessController-setDefaultAdminRole-address-[`++setDefaultAdminRole++`]] +:grantRole: pass:normal[xref:#AccessController-grantRole-bytes32-address-[`++grantRole++`]] +:revokeRole: pass:normal[xref:#AccessController-revokeRole-bytes32-address-[`++revokeRole++`]] +:renounceRole: pass:normal[xref:#AccessController-renounceRole-bytes32-address-[`++renounceRole++`]] +:addRole: pass:normal[xref:#AccessController-addRole-bytes32-[`++addRole++`]] +:invalidateRole: pass:normal[xref:#AccessController-invalidateRole-bytes32-[`++invalidateRole++`]] +:hasRole: pass:normal[xref:#AccessController-hasRole-bytes32-address-[`++hasRole++`]] +:getDefaultAdminRole: pass:normal[xref:#AccessController-getDefaultAdminRole--[`++getDefaultAdminRole++`]] +:getProductOwnerRole: pass:normal[xref:#AccessController-getProductOwnerRole--[`++getProductOwnerRole++`]] +:getOracleProviderRole: pass:normal[xref:#AccessController-getOracleProviderRole--[`++getOracleProviderRole++`]] +:getRiskpoolKeeperRole: pass:normal[xref:#AccessController-getRiskpoolKeeperRole--[`++getRiskpoolKeeperRole++`]] + +[.contract] +[[AccessController]] +=== `++AccessController++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/modules/AccessController.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/modules/AccessController.sol"; +``` + +The provided smart contract is called "AccessController" and is written in Solidity. It implements the "IAccess" interface and inherits from the "CoreController" contract and the "AccessControlEnumerable" contract. The contract provides functionalities for access control and role management. + +Roles: + +The contract defines three role identifiers as bytes32 constants: +1. PRODUCT_OWNER_ROLE: Represents the role of a product owner. +2. ORACLE_PROVIDER_ROLE: Represents the role of an oracle provider. +3. RISKPOOL_KEEPER_ROLE: Represents the role of a risk pool keeper. + +State Variables: + +- `validRole`: A mapping that stores the validity of each role. It maps a role identifier (bytes32) to a boolean value indicating whether the role is valid. +- `_defaultAdminSet`: A boolean flag indicating whether the default admin role has been set. + +Modifiers: + +- `onlyInstanceOperator`: A modifier that restricts access to functions to only instance operators. + +Overall, the contract provides a flexible access control mechanism by defining roles and +allowing the assignment, revocation, and validation of roles by instance operators. +It also sets a default admin role and manages the validity of roles through the `validRole` mapping. + +[.contract-index] +.Functions +-- +* {xref-AccessController-_afterInitialize--}[`++_afterInitialize()++`] +* {xref-AccessController-_getName--}[`++_getName()++`] +* {xref-AccessController-setDefaultAdminRole-address-}[`++setDefaultAdminRole(defaultAdmin)++`] +* {xref-AccessController-grantRole-bytes32-address-}[`++grantRole(role, principal)++`] +* {xref-AccessController-revokeRole-bytes32-address-}[`++revokeRole(role, principal)++`] +* {xref-AccessController-renounceRole-bytes32-address-}[`++renounceRole(role, principal)++`] +* {xref-AccessController-addRole-bytes32-}[`++addRole(role)++`] +* {xref-AccessController-invalidateRole-bytes32-}[`++invalidateRole(role)++`] +* {xref-AccessController-hasRole-bytes32-address-}[`++hasRole(role, principal)++`] +* {xref-AccessController-getDefaultAdminRole--}[`++getDefaultAdminRole()++`] +* {xref-AccessController-getProductOwnerRole--}[`++getProductOwnerRole()++`] +* {xref-AccessController-getOracleProviderRole--}[`++getOracleProviderRole()++`] +* {xref-AccessController-getRiskpoolKeeperRole--}[`++getRiskpoolKeeperRole()++`] + +[.contract-subindex-inherited] +.AccessControlEnumerable +* https://docs.openzeppelin.com/contracts/3.x/api/access#AccessControlEnumerable-supportsInterface-bytes4-[`++supportsInterface(interfaceId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#AccessControlEnumerable-getRoleMember-bytes32-uint256-[`++getRoleMember(role, index)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#AccessControlEnumerable-getRoleMemberCount-bytes32-[`++getRoleMemberCount(role)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#AccessControlEnumerable-_grantRole-bytes32-address-[`++_grantRole(role, account)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#AccessControlEnumerable-_revokeRole-bytes32-address-[`++_revokeRole(role, account)++`] + +[.contract-subindex-inherited] +.AccessControl +* https://docs.openzeppelin.com/contracts/3.x/api/access#AccessControl-hasRole-bytes32-address-[`++hasRole(role, account)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#AccessControl-_checkRole-bytes32-[`++_checkRole(role)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#AccessControl-_checkRole-bytes32-address-[`++_checkRole(role, account)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#AccessControl-getRoleAdmin-bytes32-[`++getRoleAdmin(role)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#AccessControl-grantRole-bytes32-address-[`++grantRole(role, account)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#AccessControl-revokeRole-bytes32-address-[`++revokeRole(role, account)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#AccessControl-renounceRole-bytes32-address-[`++renounceRole(role, account)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#AccessControl-_setupRole-bytes32-address-[`++_setupRole(role, account)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#AccessControl-_setRoleAdmin-bytes32-bytes32-[`++_setRoleAdmin(role, adminRole)++`] + +[.contract-subindex-inherited] +.ERC165 + +[.contract-subindex-inherited] +.IERC165 + +[.contract-subindex-inherited] +.IAccessControlEnumerable + +[.contract-subindex-inherited] +.IAccessControl + +[.contract-subindex-inherited] +.CoreController +* {xref-CoreController-initialize-address-}[`++initialize(registry)++`] +* {xref-CoreController-_getContractAddress-bytes32-}[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-_disableInitializers--[`++_disableInitializers()++`] + +[.contract-subindex-inherited] +.IAccess + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.AccessControlEnumerable + +[.contract-subindex-inherited] +.AccessControl + +[.contract-subindex-inherited] +.ERC165 + +[.contract-subindex-inherited] +.IERC165 + +[.contract-subindex-inherited] +.IAccessControlEnumerable + +[.contract-subindex-inherited] +.IAccessControl +* https://docs.openzeppelin.com/contracts/3.x/api/access#IAccessControl-RoleAdminChanged-bytes32-bytes32-bytes32-[`++RoleAdminChanged(role, previousAdminRole, newAdminRole)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#IAccessControl-RoleGranted-bytes32-address-address-[`++RoleGranted(role, account, sender)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#IAccessControl-RoleRevoked-bytes32-address-address-[`++RoleRevoked(role, account, sender)++`] + +[.contract-subindex-inherited] +.CoreController + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-Initialized-uint8-[`++Initialized(version)++`] + +[.contract-subindex-inherited] +.IAccess + +-- + +[.contract-item] +[[AccessController-_afterInitialize--]] +==== `[.contract-item-name]#++_afterInitialize++#++()++` [.item-kind]#internal# + +This function is called after contract initialization and adds the product owner, oracle provider, and riskpool keeper roles. + +[.contract-item] +[[AccessController-_getName--]] +==== `[.contract-item-name]#++_getName++#++() → bytes32++` [.item-kind]#internal# + +Returns the name of the contract. + +[.contract-item] +[[AccessController-setDefaultAdminRole-address-]] +==== `[.contract-item-name]#++setDefaultAdminRole++#++(address defaultAdmin)++` [.item-kind]#external# + +Sets the default admin role for the Access Control List (ACL). + +[.contract-item] +[[AccessController-grantRole-bytes32-address-]] +==== `[.contract-item-name]#++grantRole++#++(bytes32 role, address principal)++` [.item-kind]#public# + +Grants a role to a principal. + +[.contract-item] +[[AccessController-revokeRole-bytes32-address-]] +==== `[.contract-item-name]#++revokeRole++#++(bytes32 role, address principal)++` [.item-kind]#public# + +Revokes the specified role from the specified principal. + +[.contract-item] +[[AccessController-renounceRole-bytes32-address-]] +==== `[.contract-item-name]#++renounceRole++#++(bytes32 role, address principal)++` [.item-kind]#public# + +Removes the specified `principal` from the `role` in the access control list (ACL) of the contract. + +[.contract-item] +[[AccessController-addRole-bytes32-]] +==== `[.contract-item-name]#++addRole++#++(bytes32 role)++` [.item-kind]#public# + +Adds a new role to the Access Control List. + +[.contract-item] +[[AccessController-invalidateRole-bytes32-]] +==== `[.contract-item-name]#++invalidateRole++#++(bytes32 role)++` [.item-kind]#public# + +Invalidates a role. + +[.contract-item] +[[AccessController-hasRole-bytes32-address-]] +==== `[.contract-item-name]#++hasRole++#++(bytes32 role, address principal) → bool++` [.item-kind]#public# + +Checks if a given principal has a specific role. + +[.contract-item] +[[AccessController-getDefaultAdminRole--]] +==== `[.contract-item-name]#++getDefaultAdminRole++#++() → bytes32++` [.item-kind]#public# + +Returns the default admin role. + +[.contract-item] +[[AccessController-getProductOwnerRole--]] +==== `[.contract-item-name]#++getProductOwnerRole++#++() → bytes32++` [.item-kind]#public# + +Returns the bytes32 value of the PRODUCT_OWNER_ROLE. + +[.contract-item] +[[AccessController-getOracleProviderRole--]] +==== `[.contract-item-name]#++getOracleProviderRole++#++() → bytes32++` [.item-kind]#public# + +Returns the bytes32 identifier of the Oracle Provider role. + +[.contract-item] +[[AccessController-getRiskpoolKeeperRole--]] +==== `[.contract-item-name]#++getRiskpoolKeeperRole++#++() → bytes32++` [.item-kind]#public# + +Returns the bytes32 value of the RISKPOOL_KEEPER_ROLE. + +The "AccessController" smart contract is a Solidity implementation that provides access control and role management functionalities. +It inherits from other contracts and implements the "IAccess" interface. +It defines three role identifiers: PRODUCT_OWNER_ROLE, ORACLE_PROVIDER_ROLE, and RISKPOOL_KEEPER_ROLE. +The contract has state variables to store role validity and a flag to indicate if the default admin role is set. +It includes functions to grant, revoke, and renounce roles, as well as add and invalidate roles. +t also has functions to check role membership and retrieve role identifiers. +The contract ensures that only instance operators can access certain functions. +Overall, it offers a flexible access control mechanism for managing roles and permissions. + +:onlyRiskpoolService: pass:normal[xref:#BundleController-onlyRiskpoolService--[`++onlyRiskpoolService++`]] +:onlyFundableBundle: pass:normal[xref:#BundleController-onlyFundableBundle-uint256-[`++onlyFundableBundle++`]] +:_afterInitialize: pass:normal[xref:#BundleController-_afterInitialize--[`++_afterInitialize++`]] +:create: pass:normal[xref:#BundleController-create-address-uint256-bytes-uint256-[`++create++`]] +:fund: pass:normal[xref:#BundleController-fund-uint256-uint256-[`++fund++`]] +:defund: pass:normal[xref:#BundleController-defund-uint256-uint256-[`++defund++`]] +:lock: pass:normal[xref:#BundleController-lock-uint256-[`++lock++`]] +:unlock: pass:normal[xref:#BundleController-unlock-uint256-[`++unlock++`]] +:close: pass:normal[xref:#BundleController-close-uint256-[`++close++`]] +:burn: pass:normal[xref:#BundleController-burn-uint256-[`++burn++`]] +:collateralizePolicy: pass:normal[xref:#BundleController-collateralizePolicy-uint256-bytes32-uint256-[`++collateralizePolicy++`]] +:processPremium: pass:normal[xref:#BundleController-processPremium-uint256-bytes32-uint256-[`++processPremium++`]] +:processPayout: pass:normal[xref:#BundleController-processPayout-uint256-bytes32-uint256-[`++processPayout++`]] +:releasePolicy: pass:normal[xref:#BundleController-releasePolicy-uint256-bytes32-[`++releasePolicy++`]] +:getOwner: pass:normal[xref:#BundleController-getOwner-uint256-[`++getOwner++`]] +:getState: pass:normal[xref:#BundleController-getState-uint256-[`++getState++`]] +:getFilter: pass:normal[xref:#BundleController-getFilter-uint256-[`++getFilter++`]] +:getCapacity: pass:normal[xref:#BundleController-getCapacity-uint256-[`++getCapacity++`]] +:getTotalValueLocked: pass:normal[xref:#BundleController-getTotalValueLocked-uint256-[`++getTotalValueLocked++`]] +:getBalance: pass:normal[xref:#BundleController-getBalance-uint256-[`++getBalance++`]] +:getToken: pass:normal[xref:#BundleController-getToken--[`++getToken++`]] +:getBundle: pass:normal[xref:#BundleController-getBundle-uint256-[`++getBundle++`]] +:bundles: pass:normal[xref:#BundleController-bundles--[`++bundles++`]] +:unburntBundles: pass:normal[xref:#BundleController-unburntBundles-uint256-[`++unburntBundles++`]] +:_getPoolController: pass:normal[xref:#BundleController-_getPoolController--[`++_getPoolController++`]] +:_changeState: pass:normal[xref:#BundleController-_changeState-uint256-enum-IBundle-BundleState-[`++_changeState++`]] +:_setState: pass:normal[xref:#BundleController-_setState-uint256-enum-IBundle-BundleState-[`++_setState++`]] +:_checkStateTransition: pass:normal[xref:#BundleController-_checkStateTransition-enum-IBundle-BundleState-enum-IBundle-BundleState-[`++_checkStateTransition++`]] + +[.contract] +[[BundleController]] +=== `++BundleController++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/modules/BundleController.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/modules/BundleController.sol"; +``` + +The smart contract is used to manage bundles, which are collections of policies. + +- The contract imports other Solidity contracts such as `PolicyController.sol`, `CoreController.sol`, and `BundleToken.sol`. +- The contract implements the `IBundle` interface and extends the `CoreController` contract. +- It defines several mappings to store information about bundles, active policies, locked capital per policy, and the number of unburt bundles for each risk pool. +- There is a private variable `_bundleCount` to keep track of the number of bundles created. +- The contract includes modifiers to restrict access to certain functions, such as `onlyRiskpoolService` and `onlyFundableBundle`. + +The contract includes various modifiers and event emitters to enforce access control and emit relevant events. +Overall, the `BundleController` contract provides functionality to manage bundles and their associated policies, including creating, funding, locking, unlocking, closing, burning, collateralizing, and releasing policies within a bundle. + +[.contract-index] +.Modifiers +-- +* {xref-BundleController-onlyRiskpoolService--}[`++onlyRiskpoolService()++`] +* {xref-BundleController-onlyFundableBundle-uint256-}[`++onlyFundableBundle(bundleId)++`] +-- + +[.contract-index] +.Functions +-- +* {xref-BundleController-_afterInitialize--}[`++_afterInitialize()++`] +* {xref-BundleController-create-address-uint256-bytes-uint256-}[`++create(owner_, riskpoolId_, filter_, amount_)++`] +* {xref-BundleController-fund-uint256-uint256-}[`++fund(bundleId, amount)++`] +* {xref-BundleController-defund-uint256-uint256-}[`++defund(bundleId, amount)++`] +* {xref-BundleController-lock-uint256-}[`++lock(bundleId)++`] +* {xref-BundleController-unlock-uint256-}[`++unlock(bundleId)++`] +* {xref-BundleController-close-uint256-}[`++close(bundleId)++`] +* {xref-BundleController-burn-uint256-}[`++burn(bundleId)++`] +* {xref-BundleController-collateralizePolicy-uint256-bytes32-uint256-}[`++collateralizePolicy(bundleId, processId, amount)++`] +* {xref-BundleController-processPremium-uint256-bytes32-uint256-}[`++processPremium(bundleId, processId, amount)++`] +* {xref-BundleController-processPayout-uint256-bytes32-uint256-}[`++processPayout(bundleId, processId, amount)++`] +* {xref-BundleController-releasePolicy-uint256-bytes32-}[`++releasePolicy(bundleId, processId)++`] +* {xref-BundleController-getOwner-uint256-}[`++getOwner(bundleId)++`] +* {xref-BundleController-getState-uint256-}[`++getState(bundleId)++`] +* {xref-BundleController-getFilter-uint256-}[`++getFilter(bundleId)++`] +* {xref-BundleController-getCapacity-uint256-}[`++getCapacity(bundleId)++`] +* {xref-BundleController-getTotalValueLocked-uint256-}[`++getTotalValueLocked(bundleId)++`] +* {xref-BundleController-getBalance-uint256-}[`++getBalance(bundleId)++`] +* {xref-BundleController-getToken--}[`++getToken()++`] +* {xref-BundleController-getBundle-uint256-}[`++getBundle(bundleId)++`] +* {xref-BundleController-bundles--}[`++bundles()++`] +* {xref-BundleController-unburntBundles-uint256-}[`++unburntBundles(riskpoolId)++`] +* {xref-BundleController-_getPoolController--}[`++_getPoolController()++`] +* {xref-BundleController-_changeState-uint256-enum-IBundle-BundleState-}[`++_changeState(bundleId, newState)++`] +* {xref-BundleController-_setState-uint256-enum-IBundle-BundleState-}[`++_setState(bundleId, newState)++`] +* {xref-BundleController-_checkStateTransition-enum-IBundle-BundleState-enum-IBundle-BundleState-}[`++_checkStateTransition(oldState, newState)++`] + +[.contract-subindex-inherited] +.CoreController +* {xref-CoreController-initialize-address-}[`++initialize(registry)++`] +* {xref-CoreController-_getName--}[`++_getName()++`] +* {xref-CoreController-_getContractAddress-bytes32-}[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-_disableInitializers--[`++_disableInitializers()++`] + +[.contract-subindex-inherited] +.IBundle + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.CoreController + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-Initialized-uint8-[`++Initialized(version)++`] + +[.contract-subindex-inherited] +.IBundle +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IBundle.sol[`++LogBundleCreated(bundleId, riskpoolId, owner, state, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IBundle.sol[`++LogBundleStateChanged(bundleId, oldState, newState)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IBundle.sol[`++LogBundleCapitalProvided(bundleId, sender, amount, capacity)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IBundle.sol[`++LogBundleCapitalWithdrawn(bundleId, recipient, amount, capacity)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IBundle.sol[`++LogBundlePolicyCollateralized(bundleId, processId, amount, capacity)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IBundle.sol[`++LogBundlePayoutProcessed(bundleId, processId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IBundle.sol[`++LogBundlePolicyReleased(bundleId, processId, amount, capacity)++`] + +-- + +[.contract-item] +[[BundleController-onlyRiskpoolService--]] +==== `[.contract-item-name]#++onlyRiskpoolService++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[BundleController-onlyFundableBundle-uint256-]] +==== `[.contract-item-name]#++onlyFundableBundle++#++(uint256 bundleId)++` [.item-kind]#modifier# + +[.contract-item] +[[BundleController-_afterInitialize--]] +==== `[.contract-item-name]#++_afterInitialize++#++()++` [.item-kind]#internal# + +Performs internal operations after the contract initialization. + +[.contract-item] +[[BundleController-create-address-uint256-bytes-uint256-]] +==== `[.contract-item-name]#++create++#++(address owner_, uint256 riskpoolId_, bytes filter_, uint256 amount_) → uint256 bundleId++` [.item-kind]#external# + +Creates a new bundle and mints a corresponding NFT token. Only callable by the RiskpoolService contract. + +[.contract-item] +[[BundleController-fund-uint256-uint256-]] +==== `[.contract-item-name]#++fund++#++(uint256 bundleId, uint256 amount)++` [.item-kind]#external# + +Adds funds to a bundle's capital and balance. + +[.contract-item] +[[BundleController-defund-uint256-uint256-]] +==== `[.contract-item-name]#++defund++#++(uint256 bundleId, uint256 amount)++` [.item-kind]#external# + +Allows the Riskpool service to withdraw `amount` from the `bundleId` Bundle. + +[.contract-item] +[[BundleController-lock-uint256-]] +==== `[.contract-item-name]#++lock++#++(uint256 bundleId)++` [.item-kind]#external# + +Locks a bundle of assets. + +[.contract-item] +[[BundleController-unlock-uint256-]] +==== `[.contract-item-name]#++unlock++#++(uint256 bundleId)++` [.item-kind]#external# + +Unlocks a bundle, changing its state to active. + +[.contract-item] +[[BundleController-close-uint256-]] +==== `[.contract-item-name]#++close++#++(uint256 bundleId)++` [.item-kind]#external# + +Closes a bundle of policies. + +[.contract-item] +[[BundleController-burn-uint256-]] +==== `[.contract-item-name]#++burn++#++(uint256 bundleId)++` [.item-kind]#external# + +Burns a bundle and changes its state to Burned. + +[.contract-item] +[[BundleController-collateralizePolicy-uint256-bytes32-uint256-]] +==== `[.contract-item-name]#++collateralizePolicy++#++(uint256 bundleId, bytes32 processId, uint256 amount)++` [.item-kind]#external# + +Collateralizes a policy by locking a specific amount of capital in the corresponding bundle. + +[.contract-item] +[[BundleController-processPremium-uint256-bytes32-uint256-]] +==== `[.contract-item-name]#++processPremium++#++(uint256 bundleId, bytes32 processId, uint256 amount)++` [.item-kind]#external# + +Process the premium payment for a given bundle and update its balance. + +[.contract-item] +[[BundleController-processPayout-uint256-bytes32-uint256-]] +==== `[.contract-item-name]#++processPayout++#++(uint256 bundleId, bytes32 processId, uint256 amount)++` [.item-kind]#external# + +Processes a payout for a policy from a bundle. + +[.contract-item] +[[BundleController-releasePolicy-uint256-bytes32-]] +==== `[.contract-item-name]#++releasePolicy++#++(uint256 bundleId, bytes32 processId) → uint256 remainingCollateralAmount++` [.item-kind]#external# + +Release a policy and update the bundle capital. + +[.contract-item] +[[BundleController-getOwner-uint256-]] +==== `[.contract-item-name]#++getOwner++#++(uint256 bundleId) → address++` [.item-kind]#public# + +Returns the address of the owner of the token associated with the given bundle ID. + +[.contract-item] +[[BundleController-getState-uint256-]] +==== `[.contract-item-name]#++getState++#++(uint256 bundleId) → enum IBundle.BundleState++` [.item-kind]#public# + +Returns the state of the bundle with the given ID. + +[.contract-item] +[[BundleController-getFilter-uint256-]] +==== `[.contract-item-name]#++getFilter++#++(uint256 bundleId) → bytes++` [.item-kind]#public# + +Returns the filter of a given bundle. + +[.contract-item] +[[BundleController-getCapacity-uint256-]] +==== `[.contract-item-name]#++getCapacity++#++(uint256 bundleId) → uint256++` [.item-kind]#public# + +Returns the available capacity of a bundle. + +[.contract-item] +[[BundleController-getTotalValueLocked-uint256-]] +==== `[.contract-item-name]#++getTotalValueLocked++#++(uint256 bundleId) → uint256++` [.item-kind]#public# + +Returns the total value locked in a particular bundle. + +[.contract-item] +[[BundleController-getBalance-uint256-]] +==== `[.contract-item-name]#++getBalance++#++(uint256 bundleId) → uint256++` [.item-kind]#public# + +Returns the balance of a specific bundle. + +[.contract-item] +[[BundleController-getToken--]] +==== `[.contract-item-name]#++getToken++#++() → contract BundleToken++` [.item-kind]#external# + +Returns the BundleToken contract instance. + +[.contract-item] +[[BundleController-getBundle-uint256-]] +==== `[.contract-item-name]#++getBundle++#++(uint256 bundleId) → struct IBundle.Bundle++` [.item-kind]#public# + +Returns the bundle with the specified bundle ID. + +[.contract-item] +[[BundleController-bundles--]] +==== `[.contract-item-name]#++bundles++#++() → uint256++` [.item-kind]#public# + +Returns the number of bundles created. + +[.contract-item] +[[BundleController-unburntBundles-uint256-]] +==== `[.contract-item-name]#++unburntBundles++#++(uint256 riskpoolId) → uint256++` [.item-kind]#external# + +Returns the number of unburnt bundles for a given riskpool ID. + +[.contract-item] +[[BundleController-_getPoolController--]] +==== `[.contract-item-name]#++_getPoolController++#++() → contract PoolController _poolController++` [.item-kind]#internal# + +Returns the pool controller contract instance. + +[.contract-item] +[[BundleController-_changeState-uint256-enum-IBundle-BundleState-]] +==== `[.contract-item-name]#++_changeState++#++(uint256 bundleId, enum IBundle.BundleState newState)++` [.item-kind]#internal# + +Changes the state of a bundle. + +[.contract-item] +[[BundleController-_setState-uint256-enum-IBundle-BundleState-]] +==== `[.contract-item-name]#++_setState++#++(uint256 bundleId, enum IBundle.BundleState newState)++` [.item-kind]#internal# + +Sets the state and updated timestamp of a given bundle. + +[.contract-item] +[[BundleController-_checkStateTransition-enum-IBundle-BundleState-enum-IBundle-BundleState-]] +==== `[.contract-item-name]#++_checkStateTransition++#++(enum IBundle.BundleState oldState, enum IBundle.BundleState newState)++` [.item-kind]#internal# + +Checks if a state transition is valid. + +The "BundleController" smart contract is designed to manage bundles, which are collections of policies. +It imports other Solidity contracts, implements the "IBundle" interface, and extends the "CoreController" contract. +The contract includes mappings to store information about bundles, active policies, locked capital, and unburt bundles. +It has functions to create bundles, fund and defund them, lock and unlock assets, close and burn bundles, and collateralize and release policies. +The contract includes modifiers and event emitters for access control and important events. +Overall, it provides comprehensive functionality for managing bundles and their associated policies. + +:onlyComponentOwnerService: pass:normal[xref:#ComponentController-onlyComponentOwnerService--[`++onlyComponentOwnerService++`]] +:onlyInstanceOperatorService: pass:normal[xref:#ComponentController-onlyInstanceOperatorService--[`++onlyInstanceOperatorService++`]] +:propose: pass:normal[xref:#ComponentController-propose-contract-IComponent-[`++propose++`]] +:_persistComponent: pass:normal[xref:#ComponentController-_persistComponent-contract-IComponent-[`++_persistComponent++`]] +:exists: pass:normal[xref:#ComponentController-exists-uint256-[`++exists++`]] +:approve: pass:normal[xref:#ComponentController-approve-uint256-[`++approve++`]] +:decline: pass:normal[xref:#ComponentController-decline-uint256-[`++decline++`]] +:suspend: pass:normal[xref:#ComponentController-suspend-uint256-[`++suspend++`]] +:resume: pass:normal[xref:#ComponentController-resume-uint256-[`++resume++`]] +:pause: pass:normal[xref:#ComponentController-pause-uint256-[`++pause++`]] +:unpause: pass:normal[xref:#ComponentController-unpause-uint256-[`++unpause++`]] +:archiveFromComponentOwner: pass:normal[xref:#ComponentController-archiveFromComponentOwner-uint256-[`++archiveFromComponentOwner++`]] +:archiveFromInstanceOperator: pass:normal[xref:#ComponentController-archiveFromInstanceOperator-uint256-[`++archiveFromInstanceOperator++`]] +:getComponent: pass:normal[xref:#ComponentController-getComponent-uint256-[`++getComponent++`]] +:getComponentId: pass:normal[xref:#ComponentController-getComponentId-address-[`++getComponentId++`]] +:getComponentType: pass:normal[xref:#ComponentController-getComponentType-uint256-[`++getComponentType++`]] +:getComponentState: pass:normal[xref:#ComponentController-getComponentState-uint256-[`++getComponentState++`]] +:getOracleId: pass:normal[xref:#ComponentController-getOracleId-uint256-[`++getOracleId++`]] +:getRiskpoolId: pass:normal[xref:#ComponentController-getRiskpoolId-uint256-[`++getRiskpoolId++`]] +:getProductId: pass:normal[xref:#ComponentController-getProductId-uint256-[`++getProductId++`]] +:getRequiredRole: pass:normal[xref:#ComponentController-getRequiredRole-enum-IComponent-ComponentType-[`++getRequiredRole++`]] +:components: pass:normal[xref:#ComponentController-components--[`++components++`]] +:products: pass:normal[xref:#ComponentController-products--[`++products++`]] +:oracles: pass:normal[xref:#ComponentController-oracles--[`++oracles++`]] +:riskpools: pass:normal[xref:#ComponentController-riskpools--[`++riskpools++`]] +:isProduct: pass:normal[xref:#ComponentController-isProduct-uint256-[`++isProduct++`]] +:isOracle: pass:normal[xref:#ComponentController-isOracle-uint256-[`++isOracle++`]] +:isRiskpool: pass:normal[xref:#ComponentController-isRiskpool-uint256-[`++isRiskpool++`]] +:getPolicyFlow: pass:normal[xref:#ComponentController-getPolicyFlow-uint256-[`++getPolicyFlow++`]] +:_changeState: pass:normal[xref:#ComponentController-_changeState-uint256-enum-IComponent-ComponentState-[`++_changeState++`]] +:_checkStateTransition: pass:normal[xref:#ComponentController-_checkStateTransition-enum-IComponent-ComponentState-enum-IComponent-ComponentState-[`++_checkStateTransition++`]] + +[.contract] +[[ComponentController]] +=== `++ComponentController++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/modules/ComponentController.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/modules/ComponentController.sol"; +``` + +The smart contract provides functionality to manage and control components in a system. +The contract defines several mappings and sets to store information about components, such as their addresses, IDs, states, and types. +It also includes modifiers to restrict access to certain functions based on the caller's role. + +The contract also includes various modifiers (`onlyComponentOwnerService` and `onlyInstanceOperatorService`) to ensure that only authorized callers can access certain functions. + +The contract imports several Solidity files from external dependencies and uses the `EnumerableSet` library from the OpenZeppelin library for set operations. + +[.contract-index] +.Modifiers +-- +* {xref-ComponentController-onlyComponentOwnerService--}[`++onlyComponentOwnerService()++`] +* {xref-ComponentController-onlyInstanceOperatorService--}[`++onlyInstanceOperatorService()++`] +-- + +[.contract-index] +.Functions +-- +* {xref-ComponentController-propose-contract-IComponent-}[`++propose(component)++`] +* {xref-ComponentController-_persistComponent-contract-IComponent-}[`++_persistComponent(component)++`] +* {xref-ComponentController-exists-uint256-}[`++exists(id)++`] +* {xref-ComponentController-approve-uint256-}[`++approve(id)++`] +* {xref-ComponentController-decline-uint256-}[`++decline(id)++`] +* {xref-ComponentController-suspend-uint256-}[`++suspend(id)++`] +* {xref-ComponentController-resume-uint256-}[`++resume(id)++`] +* {xref-ComponentController-pause-uint256-}[`++pause(id)++`] +* {xref-ComponentController-unpause-uint256-}[`++unpause(id)++`] +* {xref-ComponentController-archiveFromComponentOwner-uint256-}[`++archiveFromComponentOwner(id)++`] +* {xref-ComponentController-archiveFromInstanceOperator-uint256-}[`++archiveFromInstanceOperator(id)++`] +* {xref-ComponentController-getComponent-uint256-}[`++getComponent(id)++`] +* {xref-ComponentController-getComponentId-address-}[`++getComponentId(componentAddress)++`] +* {xref-ComponentController-getComponentType-uint256-}[`++getComponentType(id)++`] +* {xref-ComponentController-getComponentState-uint256-}[`++getComponentState(id)++`] +* {xref-ComponentController-getOracleId-uint256-}[`++getOracleId(idx)++`] +* {xref-ComponentController-getRiskpoolId-uint256-}[`++getRiskpoolId(idx)++`] +* {xref-ComponentController-getProductId-uint256-}[`++getProductId(idx)++`] +* {xref-ComponentController-getRequiredRole-enum-IComponent-ComponentType-}[`++getRequiredRole(componentType)++`] +* {xref-ComponentController-components--}[`++components()++`] +* {xref-ComponentController-products--}[`++products()++`] +* {xref-ComponentController-oracles--}[`++oracles()++`] +* {xref-ComponentController-riskpools--}[`++riskpools()++`] +* {xref-ComponentController-isProduct-uint256-}[`++isProduct(id)++`] +* {xref-ComponentController-isOracle-uint256-}[`++isOracle(id)++`] +* {xref-ComponentController-isRiskpool-uint256-}[`++isRiskpool(id)++`] +* {xref-ComponentController-getPolicyFlow-uint256-}[`++getPolicyFlow(productId)++`] +* {xref-ComponentController-_changeState-uint256-enum-IComponent-ComponentState-}[`++_changeState(componentId, newState)++`] +* {xref-ComponentController-_checkStateTransition-enum-IComponent-ComponentState-enum-IComponent-ComponentState-}[`++_checkStateTransition(oldState, newState)++`] + +[.contract-subindex-inherited] +.CoreController +* {xref-CoreController-initialize-address-}[`++initialize(registry)++`] +* {xref-CoreController-_getName--}[`++_getName()++`] +* {xref-CoreController-_afterInitialize--}[`++_afterInitialize()++`] +* {xref-CoreController-_getContractAddress-bytes32-}[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-_disableInitializers--[`++_disableInitializers()++`] + +[.contract-subindex-inherited] +.IComponentEvents + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.CoreController + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-Initialized-uint8-[`++Initialized(version)++`] + +[.contract-subindex-inherited] +.IComponentEvents +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentProposed(componentName, componentType, componentAddress, id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentApproved(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentDeclined(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentSuspended(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentResumed(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentPaused(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentUnpaused(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentArchived(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentStateChanged(id, stateOld, stateNew)++`] + +-- + +[.contract-item] +[[ComponentController-onlyComponentOwnerService--]] +==== `[.contract-item-name]#++onlyComponentOwnerService++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[ComponentController-onlyInstanceOperatorService--]] +==== `[.contract-item-name]#++onlyInstanceOperatorService++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[ComponentController-propose-contract-IComponent-]] +==== `[.contract-item-name]#++propose++#++(contract IComponent component)++` [.item-kind]#external# + +Proposes a new component to the system. + +[.contract-item] +[[ComponentController-_persistComponent-contract-IComponent-]] +==== `[.contract-item-name]#++_persistComponent++#++(contract IComponent component) → uint256 id++` [.item-kind]#internal# + +Persists a new component into the system. + +[.contract-item] +[[ComponentController-exists-uint256-]] +==== `[.contract-item-name]#++exists++#++(uint256 id) → bool++` [.item-kind]#public# + +Checks if a component with the given ID exists. + +[.contract-item] +[[ComponentController-approve-uint256-]] +==== `[.contract-item-name]#++approve++#++(uint256 id)++` [.item-kind]#external# + +Approves a component with the given id. + +[.contract-item] +[[ComponentController-decline-uint256-]] +==== `[.contract-item-name]#++decline++#++(uint256 id)++` [.item-kind]#external# + +Changes the state of a component with the given ID to "Declined" and emits a LogComponentDeclined event. + Calls the declineCallback function of the component with the given ID. + +[.contract-item] +[[ComponentController-suspend-uint256-]] +==== `[.contract-item-name]#++suspend++#++(uint256 id)++` [.item-kind]#external# + +Suspends a component with the given ID. + +[.contract-item] +[[ComponentController-resume-uint256-]] +==== `[.contract-item-name]#++resume++#++(uint256 id)++` [.item-kind]#external# + +Resumes a component by changing its state to Active and emitting an event. + It also calls the resumeCallback() function of the component to inform it about the resuming. + +[.contract-item] +[[ComponentController-pause-uint256-]] +==== `[.contract-item-name]#++pause++#++(uint256 id)++` [.item-kind]#external# + +Pauses the component with the given ID. + +[.contract-item] +[[ComponentController-unpause-uint256-]] +==== `[.contract-item-name]#++unpause++#++(uint256 id)++` [.item-kind]#external# + +Unpauses a component with the given id. + +[.contract-item] +[[ComponentController-archiveFromComponentOwner-uint256-]] +==== `[.contract-item-name]#++archiveFromComponentOwner++#++(uint256 id)++` [.item-kind]#external# + +Archives a component with the given ID, changing its state to "Archived" and emitting a LogComponentArchived event. + Also calls the archiveCallback function of the component with the given ID, informing it about the archiving. + +[.contract-item] +[[ComponentController-archiveFromInstanceOperator-uint256-]] +==== `[.contract-item-name]#++archiveFromInstanceOperator++#++(uint256 id)++` [.item-kind]#external# + +Archives a component instance with the given ID. + +[.contract-item] +[[ComponentController-getComponent-uint256-]] +==== `[.contract-item-name]#++getComponent++#++(uint256 id) → contract IComponent component++` [.item-kind]#public# + +Returns the component with the given ID. + +[.contract-item] +[[ComponentController-getComponentId-address-]] +==== `[.contract-item-name]#++getComponentId++#++(address componentAddress) → uint256 id++` [.item-kind]#public# + +Returns the ID of a registered component given its address. + +[.contract-item] +[[ComponentController-getComponentType-uint256-]] +==== `[.contract-item-name]#++getComponentType++#++(uint256 id) → enum IComponent.ComponentType componentType++` [.item-kind]#public# + +Returns the component type of a given component ID. + +[.contract-item] +[[ComponentController-getComponentState-uint256-]] +==== `[.contract-item-name]#++getComponentState++#++(uint256 id) → enum IComponent.ComponentState componentState++` [.item-kind]#public# + +Returns the state of the component with the given ID. + +[.contract-item] +[[ComponentController-getOracleId-uint256-]] +==== `[.contract-item-name]#++getOracleId++#++(uint256 idx) → uint256 oracleId++` [.item-kind]#public# + +Returns the oracle ID at the given index. + +[.contract-item] +[[ComponentController-getRiskpoolId-uint256-]] +==== `[.contract-item-name]#++getRiskpoolId++#++(uint256 idx) → uint256 riskpoolId++` [.item-kind]#public# + +Returns the riskpool ID at the specified index. + +[.contract-item] +[[ComponentController-getProductId-uint256-]] +==== `[.contract-item-name]#++getProductId++#++(uint256 idx) → uint256 productId++` [.item-kind]#public# + +Returns the product ID at the given index in the _products set. + +[.contract-item] +[[ComponentController-getRequiredRole-enum-IComponent-ComponentType-]] +==== `[.contract-item-name]#++getRequiredRole++#++(enum IComponent.ComponentType componentType) → bytes32++` [.item-kind]#external# + +Returns the required role for a given component type. + +[.contract-item] +[[ComponentController-components--]] +==== `[.contract-item-name]#++components++#++() → uint256 count++` [.item-kind]#public# + +Returns the number of components currently stored in the contract. + +[.contract-item] +[[ComponentController-products--]] +==== `[.contract-item-name]#++products++#++() → uint256 count++` [.item-kind]#public# + +Returns the number of products in the set '_products'. + +[.contract-item] +[[ComponentController-oracles--]] +==== `[.contract-item-name]#++oracles++#++() → uint256 count++` [.item-kind]#public# + +Returns the number of oracles registered in the _oracles set. + +[.contract-item] +[[ComponentController-riskpools--]] +==== `[.contract-item-name]#++riskpools++#++() → uint256 count++` [.item-kind]#public# + +Returns the number of risk pools in the EnumerableSet. + +[.contract-item] +[[ComponentController-isProduct-uint256-]] +==== `[.contract-item-name]#++isProduct++#++(uint256 id) → bool++` [.item-kind]#public# + +Check if a product exists in the set of products. + +[.contract-item] +[[ComponentController-isOracle-uint256-]] +==== `[.contract-item-name]#++isOracle++#++(uint256 id) → bool++` [.item-kind]#public# + +Checks if an oracle with a given ID exists. + +[.contract-item] +[[ComponentController-isRiskpool-uint256-]] +==== `[.contract-item-name]#++isRiskpool++#++(uint256 id) → bool++` [.item-kind]#public# + +Checks if a given ID is a riskpool. + +[.contract-item] +[[ComponentController-getPolicyFlow-uint256-]] +==== `[.contract-item-name]#++getPolicyFlow++#++(uint256 productId) → address _policyFlow++` [.item-kind]#public# + +Returns the address of the policy flow for a given product ID. + +[.contract-item] +[[ComponentController-_changeState-uint256-enum-IComponent-ComponentState-]] +==== `[.contract-item-name]#++_changeState++#++(uint256 componentId, enum IComponent.ComponentState newState)++` [.item-kind]#internal# + +Changes the state of a component. + +[.contract-item] +[[ComponentController-_checkStateTransition-enum-IComponent-ComponentState-enum-IComponent-ComponentState-]] +==== `[.contract-item-name]#++_checkStateTransition++#++(enum IComponent.ComponentState oldState, enum IComponent.ComponentState newState)++` [.item-kind]#internal# + +Checks if the state transition is valid. +Throws an error if the newState is the same as the oldState. +Throws an error if the transition from Created state is not to Proposed state. +Throws an error if the transition from Proposed state is not to Active or Declined state. +Throws an error if the transition from Declined state is attempted. +Throws an error if the transition from Active state is not to Paused or Suspended state. +Throws an error if the transition from Paused state is not to Active or Archived state. +Throws an error if the transition from Suspended state is not to Active or Archived state. +Throws an error if the initial state is not handled. + +The "Component Controller" smart contract provides functionality to manage and control components within a system. +It includes mappings and sets to store information about components, such as addresses, IDs, states, and types. +The contract allows component owners to propose new components, and the contract owner can approve, decline, suspend, resume, pause, unpause, or archive components. +Functions are available to retrieve component information, such as ID, type, state, and required role. +The contract includes modifiers to restrict access to authorized callers, and it utilizes external dependencies and libraries for set operations. +Overall, the contract enables efficient management and control of components in a system. + +:_afterInitialize: pass:normal[xref:#LicenseController-_afterInitialize--[`++_afterInitialize++`]] +:getAuthorizationStatus: pass:normal[xref:#LicenseController-getAuthorizationStatus-address-[`++getAuthorizationStatus++`]] +:_isValidCall: pass:normal[xref:#LicenseController-_isValidCall-uint256-[`++_isValidCall++`]] +:_getProduct: pass:normal[xref:#LicenseController-_getProduct-uint256-[`++_getProduct++`]] + +[.contract] +[[LicenseController]] +=== `++LicenseController++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/modules/LicenseController.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/modules/LicenseController.sol"; +``` + +The smart contract serves as a controller contract for managing licenses related to products in an insurance ecosystem. +The contract implements the `ILicense` interface and extends the `CoreController` contract. + +The contract imports two other contracts: `ComponentController.sol` and `CoreController.sol`, which are expected to be located in specific file paths. +It also imports several interfaces from the "etherisc/gif-interface" library, including `IComponent.sol`, `IProduct.sol`, and `ILicense.sol`. +The contract includes a private variable `_component` of type `ComponentController`, which is used to interact with the `ComponentController` contract. + +Overall, the `LicenseController` contract serves as a controller for managing licenses and provides functions to check the authorization status and activity of products within an insurance ecosystem. + +[.contract-index] +.Functions +-- +* {xref-LicenseController-_afterInitialize--}[`++_afterInitialize()++`] +* {xref-LicenseController-getAuthorizationStatus-address-}[`++getAuthorizationStatus(productAddress)++`] +* {xref-LicenseController-_isValidCall-uint256-}[`++_isValidCall(productId)++`] +* {xref-LicenseController-_getProduct-uint256-}[`++_getProduct(id)++`] + +[.contract-subindex-inherited] +.CoreController +* {xref-CoreController-initialize-address-}[`++initialize(registry)++`] +* {xref-CoreController-_getName--}[`++_getName()++`] +* {xref-CoreController-_getContractAddress-bytes32-}[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-_disableInitializers--[`++_disableInitializers()++`] + +[.contract-subindex-inherited] +.ILicense + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.CoreController + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-Initialized-uint8-[`++Initialized(version)++`] + +[.contract-subindex-inherited] +.ILicense + +-- + +[.contract-item] +[[LicenseController-_afterInitialize--]] +==== `[.contract-item-name]#++_afterInitialize++#++()++` [.item-kind]#internal# + +This function is called after the contract is initialized and sets the `_component` variable to the address of the `ComponentController` contract. + +[.contract-item] +[[LicenseController-getAuthorizationStatus-address-]] +==== `[.contract-item-name]#++getAuthorizationStatus++#++(address productAddress) → uint256 productId, bool isAuthorized, address policyFlow++` [.item-kind]#public# + +Returns the authorization status of a given product address. + +[.contract-item] +[[LicenseController-_isValidCall-uint256-]] +==== `[.contract-item-name]#++_isValidCall++#++(uint256 productId) → bool++` [.item-kind]#internal# + +Checks if a product is currently active. + +[.contract-item] +[[LicenseController-_getProduct-uint256-]] +==== `[.contract-item-name]#++_getProduct++#++(uint256 id) → contract IProduct product++` [.item-kind]#internal# + +Returns the product associated with the given ID. + +The "LicenseController" smart contract serves as a controller for managing licenses in an insurance ecosystem. +It implements the ILicense interface and extends the CoreController contract. +The contract interacts with the ComponentController contract to retrieve information about products and their authorization status. +Functions are available to check the authorization status of a product, validate if a product is active, and retrieve product information. +The contract plays a crucial role in managing licenses within the insurance ecosystem. + +:metadata: pass:normal[xref:#PolicyController-metadata-mapping-bytes32----struct-IPolicy-Metadata-[`++metadata++`]] +:applications: pass:normal[xref:#PolicyController-applications-mapping-bytes32----struct-IPolicy-Application-[`++applications++`]] +:policies: pass:normal[xref:#PolicyController-policies-mapping-bytes32----struct-IPolicy-Policy-[`++policies++`]] +:claims: pass:normal[xref:#PolicyController-claims-mapping-bytes32----mapping-uint256----struct-IPolicy-Claim--[`++claims++`]] +:payouts: pass:normal[xref:#PolicyController-payouts-mapping-bytes32----mapping-uint256----struct-IPolicy-Payout--[`++payouts++`]] +:payoutCount: pass:normal[xref:#PolicyController-payoutCount-mapping-bytes32----uint256-[`++payoutCount++`]] +:_afterInitialize: pass:normal[xref:#PolicyController-_afterInitialize--[`++_afterInitialize++`]] +:createPolicyFlow: pass:normal[xref:#PolicyController-createPolicyFlow-address-uint256-bytes-[`++createPolicyFlow++`]] +:createApplication: pass:normal[xref:#PolicyController-createApplication-bytes32-uint256-uint256-bytes-[`++createApplication++`]] +:collectPremium: pass:normal[xref:#PolicyController-collectPremium-bytes32-uint256-[`++collectPremium++`]] +:revokeApplication: pass:normal[xref:#PolicyController-revokeApplication-bytes32-[`++revokeApplication++`]] +:underwriteApplication: pass:normal[xref:#PolicyController-underwriteApplication-bytes32-[`++underwriteApplication++`]] +:declineApplication: pass:normal[xref:#PolicyController-declineApplication-bytes32-[`++declineApplication++`]] +:createPolicy: pass:normal[xref:#PolicyController-createPolicy-bytes32-[`++createPolicy++`]] +:adjustPremiumSumInsured: pass:normal[xref:#PolicyController-adjustPremiumSumInsured-bytes32-uint256-uint256-[`++adjustPremiumSumInsured++`]] +:expirePolicy: pass:normal[xref:#PolicyController-expirePolicy-bytes32-[`++expirePolicy++`]] +:closePolicy: pass:normal[xref:#PolicyController-closePolicy-bytes32-[`++closePolicy++`]] +:createClaim: pass:normal[xref:#PolicyController-createClaim-bytes32-uint256-bytes-[`++createClaim++`]] +:confirmClaim: pass:normal[xref:#PolicyController-confirmClaim-bytes32-uint256-uint256-[`++confirmClaim++`]] +:declineClaim: pass:normal[xref:#PolicyController-declineClaim-bytes32-uint256-[`++declineClaim++`]] +:closeClaim: pass:normal[xref:#PolicyController-closeClaim-bytes32-uint256-[`++closeClaim++`]] +:createPayout: pass:normal[xref:#PolicyController-createPayout-bytes32-uint256-uint256-bytes-[`++createPayout++`]] +:processPayout: pass:normal[xref:#PolicyController-processPayout-bytes32-uint256-[`++processPayout++`]] +:getMetadata: pass:normal[xref:#PolicyController-getMetadata-bytes32-[`++getMetadata++`]] +:getApplication: pass:normal[xref:#PolicyController-getApplication-bytes32-[`++getApplication++`]] +:getNumberOfClaims: pass:normal[xref:#PolicyController-getNumberOfClaims-bytes32-[`++getNumberOfClaims++`]] +:getNumberOfPayouts: pass:normal[xref:#PolicyController-getNumberOfPayouts-bytes32-[`++getNumberOfPayouts++`]] +:getPolicy: pass:normal[xref:#PolicyController-getPolicy-bytes32-[`++getPolicy++`]] +:getClaim: pass:normal[xref:#PolicyController-getClaim-bytes32-uint256-[`++getClaim++`]] +:getPayout: pass:normal[xref:#PolicyController-getPayout-bytes32-uint256-[`++getPayout++`]] +:processIds: pass:normal[xref:#PolicyController-processIds--[`++processIds++`]] + +[.contract] +[[PolicyController]] +=== `++PolicyController++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/modules/PolicyController.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/modules/PolicyController.sol"; +``` + +The smart contract implements functions for policy operations, including creation, update, cancellation, and retrieval. +It also provides functions for claim creation, confirmation, decline, closure, and payout creation. +Additionally, it includes functions to process payouts, retrieve metadata and application information, and get the number of claims and payouts associated with a policy. +The contract inherits from the `IPolicy` interface and the `CoreController` contract. + +State Variables: + +- `metadata`: A mapping that stores metadata associated with policy flows. +- `applications`: A mapping that stores insurance applications associated with policy flows. +- `policies`: A mapping that stores policies associated with policy flows. +- `claims`: A nested mapping that stores claims associated with policies. +- `payouts`: A nested mapping that stores payouts associated with policies. +- `payoutCount`: A mapping that stores the count of payouts for each policy flow. +- `_assigendProcessIds`: A counter variable for assigning unique process IDs. +- `_component`: A reference to the `ComponentController` contract. + +Overall, these functions provide functionality for creating, managing, and processing claims and payouts within the insurance policy contract. + +[.contract-index] +.Functions +-- +* {xref-PolicyController-_afterInitialize--}[`++_afterInitialize()++`] +* {xref-PolicyController-createPolicyFlow-address-uint256-bytes-}[`++createPolicyFlow(owner, productId, data)++`] +* {xref-PolicyController-createApplication-bytes32-uint256-uint256-bytes-}[`++createApplication(processId, premiumAmount, sumInsuredAmount, data)++`] +* {xref-PolicyController-collectPremium-bytes32-uint256-}[`++collectPremium(processId, amount)++`] +* {xref-PolicyController-revokeApplication-bytes32-}[`++revokeApplication(processId)++`] +* {xref-PolicyController-underwriteApplication-bytes32-}[`++underwriteApplication(processId)++`] +* {xref-PolicyController-declineApplication-bytes32-}[`++declineApplication(processId)++`] +* {xref-PolicyController-createPolicy-bytes32-}[`++createPolicy(processId)++`] +* {xref-PolicyController-adjustPremiumSumInsured-bytes32-uint256-uint256-}[`++adjustPremiumSumInsured(processId, expectedPremiumAmount, sumInsuredAmount)++`] +* {xref-PolicyController-expirePolicy-bytes32-}[`++expirePolicy(processId)++`] +* {xref-PolicyController-closePolicy-bytes32-}[`++closePolicy(processId)++`] +* {xref-PolicyController-createClaim-bytes32-uint256-bytes-}[`++createClaim(processId, claimAmount, data)++`] +* {xref-PolicyController-confirmClaim-bytes32-uint256-uint256-}[`++confirmClaim(processId, claimId, confirmedAmount)++`] +* {xref-PolicyController-declineClaim-bytes32-uint256-}[`++declineClaim(processId, claimId)++`] +* {xref-PolicyController-closeClaim-bytes32-uint256-}[`++closeClaim(processId, claimId)++`] +* {xref-PolicyController-createPayout-bytes32-uint256-uint256-bytes-}[`++createPayout(processId, claimId, payoutAmount, data)++`] +* {xref-PolicyController-processPayout-bytes32-uint256-}[`++processPayout(processId, payoutId)++`] +* {xref-PolicyController-getMetadata-bytes32-}[`++getMetadata(processId)++`] +* {xref-PolicyController-getApplication-bytes32-}[`++getApplication(processId)++`] +* {xref-PolicyController-getNumberOfClaims-bytes32-}[`++getNumberOfClaims(processId)++`] +* {xref-PolicyController-getNumberOfPayouts-bytes32-}[`++getNumberOfPayouts(processId)++`] +* {xref-PolicyController-getPolicy-bytes32-}[`++getPolicy(processId)++`] +* {xref-PolicyController-getClaim-bytes32-uint256-}[`++getClaim(processId, claimId)++`] +* {xref-PolicyController-getPayout-bytes32-uint256-}[`++getPayout(processId, payoutId)++`] +* {xref-PolicyController-processIds--}[`++processIds()++`] + +[.contract-subindex-inherited] +.CoreController +* {xref-CoreController-initialize-address-}[`++initialize(registry)++`] +* {xref-CoreController-_getName--}[`++_getName()++`] +* {xref-CoreController-_getContractAddress-bytes32-}[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-_disableInitializers--[`++_disableInitializers()++`] + +[.contract-subindex-inherited] +.IPolicy + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.CoreController + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-Initialized-uint8-[`++Initialized(version)++`] + +[.contract-subindex-inherited] +.IPolicy +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogMetadataCreated(owner, processId, productId, state)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogMetadataStateChanged(processId, state)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogApplicationCreated(processId, premiumAmount, sumInsuredAmount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogApplicationRevoked(processId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogApplicationUnderwritten(processId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogApplicationDeclined(processId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogPolicyCreated(processId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogPolicyExpired(processId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogPolicyClosed(processId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogPremiumCollected(processId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogApplicationSumInsuredAdjusted(processId, sumInsuredAmountOld, sumInsuredAmount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogApplicationPremiumAdjusted(processId, premiumAmountOld, premiumAmount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogPolicyPremiumAdjusted(processId, premiumExpectedAmountOld, premiumExpectedAmount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogClaimCreated(processId, claimId, claimAmount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogClaimConfirmed(processId, claimId, confirmedAmount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogClaimDeclined(processId, claimId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogClaimClosed(processId, claimId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogPayoutCreated(processId, claimId, payoutId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPolicy.sol[`++LogPayoutProcessed(processId, payoutId)++`] + +-- + +[.contract-item] +[[PolicyController-_afterInitialize--]] +==== `[.contract-item-name]#++_afterInitialize++#++()++` [.item-kind]#internal# + +Internal function that sets the _component variable to the address of the ComponentController contract. + +[.contract-item] +[[PolicyController-createPolicyFlow-address-uint256-bytes-]] +==== `[.contract-item-name]#++createPolicyFlow++#++(address owner, uint256 productId, bytes data) → bytes32 processId++` [.item-kind]#external# + +Creates a new policy flow for a given owner and product. + +[.contract-item] +[[PolicyController-createApplication-bytes32-uint256-uint256-bytes-]] +==== `[.contract-item-name]#++createApplication++#++(bytes32 processId, uint256 premiumAmount, uint256 sumInsuredAmount, bytes data)++` [.item-kind]#external# + +Creates a new insurance application for a given process ID. + +[.contract-item] +[[PolicyController-collectPremium-bytes32-uint256-]] +==== `[.contract-item-name]#++collectPremium++#++(bytes32 processId, uint256 amount)++` [.item-kind]#external# + +Collects premium for a policy. + +[.contract-item] +[[PolicyController-revokeApplication-bytes32-]] +==== `[.contract-item-name]#++revokeApplication++#++(bytes32 processId)++` [.item-kind]#external# + +Revokes an application with the given process ID. + +[.contract-item] +[[PolicyController-underwriteApplication-bytes32-]] +==== `[.contract-item-name]#++underwriteApplication++#++(bytes32 processId)++` [.item-kind]#external# + +Changes the state of an application to underwritten. + +[.contract-item] +[[PolicyController-declineApplication-bytes32-]] +==== `[.contract-item-name]#++declineApplication++#++(bytes32 processId)++` [.item-kind]#external# + +Declines an application for a policy flow. + +[.contract-item] +[[PolicyController-createPolicy-bytes32-]] +==== `[.contract-item-name]#++createPolicy++#++(bytes32 processId)++` [.item-kind]#external# + +Creates a new policy for a given application process ID. + +[.contract-item] +[[PolicyController-adjustPremiumSumInsured-bytes32-uint256-uint256-]] +==== `[.contract-item-name]#++adjustPremiumSumInsured++#++(bytes32 processId, uint256 expectedPremiumAmount, uint256 sumInsuredAmount)++` [.item-kind]#external# + +This function adjusts the premium and sum insured amount of an insurance policy application. + +[.contract-item] +[[PolicyController-expirePolicy-bytes32-]] +==== `[.contract-item-name]#++expirePolicy++#++(bytes32 processId)++` [.item-kind]#external# + +This function expires a policy with the given process ID. + +[.contract-item] +[[PolicyController-closePolicy-bytes32-]] +==== `[.contract-item-name]#++closePolicy++#++(bytes32 processId)++` [.item-kind]#external# + +Closes a policy that has expired and has no open claims. + +[.contract-item] +[[PolicyController-createClaim-bytes32-uint256-bytes-]] +==== `[.contract-item-name]#++createClaim++#++(bytes32 processId, uint256 claimAmount, bytes data) → uint256 claimId++` [.item-kind]#external# + +Creates a new claim for a given policy. + +[.contract-item] +[[PolicyController-confirmClaim-bytes32-uint256-uint256-]] +==== `[.contract-item-name]#++confirmClaim++#++(bytes32 processId, uint256 claimId, uint256 confirmedAmount)++` [.item-kind]#external# + +Confirms a claim for a policy, updating the claim state to Confirmed and setting the confirmed amount. + +[.contract-item] +[[PolicyController-declineClaim-bytes32-uint256-]] +==== `[.contract-item-name]#++declineClaim++#++(bytes32 processId, uint256 claimId)++` [.item-kind]#external# + +This function allows the Policy contract to decline a claim. + +[.contract-item] +[[PolicyController-closeClaim-bytes32-uint256-]] +==== `[.contract-item-name]#++closeClaim++#++(bytes32 processId, uint256 claimId)++` [.item-kind]#external# + +Closes a claim for a given policy. + +[.contract-item] +[[PolicyController-createPayout-bytes32-uint256-uint256-bytes-]] +==== `[.contract-item-name]#++createPayout++#++(bytes32 processId, uint256 claimId, uint256 payoutAmount, bytes data) → uint256 payoutId++` [.item-kind]#external# + +Creates a new payout for a confirmed claim in a policy. + +[.contract-item] +[[PolicyController-processPayout-bytes32-uint256-]] +==== `[.contract-item-name]#++processPayout++#++(bytes32 processId, uint256 payoutId)++` [.item-kind]#external# + +Processes a payout for a policy and claim. + +[.contract-item] +[[PolicyController-getMetadata-bytes32-]] +==== `[.contract-item-name]#++getMetadata++#++(bytes32 processId) → struct IPolicy.Metadata _metadata++` [.item-kind]#public# + +Returns the metadata for the given process ID. + +[.contract-item] +[[PolicyController-getApplication-bytes32-]] +==== `[.contract-item-name]#++getApplication++#++(bytes32 processId) → struct IPolicy.Application application++` [.item-kind]#public# + +Returns the application associated with the provided process ID. + +[.contract-item] +[[PolicyController-getNumberOfClaims-bytes32-]] +==== `[.contract-item-name]#++getNumberOfClaims++#++(bytes32 processId) → uint256 numberOfClaims++` [.item-kind]#external# + +Returns the number of claims associated with a given process ID. + +[.contract-item] +[[PolicyController-getNumberOfPayouts-bytes32-]] +==== `[.contract-item-name]#++getNumberOfPayouts++#++(bytes32 processId) → uint256 numberOfPayouts++` [.item-kind]#external# + +Returns the number of payouts for a given process ID. + +[.contract-item] +[[PolicyController-getPolicy-bytes32-]] +==== `[.contract-item-name]#++getPolicy++#++(bytes32 processId) → struct IPolicy.Policy policy++` [.item-kind]#public# + +Returns the policy associated with the given process ID. + +[.contract-item] +[[PolicyController-getClaim-bytes32-uint256-]] +==== `[.contract-item-name]#++getClaim++#++(bytes32 processId, uint256 claimId) → struct IPolicy.Claim claim++` [.item-kind]#public# + +Returns the claim with the given ID for the specified process. + +[.contract-item] +[[PolicyController-getPayout-bytes32-uint256-]] +==== `[.contract-item-name]#++getPayout++#++(bytes32 processId, uint256 payoutId) → struct IPolicy.Payout payout++` [.item-kind]#public# + +Retrieves a specific payout from a process. + +[.contract-item] +[[PolicyController-processIds--]] +==== `[.contract-item-name]#++processIds++#++() → uint256++` [.item-kind]#external# + +Returns the number of process IDs that have been assigned. + +The "PolicyController" smart contract implements functions for policy operations, such as creation, update, cancellation, and retrieval. +It also handles claim creation, confirmation, decline, closure, and payout creation. +The contract includes mappings to store policies, claims, payouts, and metadata associated with policy flows. +It inherits from the IPolicy interface and the CoreController contract. +The functions validate inputs, update states, and emit events to manage the lifecycle of policies, claims, and payouts. +The contract provides comprehensive functionality for managing insurance policies and associated operations. + +:FULL_COLLATERALIZATION_LEVEL: pass:normal[xref:#PoolController-FULL_COLLATERALIZATION_LEVEL-uint256[`++FULL_COLLATERALIZATION_LEVEL++`]] +:COLLATERALIZATION_LEVEL_CAP: pass:normal[xref:#PoolController-COLLATERALIZATION_LEVEL_CAP-uint256[`++COLLATERALIZATION_LEVEL_CAP++`]] +:DEFAULT_MAX_NUMBER_OF_ACTIVE_BUNDLES: pass:normal[xref:#PoolController-DEFAULT_MAX_NUMBER_OF_ACTIVE_BUNDLES-uint256[`++DEFAULT_MAX_NUMBER_OF_ACTIVE_BUNDLES++`]] +:onlyInstanceOperatorService: pass:normal[xref:#PoolController-onlyInstanceOperatorService--[`++onlyInstanceOperatorService++`]] +:onlyRiskpoolService: pass:normal[xref:#PoolController-onlyRiskpoolService--[`++onlyRiskpoolService++`]] +:onlyActivePool: pass:normal[xref:#PoolController-onlyActivePool-uint256-[`++onlyActivePool++`]] +:onlyActivePoolForProcess: pass:normal[xref:#PoolController-onlyActivePoolForProcess-bytes32-[`++onlyActivePoolForProcess++`]] +:_afterInitialize: pass:normal[xref:#PoolController-_afterInitialize--[`++_afterInitialize++`]] +:registerRiskpool: pass:normal[xref:#PoolController-registerRiskpool-uint256-address-address-uint256-uint256-[`++registerRiskpool++`]] +:setRiskpoolForProduct: pass:normal[xref:#PoolController-setRiskpoolForProduct-uint256-uint256-[`++setRiskpoolForProduct++`]] +:fund: pass:normal[xref:#PoolController-fund-uint256-uint256-[`++fund++`]] +:defund: pass:normal[xref:#PoolController-defund-uint256-uint256-[`++defund++`]] +:underwrite: pass:normal[xref:#PoolController-underwrite-bytes32-[`++underwrite++`]] +:calculateCollateral: pass:normal[xref:#PoolController-calculateCollateral-uint256-uint256-[`++calculateCollateral++`]] +:processPremium: pass:normal[xref:#PoolController-processPremium-bytes32-uint256-[`++processPremium++`]] +:processPayout: pass:normal[xref:#PoolController-processPayout-bytes32-uint256-[`++processPayout++`]] +:release: pass:normal[xref:#PoolController-release-bytes32-[`++release++`]] +:setMaximumNumberOfActiveBundles: pass:normal[xref:#PoolController-setMaximumNumberOfActiveBundles-uint256-uint256-[`++setMaximumNumberOfActiveBundles++`]] +:getMaximumNumberOfActiveBundles: pass:normal[xref:#PoolController-getMaximumNumberOfActiveBundles-uint256-[`++getMaximumNumberOfActiveBundles++`]] +:riskpools: pass:normal[xref:#PoolController-riskpools--[`++riskpools++`]] +:getRiskpool: pass:normal[xref:#PoolController-getRiskpool-uint256-[`++getRiskpool++`]] +:getRiskPoolForProduct: pass:normal[xref:#PoolController-getRiskPoolForProduct-uint256-[`++getRiskPoolForProduct++`]] +:activeBundles: pass:normal[xref:#PoolController-activeBundles-uint256-[`++activeBundles++`]] +:getActiveBundleId: pass:normal[xref:#PoolController-getActiveBundleId-uint256-uint256-[`++getActiveBundleId++`]] +:addBundleIdToActiveSet: pass:normal[xref:#PoolController-addBundleIdToActiveSet-uint256-uint256-[`++addBundleIdToActiveSet++`]] +:removeBundleIdFromActiveSet: pass:normal[xref:#PoolController-removeBundleIdFromActiveSet-uint256-uint256-[`++removeBundleIdFromActiveSet++`]] +:getFullCollateralizationLevel: pass:normal[xref:#PoolController-getFullCollateralizationLevel--[`++getFullCollateralizationLevel++`]] +:_getRiskpoolComponent: pass:normal[xref:#PoolController-_getRiskpoolComponent-struct-IPolicy-Metadata-[`++_getRiskpoolComponent++`]] +:_getRiskpoolForId: pass:normal[xref:#PoolController-_getRiskpoolForId-uint256-[`++_getRiskpoolForId++`]] + +[.contract] +[[PoolController]] +=== `++PoolController++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/modules/PoolController.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/modules/PoolController.sol"; +``` + +The smart contract manages riskpools, their registration, funding, defunding, collateralization, and other related operations. + +- The contract implements the IPool interface and extends the CoreController contract. +- It imports other contracts such as ComponentController, PolicyController, BundleController, and CoreController. +- It uses the EnumerableSet library from OpenZeppelin for managing sets of bundle IDs. +- The contract defines constants for full collateralization level, collateralization level cap, and default maximum number of active bundles. +- It maintains mappings to store riskpool information, riskpool IDs for products, maximum number of active bundles for riskpools, and active bundle IDs for riskpools. +- The contract has a private array to store riskpool IDs. +- It has references to other contracts: ComponentController, PolicyController, and BundleController. +- The contract defines modifiers for access control to specific functions. + +Overall, the PoolController contract provides functionality to manage riskpools, register riskpools, collateralize policies, process premium payments, process payouts, and release collaterals. It acts as an intermediary between the PolicyController, ComponentController, and BundleController contracts to coordinate these operations. + +[.contract-index] +.Modifiers +-- +* {xref-PoolController-onlyInstanceOperatorService--}[`++onlyInstanceOperatorService()++`] +* {xref-PoolController-onlyRiskpoolService--}[`++onlyRiskpoolService()++`] +* {xref-PoolController-onlyActivePool-uint256-}[`++onlyActivePool(riskpoolId)++`] +* {xref-PoolController-onlyActivePoolForProcess-bytes32-}[`++onlyActivePoolForProcess(processId)++`] +-- + +[.contract-index] +.Functions +-- +* {xref-PoolController-_afterInitialize--}[`++_afterInitialize()++`] +* {xref-PoolController-registerRiskpool-uint256-address-address-uint256-uint256-}[`++registerRiskpool(riskpoolId, wallet, erc20Token, collateralizationLevel, sumOfSumInsuredCap)++`] +* {xref-PoolController-setRiskpoolForProduct-uint256-uint256-}[`++setRiskpoolForProduct(productId, riskpoolId)++`] +* {xref-PoolController-fund-uint256-uint256-}[`++fund(riskpoolId, amount)++`] +* {xref-PoolController-defund-uint256-uint256-}[`++defund(riskpoolId, amount)++`] +* {xref-PoolController-underwrite-bytes32-}[`++underwrite(processId)++`] +* {xref-PoolController-calculateCollateral-uint256-uint256-}[`++calculateCollateral(riskpoolId, sumInsuredAmount)++`] +* {xref-PoolController-processPremium-bytes32-uint256-}[`++processPremium(processId, amount)++`] +* {xref-PoolController-processPayout-bytes32-uint256-}[`++processPayout(processId, amount)++`] +* {xref-PoolController-release-bytes32-}[`++release(processId)++`] +* {xref-PoolController-setMaximumNumberOfActiveBundles-uint256-uint256-}[`++setMaximumNumberOfActiveBundles(riskpoolId, maxNumberOfActiveBundles)++`] +* {xref-PoolController-getMaximumNumberOfActiveBundles-uint256-}[`++getMaximumNumberOfActiveBundles(riskpoolId)++`] +* {xref-PoolController-riskpools--}[`++riskpools()++`] +* {xref-PoolController-getRiskpool-uint256-}[`++getRiskpool(riskpoolId)++`] +* {xref-PoolController-getRiskPoolForProduct-uint256-}[`++getRiskPoolForProduct(productId)++`] +* {xref-PoolController-activeBundles-uint256-}[`++activeBundles(riskpoolId)++`] +* {xref-PoolController-getActiveBundleId-uint256-uint256-}[`++getActiveBundleId(riskpoolId, bundleIdx)++`] +* {xref-PoolController-addBundleIdToActiveSet-uint256-uint256-}[`++addBundleIdToActiveSet(riskpoolId, bundleId)++`] +* {xref-PoolController-removeBundleIdFromActiveSet-uint256-uint256-}[`++removeBundleIdFromActiveSet(riskpoolId, bundleId)++`] +* {xref-PoolController-getFullCollateralizationLevel--}[`++getFullCollateralizationLevel()++`] +* {xref-PoolController-_getRiskpoolComponent-struct-IPolicy-Metadata-}[`++_getRiskpoolComponent(metadata)++`] +* {xref-PoolController-_getRiskpoolForId-uint256-}[`++_getRiskpoolForId(riskpoolId)++`] + +[.contract-subindex-inherited] +.CoreController +* {xref-CoreController-initialize-address-}[`++initialize(registry)++`] +* {xref-CoreController-_getName--}[`++_getName()++`] +* {xref-CoreController-_getContractAddress-bytes32-}[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-_disableInitializers--[`++_disableInitializers()++`] + +[.contract-subindex-inherited] +.IPool + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.CoreController + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-Initialized-uint8-[`++Initialized(version)++`] + +[.contract-subindex-inherited] +.IPool +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPool.sol[`++LogRiskpoolRegistered(riskpoolId, wallet, erc20Token, collateralizationLevel, sumOfSumInsuredCap)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPool.sol[`++LogRiskpoolRequiredCollateral(processId, sumInsured, collateral)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPool.sol[`++LogRiskpoolCollateralizationFailed(riskpoolId, processId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPool.sol[`++LogRiskpoolCollateralizationSucceeded(riskpoolId, processId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IPool.sol[`++LogRiskpoolCollateralReleased(riskpoolId, processId, amount)++`] + +-- + +[.contract-item] +[[PoolController-onlyInstanceOperatorService--]] +==== `[.contract-item-name]#++onlyInstanceOperatorService++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[PoolController-onlyRiskpoolService--]] +==== `[.contract-item-name]#++onlyRiskpoolService++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[PoolController-onlyActivePool-uint256-]] +==== `[.contract-item-name]#++onlyActivePool++#++(uint256 riskpoolId)++` [.item-kind]#modifier# + +[.contract-item] +[[PoolController-onlyActivePoolForProcess-bytes32-]] +==== `[.contract-item-name]#++onlyActivePoolForProcess++#++(bytes32 processId)++` [.item-kind]#modifier# + +[.contract-item] +[[PoolController-_afterInitialize--]] +==== `[.contract-item-name]#++_afterInitialize++#++()++` [.item-kind]#internal# + +This function is called after the contract is initialized and sets the addresses of the ComponentController, PolicyController, and BundleController contracts. + +[.contract-item] +[[PoolController-registerRiskpool-uint256-address-address-uint256-uint256-]] +==== `[.contract-item-name]#++registerRiskpool++#++(uint256 riskpoolId, address wallet, address erc20Token, uint256 collateralizationLevel, uint256 sumOfSumInsuredCap)++` [.item-kind]#external# + +Registers a new riskpool with the given parameters. + +[.contract-item] +[[PoolController-setRiskpoolForProduct-uint256-uint256-]] +==== `[.contract-item-name]#++setRiskpoolForProduct++#++(uint256 productId, uint256 riskpoolId)++` [.item-kind]#external# + +Sets the riskpool ID for a given product ID. + +[.contract-item] +[[PoolController-fund-uint256-uint256-]] +==== `[.contract-item-name]#++fund++#++(uint256 riskpoolId, uint256 amount)++` [.item-kind]#external# + +Adds funds to a specific riskpool. + +[.contract-item] +[[PoolController-defund-uint256-uint256-]] +==== `[.contract-item-name]#++defund++#++(uint256 riskpoolId, uint256 amount)++` [.item-kind]#external# + +Allows the Riskpool service to defund the specified Riskpool by the given amount. + +[.contract-item] +[[PoolController-underwrite-bytes32-]] +==== `[.contract-item-name]#++underwrite++#++(bytes32 processId) → bool success++` [.item-kind]#external# + +Underwrites a policy application by calculating the required collateral amount and asking the responsible riskpool to secure the application. + +[.contract-item] +[[PoolController-calculateCollateral-uint256-uint256-]] +==== `[.contract-item-name]#++calculateCollateral++#++(uint256 riskpoolId, uint256 sumInsuredAmount) → uint256 collateralAmount++` [.item-kind]#public# + +Calculates the required collateral amount for a given riskpool and sum insured amount. + +[.contract-item] +[[PoolController-processPremium-bytes32-uint256-]] +==== `[.contract-item-name]#++processPremium++#++(bytes32 processId, uint256 amount)++` [.item-kind]#external# + +Processes the premium payment for a policy. + +[.contract-item] +[[PoolController-processPayout-bytes32-uint256-]] +==== `[.contract-item-name]#++processPayout++#++(bytes32 processId, uint256 amount)++` [.item-kind]#external# + +Process a payout for a policy flow in the Pool. + +[.contract-item] +[[PoolController-release-bytes32-]] +==== `[.contract-item-name]#++release++#++(bytes32 processId)++` [.item-kind]#external# + +Releases a policy's collateral from the riskpool. + +[.contract-item] +[[PoolController-setMaximumNumberOfActiveBundles-uint256-uint256-]] +==== `[.contract-item-name]#++setMaximumNumberOfActiveBundles++#++(uint256 riskpoolId, uint256 maxNumberOfActiveBundles)++` [.item-kind]#external# + +Sets the maximum number of active bundles for a given riskpool ID. + +[.contract-item] +[[PoolController-getMaximumNumberOfActiveBundles-uint256-]] +==== `[.contract-item-name]#++getMaximumNumberOfActiveBundles++#++(uint256 riskpoolId) → uint256 maximumNumberOfActiveBundles++` [.item-kind]#public# + +Returns the maximum number of active bundles for a given riskpool ID. + +[.contract-item] +[[PoolController-riskpools--]] +==== `[.contract-item-name]#++riskpools++#++() → uint256 idx++` [.item-kind]#external# + +Returns the number of risk pools created. + +[.contract-item] +[[PoolController-getRiskpool-uint256-]] +==== `[.contract-item-name]#++getRiskpool++#++(uint256 riskpoolId) → struct IPool.Pool riskPool++` [.item-kind]#public# + +Returns the risk pool data for a given risk pool ID. + +[.contract-item] +[[PoolController-getRiskPoolForProduct-uint256-]] +==== `[.contract-item-name]#++getRiskPoolForProduct++#++(uint256 productId) → uint256 riskpoolId++` [.item-kind]#external# + +Returns the risk pool ID associated with the given product ID. + +[.contract-item] +[[PoolController-activeBundles-uint256-]] +==== `[.contract-item-name]#++activeBundles++#++(uint256 riskpoolId) → uint256 numberOfActiveBundles++` [.item-kind]#external# + +Returns the number of active bundles for a given risk pool ID. + +[.contract-item] +[[PoolController-getActiveBundleId-uint256-uint256-]] +==== `[.contract-item-name]#++getActiveBundleId++#++(uint256 riskpoolId, uint256 bundleIdx) → uint256 bundleId++` [.item-kind]#external# + +Returns the active bundle ID at the specified index for the given risk pool ID. + +[.contract-item] +[[PoolController-addBundleIdToActiveSet-uint256-uint256-]] +==== `[.contract-item-name]#++addBundleIdToActiveSet++#++(uint256 riskpoolId, uint256 bundleId)++` [.item-kind]#external# + +Adds a bundle ID to the active set for a specific riskpool ID. + +[.contract-item] +[[PoolController-removeBundleIdFromActiveSet-uint256-uint256-]] +==== `[.contract-item-name]#++removeBundleIdFromActiveSet++#++(uint256 riskpoolId, uint256 bundleId)++` [.item-kind]#external# + +Removes a bundle ID from the active set for a given risk pool ID. + +[.contract-item] +[[PoolController-getFullCollateralizationLevel--]] +==== `[.contract-item-name]#++getFullCollateralizationLevel++#++() → uint256++` [.item-kind]#external# + +Returns the full collateralization level of the contract. + +[.contract-item] +[[PoolController-_getRiskpoolComponent-struct-IPolicy-Metadata-]] +==== `[.contract-item-name]#++_getRiskpoolComponent++#++(struct IPolicy.Metadata metadata) → contract IRiskpool riskpool++` [.item-kind]#internal# + +Returns the Riskpool contract instance associated with the given policy metadata. + +[.contract-item] +[[PoolController-_getRiskpoolForId-uint256-]] +==== `[.contract-item-name]#++_getRiskpoolForId++#++(uint256 riskpoolId) → contract IRiskpool riskpool++` [.item-kind]#internal# + +Returns the Riskpool contract instance for a given riskpoolId. + +The "PoolController" smart contract manages riskpools and their operations, including registration, funding, defunding, collateralization, and more. +It interacts with other contracts such as ComponentController, PolicyController, and BundleController. +The contract maintains mappings to store riskpool information and handles functions for funding, defunding, underwriting, calculating collateral, processing premiums and payouts, and releasing collateral. +It ensures access control through modifiers and emits events to track the success or failure of operations. +The PoolController contract acts as a central component for coordinating riskpool-related operations within the ecosystem. + +:onlyOracleService: pass:normal[xref:#QueryModule-onlyOracleService--[`++onlyOracleService++`]] +:onlyResponsibleOracle: pass:normal[xref:#QueryModule-onlyResponsibleOracle-uint256-address-[`++onlyResponsibleOracle++`]] +:_afterInitialize: pass:normal[xref:#QueryModule-_afterInitialize--[`++_afterInitialize++`]] +:request: pass:normal[xref:#QueryModule-request-bytes32-bytes-string-address-uint256-[`++request++`]] +:respond: pass:normal[xref:#QueryModule-respond-uint256-address-bytes-[`++respond++`]] +:cancel: pass:normal[xref:#QueryModule-cancel-uint256-[`++cancel++`]] +:getProcessId: pass:normal[xref:#QueryModule-getProcessId-uint256-[`++getProcessId++`]] +:getOracleRequestCount: pass:normal[xref:#QueryModule-getOracleRequestCount--[`++getOracleRequestCount++`]] +:_getOracle: pass:normal[xref:#QueryModule-_getOracle-uint256-[`++_getOracle++`]] + +[.contract] +[[QueryModule]] +=== `++QueryModule++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/modules/QueryModule.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/modules/QueryModule.sol"; +``` + +The smart contract implements the "IQuery" interface and extends the "CoreController" contract. +The contract imports several external contracts from the "etherisc/gif-interface" repository, including "IComponent.sol", "IOracle.sol", "IQuery.sol", and "IInstanceService.sol". +It also imports two local contracts, "ComponentController.sol" and "CoreController.sol". + +The contract defines a private variable `_component` of type "ComponentController" and an array `_oracleRequests` of type "OracleRequest[]". + +The contract includes two modifiers: + +1. `onlyOracleService`: It requires that the caller must be the contract with the address specified by the "OracleService" contract address stored in the CoreController. +2. `onlyResponsibleOracle`: It checks if the oracle specified by the `responder` address is responsible for the given `requestId`. + +The contract emits the following events: + +1. `LogOracleRequested`: Indicates the creation of a new oracle request and includes the process ID, request ID, and responsible oracle ID. +2. `LogOracleResponded`: Indicates the response to an oracle request and includes the process ID, request ID, responder address, and success status. +3. `LogOracleCanceled`: Indicates the cancellation of an oracle request and includes the request ID. + +[.contract-index] +.Modifiers +-- +* {xref-QueryModule-onlyOracleService--}[`++onlyOracleService()++`] +* {xref-QueryModule-onlyResponsibleOracle-uint256-address-}[`++onlyResponsibleOracle(requestId, responder)++`] +-- + +[.contract-index] +.Functions +-- +* {xref-QueryModule-_afterInitialize--}[`++_afterInitialize()++`] +* {xref-QueryModule-request-bytes32-bytes-string-address-uint256-}[`++request(processId, input, callbackMethodName, callbackContractAddress, responsibleOracleId)++`] +* {xref-QueryModule-respond-uint256-address-bytes-}[`++respond(requestId, responder, data)++`] +* {xref-QueryModule-cancel-uint256-}[`++cancel(requestId)++`] +* {xref-QueryModule-getProcessId-uint256-}[`++getProcessId(requestId)++`] +* {xref-QueryModule-getOracleRequestCount--}[`++getOracleRequestCount()++`] +* {xref-QueryModule-_getOracle-uint256-}[`++_getOracle(id)++`] + +[.contract-subindex-inherited] +.CoreController +* {xref-CoreController-initialize-address-}[`++initialize(registry)++`] +* {xref-CoreController-_getName--}[`++_getName()++`] +* {xref-CoreController-_getContractAddress-bytes32-}[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-_disableInitializers--[`++_disableInitializers()++`] + +[.contract-subindex-inherited] +.IQuery + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.CoreController + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-Initialized-uint8-[`++Initialized(version)++`] + +[.contract-subindex-inherited] +.IQuery +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IQuery.sol[`++LogOracleRequested(processId, requestId, responsibleOracleId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IQuery.sol[`++LogOracleResponded(processId, requestId, responder, success)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IQuery.sol[`++LogOracleCanceled(requestId)++`] + +-- + +[.contract-item] +[[QueryModule-onlyOracleService--]] +==== `[.contract-item-name]#++onlyOracleService++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[QueryModule-onlyResponsibleOracle-uint256-address-]] +==== `[.contract-item-name]#++onlyResponsibleOracle++#++(uint256 requestId, address responder)++` [.item-kind]#modifier# + +[.contract-item] +[[QueryModule-_afterInitialize--]] +==== `[.contract-item-name]#++_afterInitialize++#++()++` [.item-kind]#internal# + +Internal function that sets the `_component` variable to the `ComponentController` contract address. + +[.contract-item] +[[QueryModule-request-bytes32-bytes-string-address-uint256-]] +==== `[.contract-item-name]#++request++#++(bytes32 processId, bytes input, string callbackMethodName, address callbackContractAddress, uint256 responsibleOracleId) → uint256 requestId++` [.item-kind]#external# + +Creates a new oracle request for a given process with the specified input data and callback information. + +[.contract-item] +[[QueryModule-respond-uint256-address-bytes-]] +==== `[.contract-item-name]#++respond++#++(uint256 requestId, address responder, bytes data)++` [.item-kind]#external# + +Responds to an oracle request with the given requestId, responder address, and data. + +[.contract-item] +[[QueryModule-cancel-uint256-]] +==== `[.contract-item-name]#++cancel++#++(uint256 requestId)++` [.item-kind]#external# + +Cancels an oracle request. + +[.contract-item] +[[QueryModule-getProcessId-uint256-]] +==== `[.contract-item-name]#++getProcessId++#++(uint256 requestId) → bytes32 processId++` [.item-kind]#external# + +Returns the process ID associated with a given request ID. + +[.contract-item] +[[QueryModule-getOracleRequestCount--]] +==== `[.contract-item-name]#++getOracleRequestCount++#++() → uint256 _count++` [.item-kind]#public# + +Returns the number of oracle requests made. + +[.contract-item] +[[QueryModule-_getOracle-uint256-]] +==== `[.contract-item-name]#++_getOracle++#++(uint256 id) → contract IOracle oracle++` [.item-kind]#internal# + +Returns the Oracle component with the specified ID. + +The "QueryModule" smart contract implements the IQuery interface and extends the CoreController contract. +It interacts with external contracts such as IComponent.sol, IOracle.sol, IQuery.sol, and IInstanceService.sol. +The contract allows the creation of oracle requests, enables oracles to respond to requests, cancels requests, and provides functions to retrieve information about requests and oracles. +It ensures access control through modifiers and emits events to track the creation, response, and cancellation of oracle requests. +The QueryModule contract acts as a module for managing oracle queries within the ecosystem. + +:MAX_CONTRACTS: pass:normal[xref:#RegistryController-MAX_CONTRACTS-uint256[`++MAX_CONTRACTS++`]] +:release: pass:normal[xref:#RegistryController-release-bytes32[`++release++`]] +:startBlock: pass:normal[xref:#RegistryController-startBlock-uint256[`++startBlock++`]] +:_contracts: pass:normal[xref:#RegistryController-_contracts-mapping-bytes32----mapping-bytes32----address--[`++_contracts++`]] +:_contractsInRelease: pass:normal[xref:#RegistryController-_contractsInRelease-mapping-bytes32----uint256-[`++_contractsInRelease++`]] +:initializeRegistry: pass:normal[xref:#RegistryController-initializeRegistry-bytes32-[`++initializeRegistry++`]] +:ensureSender: pass:normal[xref:#RegistryController-ensureSender-address-bytes32-[`++ensureSender++`]] +:getRelease: pass:normal[xref:#RegistryController-getRelease--[`++getRelease++`]] +:getContract: pass:normal[xref:#RegistryController-getContract-bytes32-[`++getContract++`]] +:register: pass:normal[xref:#RegistryController-register-bytes32-address-[`++register++`]] +:deregister: pass:normal[xref:#RegistryController-deregister-bytes32-[`++deregister++`]] +:getContractInRelease: pass:normal[xref:#RegistryController-getContractInRelease-bytes32-bytes32-[`++getContractInRelease++`]] +:registerInRelease: pass:normal[xref:#RegistryController-registerInRelease-bytes32-bytes32-address-[`++registerInRelease++`]] +:deregisterInRelease: pass:normal[xref:#RegistryController-deregisterInRelease-bytes32-bytes32-[`++deregisterInRelease++`]] +:prepareRelease: pass:normal[xref:#RegistryController-prepareRelease-bytes32-[`++prepareRelease++`]] +:contracts: pass:normal[xref:#RegistryController-contracts--[`++contracts++`]] +:contractName: pass:normal[xref:#RegistryController-contractName-uint256-[`++contractName++`]] +:_getContractInRelease: pass:normal[xref:#RegistryController-_getContractInRelease-bytes32-bytes32-[`++_getContractInRelease++`]] +:_registerInRelease: pass:normal[xref:#RegistryController-_registerInRelease-bytes32-bool-bytes32-address-[`++_registerInRelease++`]] +:_deregisterInRelease: pass:normal[xref:#RegistryController-_deregisterInRelease-bytes32-bytes32-[`++_deregisterInRelease++`]] + +[.contract] +[[RegistryController]] +=== `++RegistryController++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/modules/RegistryController.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/modules/RegistryController.sol"; +``` + +The smart contract implements the `IRegistry` interface and inherits from the `CoreController` contract. +The contract provides functionality for registering, deregistering, and accessing contracts within different releases. It maintains mappings and sets to store contract names and addresses in different releases. + +- `MAX_CONTRACTS`: A constant variable set to 100, representing the maximum number of contracts allowed in a release. +- `release`: A bytes32 variable representing the current release identifier. +- `startBlock`: An unsigned integer storing the block number at which the contract was deployed. +- `_contracts`: A nested mapping that stores contract addresses based on the release and contract name. +- `_contractsInRelease`: A mapping that keeps track of the number of contracts in each release. +- `_contractNames`: A private EnumerableSet that stores the names of contracts in a specific release. + +The contract emits various events such as `LogContractRegistered` and `LogContractDeregistered` to notify when contracts are registered or deregistered. + +Overall, the `RegistryController` contract provides a mechanism to manage and track contracts within different releases, allowing for controlled registration and deregistration of contracts. + +[.contract-index] +.Functions +-- +* {xref-RegistryController-initializeRegistry-bytes32-}[`++initializeRegistry(_initialRelease)++`] +* {xref-RegistryController-ensureSender-address-bytes32-}[`++ensureSender(sender, _contractName)++`] +* {xref-RegistryController-getRelease--}[`++getRelease()++`] +* {xref-RegistryController-getContract-bytes32-}[`++getContract(_contractName)++`] +* {xref-RegistryController-register-bytes32-address-}[`++register(_contractName, _contractAddress)++`] +* {xref-RegistryController-deregister-bytes32-}[`++deregister(_contractName)++`] +* {xref-RegistryController-getContractInRelease-bytes32-bytes32-}[`++getContractInRelease(_release, _contractName)++`] +* {xref-RegistryController-registerInRelease-bytes32-bytes32-address-}[`++registerInRelease(_release, _contractName, _contractAddress)++`] +* {xref-RegistryController-deregisterInRelease-bytes32-bytes32-}[`++deregisterInRelease(_release, _contractName)++`] +* {xref-RegistryController-prepareRelease-bytes32-}[`++prepareRelease(_newRelease)++`] +* {xref-RegistryController-contracts--}[`++contracts()++`] +* {xref-RegistryController-contractName-uint256-}[`++contractName(idx)++`] +* {xref-RegistryController-_getContractInRelease-bytes32-bytes32-}[`++_getContractInRelease(_release, _contractName)++`] +* {xref-RegistryController-_registerInRelease-bytes32-bool-bytes32-address-}[`++_registerInRelease(_release, isNewRelease, _contractName, _contractAddress)++`] +* {xref-RegistryController-_deregisterInRelease-bytes32-bytes32-}[`++_deregisterInRelease(_release, _contractName)++`] + +[.contract-subindex-inherited] +.CoreController +* {xref-CoreController-initialize-address-}[`++initialize(registry)++`] +* {xref-CoreController-_getName--}[`++_getName()++`] +* {xref-CoreController-_afterInitialize--}[`++_afterInitialize()++`] +* {xref-CoreController-_getContractAddress-bytes32-}[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-_disableInitializers--[`++_disableInitializers()++`] + +[.contract-subindex-inherited] +.IRegistry + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.CoreController + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-Initialized-uint8-[`++Initialized(version)++`] + +[.contract-subindex-inherited] +.IRegistry +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IRegistry.sol[`++LogContractRegistered(release, contractName, contractAddress, isNew)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IRegistry.sol[`++LogContractDeregistered(release, contractName)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IRegistry.sol[`++LogReleasePrepared(release)++`] + +-- + +[.contract-item] +[[RegistryController-initializeRegistry-bytes32-]] +==== `[.contract-item-name]#++initializeRegistry++#++(bytes32 _initialRelease)++` [.item-kind]#public# + +Initializes the GIF registry with an initial release and sets the deployment block for reading logs. + +[.contract-item] +[[RegistryController-ensureSender-address-bytes32-]] +==== `[.contract-item-name]#++ensureSender++#++(address sender, bytes32 _contractName) → bool _senderMatches++` [.item-kind]#external# + +Verifies if the provided 'sender' address matches the address of the contract with the given '_contractName' in the current release. + +[.contract-item] +[[RegistryController-getRelease--]] +==== `[.contract-item-name]#++getRelease++#++() → bytes32 _release++` [.item-kind]#external# + +Returns the current release identifier. + +[.contract-item] +[[RegistryController-getContract-bytes32-]] +==== `[.contract-item-name]#++getContract++#++(bytes32 _contractName) → address _addr++` [.item-kind]#public# + +Returns the address of a contract by its name. + +[.contract-item] +[[RegistryController-register-bytes32-address-]] +==== `[.contract-item-name]#++register++#++(bytes32 _contractName, address _contractAddress)++` [.item-kind]#external# + +Registers a contract with a given name and address. + +[.contract-item] +[[RegistryController-deregister-bytes32-]] +==== `[.contract-item-name]#++deregister++#++(bytes32 _contractName)++` [.item-kind]#external# + +Deregisters a contract from the current release. + +[.contract-item] +[[RegistryController-getContractInRelease-bytes32-bytes32-]] +==== `[.contract-item-name]#++getContractInRelease++#++(bytes32 _release, bytes32 _contractName) → address _addr++` [.item-kind]#external# + +Returns the address of a specific contract within a given release. + +[.contract-item] +[[RegistryController-registerInRelease-bytes32-bytes32-address-]] +==== `[.contract-item-name]#++registerInRelease++#++(bytes32 _release, bytes32 _contractName, address _contractAddress)++` [.item-kind]#external# + +Registers a contract in a specific release. + +[.contract-item] +[[RegistryController-deregisterInRelease-bytes32-bytes32-]] +==== `[.contract-item-name]#++deregisterInRelease++#++(bytes32 _release, bytes32 _contractName)++` [.item-kind]#external# + +Deregisters a contract name from a specific release. + +[.contract-item] +[[RegistryController-prepareRelease-bytes32-]] +==== `[.contract-item-name]#++prepareRelease++#++(bytes32 _newRelease)++` [.item-kind]#external# + +Prepares a new release by copying all contracts from the current release to the new one. + +[.contract-item] +[[RegistryController-contracts--]] +==== `[.contract-item-name]#++contracts++#++() → uint256 _numberOfContracts++` [.item-kind]#external# + +Returns the number of contracts in the current release. + +[.contract-item] +[[RegistryController-contractName-uint256-]] +==== `[.contract-item-name]#++contractName++#++(uint256 idx) → bytes32 _contractName++` [.item-kind]#external# + +Returns the name of the contract at the specified index in the contractNames set. + +[.contract-item] +[[RegistryController-_getContractInRelease-bytes32-bytes32-]] +==== `[.contract-item-name]#++_getContractInRelease++#++(bytes32 _release, bytes32 _contractName) → address _addr++` [.item-kind]#internal# + +Returns the address of a contract in a specific release. + +[.contract-item] +[[RegistryController-_registerInRelease-bytes32-bool-bytes32-address-]] +==== `[.contract-item-name]#++_registerInRelease++#++(bytes32 _release, bool isNewRelease, bytes32 _contractName, address _contractAddress)++` [.item-kind]#internal# + +Registers a contract in a release. + +[.contract-item] +[[RegistryController-_deregisterInRelease-bytes32-bytes32-]] +==== `[.contract-item-name]#++_deregisterInRelease++#++(bytes32 _release, bytes32 _contractName)++` [.item-kind]#internal# + +Internal function to deregister a contract in a specific release. + +The "RegistryController" smart contract implements the IRegistry interface and inherits from the CoreController contract. +It facilitates the registration, deregistration, and access of contracts within different releases. +The contract maintains mappings and sets to store contract names and addresses in various releases. +It provides functions to register and deregister contracts, retrieve contract addresses, and manage releases. +The contract ensures sender verification and emits events to track contract registration and deregistration. +The RegistryController contract serves as a centralized registry for managing contracts in different releases within the ecosystem. + +:FRACTION_FULL_UNIT: pass:normal[xref:#TreasuryModule-FRACTION_FULL_UNIT-uint256[`++FRACTION_FULL_UNIT++`]] +:FRACTIONAL_FEE_MAX: pass:normal[xref:#TreasuryModule-FRACTIONAL_FEE_MAX-uint256[`++FRACTIONAL_FEE_MAX++`]] +:LogTransferHelperInputValidation1Failed: pass:normal[xref:#TreasuryModule-LogTransferHelperInputValidation1Failed-bool-address-address-[`++LogTransferHelperInputValidation1Failed++`]] +:LogTransferHelperInputValidation2Failed: pass:normal[xref:#TreasuryModule-LogTransferHelperInputValidation2Failed-uint256-uint256-[`++LogTransferHelperInputValidation2Failed++`]] +:LogTransferHelperCallFailed: pass:normal[xref:#TreasuryModule-LogTransferHelperCallFailed-bool-uint256-bytes-[`++LogTransferHelperCallFailed++`]] +:instanceWalletDefined: pass:normal[xref:#TreasuryModule-instanceWalletDefined--[`++instanceWalletDefined++`]] +:riskpoolWalletDefinedForProcess: pass:normal[xref:#TreasuryModule-riskpoolWalletDefinedForProcess-bytes32-[`++riskpoolWalletDefinedForProcess++`]] +:riskpoolWalletDefinedForBundle: pass:normal[xref:#TreasuryModule-riskpoolWalletDefinedForBundle-uint256-[`++riskpoolWalletDefinedForBundle++`]] +:whenNotSuspended: pass:normal[xref:#TreasuryModule-whenNotSuspended--[`++whenNotSuspended++`]] +:onlyRiskpoolService: pass:normal[xref:#TreasuryModule-onlyRiskpoolService--[`++onlyRiskpoolService++`]] +:_afterInitialize: pass:normal[xref:#TreasuryModule-_afterInitialize--[`++_afterInitialize++`]] +:suspend: pass:normal[xref:#TreasuryModule-suspend--[`++suspend++`]] +:resume: pass:normal[xref:#TreasuryModule-resume--[`++resume++`]] +:setProductToken: pass:normal[xref:#TreasuryModule-setProductToken-uint256-address-[`++setProductToken++`]] +:setInstanceWallet: pass:normal[xref:#TreasuryModule-setInstanceWallet-address-[`++setInstanceWallet++`]] +:setRiskpoolWallet: pass:normal[xref:#TreasuryModule-setRiskpoolWallet-uint256-address-[`++setRiskpoolWallet++`]] +:createFeeSpecification: pass:normal[xref:#TreasuryModule-createFeeSpecification-uint256-uint256-uint256-bytes-[`++createFeeSpecification++`]] +:setPremiumFees: pass:normal[xref:#TreasuryModule-setPremiumFees-struct-ITreasury-FeeSpecification-[`++setPremiumFees++`]] +:setCapitalFees: pass:normal[xref:#TreasuryModule-setCapitalFees-struct-ITreasury-FeeSpecification-[`++setCapitalFees++`]] +:calculateFee: pass:normal[xref:#TreasuryModule-calculateFee-uint256-uint256-[`++calculateFee++`]] +:processPremium: pass:normal[xref:#TreasuryModule-processPremium-bytes32-[`++processPremium++`]] +:processPremium: pass:normal[xref:#TreasuryModule-processPremium-bytes32-uint256-[`++processPremium++`]] +:processPayout: pass:normal[xref:#TreasuryModule-processPayout-bytes32-uint256-[`++processPayout++`]] +:processCapital: pass:normal[xref:#TreasuryModule-processCapital-uint256-uint256-[`++processCapital++`]] +:processWithdrawal: pass:normal[xref:#TreasuryModule-processWithdrawal-uint256-uint256-[`++processWithdrawal++`]] +:getComponentToken: pass:normal[xref:#TreasuryModule-getComponentToken-uint256-[`++getComponentToken++`]] +:getFeeSpecification: pass:normal[xref:#TreasuryModule-getFeeSpecification-uint256-[`++getFeeSpecification++`]] +:getFractionFullUnit: pass:normal[xref:#TreasuryModule-getFractionFullUnit--[`++getFractionFullUnit++`]] +:getInstanceWallet: pass:normal[xref:#TreasuryModule-getInstanceWallet--[`++getInstanceWallet++`]] +:getRiskpoolWallet: pass:normal[xref:#TreasuryModule-getRiskpoolWallet-uint256-[`++getRiskpoolWallet++`]] +:_calculatePremiumFee: pass:normal[xref:#TreasuryModule-_calculatePremiumFee-struct-ITreasury-FeeSpecification-bytes32-[`++_calculatePremiumFee++`]] +:_calculateFee: pass:normal[xref:#TreasuryModule-_calculateFee-struct-ITreasury-FeeSpecification-uint256-[`++_calculateFee++`]] +:_getRiskpoolWallet: pass:normal[xref:#TreasuryModule-_getRiskpoolWallet-bytes32-[`++_getRiskpoolWallet++`]] + +[.contract] +[[TreasuryModule]] +=== `++TreasuryModule++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/modules/TreasuryModule.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/modules/TreasuryModule.sol"; +``` + +The smart contract implements the ITreasury interface and inherits from the CoreController and Pausable contracts. +The contract imports several other contracts and interfaces, including ComponentController.sol, PolicyController.sol, BundleController.sol, PoolController.sol, CoreController.sol, TransferHelper.sol, and various interfaces from the "etherisc/gif-interface" and "openzeppelin/contracts" libraries. + +The contract defines several state variables, including: + +- FRACTION_FULL_UNIT: a constant representing the full unit value (10^18). +- FRACTIONAL_FEE_MAX: a constant representing the maximum fractional fee value (25%). +- event LogTransferHelperInputValidation1Failed: an event that logs a failed input validation. +- event LogTransferHelperInputValidation2Failed: an event that logs a failed input validation. +- event LogTransferHelperCallFailed: an event that logs a failed external call. +- _instanceWalletAddress: a private variable representing the address of the instance wallet. +- _riskpoolWallet: a mapping of riskpool IDs to wallet addresses. +- _fees: a mapping of component IDs to FeeSpecification structs. +- _componentToken: a mapping of product IDs/riskpool IDs to ERC20 token addresses. +- _bundle: an instance of the BundleController contract. +- _component: an instance of the ComponentController contract. +- _policy: an instance of the PolicyController contract. +- _pool: an instance of the PoolController contract. + +The contract includes several modifiers that enforce certain conditions on function execution, such as the instanceWalletDefined modifier, which requires the instance wallet address to be defined; +the riskpoolWalletDefinedForProcess modifier, which requires the riskpool wallet address to be defined for a given process ID; +the riskpoolWalletDefinedForBundle modifier, which requires the riskpool wallet address to be defined for a given bundle ID; +the whenNotSuspended modifier, which requires the contract to not be paused; and the onlyRiskpoolService modifier, which restricts access to the RiskpoolService contract. + +The contract contains various functions for managing the treasury, such as setting the product token address, setting the instance wallet address, setting the riskpool wallet address, creating fee specifications, and setting premium and capital fees for components. +There are also functions for suspending and resuming the treasury contract. + +The contract includes a function to calculate the fee amount and net amount for a given component ID and amount. +It also includes functions to process premium payments for policies, either for the remaining premium amount or for a specific amount. + +Overall, the TreasuryModule contract provides functionality for managing fees, processing premium payments, and interacting with other controllers and contracts in the system. + +[.contract-index] +.Modifiers +-- +* {xref-TreasuryModule-instanceWalletDefined--}[`++instanceWalletDefined()++`] +* {xref-TreasuryModule-riskpoolWalletDefinedForProcess-bytes32-}[`++riskpoolWalletDefinedForProcess(processId)++`] +* {xref-TreasuryModule-riskpoolWalletDefinedForBundle-uint256-}[`++riskpoolWalletDefinedForBundle(bundleId)++`] +* {xref-TreasuryModule-whenNotSuspended--}[`++whenNotSuspended()++`] +* {xref-TreasuryModule-onlyRiskpoolService--}[`++onlyRiskpoolService()++`] +-- + +[.contract-index] +.Functions +-- +* {xref-TreasuryModule-_afterInitialize--}[`++_afterInitialize()++`] +* {xref-TreasuryModule-suspend--}[`++suspend()++`] +* {xref-TreasuryModule-resume--}[`++resume()++`] +* {xref-TreasuryModule-setProductToken-uint256-address-}[`++setProductToken(productId, erc20Address)++`] +* {xref-TreasuryModule-setInstanceWallet-address-}[`++setInstanceWallet(instanceWalletAddress)++`] +* {xref-TreasuryModule-setRiskpoolWallet-uint256-address-}[`++setRiskpoolWallet(riskpoolId, riskpoolWalletAddress)++`] +* {xref-TreasuryModule-createFeeSpecification-uint256-uint256-uint256-bytes-}[`++createFeeSpecification(componentId, fixedFee, fractionalFee, feeCalculationData)++`] +* {xref-TreasuryModule-setPremiumFees-struct-ITreasury-FeeSpecification-}[`++setPremiumFees(feeSpec)++`] +* {xref-TreasuryModule-setCapitalFees-struct-ITreasury-FeeSpecification-}[`++setCapitalFees(feeSpec)++`] +* {xref-TreasuryModule-calculateFee-uint256-uint256-}[`++calculateFee(componentId, amount)++`] +* {xref-TreasuryModule-processPremium-bytes32-}[`++processPremium(processId)++`] +* {xref-TreasuryModule-processPremium-bytes32-uint256-}[`++processPremium(processId, amount)++`] +* {xref-TreasuryModule-processPayout-bytes32-uint256-}[`++processPayout(processId, payoutId)++`] +* {xref-TreasuryModule-processCapital-uint256-uint256-}[`++processCapital(bundleId, capitalAmount)++`] +* {xref-TreasuryModule-processWithdrawal-uint256-uint256-}[`++processWithdrawal(bundleId, amount)++`] +* {xref-TreasuryModule-getComponentToken-uint256-}[`++getComponentToken(componentId)++`] +* {xref-TreasuryModule-getFeeSpecification-uint256-}[`++getFeeSpecification(componentId)++`] +* {xref-TreasuryModule-getFractionFullUnit--}[`++getFractionFullUnit()++`] +* {xref-TreasuryModule-getInstanceWallet--}[`++getInstanceWallet()++`] +* {xref-TreasuryModule-getRiskpoolWallet-uint256-}[`++getRiskpoolWallet(riskpoolId)++`] +* {xref-TreasuryModule-_calculatePremiumFee-struct-ITreasury-FeeSpecification-bytes32-}[`++_calculatePremiumFee(feeSpec, processId)++`] +* {xref-TreasuryModule-_calculateFee-struct-ITreasury-FeeSpecification-uint256-}[`++_calculateFee(feeSpec, amount)++`] +* {xref-TreasuryModule-_getRiskpoolWallet-bytes32-}[`++_getRiskpoolWallet(processId)++`] + +[.contract-subindex-inherited] +.Pausable +* https://docs.openzeppelin.com/contracts/3.x/api/security#Pausable-paused--[`++paused()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/security#Pausable-_requireNotPaused--[`++_requireNotPaused()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/security#Pausable-_requirePaused--[`++_requirePaused()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/security#Pausable-_pause--[`++_pause()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/security#Pausable-_unpause--[`++_unpause()++`] + +[.contract-subindex-inherited] +.CoreController +* {xref-CoreController-initialize-address-}[`++initialize(registry)++`] +* {xref-CoreController-_getName--}[`++_getName()++`] +* {xref-CoreController-_getContractAddress-bytes32-}[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-_disableInitializers--[`++_disableInitializers()++`] + +[.contract-subindex-inherited] +.ITreasury + +-- + +[.contract-index] +.Events +-- +* {xref-TreasuryModule-LogTransferHelperInputValidation1Failed-bool-address-address-}[`++LogTransferHelperInputValidation1Failed(tokenIsContract, from, to)++`] +* {xref-TreasuryModule-LogTransferHelperInputValidation2Failed-uint256-uint256-}[`++LogTransferHelperInputValidation2Failed(balance, allowance)++`] +* {xref-TreasuryModule-LogTransferHelperCallFailed-bool-uint256-bytes-}[`++LogTransferHelperCallFailed(callSuccess, returnDataLength, returnData)++`] + +[.contract-subindex-inherited] +.Pausable +* https://docs.openzeppelin.com/contracts/3.x/api/security#Pausable-Paused-address-[`++Paused(account)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/security#Pausable-Unpaused-address-[`++Unpaused(account)++`] + +[.contract-subindex-inherited] +.CoreController + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-Initialized-uint8-[`++Initialized(version)++`] + +[.contract-subindex-inherited] +.ITreasury +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/ITreasury.sol[`++LogTreasurySuspended()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/ITreasury.sol[`++LogTreasuryResumed()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/ITreasury.sol[`++LogTreasuryProductTokenSet(productId, riskpoolId, erc20Address)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/ITreasury.sol[`++LogTreasuryInstanceWalletSet(walletAddress)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/ITreasury.sol[`++LogTreasuryRiskpoolWalletSet(riskpoolId, walletAddress)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/ITreasury.sol[`++LogTreasuryPremiumFeesSet(productId, fixedFee, fractionalFee)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/ITreasury.sol[`++LogTreasuryCapitalFeesSet(riskpoolId, fixedFee, fractionalFee)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/ITreasury.sol[`++LogTreasuryPremiumTransferred(from, riskpoolWalletAddress, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/ITreasury.sol[`++LogTreasuryPayoutTransferred(riskpoolWalletAddress, to, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/ITreasury.sol[`++LogTreasuryCapitalTransferred(from, riskpoolWalletAddress, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/ITreasury.sol[`++LogTreasuryFeesTransferred(from, instanceWalletAddress, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/ITreasury.sol[`++LogTreasuryWithdrawalTransferred(riskpoolWalletAddress, to, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/ITreasury.sol[`++LogTreasuryPremiumProcessed(processId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/ITreasury.sol[`++LogTreasuryPayoutProcessed(riskpoolId, to, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/ITreasury.sol[`++LogTreasuryCapitalProcessed(riskpoolId, bundleId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/ITreasury.sol[`++LogTreasuryWithdrawalProcessed(riskpoolId, bundleId, amount)++`] + +-- + +[.contract-item] +[[TreasuryModule-instanceWalletDefined--]] +==== `[.contract-item-name]#++instanceWalletDefined++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[TreasuryModule-riskpoolWalletDefinedForProcess-bytes32-]] +==== `[.contract-item-name]#++riskpoolWalletDefinedForProcess++#++(bytes32 processId)++` [.item-kind]#modifier# + +[.contract-item] +[[TreasuryModule-riskpoolWalletDefinedForBundle-uint256-]] +==== `[.contract-item-name]#++riskpoolWalletDefinedForBundle++#++(uint256 bundleId)++` [.item-kind]#modifier# + +[.contract-item] +[[TreasuryModule-whenNotSuspended--]] +==== `[.contract-item-name]#++whenNotSuspended++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[TreasuryModule-onlyRiskpoolService--]] +==== `[.contract-item-name]#++onlyRiskpoolService++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[TreasuryModule-_afterInitialize--]] +==== `[.contract-item-name]#++_afterInitialize++#++()++` [.item-kind]#internal# + +Sets the addresses of the BundleController, ComponentController, PolicyController, and PoolController contracts. + +[.contract-item] +[[TreasuryModule-suspend--]] +==== `[.contract-item-name]#++suspend++#++()++` [.item-kind]#external# + +Suspends the treasury contract, preventing any further transfers or withdrawals. + Can only be called by the instance operator. + +[.contract-item] +[[TreasuryModule-resume--]] +==== `[.contract-item-name]#++resume++#++()++` [.item-kind]#external# + +Resumes the treasury contract after it has been paused. + +[.contract-item] +[[TreasuryModule-setProductToken-uint256-address-]] +==== `[.contract-item-name]#++setProductToken++#++(uint256 productId, address erc20Address)++` [.item-kind]#external# + +Sets the ERC20 token address for a given product ID and its associated risk pool. + +[.contract-item] +[[TreasuryModule-setInstanceWallet-address-]] +==== `[.contract-item-name]#++setInstanceWallet++#++(address instanceWalletAddress)++` [.item-kind]#external# + +Sets the address of the instance wallet. + +[.contract-item] +[[TreasuryModule-setRiskpoolWallet-uint256-address-]] +==== `[.contract-item-name]#++setRiskpoolWallet++#++(uint256 riskpoolId, address riskpoolWalletAddress)++` [.item-kind]#external# + +Sets the wallet address for a specific riskpool. + +[.contract-item] +[[TreasuryModule-createFeeSpecification-uint256-uint256-uint256-bytes-]] +==== `[.contract-item-name]#++createFeeSpecification++#++(uint256 componentId, uint256 fixedFee, uint256 fractionalFee, bytes feeCalculationData) → struct ITreasury.FeeSpecification++` [.item-kind]#external# + +Creates a fee specification for a given component. + +[.contract-item] +[[TreasuryModule-setPremiumFees-struct-ITreasury-FeeSpecification-]] +==== `[.contract-item-name]#++setPremiumFees++#++(struct ITreasury.FeeSpecification feeSpec)++` [.item-kind]#external# + +Sets the premium fees for a specific component. + +[.contract-item] +[[TreasuryModule-setCapitalFees-struct-ITreasury-FeeSpecification-]] +==== `[.contract-item-name]#++setCapitalFees++#++(struct ITreasury.FeeSpecification feeSpec)++` [.item-kind]#external# + +Sets the fee specification for a given component, which includes the fixed and fractional fees. + +[.contract-item] +[[TreasuryModule-calculateFee-uint256-uint256-]] +==== `[.contract-item-name]#++calculateFee++#++(uint256 componentId, uint256 amount) → uint256 feeAmount, uint256 netAmount++` [.item-kind]#public# + +Calculates the fee amount and net amount for a given component ID and amount. + +[.contract-item] +[[TreasuryModule-processPremium-bytes32-]] +==== `[.contract-item-name]#++processPremium++#++(bytes32 processId) → bool success, uint256 feeAmount, uint256 netPremiumAmount++` [.item-kind]#external# + +Processes the premium for a given policy process ID. + +[.contract-item] +[[TreasuryModule-processPremium-bytes32-uint256-]] +==== `[.contract-item-name]#++processPremium++#++(bytes32 processId, uint256 amount) → bool success, uint256 feeAmount, uint256 netAmount++` [.item-kind]#public# + +Processes a premium payment for a policy. + +[.contract-item] +[[TreasuryModule-processPayout-bytes32-uint256-]] +==== `[.contract-item-name]#++processPayout++#++(bytes32 processId, uint256 payoutId) → uint256 feeAmount, uint256 netPayoutAmount++` [.item-kind]#external# + +Processes a payout for a specific process and payout ID. + +[.contract-item] +[[TreasuryModule-processCapital-uint256-uint256-]] +==== `[.contract-item-name]#++processCapital++#++(uint256 bundleId, uint256 capitalAmount) → uint256 feeAmount, uint256 netCapitalAmount++` [.item-kind]#external# + +Processes capital for a given bundle ID and calculates fees. Transfers fees to the instance wallet and net capital to the riskpool wallet. + +[.contract-item] +[[TreasuryModule-processWithdrawal-uint256-uint256-]] +==== `[.contract-item-name]#++processWithdrawal++#++(uint256 bundleId, uint256 amount) → uint256 feeAmount, uint256 netAmount++` [.item-kind]#external# + +Processes a withdrawal of a specified amount from a bundle, transferring the funds to the bundle owner's wallet. + +[.contract-item] +[[TreasuryModule-getComponentToken-uint256-]] +==== `[.contract-item-name]#++getComponentToken++#++(uint256 componentId) → contract IERC20 token++` [.item-kind]#public# + +Returns the ERC20 token address associated with the given component ID. + +[.contract-item] +[[TreasuryModule-getFeeSpecification-uint256-]] +==== `[.contract-item-name]#++getFeeSpecification++#++(uint256 componentId) → struct ITreasury.FeeSpecification++` [.item-kind]#public# + +Returns the fee specification of a given component. + +[.contract-item] +[[TreasuryModule-getFractionFullUnit--]] +==== `[.contract-item-name]#++getFractionFullUnit++#++() → uint256++` [.item-kind]#public# + +Returns the value of the constant FRACTION_FULL_UNIT. + +[.contract-item] +[[TreasuryModule-getInstanceWallet--]] +==== `[.contract-item-name]#++getInstanceWallet++#++() → address++` [.item-kind]#public# + +Returns the address of the instance wallet. + +[.contract-item] +[[TreasuryModule-getRiskpoolWallet-uint256-]] +==== `[.contract-item-name]#++getRiskpoolWallet++#++(uint256 riskpoolId) → address++` [.item-kind]#public# + +Returns the wallet address of the specified risk pool. + +[.contract-item] +[[TreasuryModule-_calculatePremiumFee-struct-ITreasury-FeeSpecification-bytes32-]] +==== `[.contract-item-name]#++_calculatePremiumFee++#++(struct ITreasury.FeeSpecification feeSpec, bytes32 processId) → struct IPolicy.Application application, uint256 feeAmount++` [.item-kind]#internal# + +Calculates the premium fee for a given fee specification and process ID. + +[.contract-item] +[[TreasuryModule-_calculateFee-struct-ITreasury-FeeSpecification-uint256-]] +==== `[.contract-item-name]#++_calculateFee++#++(struct ITreasury.FeeSpecification feeSpec, uint256 amount) → uint256 feeAmount++` [.item-kind]#internal# + +Calculates the fee amount based on the given fee specification and the transaction amount. + +[.contract-item] +[[TreasuryModule-_getRiskpoolWallet-bytes32-]] +==== `[.contract-item-name]#++_getRiskpoolWallet++#++(bytes32 processId) → uint256 riskpoolId, address riskpoolWalletAddress++` [.item-kind]#internal# + +Returns the riskpool ID and wallet address for a given process ID. + +[.contract-item] +[[TreasuryModule-LogTransferHelperInputValidation1Failed-bool-address-address-]] +==== `[.contract-item-name]#++LogTransferHelperInputValidation1Failed++#++(bool tokenIsContract, address from, address to)++` [.item-kind]#event# + +[.contract-item] +[[TreasuryModule-LogTransferHelperInputValidation2Failed-uint256-uint256-]] +==== `[.contract-item-name]#++LogTransferHelperInputValidation2Failed++#++(uint256 balance, uint256 allowance)++` [.item-kind]#event# + +[.contract-item] +[[TreasuryModule-LogTransferHelperCallFailed-bool-uint256-bytes-]] +==== `[.contract-item-name]#++LogTransferHelperCallFailed++#++(bool callSuccess, uint256 returnDataLength, bytes returnData)++` [.item-kind]#event# + +The "TreasuryModule" smart contract implements the ITreasury interface and inherits from the CoreController and Pausable contracts. +It imports various contracts and interfaces to handle treasury operations. +The contract defines state variables, including constants, wallet addresses, fee specifications, and instances of other contracts. +It includes modifiers to enforce conditions for function execution. +The contract provides functions to set token and wallet addresses, create fee specifications, process premium payments, and manage suspension/resumption. +It also calculates fee amounts and net amounts. +The TreasuryModule contract serves as a central component for managing fees and treasury operations, interacting with other controllers and contracts within the system. + diff --git a/docs/modules/api/pages/services.adoc b/docs/modules/api/pages/services.adoc new file mode 100644 index 00000000..923835ba --- /dev/null +++ b/docs/modules/api/pages/services.adoc @@ -0,0 +1,1352 @@ +:github-icon: pass:[] +:xref-ComponentOwnerService-onlyOwnerWithRoleFromComponent-contract-IComponent-: xref:services.adoc#ComponentOwnerService-onlyOwnerWithRoleFromComponent-contract-IComponent- +:xref-ComponentOwnerService-onlyOwnerWithRole-uint256-: xref:services.adoc#ComponentOwnerService-onlyOwnerWithRole-uint256- +:xref-ComponentOwnerService-_afterInitialize--: xref:services.adoc#ComponentOwnerService-_afterInitialize-- +:xref-ComponentOwnerService-propose-contract-IComponent-: xref:services.adoc#ComponentOwnerService-propose-contract-IComponent- +:xref-ComponentOwnerService-stake-uint256-: xref:services.adoc#ComponentOwnerService-stake-uint256- +:xref-ComponentOwnerService-withdraw-uint256-: xref:services.adoc#ComponentOwnerService-withdraw-uint256- +:xref-ComponentOwnerService-pause-uint256-: xref:services.adoc#ComponentOwnerService-pause-uint256- +:xref-ComponentOwnerService-unpause-uint256-: xref:services.adoc#ComponentOwnerService-unpause-uint256- +:xref-ComponentOwnerService-archive-uint256-: xref:services.adoc#ComponentOwnerService-archive-uint256- +:xref-CoreController-initialize-address-: xref:shared.adoc#CoreController-initialize-address- +:xref-CoreController-_getName--: xref:shared.adoc#CoreController-_getName-- +:xref-CoreController-_getContractAddress-bytes32-: xref:shared.adoc#CoreController-_getContractAddress-bytes32- +:xref-InstanceOperatorService-onlyInstanceOperatorAddress--: xref:services.adoc#InstanceOperatorService-onlyInstanceOperatorAddress-- +:xref-InstanceOperatorService-_afterInitialize--: xref:services.adoc#InstanceOperatorService-_afterInitialize-- +:xref-InstanceOperatorService-prepareRelease-bytes32-: xref:services.adoc#InstanceOperatorService-prepareRelease-bytes32- +:xref-InstanceOperatorService-register-bytes32-address-: xref:services.adoc#InstanceOperatorService-register-bytes32-address- +:xref-InstanceOperatorService-deregister-bytes32-: xref:services.adoc#InstanceOperatorService-deregister-bytes32- +:xref-InstanceOperatorService-registerInRelease-bytes32-bytes32-address-: xref:services.adoc#InstanceOperatorService-registerInRelease-bytes32-bytes32-address- +:xref-InstanceOperatorService-deregisterInRelease-bytes32-bytes32-: xref:services.adoc#InstanceOperatorService-deregisterInRelease-bytes32-bytes32- +:xref-InstanceOperatorService-createRole-bytes32-: xref:services.adoc#InstanceOperatorService-createRole-bytes32- +:xref-InstanceOperatorService-invalidateRole-bytes32-: xref:services.adoc#InstanceOperatorService-invalidateRole-bytes32- +:xref-InstanceOperatorService-grantRole-bytes32-address-: xref:services.adoc#InstanceOperatorService-grantRole-bytes32-address- +:xref-InstanceOperatorService-revokeRole-bytes32-address-: xref:services.adoc#InstanceOperatorService-revokeRole-bytes32-address- +:xref-InstanceOperatorService-approve-uint256-: xref:services.adoc#InstanceOperatorService-approve-uint256- +:xref-InstanceOperatorService-decline-uint256-: xref:services.adoc#InstanceOperatorService-decline-uint256- +:xref-InstanceOperatorService-suspend-uint256-: xref:services.adoc#InstanceOperatorService-suspend-uint256- +:xref-InstanceOperatorService-resume-uint256-: xref:services.adoc#InstanceOperatorService-resume-uint256- +:xref-InstanceOperatorService-archive-uint256-: xref:services.adoc#InstanceOperatorService-archive-uint256- +:xref-InstanceOperatorService-setDefaultStaking-uint16-bytes-: xref:services.adoc#InstanceOperatorService-setDefaultStaking-uint16-bytes- +:xref-InstanceOperatorService-adjustStakingRequirements-uint256-bytes-: xref:services.adoc#InstanceOperatorService-adjustStakingRequirements-uint256-bytes- +:xref-InstanceOperatorService-suspendTreasury--: xref:services.adoc#InstanceOperatorService-suspendTreasury-- +:xref-InstanceOperatorService-resumeTreasury--: xref:services.adoc#InstanceOperatorService-resumeTreasury-- +:xref-InstanceOperatorService-setInstanceWallet-address-: xref:services.adoc#InstanceOperatorService-setInstanceWallet-address- +:xref-InstanceOperatorService-setRiskpoolWallet-uint256-address-: xref:services.adoc#InstanceOperatorService-setRiskpoolWallet-uint256-address- +:xref-InstanceOperatorService-setProductToken-uint256-address-: xref:services.adoc#InstanceOperatorService-setProductToken-uint256-address- +:xref-InstanceOperatorService-createFeeSpecification-uint256-uint256-uint256-bytes-: xref:services.adoc#InstanceOperatorService-createFeeSpecification-uint256-uint256-uint256-bytes- +:xref-InstanceOperatorService-setPremiumFees-struct-ITreasury-FeeSpecification-: xref:services.adoc#InstanceOperatorService-setPremiumFees-struct-ITreasury-FeeSpecification- +:xref-InstanceOperatorService-setCapitalFees-struct-ITreasury-FeeSpecification-: xref:services.adoc#InstanceOperatorService-setCapitalFees-struct-ITreasury-FeeSpecification- +:xref-CoreController-initialize-address-: xref:shared.adoc#CoreController-initialize-address- +:xref-CoreController-_getName--: xref:shared.adoc#CoreController-_getName-- +:xref-CoreController-_getContractAddress-bytes32-: xref:shared.adoc#CoreController-_getContractAddress-bytes32- +:xref-InstanceService-_afterInitialize--: xref:services.adoc#InstanceService-_afterInitialize-- +:xref-InstanceService-_setChainNames--: xref:services.adoc#InstanceService-_setChainNames-- +:xref-InstanceService-getChainId--: xref:services.adoc#InstanceService-getChainId-- +:xref-InstanceService-getChainName--: xref:services.adoc#InstanceService-getChainName-- +:xref-InstanceService-getInstanceId--: xref:services.adoc#InstanceService-getInstanceId-- +:xref-InstanceService-getInstanceOperator--: xref:services.adoc#InstanceService-getInstanceOperator-- +:xref-InstanceService-getComponentOwnerService--: xref:services.adoc#InstanceService-getComponentOwnerService-- +:xref-InstanceService-getInstanceOperatorService--: xref:services.adoc#InstanceService-getInstanceOperatorService-- +:xref-InstanceService-getOracleService--: xref:services.adoc#InstanceService-getOracleService-- +:xref-InstanceService-getProductService--: xref:services.adoc#InstanceService-getProductService-- +:xref-InstanceService-getRiskpoolService--: xref:services.adoc#InstanceService-getRiskpoolService-- +:xref-InstanceService-getRegistry--: xref:services.adoc#InstanceService-getRegistry-- +:xref-InstanceService-contracts--: xref:services.adoc#InstanceService-contracts-- +:xref-InstanceService-contractName-uint256-: xref:services.adoc#InstanceService-contractName-uint256- +:xref-InstanceService-getDefaultAdminRole--: xref:services.adoc#InstanceService-getDefaultAdminRole-- +:xref-InstanceService-getProductOwnerRole--: xref:services.adoc#InstanceService-getProductOwnerRole-- +:xref-InstanceService-getOracleProviderRole--: xref:services.adoc#InstanceService-getOracleProviderRole-- +:xref-InstanceService-getRiskpoolKeeperRole--: xref:services.adoc#InstanceService-getRiskpoolKeeperRole-- +:xref-InstanceService-hasRole-bytes32-address-: xref:services.adoc#InstanceService-hasRole-bytes32-address- +:xref-InstanceService-products--: xref:services.adoc#InstanceService-products-- +:xref-InstanceService-oracles--: xref:services.adoc#InstanceService-oracles-- +:xref-InstanceService-riskpools--: xref:services.adoc#InstanceService-riskpools-- +:xref-InstanceService-getComponentId-address-: xref:services.adoc#InstanceService-getComponentId-address- +:xref-InstanceService-getComponentType-uint256-: xref:services.adoc#InstanceService-getComponentType-uint256- +:xref-InstanceService-getComponentState-uint256-: xref:services.adoc#InstanceService-getComponentState-uint256- +:xref-InstanceService-getComponent-uint256-: xref:services.adoc#InstanceService-getComponent-uint256- +:xref-InstanceService-getOracleId-uint256-: xref:services.adoc#InstanceService-getOracleId-uint256- +:xref-InstanceService-getRiskpoolId-uint256-: xref:services.adoc#InstanceService-getRiskpoolId-uint256- +:xref-InstanceService-getProductId-uint256-: xref:services.adoc#InstanceService-getProductId-uint256- +:xref-InstanceService-getStakingRequirements-uint256-: xref:services.adoc#InstanceService-getStakingRequirements-uint256- +:xref-InstanceService-getStakedAssets-uint256-: xref:services.adoc#InstanceService-getStakedAssets-uint256- +:xref-InstanceService-processIds--: xref:services.adoc#InstanceService-processIds-- +:xref-InstanceService-getMetadata-bytes32-: xref:services.adoc#InstanceService-getMetadata-bytes32- +:xref-InstanceService-getApplication-bytes32-: xref:services.adoc#InstanceService-getApplication-bytes32- +:xref-InstanceService-getPolicy-bytes32-: xref:services.adoc#InstanceService-getPolicy-bytes32- +:xref-InstanceService-claims-bytes32-: xref:services.adoc#InstanceService-claims-bytes32- +:xref-InstanceService-payouts-bytes32-: xref:services.adoc#InstanceService-payouts-bytes32- +:xref-InstanceService-getClaim-bytes32-uint256-: xref:services.adoc#InstanceService-getClaim-bytes32-uint256- +:xref-InstanceService-getPayout-bytes32-uint256-: xref:services.adoc#InstanceService-getPayout-bytes32-uint256- +:xref-InstanceService-getRiskpool-uint256-: xref:services.adoc#InstanceService-getRiskpool-uint256- +:xref-InstanceService-getFullCollateralizationLevel--: xref:services.adoc#InstanceService-getFullCollateralizationLevel-- +:xref-InstanceService-getCapital-uint256-: xref:services.adoc#InstanceService-getCapital-uint256- +:xref-InstanceService-getTotalValueLocked-uint256-: xref:services.adoc#InstanceService-getTotalValueLocked-uint256- +:xref-InstanceService-getCapacity-uint256-: xref:services.adoc#InstanceService-getCapacity-uint256- +:xref-InstanceService-getBalance-uint256-: xref:services.adoc#InstanceService-getBalance-uint256- +:xref-InstanceService-activeBundles-uint256-: xref:services.adoc#InstanceService-activeBundles-uint256- +:xref-InstanceService-getActiveBundleId-uint256-uint256-: xref:services.adoc#InstanceService-getActiveBundleId-uint256-uint256- +:xref-InstanceService-getMaximumNumberOfActiveBundles-uint256-: xref:services.adoc#InstanceService-getMaximumNumberOfActiveBundles-uint256- +:xref-InstanceService-getBundleToken--: xref:services.adoc#InstanceService-getBundleToken-- +:xref-InstanceService-getBundle-uint256-: xref:services.adoc#InstanceService-getBundle-uint256- +:xref-InstanceService-bundles--: xref:services.adoc#InstanceService-bundles-- +:xref-InstanceService-unburntBundles-uint256-: xref:services.adoc#InstanceService-unburntBundles-uint256- +:xref-InstanceService-getTreasuryAddress--: xref:services.adoc#InstanceService-getTreasuryAddress-- +:xref-InstanceService-getInstanceWallet--: xref:services.adoc#InstanceService-getInstanceWallet-- +:xref-InstanceService-getRiskpoolWallet-uint256-: xref:services.adoc#InstanceService-getRiskpoolWallet-uint256- +:xref-InstanceService-getComponentToken-uint256-: xref:services.adoc#InstanceService-getComponentToken-uint256- +:xref-InstanceService-getFeeFractionFullUnit--: xref:services.adoc#InstanceService-getFeeFractionFullUnit-- +:xref-CoreController-initialize-address-: xref:shared.adoc#CoreController-initialize-address- +:xref-CoreController-_getName--: xref:shared.adoc#CoreController-_getName-- +:xref-CoreController-_getContractAddress-bytes32-: xref:shared.adoc#CoreController-_getContractAddress-bytes32- +:xref-OracleService-_afterInitialize--: xref:services.adoc#OracleService-_afterInitialize-- +:xref-OracleService-respond-uint256-bytes-: xref:services.adoc#OracleService-respond-uint256-bytes- +:xref-CoreController-initialize-address-: xref:shared.adoc#CoreController-initialize-address- +:xref-CoreController-_getName--: xref:shared.adoc#CoreController-_getName-- +:xref-CoreController-_getContractAddress-bytes32-: xref:shared.adoc#CoreController-_getContractAddress-bytes32- +:xref-ProductService-constructor-address-: xref:services.adoc#ProductService-constructor-address- +:xref-ProductService-fallback--: xref:services.adoc#ProductService-fallback-- +:xref-ProductService-_delegate-address-: xref:services.adoc#ProductService-_delegate-address- +:xref-ProductService-_license--: xref:services.adoc#ProductService-_license-- +:xref-WithRegistry-getContractFromRegistry-bytes32-: xref:shared.adoc#WithRegistry-getContractFromRegistry-bytes32- +:xref-WithRegistry-getContractInReleaseFromRegistry-bytes32-bytes32-: xref:shared.adoc#WithRegistry-getContractInReleaseFromRegistry-bytes32-bytes32- +:xref-WithRegistry-getReleaseFromRegistry--: xref:shared.adoc#WithRegistry-getReleaseFromRegistry-- +:xref-RiskpoolService-onlyProposedRiskpool--: xref:services.adoc#RiskpoolService-onlyProposedRiskpool-- +:xref-RiskpoolService-onlyActiveRiskpool--: xref:services.adoc#RiskpoolService-onlyActiveRiskpool-- +:xref-RiskpoolService-onlyOwningRiskpool-uint256-bool-: xref:services.adoc#RiskpoolService-onlyOwningRiskpool-uint256-bool- +:xref-RiskpoolService-onlyOwningRiskpoolId-uint256-bool-: xref:services.adoc#RiskpoolService-onlyOwningRiskpoolId-uint256-bool- +:xref-RiskpoolService-_afterInitialize--: xref:services.adoc#RiskpoolService-_afterInitialize-- +:xref-RiskpoolService-registerRiskpool-address-address-uint256-uint256-: xref:services.adoc#RiskpoolService-registerRiskpool-address-address-uint256-uint256- +:xref-RiskpoolService-createBundle-address-bytes-uint256-: xref:services.adoc#RiskpoolService-createBundle-address-bytes-uint256- +:xref-RiskpoolService-fundBundle-uint256-uint256-: xref:services.adoc#RiskpoolService-fundBundle-uint256-uint256- +:xref-RiskpoolService-defundBundle-uint256-uint256-: xref:services.adoc#RiskpoolService-defundBundle-uint256-uint256- +:xref-RiskpoolService-lockBundle-uint256-: xref:services.adoc#RiskpoolService-lockBundle-uint256- +:xref-RiskpoolService-unlockBundle-uint256-: xref:services.adoc#RiskpoolService-unlockBundle-uint256- +:xref-RiskpoolService-closeBundle-uint256-: xref:services.adoc#RiskpoolService-closeBundle-uint256- +:xref-RiskpoolService-burnBundle-uint256-: xref:services.adoc#RiskpoolService-burnBundle-uint256- +:xref-RiskpoolService-collateralizePolicy-uint256-bytes32-uint256-: xref:services.adoc#RiskpoolService-collateralizePolicy-uint256-bytes32-uint256- +:xref-RiskpoolService-processPremium-uint256-bytes32-uint256-: xref:services.adoc#RiskpoolService-processPremium-uint256-bytes32-uint256- +:xref-RiskpoolService-processPayout-uint256-bytes32-uint256-: xref:services.adoc#RiskpoolService-processPayout-uint256-bytes32-uint256- +:xref-RiskpoolService-releasePolicy-uint256-bytes32-: xref:services.adoc#RiskpoolService-releasePolicy-uint256-bytes32- +:xref-RiskpoolService-setMaximumNumberOfActiveBundles-uint256-uint256-: xref:services.adoc#RiskpoolService-setMaximumNumberOfActiveBundles-uint256-uint256- +:xref-CoreController-initialize-address-: xref:shared.adoc#CoreController-initialize-address- +:xref-CoreController-_getName--: xref:shared.adoc#CoreController-_getName-- +:xref-CoreController-_getContractAddress-bytes32-: xref:shared.adoc#CoreController-_getContractAddress-bytes32- += Services + +[.readme-notice] +NOTE: This document is better viewed at https://docs.etherisc.com/contracts/api/services + +== Contracts + +:onlyOwnerWithRoleFromComponent: pass:normal[xref:#ComponentOwnerService-onlyOwnerWithRoleFromComponent-contract-IComponent-[`++onlyOwnerWithRoleFromComponent++`]] +:onlyOwnerWithRole: pass:normal[xref:#ComponentOwnerService-onlyOwnerWithRole-uint256-[`++onlyOwnerWithRole++`]] +:_afterInitialize: pass:normal[xref:#ComponentOwnerService-_afterInitialize--[`++_afterInitialize++`]] +:propose: pass:normal[xref:#ComponentOwnerService-propose-contract-IComponent-[`++propose++`]] +:stake: pass:normal[xref:#ComponentOwnerService-stake-uint256-[`++stake++`]] +:withdraw: pass:normal[xref:#ComponentOwnerService-withdraw-uint256-[`++withdraw++`]] +:pause: pass:normal[xref:#ComponentOwnerService-pause-uint256-[`++pause++`]] +:unpause: pass:normal[xref:#ComponentOwnerService-unpause-uint256-[`++unpause++`]] +:archive: pass:normal[xref:#ComponentOwnerService-archive-uint256-[`++archive++`]] + +[.contract] +[[ComponentOwnerService]] +=== `++ComponentOwnerService++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/services/ComponentOwnerService.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/services/ComponentOwnerService.sol"; +``` + +[.contract-index] +.Modifiers +-- +* {xref-ComponentOwnerService-onlyOwnerWithRoleFromComponent-contract-IComponent-}[`++onlyOwnerWithRoleFromComponent(component)++`] +* {xref-ComponentOwnerService-onlyOwnerWithRole-uint256-}[`++onlyOwnerWithRole(id)++`] +-- + +[.contract-index] +.Functions +-- +* {xref-ComponentOwnerService-_afterInitialize--}[`++_afterInitialize()++`] +* {xref-ComponentOwnerService-propose-contract-IComponent-}[`++propose(component)++`] +* {xref-ComponentOwnerService-stake-uint256-}[`++stake(id)++`] +* {xref-ComponentOwnerService-withdraw-uint256-}[`++withdraw(id)++`] +* {xref-ComponentOwnerService-pause-uint256-}[`++pause(id)++`] +* {xref-ComponentOwnerService-unpause-uint256-}[`++unpause(id)++`] +* {xref-ComponentOwnerService-archive-uint256-}[`++archive(id)++`] + +[.contract-subindex-inherited] +.CoreController +* {xref-CoreController-initialize-address-}[`++initialize(registry)++`] +* {xref-CoreController-_getName--}[`++_getName()++`] +* {xref-CoreController-_getContractAddress-bytes32-}[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-_disableInitializers--[`++_disableInitializers()++`] + +[.contract-subindex-inherited] +.IComponentOwnerService + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.CoreController + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-Initialized-uint8-[`++Initialized(version)++`] + +[.contract-subindex-inherited] +.IComponentOwnerService + +-- + +[.contract-item] +[[ComponentOwnerService-onlyOwnerWithRoleFromComponent-contract-IComponent-]] +==== `[.contract-item-name]#++onlyOwnerWithRoleFromComponent++#++(contract IComponent component)++` [.item-kind]#modifier# + +[.contract-item] +[[ComponentOwnerService-onlyOwnerWithRole-uint256-]] +==== `[.contract-item-name]#++onlyOwnerWithRole++#++(uint256 id)++` [.item-kind]#modifier# + +[.contract-item] +[[ComponentOwnerService-_afterInitialize--]] +==== `[.contract-item-name]#++_afterInitialize++#++()++` [.item-kind]#internal# + +This function is called after the contract is initialized and can only be called once. It sets the component controller contract address. + +[.contract-item] +[[ComponentOwnerService-propose-contract-IComponent-]] +==== `[.contract-item-name]#++propose++#++(contract IComponent component)++` [.item-kind]#external# + +Propose a new component to be added to the system. + +[.contract-item] +[[ComponentOwnerService-stake-uint256-]] +==== `[.contract-item-name]#++stake++#++(uint256 id)++` [.item-kind]#external# + +Stake function allows the owner to stake a specific id. + +[.contract-item] +[[ComponentOwnerService-withdraw-uint256-]] +==== `[.contract-item-name]#++withdraw++#++(uint256 id)++` [.item-kind]#external# + +Allows the owner to withdraw a specific asset by its ID. + +[.contract-item] +[[ComponentOwnerService-pause-uint256-]] +==== `[.contract-item-name]#++pause++#++(uint256 id)++` [.item-kind]#external# + +Pauses a specific component with the given ID. + +[.contract-item] +[[ComponentOwnerService-unpause-uint256-]] +==== `[.contract-item-name]#++unpause++#++(uint256 id)++` [.item-kind]#external# + +Unpauses a component with the specified ID. + +[.contract-item] +[[ComponentOwnerService-archive-uint256-]] +==== `[.contract-item-name]#++archive++#++(uint256 id)++` [.item-kind]#external# + +Archives a component with the given ID from the component owner's inventory. + +:onlyInstanceOperatorAddress: pass:normal[xref:#InstanceOperatorService-onlyInstanceOperatorAddress--[`++onlyInstanceOperatorAddress++`]] +:_afterInitialize: pass:normal[xref:#InstanceOperatorService-_afterInitialize--[`++_afterInitialize++`]] +:prepareRelease: pass:normal[xref:#InstanceOperatorService-prepareRelease-bytes32-[`++prepareRelease++`]] +:register: pass:normal[xref:#InstanceOperatorService-register-bytes32-address-[`++register++`]] +:deregister: pass:normal[xref:#InstanceOperatorService-deregister-bytes32-[`++deregister++`]] +:registerInRelease: pass:normal[xref:#InstanceOperatorService-registerInRelease-bytes32-bytes32-address-[`++registerInRelease++`]] +:deregisterInRelease: pass:normal[xref:#InstanceOperatorService-deregisterInRelease-bytes32-bytes32-[`++deregisterInRelease++`]] +:createRole: pass:normal[xref:#InstanceOperatorService-createRole-bytes32-[`++createRole++`]] +:invalidateRole: pass:normal[xref:#InstanceOperatorService-invalidateRole-bytes32-[`++invalidateRole++`]] +:grantRole: pass:normal[xref:#InstanceOperatorService-grantRole-bytes32-address-[`++grantRole++`]] +:revokeRole: pass:normal[xref:#InstanceOperatorService-revokeRole-bytes32-address-[`++revokeRole++`]] +:approve: pass:normal[xref:#InstanceOperatorService-approve-uint256-[`++approve++`]] +:decline: pass:normal[xref:#InstanceOperatorService-decline-uint256-[`++decline++`]] +:suspend: pass:normal[xref:#InstanceOperatorService-suspend-uint256-[`++suspend++`]] +:resume: pass:normal[xref:#InstanceOperatorService-resume-uint256-[`++resume++`]] +:archive: pass:normal[xref:#InstanceOperatorService-archive-uint256-[`++archive++`]] +:setDefaultStaking: pass:normal[xref:#InstanceOperatorService-setDefaultStaking-uint16-bytes-[`++setDefaultStaking++`]] +:adjustStakingRequirements: pass:normal[xref:#InstanceOperatorService-adjustStakingRequirements-uint256-bytes-[`++adjustStakingRequirements++`]] +:suspendTreasury: pass:normal[xref:#InstanceOperatorService-suspendTreasury--[`++suspendTreasury++`]] +:resumeTreasury: pass:normal[xref:#InstanceOperatorService-resumeTreasury--[`++resumeTreasury++`]] +:setInstanceWallet: pass:normal[xref:#InstanceOperatorService-setInstanceWallet-address-[`++setInstanceWallet++`]] +:setRiskpoolWallet: pass:normal[xref:#InstanceOperatorService-setRiskpoolWallet-uint256-address-[`++setRiskpoolWallet++`]] +:setProductToken: pass:normal[xref:#InstanceOperatorService-setProductToken-uint256-address-[`++setProductToken++`]] +:createFeeSpecification: pass:normal[xref:#InstanceOperatorService-createFeeSpecification-uint256-uint256-uint256-bytes-[`++createFeeSpecification++`]] +:setPremiumFees: pass:normal[xref:#InstanceOperatorService-setPremiumFees-struct-ITreasury-FeeSpecification-[`++setPremiumFees++`]] +:setCapitalFees: pass:normal[xref:#InstanceOperatorService-setCapitalFees-struct-ITreasury-FeeSpecification-[`++setCapitalFees++`]] + +[.contract] +[[InstanceOperatorService]] +=== `++InstanceOperatorService++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/services/InstanceOperatorService.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/services/InstanceOperatorService.sol"; +``` + +[.contract-index] +.Modifiers +-- +* {xref-InstanceOperatorService-onlyInstanceOperatorAddress--}[`++onlyInstanceOperatorAddress()++`] +-- + +[.contract-index] +.Functions +-- +* {xref-InstanceOperatorService-_afterInitialize--}[`++_afterInitialize()++`] +* {xref-InstanceOperatorService-prepareRelease-bytes32-}[`++prepareRelease(_newRelease)++`] +* {xref-InstanceOperatorService-register-bytes32-address-}[`++register(_contractName, _contractAddress)++`] +* {xref-InstanceOperatorService-deregister-bytes32-}[`++deregister(_contractName)++`] +* {xref-InstanceOperatorService-registerInRelease-bytes32-bytes32-address-}[`++registerInRelease(_release, _contractName, _contractAddress)++`] +* {xref-InstanceOperatorService-deregisterInRelease-bytes32-bytes32-}[`++deregisterInRelease(_release, _contractName)++`] +* {xref-InstanceOperatorService-createRole-bytes32-}[`++createRole(_role)++`] +* {xref-InstanceOperatorService-invalidateRole-bytes32-}[`++invalidateRole(_role)++`] +* {xref-InstanceOperatorService-grantRole-bytes32-address-}[`++grantRole(role, principal)++`] +* {xref-InstanceOperatorService-revokeRole-bytes32-address-}[`++revokeRole(role, principal)++`] +* {xref-InstanceOperatorService-approve-uint256-}[`++approve(id)++`] +* {xref-InstanceOperatorService-decline-uint256-}[`++decline(id)++`] +* {xref-InstanceOperatorService-suspend-uint256-}[`++suspend(id)++`] +* {xref-InstanceOperatorService-resume-uint256-}[`++resume(id)++`] +* {xref-InstanceOperatorService-archive-uint256-}[`++archive(id)++`] +* {xref-InstanceOperatorService-setDefaultStaking-uint16-bytes-}[`++setDefaultStaking(componentType, data)++`] +* {xref-InstanceOperatorService-adjustStakingRequirements-uint256-bytes-}[`++adjustStakingRequirements(id, data)++`] +* {xref-InstanceOperatorService-suspendTreasury--}[`++suspendTreasury()++`] +* {xref-InstanceOperatorService-resumeTreasury--}[`++resumeTreasury()++`] +* {xref-InstanceOperatorService-setInstanceWallet-address-}[`++setInstanceWallet(walletAddress)++`] +* {xref-InstanceOperatorService-setRiskpoolWallet-uint256-address-}[`++setRiskpoolWallet(riskpoolId, riskpoolWalletAddress)++`] +* {xref-InstanceOperatorService-setProductToken-uint256-address-}[`++setProductToken(productId, erc20Address)++`] +* {xref-InstanceOperatorService-createFeeSpecification-uint256-uint256-uint256-bytes-}[`++createFeeSpecification(componentId, fixedFee, fractionalFee, feeCalculationData)++`] +* {xref-InstanceOperatorService-setPremiumFees-struct-ITreasury-FeeSpecification-}[`++setPremiumFees(feeSpec)++`] +* {xref-InstanceOperatorService-setCapitalFees-struct-ITreasury-FeeSpecification-}[`++setCapitalFees(feeSpec)++`] + +[.contract-subindex-inherited] +.Ownable +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-owner--[`++owner()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-_checkOwner--[`++_checkOwner()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-renounceOwnership--[`++renounceOwnership()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-transferOwnership-address-[`++transferOwnership(newOwner)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-_transferOwnership-address-[`++_transferOwnership(newOwner)++`] + +[.contract-subindex-inherited] +.CoreController +* {xref-CoreController-initialize-address-}[`++initialize(registry)++`] +* {xref-CoreController-_getName--}[`++_getName()++`] +* {xref-CoreController-_getContractAddress-bytes32-}[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-_disableInitializers--[`++_disableInitializers()++`] + +[.contract-subindex-inherited] +.IInstanceOperatorService + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.Ownable +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-OwnershipTransferred-address-address-[`++OwnershipTransferred(previousOwner, newOwner)++`] + +[.contract-subindex-inherited] +.CoreController + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-Initialized-uint8-[`++Initialized(version)++`] + +[.contract-subindex-inherited] +.IInstanceOperatorService + +-- + +[.contract-item] +[[InstanceOperatorService-onlyInstanceOperatorAddress--]] +==== `[.contract-item-name]#++onlyInstanceOperatorAddress++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[InstanceOperatorService-_afterInitialize--]] +==== `[.contract-item-name]#++_afterInitialize++#++()++` [.item-kind]#internal# + +Performs the necessary setup after contract initialization. + - Sets the component, pool, and treasury contracts. + - Transfers ownership to the message sender. + - Links the bundle module to the bundle token. + - Sets the default admin role. + +[.contract-item] +[[InstanceOperatorService-prepareRelease-bytes32-]] +==== `[.contract-item-name]#++prepareRelease++#++(bytes32 _newRelease)++` [.item-kind]#external# + +Prepares a new release by calling the prepareRelease function from the Registry contract. + +[.contract-item] +[[InstanceOperatorService-register-bytes32-address-]] +==== `[.contract-item-name]#++register++#++(bytes32 _contractName, address _contractAddress)++` [.item-kind]#external# + +Registers a contract in the registry. + +[.contract-item] +[[InstanceOperatorService-deregister-bytes32-]] +==== `[.contract-item-name]#++deregister++#++(bytes32 _contractName)++` [.item-kind]#external# + +Deregisters a contract from the registry. + +[.contract-item] +[[InstanceOperatorService-registerInRelease-bytes32-bytes32-address-]] +==== `[.contract-item-name]#++registerInRelease++#++(bytes32 _release, bytes32 _contractName, address _contractAddress)++` [.item-kind]#external# + +Registers a contract in a specific release. + +[.contract-item] +[[InstanceOperatorService-deregisterInRelease-bytes32-bytes32-]] +==== `[.contract-item-name]#++deregisterInRelease++#++(bytes32 _release, bytes32 _contractName)++` [.item-kind]#external# + +Deregisters a contract from a specific release in the registry. + +[.contract-item] +[[InstanceOperatorService-createRole-bytes32-]] +==== `[.contract-item-name]#++createRole++#++(bytes32 _role)++` [.item-kind]#external# + +Adds a new role to the access control contract. + +[.contract-item] +[[InstanceOperatorService-invalidateRole-bytes32-]] +==== `[.contract-item-name]#++invalidateRole++#++(bytes32 _role)++` [.item-kind]#external# + +Invalidates a role. + +[.contract-item] +[[InstanceOperatorService-grantRole-bytes32-address-]] +==== `[.contract-item-name]#++grantRole++#++(bytes32 role, address principal)++` [.item-kind]#external# + +Grants a role to a principal. + +[.contract-item] +[[InstanceOperatorService-revokeRole-bytes32-address-]] +==== `[.contract-item-name]#++revokeRole++#++(bytes32 role, address principal)++` [.item-kind]#external# + +Revokes a role from a principal. + +[.contract-item] +[[InstanceOperatorService-approve-uint256-]] +==== `[.contract-item-name]#++approve++#++(uint256 id)++` [.item-kind]#external# + +Approves a component with the given ID and sets its corresponding riskpool ID in the pool contract. + +[.contract-item] +[[InstanceOperatorService-decline-uint256-]] +==== `[.contract-item-name]#++decline++#++(uint256 id)++` [.item-kind]#external# + +Declines a component with the specified ID. + +[.contract-item] +[[InstanceOperatorService-suspend-uint256-]] +==== `[.contract-item-name]#++suspend++#++(uint256 id)++` [.item-kind]#external# + +Suspends the component with the given ID. + +[.contract-item] +[[InstanceOperatorService-resume-uint256-]] +==== `[.contract-item-name]#++resume++#++(uint256 id)++` [.item-kind]#external# + +Resumes the execution of a paused component instance. + +[.contract-item] +[[InstanceOperatorService-archive-uint256-]] +==== `[.contract-item-name]#++archive++#++(uint256 id)++` [.item-kind]#external# + +Archives a component with the given ID from the instance operator's address. + +[.contract-item] +[[InstanceOperatorService-setDefaultStaking-uint16-bytes-]] +==== `[.contract-item-name]#++setDefaultStaking++#++(uint16 componentType, bytes data)++` [.item-kind]#external# + +Sets the default staking for a specific component type. + +[.contract-item] +[[InstanceOperatorService-adjustStakingRequirements-uint256-bytes-]] +==== `[.contract-item-name]#++adjustStakingRequirements++#++(uint256 id, bytes data)++` [.item-kind]#external# + +Adjusts the staking requirements for a specific instance operator by providing the operator ID and the new staking requirements. + +[.contract-item] +[[InstanceOperatorService-suspendTreasury--]] +==== `[.contract-item-name]#++suspendTreasury++#++()++` [.item-kind]#external# + +Suspends the treasury functionality. + +[.contract-item] +[[InstanceOperatorService-resumeTreasury--]] +==== `[.contract-item-name]#++resumeTreasury++#++()++` [.item-kind]#external# + +Resumes the treasury contract. + +[.contract-item] +[[InstanceOperatorService-setInstanceWallet-address-]] +==== `[.contract-item-name]#++setInstanceWallet++#++(address walletAddress)++` [.item-kind]#external# + +Sets the wallet address of the instance operator. + +[.contract-item] +[[InstanceOperatorService-setRiskpoolWallet-uint256-address-]] +==== `[.contract-item-name]#++setRiskpoolWallet++#++(uint256 riskpoolId, address riskpoolWalletAddress)++` [.item-kind]#external# + +Sets the wallet address for a specific risk pool. + +[.contract-item] +[[InstanceOperatorService-setProductToken-uint256-address-]] +==== `[.contract-item-name]#++setProductToken++#++(uint256 productId, address erc20Address)++` [.item-kind]#external# + +Sets the ERC20 token address for a given product ID. + +[.contract-item] +[[InstanceOperatorService-createFeeSpecification-uint256-uint256-uint256-bytes-]] +==== `[.contract-item-name]#++createFeeSpecification++#++(uint256 componentId, uint256 fixedFee, uint256 fractionalFee, bytes feeCalculationData) → struct ITreasury.FeeSpecification++` [.item-kind]#external# + +Returns a FeeSpecification object created with the given parameters. + +[.contract-item] +[[InstanceOperatorService-setPremiumFees-struct-ITreasury-FeeSpecification-]] +==== `[.contract-item-name]#++setPremiumFees++#++(struct ITreasury.FeeSpecification feeSpec)++` [.item-kind]#external# + +Sets the premium fees for the treasury. + +[.contract-item] +[[InstanceOperatorService-setCapitalFees-struct-ITreasury-FeeSpecification-]] +==== `[.contract-item-name]#++setCapitalFees++#++(struct ITreasury.FeeSpecification feeSpec)++` [.item-kind]#external# + +Sets the fee specification for capital fees in the treasury contract. + +:BUNDLE_NAME: pass:normal[xref:#InstanceService-BUNDLE_NAME-bytes32[`++BUNDLE_NAME++`]] +:COMPONENT_NAME: pass:normal[xref:#InstanceService-COMPONENT_NAME-bytes32[`++COMPONENT_NAME++`]] +:POLICY_NAME: pass:normal[xref:#InstanceService-POLICY_NAME-bytes32[`++POLICY_NAME++`]] +:POOL_NAME: pass:normal[xref:#InstanceService-POOL_NAME-bytes32[`++POOL_NAME++`]] +:TREASURY_NAME: pass:normal[xref:#InstanceService-TREASURY_NAME-bytes32[`++TREASURY_NAME++`]] +:COMPONENT_OWNER_SERVICE_NAME: pass:normal[xref:#InstanceService-COMPONENT_OWNER_SERVICE_NAME-bytes32[`++COMPONENT_OWNER_SERVICE_NAME++`]] +:INSTANCE_OPERATOR_SERVICE_NAME: pass:normal[xref:#InstanceService-INSTANCE_OPERATOR_SERVICE_NAME-bytes32[`++INSTANCE_OPERATOR_SERVICE_NAME++`]] +:ORACLE_SERVICE_NAME: pass:normal[xref:#InstanceService-ORACLE_SERVICE_NAME-bytes32[`++ORACLE_SERVICE_NAME++`]] +:PRODUCT_SERVICE_NAME: pass:normal[xref:#InstanceService-PRODUCT_SERVICE_NAME-bytes32[`++PRODUCT_SERVICE_NAME++`]] +:RISKPOOL_SERVICE_NAME: pass:normal[xref:#InstanceService-RISKPOOL_SERVICE_NAME-bytes32[`++RISKPOOL_SERVICE_NAME++`]] +:_bundle: pass:normal[xref:#InstanceService-_bundle-contract-BundleController[`++_bundle++`]] +:_component: pass:normal[xref:#InstanceService-_component-contract-ComponentController[`++_component++`]] +:_policy: pass:normal[xref:#InstanceService-_policy-contract-PolicyController[`++_policy++`]] +:_pool: pass:normal[xref:#InstanceService-_pool-contract-PoolController[`++_pool++`]] +:_afterInitialize: pass:normal[xref:#InstanceService-_afterInitialize--[`++_afterInitialize++`]] +:_setChainNames: pass:normal[xref:#InstanceService-_setChainNames--[`++_setChainNames++`]] +:getChainId: pass:normal[xref:#InstanceService-getChainId--[`++getChainId++`]] +:getChainName: pass:normal[xref:#InstanceService-getChainName--[`++getChainName++`]] +:getInstanceId: pass:normal[xref:#InstanceService-getInstanceId--[`++getInstanceId++`]] +:getInstanceOperator: pass:normal[xref:#InstanceService-getInstanceOperator--[`++getInstanceOperator++`]] +:getComponentOwnerService: pass:normal[xref:#InstanceService-getComponentOwnerService--[`++getComponentOwnerService++`]] +:getInstanceOperatorService: pass:normal[xref:#InstanceService-getInstanceOperatorService--[`++getInstanceOperatorService++`]] +:getOracleService: pass:normal[xref:#InstanceService-getOracleService--[`++getOracleService++`]] +:getProductService: pass:normal[xref:#InstanceService-getProductService--[`++getProductService++`]] +:getRiskpoolService: pass:normal[xref:#InstanceService-getRiskpoolService--[`++getRiskpoolService++`]] +:getRegistry: pass:normal[xref:#InstanceService-getRegistry--[`++getRegistry++`]] +:contracts: pass:normal[xref:#InstanceService-contracts--[`++contracts++`]] +:contractName: pass:normal[xref:#InstanceService-contractName-uint256-[`++contractName++`]] +:getDefaultAdminRole: pass:normal[xref:#InstanceService-getDefaultAdminRole--[`++getDefaultAdminRole++`]] +:getProductOwnerRole: pass:normal[xref:#InstanceService-getProductOwnerRole--[`++getProductOwnerRole++`]] +:getOracleProviderRole: pass:normal[xref:#InstanceService-getOracleProviderRole--[`++getOracleProviderRole++`]] +:getRiskpoolKeeperRole: pass:normal[xref:#InstanceService-getRiskpoolKeeperRole--[`++getRiskpoolKeeperRole++`]] +:hasRole: pass:normal[xref:#InstanceService-hasRole-bytes32-address-[`++hasRole++`]] +:products: pass:normal[xref:#InstanceService-products--[`++products++`]] +:oracles: pass:normal[xref:#InstanceService-oracles--[`++oracles++`]] +:riskpools: pass:normal[xref:#InstanceService-riskpools--[`++riskpools++`]] +:getComponentId: pass:normal[xref:#InstanceService-getComponentId-address-[`++getComponentId++`]] +:getComponentType: pass:normal[xref:#InstanceService-getComponentType-uint256-[`++getComponentType++`]] +:getComponentState: pass:normal[xref:#InstanceService-getComponentState-uint256-[`++getComponentState++`]] +:getComponent: pass:normal[xref:#InstanceService-getComponent-uint256-[`++getComponent++`]] +:getOracleId: pass:normal[xref:#InstanceService-getOracleId-uint256-[`++getOracleId++`]] +:getRiskpoolId: pass:normal[xref:#InstanceService-getRiskpoolId-uint256-[`++getRiskpoolId++`]] +:getProductId: pass:normal[xref:#InstanceService-getProductId-uint256-[`++getProductId++`]] +:getStakingRequirements: pass:normal[xref:#InstanceService-getStakingRequirements-uint256-[`++getStakingRequirements++`]] +:getStakedAssets: pass:normal[xref:#InstanceService-getStakedAssets-uint256-[`++getStakedAssets++`]] +:processIds: pass:normal[xref:#InstanceService-processIds--[`++processIds++`]] +:getMetadata: pass:normal[xref:#InstanceService-getMetadata-bytes32-[`++getMetadata++`]] +:getApplication: pass:normal[xref:#InstanceService-getApplication-bytes32-[`++getApplication++`]] +:getPolicy: pass:normal[xref:#InstanceService-getPolicy-bytes32-[`++getPolicy++`]] +:claims: pass:normal[xref:#InstanceService-claims-bytes32-[`++claims++`]] +:payouts: pass:normal[xref:#InstanceService-payouts-bytes32-[`++payouts++`]] +:getClaim: pass:normal[xref:#InstanceService-getClaim-bytes32-uint256-[`++getClaim++`]] +:getPayout: pass:normal[xref:#InstanceService-getPayout-bytes32-uint256-[`++getPayout++`]] +:getRiskpool: pass:normal[xref:#InstanceService-getRiskpool-uint256-[`++getRiskpool++`]] +:getFullCollateralizationLevel: pass:normal[xref:#InstanceService-getFullCollateralizationLevel--[`++getFullCollateralizationLevel++`]] +:getCapital: pass:normal[xref:#InstanceService-getCapital-uint256-[`++getCapital++`]] +:getTotalValueLocked: pass:normal[xref:#InstanceService-getTotalValueLocked-uint256-[`++getTotalValueLocked++`]] +:getCapacity: pass:normal[xref:#InstanceService-getCapacity-uint256-[`++getCapacity++`]] +:getBalance: pass:normal[xref:#InstanceService-getBalance-uint256-[`++getBalance++`]] +:activeBundles: pass:normal[xref:#InstanceService-activeBundles-uint256-[`++activeBundles++`]] +:getActiveBundleId: pass:normal[xref:#InstanceService-getActiveBundleId-uint256-uint256-[`++getActiveBundleId++`]] +:getMaximumNumberOfActiveBundles: pass:normal[xref:#InstanceService-getMaximumNumberOfActiveBundles-uint256-[`++getMaximumNumberOfActiveBundles++`]] +:getBundleToken: pass:normal[xref:#InstanceService-getBundleToken--[`++getBundleToken++`]] +:getBundle: pass:normal[xref:#InstanceService-getBundle-uint256-[`++getBundle++`]] +:bundles: pass:normal[xref:#InstanceService-bundles--[`++bundles++`]] +:unburntBundles: pass:normal[xref:#InstanceService-unburntBundles-uint256-[`++unburntBundles++`]] +:getTreasuryAddress: pass:normal[xref:#InstanceService-getTreasuryAddress--[`++getTreasuryAddress++`]] +:getInstanceWallet: pass:normal[xref:#InstanceService-getInstanceWallet--[`++getInstanceWallet++`]] +:getRiskpoolWallet: pass:normal[xref:#InstanceService-getRiskpoolWallet-uint256-[`++getRiskpoolWallet++`]] +:getComponentToken: pass:normal[xref:#InstanceService-getComponentToken-uint256-[`++getComponentToken++`]] +:getFeeFractionFullUnit: pass:normal[xref:#InstanceService-getFeeFractionFullUnit--[`++getFeeFractionFullUnit++`]] + +[.contract] +[[InstanceService]] +=== `++InstanceService++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/services/InstanceService.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/services/InstanceService.sol"; +``` + +[.contract-index] +.Functions +-- +* {xref-InstanceService-_afterInitialize--}[`++_afterInitialize()++`] +* {xref-InstanceService-_setChainNames--}[`++_setChainNames()++`] +* {xref-InstanceService-getChainId--}[`++getChainId()++`] +* {xref-InstanceService-getChainName--}[`++getChainName()++`] +* {xref-InstanceService-getInstanceId--}[`++getInstanceId()++`] +* {xref-InstanceService-getInstanceOperator--}[`++getInstanceOperator()++`] +* {xref-InstanceService-getComponentOwnerService--}[`++getComponentOwnerService()++`] +* {xref-InstanceService-getInstanceOperatorService--}[`++getInstanceOperatorService()++`] +* {xref-InstanceService-getOracleService--}[`++getOracleService()++`] +* {xref-InstanceService-getProductService--}[`++getProductService()++`] +* {xref-InstanceService-getRiskpoolService--}[`++getRiskpoolService()++`] +* {xref-InstanceService-getRegistry--}[`++getRegistry()++`] +* {xref-InstanceService-contracts--}[`++contracts()++`] +* {xref-InstanceService-contractName-uint256-}[`++contractName(idx)++`] +* {xref-InstanceService-getDefaultAdminRole--}[`++getDefaultAdminRole()++`] +* {xref-InstanceService-getProductOwnerRole--}[`++getProductOwnerRole()++`] +* {xref-InstanceService-getOracleProviderRole--}[`++getOracleProviderRole()++`] +* {xref-InstanceService-getRiskpoolKeeperRole--}[`++getRiskpoolKeeperRole()++`] +* {xref-InstanceService-hasRole-bytes32-address-}[`++hasRole(role, principal)++`] +* {xref-InstanceService-products--}[`++products()++`] +* {xref-InstanceService-oracles--}[`++oracles()++`] +* {xref-InstanceService-riskpools--}[`++riskpools()++`] +* {xref-InstanceService-getComponentId-address-}[`++getComponentId(componentAddress)++`] +* {xref-InstanceService-getComponentType-uint256-}[`++getComponentType(componentId)++`] +* {xref-InstanceService-getComponentState-uint256-}[`++getComponentState(componentId)++`] +* {xref-InstanceService-getComponent-uint256-}[`++getComponent(id)++`] +* {xref-InstanceService-getOracleId-uint256-}[`++getOracleId(idx)++`] +* {xref-InstanceService-getRiskpoolId-uint256-}[`++getRiskpoolId(idx)++`] +* {xref-InstanceService-getProductId-uint256-}[`++getProductId(idx)++`] +* {xref-InstanceService-getStakingRequirements-uint256-}[`++getStakingRequirements(id)++`] +* {xref-InstanceService-getStakedAssets-uint256-}[`++getStakedAssets(id)++`] +* {xref-InstanceService-processIds--}[`++processIds()++`] +* {xref-InstanceService-getMetadata-bytes32-}[`++getMetadata(bpKey)++`] +* {xref-InstanceService-getApplication-bytes32-}[`++getApplication(processId)++`] +* {xref-InstanceService-getPolicy-bytes32-}[`++getPolicy(processId)++`] +* {xref-InstanceService-claims-bytes32-}[`++claims(processId)++`] +* {xref-InstanceService-payouts-bytes32-}[`++payouts(processId)++`] +* {xref-InstanceService-getClaim-bytes32-uint256-}[`++getClaim(processId, claimId)++`] +* {xref-InstanceService-getPayout-bytes32-uint256-}[`++getPayout(processId, payoutId)++`] +* {xref-InstanceService-getRiskpool-uint256-}[`++getRiskpool(riskpoolId)++`] +* {xref-InstanceService-getFullCollateralizationLevel--}[`++getFullCollateralizationLevel()++`] +* {xref-InstanceService-getCapital-uint256-}[`++getCapital(riskpoolId)++`] +* {xref-InstanceService-getTotalValueLocked-uint256-}[`++getTotalValueLocked(riskpoolId)++`] +* {xref-InstanceService-getCapacity-uint256-}[`++getCapacity(riskpoolId)++`] +* {xref-InstanceService-getBalance-uint256-}[`++getBalance(riskpoolId)++`] +* {xref-InstanceService-activeBundles-uint256-}[`++activeBundles(riskpoolId)++`] +* {xref-InstanceService-getActiveBundleId-uint256-uint256-}[`++getActiveBundleId(riskpoolId, bundleIdx)++`] +* {xref-InstanceService-getMaximumNumberOfActiveBundles-uint256-}[`++getMaximumNumberOfActiveBundles(riskpoolId)++`] +* {xref-InstanceService-getBundleToken--}[`++getBundleToken()++`] +* {xref-InstanceService-getBundle-uint256-}[`++getBundle(bundleId)++`] +* {xref-InstanceService-bundles--}[`++bundles()++`] +* {xref-InstanceService-unburntBundles-uint256-}[`++unburntBundles(riskpoolId)++`] +* {xref-InstanceService-getTreasuryAddress--}[`++getTreasuryAddress()++`] +* {xref-InstanceService-getInstanceWallet--}[`++getInstanceWallet()++`] +* {xref-InstanceService-getRiskpoolWallet-uint256-}[`++getRiskpoolWallet(riskpoolId)++`] +* {xref-InstanceService-getComponentToken-uint256-}[`++getComponentToken(componentId)++`] +* {xref-InstanceService-getFeeFractionFullUnit--}[`++getFeeFractionFullUnit()++`] + +[.contract-subindex-inherited] +.CoreController +* {xref-CoreController-initialize-address-}[`++initialize(registry)++`] +* {xref-CoreController-_getName--}[`++_getName()++`] +* {xref-CoreController-_getContractAddress-bytes32-}[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-_disableInitializers--[`++_disableInitializers()++`] + +[.contract-subindex-inherited] +.IInstanceService + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.CoreController + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-Initialized-uint8-[`++Initialized(version)++`] + +[.contract-subindex-inherited] +.IInstanceService + +-- + +[.contract-item] +[[InstanceService-_afterInitialize--]] +==== `[.contract-item-name]#++_afterInitialize++#++()++` [.item-kind]#internal# + +Internal function that is called after initialization is complete. It sets the bundle, component, policy, pool, and treasury controllers by retrieving their contract addresses. It also sets the chain names. + +[.contract-item] +[[InstanceService-_setChainNames--]] +==== `[.contract-item-name]#++_setChainNames++#++()++` [.item-kind]#internal# + +Sets the names for several blockchain networks by assigning them to their respective chain IDs. + +Sets the names for the Ethereum Mainnet/ETH, Goerli/ETH, Ganache, Gnosis/xDai, Sokol/SPOA, Polygon Mainnet/MATIC, Mumbai/MATIC, Avalanche C-Chain/AVAX and Avalanche Fuji Testnet/AVAX blockchain networks by assigning them to their respective chain IDs. + +[.contract-item] +[[InstanceService-getChainId--]] +==== `[.contract-item-name]#++getChainId++#++() → uint256 chainId++` [.item-kind]#public# + +Returns the chain ID of the current blockchain. + +[.contract-item] +[[InstanceService-getChainName--]] +==== `[.contract-item-name]#++getChainName++#++() → string chainName++` [.item-kind]#public# + +Returns the name of the chain based on its ID. + +[.contract-item] +[[InstanceService-getInstanceId--]] +==== `[.contract-item-name]#++getInstanceId++#++() → bytes32 instanceId++` [.item-kind]#public# + +Returns the instance ID of the contract, which is a hash of the chain ID and the registry address. + +[.contract-item] +[[InstanceService-getInstanceOperator--]] +==== `[.contract-item-name]#++getInstanceOperator++#++() → address++` [.item-kind]#external# + +Returns the address of the current instance operator. + +[.contract-item] +[[InstanceService-getComponentOwnerService--]] +==== `[.contract-item-name]#++getComponentOwnerService++#++() → contract IComponentOwnerService service++` [.item-kind]#external# + +Returns the address of the Component Owner Service contract. + +[.contract-item] +[[InstanceService-getInstanceOperatorService--]] +==== `[.contract-item-name]#++getInstanceOperatorService++#++() → contract IInstanceOperatorService service++` [.item-kind]#external# + +Returns the instance operator service contract address. + +[.contract-item] +[[InstanceService-getOracleService--]] +==== `[.contract-item-name]#++getOracleService++#++() → contract IOracleService service++` [.item-kind]#external# + +Returns the Oracle Service contract instance. + +[.contract-item] +[[InstanceService-getProductService--]] +==== `[.contract-item-name]#++getProductService++#++() → contract IProductService service++` [.item-kind]#external# + +Returns the address of the Product Service contract. + +[.contract-item] +[[InstanceService-getRiskpoolService--]] +==== `[.contract-item-name]#++getRiskpoolService++#++() → contract IRiskpoolService service++` [.item-kind]#external# + +Returns the IRiskpoolService contract instance. + +[.contract-item] +[[InstanceService-getRegistry--]] +==== `[.contract-item-name]#++getRegistry++#++() → contract IRegistry service++` [.item-kind]#external# + +Returns the current instance of the IRegistry contract. + +[.contract-item] +[[InstanceService-contracts--]] +==== `[.contract-item-name]#++contracts++#++() → uint256 numberOfContracts++` [.item-kind]#external# + +Returns the number of contracts registered in the registry. + +[.contract-item] +[[InstanceService-contractName-uint256-]] +==== `[.contract-item-name]#++contractName++#++(uint256 idx) → bytes32 name++` [.item-kind]#external# + +Returns the name of the contract at the specified index in the registry. + +[.contract-item] +[[InstanceService-getDefaultAdminRole--]] +==== `[.contract-item-name]#++getDefaultAdminRole++#++() → bytes32++` [.item-kind]#external# + +Returns the default admin role for the AccessControl contract. + +[.contract-item] +[[InstanceService-getProductOwnerRole--]] +==== `[.contract-item-name]#++getProductOwnerRole++#++() → bytes32++` [.item-kind]#external# + +Returns the role identifier of the product owner role. + +[.contract-item] +[[InstanceService-getOracleProviderRole--]] +==== `[.contract-item-name]#++getOracleProviderRole++#++() → bytes32++` [.item-kind]#external# + +Returns the role identifier for the oracle provider role. + +[.contract-item] +[[InstanceService-getRiskpoolKeeperRole--]] +==== `[.contract-item-name]#++getRiskpoolKeeperRole++#++() → bytes32++` [.item-kind]#external# + +Returns the role identifier for the Riskpool Keeper role. + +[.contract-item] +[[InstanceService-hasRole-bytes32-address-]] +==== `[.contract-item-name]#++hasRole++#++(bytes32 role, address principal) → bool++` [.item-kind]#external# + +Checks if an address has a specific role. + +[.contract-item] +[[InstanceService-products--]] +==== `[.contract-item-name]#++products++#++() → uint256++` [.item-kind]#external# + +Returns the number of products in the component contract. + +[.contract-item] +[[InstanceService-oracles--]] +==== `[.contract-item-name]#++oracles++#++() → uint256++` [.item-kind]#external# + +Returns the number of oracles registered in the component. + +[.contract-item] +[[InstanceService-riskpools--]] +==== `[.contract-item-name]#++riskpools++#++() → uint256++` [.item-kind]#external# + +Returns the number of risk pools in the component. + +[.contract-item] +[[InstanceService-getComponentId-address-]] +==== `[.contract-item-name]#++getComponentId++#++(address componentAddress) → uint256 componentId++` [.item-kind]#external# + +Returns the component ID of a given component address. + +[.contract-item] +[[InstanceService-getComponentType-uint256-]] +==== `[.contract-item-name]#++getComponentType++#++(uint256 componentId) → enum IComponent.ComponentType componentType++` [.item-kind]#external# + +Returns the type of a component given its ID. + +[.contract-item] +[[InstanceService-getComponentState-uint256-]] +==== `[.contract-item-name]#++getComponentState++#++(uint256 componentId) → enum IComponent.ComponentState componentState++` [.item-kind]#external# + +Returns the current state of a specific component. + +[.contract-item] +[[InstanceService-getComponent-uint256-]] +==== `[.contract-item-name]#++getComponent++#++(uint256 id) → contract IComponent++` [.item-kind]#external# + +Returns the component with the specified ID. + +[.contract-item] +[[InstanceService-getOracleId-uint256-]] +==== `[.contract-item-name]#++getOracleId++#++(uint256 idx) → uint256 oracleId++` [.item-kind]#public# + +Returns the oracle ID at the specified index. + +[.contract-item] +[[InstanceService-getRiskpoolId-uint256-]] +==== `[.contract-item-name]#++getRiskpoolId++#++(uint256 idx) → uint256 riskpoolId++` [.item-kind]#public# + +Returns the riskpool ID for the given index. + +[.contract-item] +[[InstanceService-getProductId-uint256-]] +==== `[.contract-item-name]#++getProductId++#++(uint256 idx) → uint256 productId++` [.item-kind]#public# + +Returns the product ID of the component at the given index. + +[.contract-item] +[[InstanceService-getStakingRequirements-uint256-]] +==== `[.contract-item-name]#++getStakingRequirements++#++(uint256 id) → bytes data++` [.item-kind]#external# + +Returns the staking requirements for a specific ID. + +[.contract-item] +[[InstanceService-getStakedAssets-uint256-]] +==== `[.contract-item-name]#++getStakedAssets++#++(uint256 id) → bytes data++` [.item-kind]#external# + +Returns the staked assets for a given ID. + +[.contract-item] +[[InstanceService-processIds--]] +==== `[.contract-item-name]#++processIds++#++() → uint256 numberOfProcessIds++` [.item-kind]#external# + +Returns the number of process IDs in the policy contract. + +[.contract-item] +[[InstanceService-getMetadata-bytes32-]] +==== `[.contract-item-name]#++getMetadata++#++(bytes32 bpKey) → struct IPolicy.Metadata metadata++` [.item-kind]#external# + +Returns the metadata associated with a given business process key. + +[.contract-item] +[[InstanceService-getApplication-bytes32-]] +==== `[.contract-item-name]#++getApplication++#++(bytes32 processId) → struct IPolicy.Application application++` [.item-kind]#external# + +Returns the application data associated with the given process ID. + +[.contract-item] +[[InstanceService-getPolicy-bytes32-]] +==== `[.contract-item-name]#++getPolicy++#++(bytes32 processId) → struct IPolicy.Policy policy++` [.item-kind]#external# + +Returns the policy associated with the given process ID. + +[.contract-item] +[[InstanceService-claims-bytes32-]] +==== `[.contract-item-name]#++claims++#++(bytes32 processId) → uint256 numberOfClaims++` [.item-kind]#external# + +Returns the number of claims associated with a given process ID. + +[.contract-item] +[[InstanceService-payouts-bytes32-]] +==== `[.contract-item-name]#++payouts++#++(bytes32 processId) → uint256 numberOfPayouts++` [.item-kind]#external# + +Returns the number of payouts for a given processId. + +[.contract-item] +[[InstanceService-getClaim-bytes32-uint256-]] +==== `[.contract-item-name]#++getClaim++#++(bytes32 processId, uint256 claimId) → struct IPolicy.Claim claim++` [.item-kind]#external# + +Returns the claim with the given claimId for the specified processId. + +[.contract-item] +[[InstanceService-getPayout-bytes32-uint256-]] +==== `[.contract-item-name]#++getPayout++#++(bytes32 processId, uint256 payoutId) → struct IPolicy.Payout payout++` [.item-kind]#external# + +Returns the information of a specific payout. + +[.contract-item] +[[InstanceService-getRiskpool-uint256-]] +==== `[.contract-item-name]#++getRiskpool++#++(uint256 riskpoolId) → struct IPool.Pool riskPool++` [.item-kind]#external# + +Returns the risk pool with the given ID. + +[.contract-item] +[[InstanceService-getFullCollateralizationLevel--]] +==== `[.contract-item-name]#++getFullCollateralizationLevel++#++() → uint256++` [.item-kind]#external# + +Returns the full collateralization level of the pool. + +[.contract-item] +[[InstanceService-getCapital-uint256-]] +==== `[.contract-item-name]#++getCapital++#++(uint256 riskpoolId) → uint256 capitalAmount++` [.item-kind]#external# + +Returns the capital amount of a given risk pool. + +[.contract-item] +[[InstanceService-getTotalValueLocked-uint256-]] +==== `[.contract-item-name]#++getTotalValueLocked++#++(uint256 riskpoolId) → uint256 totalValueLockedAmount++` [.item-kind]#external# + +Returns the total value locked in a specific risk pool. + +[.contract-item] +[[InstanceService-getCapacity-uint256-]] +==== `[.contract-item-name]#++getCapacity++#++(uint256 riskpoolId) → uint256 capacityAmount++` [.item-kind]#external# + +Returns the available capacity of a risk pool. + +[.contract-item] +[[InstanceService-getBalance-uint256-]] +==== `[.contract-item-name]#++getBalance++#++(uint256 riskpoolId) → uint256 balanceAmount++` [.item-kind]#external# + +Returns the balance amount of a specific risk pool. + +[.contract-item] +[[InstanceService-activeBundles-uint256-]] +==== `[.contract-item-name]#++activeBundles++#++(uint256 riskpoolId) → uint256 numberOfActiveBundles++` [.item-kind]#external# + +Returns the number of active bundles for a given risk pool. + +[.contract-item] +[[InstanceService-getActiveBundleId-uint256-uint256-]] +==== `[.contract-item-name]#++getActiveBundleId++#++(uint256 riskpoolId, uint256 bundleIdx) → uint256 bundleId++` [.item-kind]#external# + +Returns the active bundle ID for a given risk pool and bundle index. + +[.contract-item] +[[InstanceService-getMaximumNumberOfActiveBundles-uint256-]] +==== `[.contract-item-name]#++getMaximumNumberOfActiveBundles++#++(uint256 riskpoolId) → uint256 maximumNumberOfActiveBundles++` [.item-kind]#external# + +Returns the maximum number of active bundles for a given risk pool ID. + +[.contract-item] +[[InstanceService-getBundleToken--]] +==== `[.contract-item-name]#++getBundleToken++#++() → contract IBundleToken token++` [.item-kind]#external# + +Returns the bundle token contract address. + +[.contract-item] +[[InstanceService-getBundle-uint256-]] +==== `[.contract-item-name]#++getBundle++#++(uint256 bundleId) → struct IBundle.Bundle bundle++` [.item-kind]#external# + +Returns the bundle with the given ID. + +[.contract-item] +[[InstanceService-bundles--]] +==== `[.contract-item-name]#++bundles++#++() → uint256++` [.item-kind]#external# + +Returns the number of bundles in the `_bundle` contract. + +[.contract-item] +[[InstanceService-unburntBundles-uint256-]] +==== `[.contract-item-name]#++unburntBundles++#++(uint256 riskpoolId) → uint256 numberOfUnburntBundles++` [.item-kind]#external# + +Returns the number of unburnt bundles for a given risk pool ID. + +[.contract-item] +[[InstanceService-getTreasuryAddress--]] +==== `[.contract-item-name]#++getTreasuryAddress++#++() → address++` [.item-kind]#external# + +Returns the address of the treasury contract. + +[.contract-item] +[[InstanceService-getInstanceWallet--]] +==== `[.contract-item-name]#++getInstanceWallet++#++() → address++` [.item-kind]#external# + +Returns the address of the instance wallet associated with the treasury. + +[.contract-item] +[[InstanceService-getRiskpoolWallet-uint256-]] +==== `[.contract-item-name]#++getRiskpoolWallet++#++(uint256 riskpoolId) → address++` [.item-kind]#external# + +Returns the wallet address of the specified riskpool. + +[.contract-item] +[[InstanceService-getComponentToken-uint256-]] +==== `[.contract-item-name]#++getComponentToken++#++(uint256 componentId) → contract IERC20++` [.item-kind]#external# + +Returns the IERC20 token associated with the given component ID. + +[.contract-item] +[[InstanceService-getFeeFractionFullUnit--]] +==== `[.contract-item-name]#++getFeeFractionFullUnit++#++() → uint256++` [.item-kind]#external# + +Returns the fraction of the treasury fee expressed in full units. + +:_afterInitialize: pass:normal[xref:#OracleService-_afterInitialize--[`++_afterInitialize++`]] +:respond: pass:normal[xref:#OracleService-respond-uint256-bytes-[`++respond++`]] + +[.contract] +[[OracleService]] +=== `++OracleService++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/services/OracleService.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/services/OracleService.sol"; +``` + +[.contract-index] +.Functions +-- +* {xref-OracleService-_afterInitialize--}[`++_afterInitialize()++`] +* {xref-OracleService-respond-uint256-bytes-}[`++respond(_requestId, _data)++`] + +[.contract-subindex-inherited] +.CoreController +* {xref-CoreController-initialize-address-}[`++initialize(registry)++`] +* {xref-CoreController-_getName--}[`++_getName()++`] +* {xref-CoreController-_getContractAddress-bytes32-}[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-_disableInitializers--[`++_disableInitializers()++`] + +[.contract-subindex-inherited] +.IOracleService + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.CoreController + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-Initialized-uint8-[`++Initialized(version)++`] + +[.contract-subindex-inherited] +.IOracleService + +-- + +[.contract-item] +[[OracleService-_afterInitialize--]] +==== `[.contract-item-name]#++_afterInitialize++#++()++` [.item-kind]#internal# + +Sets the `_query` variable to an instance of the `IQuery` contract. + +[.contract-item] +[[OracleService-respond-uint256-bytes-]] +==== `[.contract-item-name]#++respond++#++(uint256 _requestId, bytes _data)++` [.item-kind]#external# + +Allows a registered oracle to respond to a data request. + +:NAME: pass:normal[xref:#ProductService-NAME-bytes32[`++NAME++`]] +:constructor: pass:normal[xref:#ProductService-constructor-address-[`++constructor++`]] +:fallback: pass:normal[xref:#ProductService-fallback--[`++fallback++`]] +:_delegate: pass:normal[xref:#ProductService-_delegate-address-[`++_delegate++`]] +:_license: pass:normal[xref:#ProductService-_license--[`++_license++`]] + +[.contract] +[[ProductService]] +=== `++ProductService++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/services/ProductService.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/services/ProductService.sol"; +``` + +[.contract-index] +.Functions +-- +* {xref-ProductService-constructor-address-}[`++constructor(_registry)++`] +* {xref-ProductService-fallback--}[`++fallback()++`] +* {xref-ProductService-_delegate-address-}[`++_delegate(implementation)++`] +* {xref-ProductService-_license--}[`++_license()++`] + +[.contract-subindex-inherited] +.WithRegistry +* {xref-WithRegistry-getContractFromRegistry-bytes32-}[`++getContractFromRegistry(_contractName)++`] +* {xref-WithRegistry-getContractInReleaseFromRegistry-bytes32-bytes32-}[`++getContractInReleaseFromRegistry(_release, _contractName)++`] +* {xref-WithRegistry-getReleaseFromRegistry--}[`++getReleaseFromRegistry()++`] + +-- + +[.contract-item] +[[ProductService-constructor-address-]] +==== `[.contract-item-name]#++constructor++#++(address _registry)++` [.item-kind]#public# + +Constructor function that initializes the contract with a registry address. + +[.contract-item] +[[ProductService-fallback--]] +==== `[.contract-item-name]#++fallback++#++()++` [.item-kind]#external# + +Fallback function that ensures the caller is a registered product and authorized to execute the delegated policy flow. + +[.contract-item] +[[ProductService-_delegate-address-]] +==== `[.contract-item-name]#++_delegate++#++(address implementation)++` [.item-kind]#internal# + +Delegates the current call to `implementation`. + +[.contract-item] +[[ProductService-_license--]] +==== `[.contract-item-name]#++_license++#++() → contract ILicense++` [.item-kind]#internal# + +Returns the instance of the License contract. + +:RISKPOOL_NAME: pass:normal[xref:#RiskpoolService-RISKPOOL_NAME-bytes32[`++RISKPOOL_NAME++`]] +:onlyProposedRiskpool: pass:normal[xref:#RiskpoolService-onlyProposedRiskpool--[`++onlyProposedRiskpool++`]] +:onlyActiveRiskpool: pass:normal[xref:#RiskpoolService-onlyActiveRiskpool--[`++onlyActiveRiskpool++`]] +:onlyOwningRiskpool: pass:normal[xref:#RiskpoolService-onlyOwningRiskpool-uint256-bool-[`++onlyOwningRiskpool++`]] +:onlyOwningRiskpoolId: pass:normal[xref:#RiskpoolService-onlyOwningRiskpoolId-uint256-bool-[`++onlyOwningRiskpoolId++`]] +:_afterInitialize: pass:normal[xref:#RiskpoolService-_afterInitialize--[`++_afterInitialize++`]] +:registerRiskpool: pass:normal[xref:#RiskpoolService-registerRiskpool-address-address-uint256-uint256-[`++registerRiskpool++`]] +:createBundle: pass:normal[xref:#RiskpoolService-createBundle-address-bytes-uint256-[`++createBundle++`]] +:fundBundle: pass:normal[xref:#RiskpoolService-fundBundle-uint256-uint256-[`++fundBundle++`]] +:defundBundle: pass:normal[xref:#RiskpoolService-defundBundle-uint256-uint256-[`++defundBundle++`]] +:lockBundle: pass:normal[xref:#RiskpoolService-lockBundle-uint256-[`++lockBundle++`]] +:unlockBundle: pass:normal[xref:#RiskpoolService-unlockBundle-uint256-[`++unlockBundle++`]] +:closeBundle: pass:normal[xref:#RiskpoolService-closeBundle-uint256-[`++closeBundle++`]] +:burnBundle: pass:normal[xref:#RiskpoolService-burnBundle-uint256-[`++burnBundle++`]] +:collateralizePolicy: pass:normal[xref:#RiskpoolService-collateralizePolicy-uint256-bytes32-uint256-[`++collateralizePolicy++`]] +:processPremium: pass:normal[xref:#RiskpoolService-processPremium-uint256-bytes32-uint256-[`++processPremium++`]] +:processPayout: pass:normal[xref:#RiskpoolService-processPayout-uint256-bytes32-uint256-[`++processPayout++`]] +:releasePolicy: pass:normal[xref:#RiskpoolService-releasePolicy-uint256-bytes32-[`++releasePolicy++`]] +:setMaximumNumberOfActiveBundles: pass:normal[xref:#RiskpoolService-setMaximumNumberOfActiveBundles-uint256-uint256-[`++setMaximumNumberOfActiveBundles++`]] + +[.contract] +[[RiskpoolService]] +=== `++RiskpoolService++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/services/RiskpoolService.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/services/RiskpoolService.sol"; +``` + +[.contract-index] +.Modifiers +-- +* {xref-RiskpoolService-onlyProposedRiskpool--}[`++onlyProposedRiskpool()++`] +* {xref-RiskpoolService-onlyActiveRiskpool--}[`++onlyActiveRiskpool()++`] +* {xref-RiskpoolService-onlyOwningRiskpool-uint256-bool-}[`++onlyOwningRiskpool(bundleId, mustBeActive)++`] +* {xref-RiskpoolService-onlyOwningRiskpoolId-uint256-bool-}[`++onlyOwningRiskpoolId(riskpoolId, mustBeActive)++`] +-- + +[.contract-index] +.Functions +-- +* {xref-RiskpoolService-_afterInitialize--}[`++_afterInitialize()++`] +* {xref-RiskpoolService-registerRiskpool-address-address-uint256-uint256-}[`++registerRiskpool(wallet, erc20Token, collateralizationLevel, sumOfSumInsuredCap)++`] +* {xref-RiskpoolService-createBundle-address-bytes-uint256-}[`++createBundle(owner, filter, initialCapital)++`] +* {xref-RiskpoolService-fundBundle-uint256-uint256-}[`++fundBundle(bundleId, amount)++`] +* {xref-RiskpoolService-defundBundle-uint256-uint256-}[`++defundBundle(bundleId, amount)++`] +* {xref-RiskpoolService-lockBundle-uint256-}[`++lockBundle(bundleId)++`] +* {xref-RiskpoolService-unlockBundle-uint256-}[`++unlockBundle(bundleId)++`] +* {xref-RiskpoolService-closeBundle-uint256-}[`++closeBundle(bundleId)++`] +* {xref-RiskpoolService-burnBundle-uint256-}[`++burnBundle(bundleId)++`] +* {xref-RiskpoolService-collateralizePolicy-uint256-bytes32-uint256-}[`++collateralizePolicy(bundleId, processId, collateralAmount)++`] +* {xref-RiskpoolService-processPremium-uint256-bytes32-uint256-}[`++processPremium(bundleId, processId, amount)++`] +* {xref-RiskpoolService-processPayout-uint256-bytes32-uint256-}[`++processPayout(bundleId, processId, amount)++`] +* {xref-RiskpoolService-releasePolicy-uint256-bytes32-}[`++releasePolicy(bundleId, processId)++`] +* {xref-RiskpoolService-setMaximumNumberOfActiveBundles-uint256-uint256-}[`++setMaximumNumberOfActiveBundles(riskpoolId, maxNumberOfActiveBundles)++`] + +[.contract-subindex-inherited] +.CoreController +* {xref-CoreController-initialize-address-}[`++initialize(registry)++`] +* {xref-CoreController-_getName--}[`++_getName()++`] +* {xref-CoreController-_getContractAddress-bytes32-}[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-_disableInitializers--[`++_disableInitializers()++`] + +[.contract-subindex-inherited] +.IRiskpoolService + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.CoreController + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-Initialized-uint8-[`++Initialized(version)++`] + +[.contract-subindex-inherited] +.IRiskpoolService + +-- + +[.contract-item] +[[RiskpoolService-onlyProposedRiskpool--]] +==== `[.contract-item-name]#++onlyProposedRiskpool++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[RiskpoolService-onlyActiveRiskpool--]] +==== `[.contract-item-name]#++onlyActiveRiskpool++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[RiskpoolService-onlyOwningRiskpool-uint256-bool-]] +==== `[.contract-item-name]#++onlyOwningRiskpool++#++(uint256 bundleId, bool mustBeActive)++` [.item-kind]#modifier# + +[.contract-item] +[[RiskpoolService-onlyOwningRiskpoolId-uint256-bool-]] +==== `[.contract-item-name]#++onlyOwningRiskpoolId++#++(uint256 riskpoolId, bool mustBeActive)++` [.item-kind]#modifier# + +[.contract-item] +[[RiskpoolService-_afterInitialize--]] +==== `[.contract-item-name]#++_afterInitialize++#++()++` [.item-kind]#internal# + +Sets the addresses of the BundleController, ComponentController, PoolController, and TreasuryModule contracts. + +[.contract-item] +[[RiskpoolService-registerRiskpool-address-address-uint256-uint256-]] +==== `[.contract-item-name]#++registerRiskpool++#++(address wallet, address erc20Token, uint256 collateralizationLevel, uint256 sumOfSumInsuredCap)++` [.item-kind]#external# + +Registers a new risk pool with the given parameters. + +[.contract-item] +[[RiskpoolService-createBundle-address-bytes-uint256-]] +==== `[.contract-item-name]#++createBundle++#++(address owner, bytes filter, uint256 initialCapital) → uint256 bundleId++` [.item-kind]#external# + +Creates a new bundle with the given parameters and adds it to the active set of the riskpool. + +[.contract-item] +[[RiskpoolService-fundBundle-uint256-uint256-]] +==== `[.contract-item-name]#++fundBundle++#++(uint256 bundleId, uint256 amount) → uint256 netAmount++` [.item-kind]#external# + +This function allows a user to fund a bundle with a specified amount. + +[.contract-item] +[[RiskpoolService-defundBundle-uint256-uint256-]] +==== `[.contract-item-name]#++defundBundle++#++(uint256 bundleId, uint256 amount) → uint256 netAmount++` [.item-kind]#external# + +Defunds a bundle by withdrawing a specified amount of tokens from it. + +[.contract-item] +[[RiskpoolService-lockBundle-uint256-]] +==== `[.contract-item-name]#++lockBundle++#++(uint256 bundleId)++` [.item-kind]#external# + +Locks a bundle, preventing it from being traded or redeemed. + +[.contract-item] +[[RiskpoolService-unlockBundle-uint256-]] +==== `[.contract-item-name]#++unlockBundle++#++(uint256 bundleId)++` [.item-kind]#external# + +Unlocks a bundle for trading by adding its ID to the active set of a risk pool and unlocking the bundle. + +[.contract-item] +[[RiskpoolService-closeBundle-uint256-]] +==== `[.contract-item-name]#++closeBundle++#++(uint256 bundleId)++` [.item-kind]#external# + +Closes a bundle and removes it from the active set of the owning riskpool. + +[.contract-item] +[[RiskpoolService-burnBundle-uint256-]] +==== `[.contract-item-name]#++burnBundle++#++(uint256 bundleId)++` [.item-kind]#external# + +Burns a closed bundle, withdrawing its remaining balance and defunding it from the riskpool and the pool. + +[.contract-item] +[[RiskpoolService-collateralizePolicy-uint256-bytes32-uint256-]] +==== `[.contract-item-name]#++collateralizePolicy++#++(uint256 bundleId, bytes32 processId, uint256 collateralAmount)++` [.item-kind]#external# + +Collateralizes a policy by locking a specified amount of collateral for a given bundle and process ID. + +[.contract-item] +[[RiskpoolService-processPremium-uint256-bytes32-uint256-]] +==== `[.contract-item-name]#++processPremium++#++(uint256 bundleId, bytes32 processId, uint256 amount)++` [.item-kind]#external# + +Processes a premium payment for a specific bundle. + +[.contract-item] +[[RiskpoolService-processPayout-uint256-bytes32-uint256-]] +==== `[.contract-item-name]#++processPayout++#++(uint256 bundleId, bytes32 processId, uint256 amount)++` [.item-kind]#external# + +Processes a payout for a specific bundle. + +[.contract-item] +[[RiskpoolService-releasePolicy-uint256-bytes32-]] +==== `[.contract-item-name]#++releasePolicy++#++(uint256 bundleId, bytes32 processId) → uint256 collateralAmount++` [.item-kind]#external# + +Releases a policy for a given bundle and process ID. + +[.contract-item] +[[RiskpoolService-setMaximumNumberOfActiveBundles-uint256-uint256-]] +==== `[.contract-item-name]#++setMaximumNumberOfActiveBundles++#++(uint256 riskpoolId, uint256 maxNumberOfActiveBundles)++` [.item-kind]#external# + +Sets the maximum number of active bundles for a given riskpool. + diff --git a/docs/modules/api/pages/shared.adoc b/docs/modules/api/pages/shared.adoc new file mode 100644 index 00000000..2b07069d --- /dev/null +++ b/docs/modules/api/pages/shared.adoc @@ -0,0 +1,345 @@ +:github-icon: pass:[] +:xref-CoreController-onlyInstanceOperator--: xref:shared.adoc#CoreController-onlyInstanceOperator-- +:xref-CoreController-onlyPolicyFlow-bytes32-: xref:shared.adoc#CoreController-onlyPolicyFlow-bytes32- +:xref-CoreController-constructor--: xref:shared.adoc#CoreController-constructor-- +:xref-CoreController-initialize-address-: xref:shared.adoc#CoreController-initialize-address- +:xref-CoreController-_getName--: xref:shared.adoc#CoreController-_getName-- +:xref-CoreController-_afterInitialize--: xref:shared.adoc#CoreController-_afterInitialize-- +:xref-CoreController-_getContractAddress-bytes32-: xref:shared.adoc#CoreController-_getContractAddress-bytes32- +:xref-CoreProxy-onlyAdmin--: xref:shared.adoc#CoreProxy-onlyAdmin-- +:xref-CoreProxy-constructor-address-bytes-: xref:shared.adoc#CoreProxy-constructor-address-bytes- +:xref-CoreProxy-implementation--: xref:shared.adoc#CoreProxy-implementation-- +:xref-CoreProxy-upgradeToAndCall-address-bytes-: xref:shared.adoc#CoreProxy-upgradeToAndCall-address-bytes- +:xref-TransferHelper-unifiedTransferFrom-contract-IERC20-address-address-uint256-: xref:shared.adoc#TransferHelper-unifiedTransferFrom-contract-IERC20-address-address-uint256- +:xref-TransferHelper-LogTransferHelperInputValidation1Failed-bool-address-address-: xref:shared.adoc#TransferHelper-LogTransferHelperInputValidation1Failed-bool-address-address- +:xref-TransferHelper-LogTransferHelperInputValidation2Failed-uint256-uint256-: xref:shared.adoc#TransferHelper-LogTransferHelperInputValidation2Failed-uint256-uint256- +:xref-TransferHelper-LogTransferHelperCallFailed-bool-uint256-bytes-: xref:shared.adoc#TransferHelper-LogTransferHelperCallFailed-bool-uint256-bytes- +:xref-WithRegistry-onlyInstanceOperator--: xref:shared.adoc#WithRegistry-onlyInstanceOperator-- +:xref-WithRegistry-onlyOracleService--: xref:shared.adoc#WithRegistry-onlyOracleService-- +:xref-WithRegistry-onlyOracleOwner--: xref:shared.adoc#WithRegistry-onlyOracleOwner-- +:xref-WithRegistry-onlyProductOwner--: xref:shared.adoc#WithRegistry-onlyProductOwner-- +:xref-WithRegistry-constructor-address-: xref:shared.adoc#WithRegistry-constructor-address- +:xref-WithRegistry-getContractFromRegistry-bytes32-: xref:shared.adoc#WithRegistry-getContractFromRegistry-bytes32- +:xref-WithRegistry-getContractInReleaseFromRegistry-bytes32-bytes32-: xref:shared.adoc#WithRegistry-getContractInReleaseFromRegistry-bytes32-bytes32- +:xref-WithRegistry-getReleaseFromRegistry--: xref:shared.adoc#WithRegistry-getReleaseFromRegistry-- += Shared + +[.readme-notice] +NOTE: This document is better viewed at https://docs.etherisc.com/contracts/api/shared + +== Contracts + +:_registry: pass:normal[xref:#CoreController-_registry-contract-IRegistry[`++_registry++`]] +:_access: pass:normal[xref:#CoreController-_access-contract-IAccess[`++_access++`]] +:constructor: pass:normal[xref:#CoreController-constructor--[`++constructor++`]] +:onlyInstanceOperator: pass:normal[xref:#CoreController-onlyInstanceOperator--[`++onlyInstanceOperator++`]] +:onlyPolicyFlow: pass:normal[xref:#CoreController-onlyPolicyFlow-bytes32-[`++onlyPolicyFlow++`]] +:initialize: pass:normal[xref:#CoreController-initialize-address-[`++initialize++`]] +:_getName: pass:normal[xref:#CoreController-_getName--[`++_getName++`]] +:_afterInitialize: pass:normal[xref:#CoreController-_afterInitialize--[`++_afterInitialize++`]] +:_getContractAddress: pass:normal[xref:#CoreController-_getContractAddress-bytes32-[`++_getContractAddress++`]] + +[.contract] +[[CoreController]] +=== `++CoreController++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/shared/CoreController.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/shared/CoreController.sol"; +``` + +[.contract-index] +.Modifiers +-- +* {xref-CoreController-onlyInstanceOperator--}[`++onlyInstanceOperator()++`] +* {xref-CoreController-onlyPolicyFlow-bytes32-}[`++onlyPolicyFlow(module)++`] +-- + +[.contract-index] +.Functions +-- +* {xref-CoreController-constructor--}[`++constructor()++`] +* {xref-CoreController-initialize-address-}[`++initialize(registry)++`] +* {xref-CoreController-_getName--}[`++_getName()++`] +* {xref-CoreController-_afterInitialize--}[`++_afterInitialize()++`] +* {xref-CoreController-_getContractAddress-bytes32-}[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-_disableInitializers--[`++_disableInitializers()++`] + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-Initialized-uint8-[`++Initialized(version)++`] + +-- + +[.contract-item] +[[CoreController-onlyInstanceOperator--]] +==== `[.contract-item-name]#++onlyInstanceOperator++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[CoreController-onlyPolicyFlow-bytes32-]] +==== `[.contract-item-name]#++onlyPolicyFlow++#++(bytes32 module)++` [.item-kind]#modifier# + +[.contract-item] +[[CoreController-constructor--]] +==== `[.contract-item-name]#++constructor++#++()++` [.item-kind]#public# + +Constructor function that disables initializers. + +[.contract-item] +[[CoreController-initialize-address-]] +==== `[.contract-item-name]#++initialize++#++(address registry)++` [.item-kind]#public# + +Initializes the contract with the provided registry address. + +[.contract-item] +[[CoreController-_getName--]] +==== `[.contract-item-name]#++_getName++#++() → bytes32++` [.item-kind]#internal# + +Returns the name of the contract. + +[.contract-item] +[[CoreController-_afterInitialize--]] +==== `[.contract-item-name]#++_afterInitialize++#++()++` [.item-kind]#internal# + +This function is called after the contract is initialized and can be used to perform additional setup. + +[.contract-item] +[[CoreController-_getContractAddress-bytes32-]] +==== `[.contract-item-name]#++_getContractAddress++#++(bytes32 contractName) → address contractAddress++` [.item-kind]#internal# + +Returns the address of a registered contract by its name. + +:onlyAdmin: pass:normal[xref:#CoreProxy-onlyAdmin--[`++onlyAdmin++`]] +:constructor: pass:normal[xref:#CoreProxy-constructor-address-bytes-[`++constructor++`]] +:implementation: pass:normal[xref:#CoreProxy-implementation--[`++implementation++`]] +:upgradeToAndCall: pass:normal[xref:#CoreProxy-upgradeToAndCall-address-bytes-[`++upgradeToAndCall++`]] + +[.contract] +[[CoreProxy]] +=== `++CoreProxy++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/shared/CoreProxy.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/shared/CoreProxy.sol"; +``` + +[.contract-index] +.Modifiers +-- +* {xref-CoreProxy-onlyAdmin--}[`++onlyAdmin()++`] +-- + +[.contract-index] +.Functions +-- +* {xref-CoreProxy-constructor-address-bytes-}[`++constructor(_controller, encoded_initializer)++`] +* {xref-CoreProxy-implementation--}[`++implementation()++`] +* {xref-CoreProxy-upgradeToAndCall-address-bytes-}[`++upgradeToAndCall(newImplementation, data)++`] + +[.contract-subindex-inherited] +.ERC1967Proxy +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#ERC1967Proxy-_implementation--[`++_implementation()++`] + +[.contract-subindex-inherited] +.ERC1967Upgrade +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#ERC1967Upgrade-_getImplementation--[`++_getImplementation()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#ERC1967Upgrade-_upgradeTo-address-[`++_upgradeTo(newImplementation)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#ERC1967Upgrade-_upgradeToAndCall-address-bytes-bool-[`++_upgradeToAndCall(newImplementation, data, forceCall)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#ERC1967Upgrade-_upgradeToAndCallUUPS-address-bytes-bool-[`++_upgradeToAndCallUUPS(newImplementation, data, forceCall)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#ERC1967Upgrade-_getAdmin--[`++_getAdmin()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#ERC1967Upgrade-_changeAdmin-address-[`++_changeAdmin(newAdmin)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#ERC1967Upgrade-_getBeacon--[`++_getBeacon()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#ERC1967Upgrade-_upgradeBeaconToAndCall-address-bytes-bool-[`++_upgradeBeaconToAndCall(newBeacon, data, forceCall)++`] + +[.contract-subindex-inherited] +.Proxy +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Proxy-_delegate-address-[`++_delegate(implementation)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Proxy-_fallback--[`++_fallback()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Proxy-fallback--[`++fallback()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Proxy-receive--[`++receive()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Proxy-_beforeFallback--[`++_beforeFallback()++`] + +[.contract-subindex-inherited] +.ICoreProxy + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.ERC1967Proxy + +[.contract-subindex-inherited] +.ERC1967Upgrade +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#ERC1967Upgrade-Upgraded-address-[`++Upgraded(implementation)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#ERC1967Upgrade-AdminChanged-address-address-[`++AdminChanged(previousAdmin, newAdmin)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#ERC1967Upgrade-BeaconUpgraded-address-[`++BeaconUpgraded(beacon)++`] + +[.contract-subindex-inherited] +.Proxy + +[.contract-subindex-inherited] +.ICoreProxy +* https://github.com/etherisc/gif-interface/blob/develop/contracts/shared/ICoreProxy.sol[`++LogCoreContractUpgraded(oldImplementation, newImplemntation)++`] + +-- + +[.contract-item] +[[CoreProxy-onlyAdmin--]] +==== `[.contract-item-name]#++onlyAdmin++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[CoreProxy-constructor-address-bytes-]] +==== `[.contract-item-name]#++constructor++#++(address _controller, bytes encoded_initializer)++` [.item-kind]#public# + +Constructor function that creates a new instance of the contract. + +[.contract-item] +[[CoreProxy-implementation--]] +==== `[.contract-item-name]#++implementation++#++() → address++` [.item-kind]#external# + +Returns the address of the current implementation contract. + +[.contract-item] +[[CoreProxy-upgradeToAndCall-address-bytes-]] +==== `[.contract-item-name]#++upgradeToAndCall++#++(address newImplementation, bytes data)++` [.item-kind]#external# + +Upgrades the contract to a new implementation and forwards a function call to it. + +:LogTransferHelperInputValidation1Failed: pass:normal[xref:#TransferHelper-LogTransferHelperInputValidation1Failed-bool-address-address-[`++LogTransferHelperInputValidation1Failed++`]] +:LogTransferHelperInputValidation2Failed: pass:normal[xref:#TransferHelper-LogTransferHelperInputValidation2Failed-uint256-uint256-[`++LogTransferHelperInputValidation2Failed++`]] +:LogTransferHelperCallFailed: pass:normal[xref:#TransferHelper-LogTransferHelperCallFailed-bool-uint256-bytes-[`++LogTransferHelperCallFailed++`]] +:unifiedTransferFrom: pass:normal[xref:#TransferHelper-unifiedTransferFrom-contract-IERC20-address-address-uint256-[`++unifiedTransferFrom++`]] + +[.contract] +[[TransferHelper]] +=== `++TransferHelper++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/shared/TransferHelper.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/shared/TransferHelper.sol"; +``` + +[.contract-index] +.Functions +-- +* {xref-TransferHelper-unifiedTransferFrom-contract-IERC20-address-address-uint256-}[`++unifiedTransferFrom(token, from, to, value)++`] + +-- + +[.contract-index] +.Events +-- +* {xref-TransferHelper-LogTransferHelperInputValidation1Failed-bool-address-address-}[`++LogTransferHelperInputValidation1Failed(tokenIsContract, from, to)++`] +* {xref-TransferHelper-LogTransferHelperInputValidation2Failed-uint256-uint256-}[`++LogTransferHelperInputValidation2Failed(balance, allowance)++`] +* {xref-TransferHelper-LogTransferHelperCallFailed-bool-uint256-bytes-}[`++LogTransferHelperCallFailed(callSuccess, returnDataLength, returnData)++`] + +-- + +[.contract-item] +[[TransferHelper-unifiedTransferFrom-contract-IERC20-address-address-uint256-]] +==== `[.contract-item-name]#++unifiedTransferFrom++#++(contract IERC20 token, address from, address to, uint256 value) → bool success++` [.item-kind]#internal# + +Executes a transferFrom function call on an ERC20 token contract, after performing input validation. + +[.contract-item] +[[TransferHelper-LogTransferHelperInputValidation1Failed-bool-address-address-]] +==== `[.contract-item-name]#++LogTransferHelperInputValidation1Failed++#++(bool tokenIsContract, address from, address to)++` [.item-kind]#event# + +[.contract-item] +[[TransferHelper-LogTransferHelperInputValidation2Failed-uint256-uint256-]] +==== `[.contract-item-name]#++LogTransferHelperInputValidation2Failed++#++(uint256 balance, uint256 allowance)++` [.item-kind]#event# + +[.contract-item] +[[TransferHelper-LogTransferHelperCallFailed-bool-uint256-bytes-]] +==== `[.contract-item-name]#++LogTransferHelperCallFailed++#++(bool callSuccess, uint256 returnDataLength, bytes returnData)++` [.item-kind]#event# + +:registry: pass:normal[xref:#WithRegistry-registry-contract-IRegistry[`++registry++`]] +:onlyInstanceOperator: pass:normal[xref:#WithRegistry-onlyInstanceOperator--[`++onlyInstanceOperator++`]] +:onlyOracleService: pass:normal[xref:#WithRegistry-onlyOracleService--[`++onlyOracleService++`]] +:onlyOracleOwner: pass:normal[xref:#WithRegistry-onlyOracleOwner--[`++onlyOracleOwner++`]] +:onlyProductOwner: pass:normal[xref:#WithRegistry-onlyProductOwner--[`++onlyProductOwner++`]] +:constructor: pass:normal[xref:#WithRegistry-constructor-address-[`++constructor++`]] +:getContractFromRegistry: pass:normal[xref:#WithRegistry-getContractFromRegistry-bytes32-[`++getContractFromRegistry++`]] +:getContractInReleaseFromRegistry: pass:normal[xref:#WithRegistry-getContractInReleaseFromRegistry-bytes32-bytes32-[`++getContractInReleaseFromRegistry++`]] +:getReleaseFromRegistry: pass:normal[xref:#WithRegistry-getReleaseFromRegistry--[`++getReleaseFromRegistry++`]] + +[.contract] +[[WithRegistry]] +=== `++WithRegistry++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/shared/WithRegistry.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/shared/WithRegistry.sol"; +``` + +[.contract-index] +.Modifiers +-- +* {xref-WithRegistry-onlyInstanceOperator--}[`++onlyInstanceOperator()++`] +* {xref-WithRegistry-onlyOracleService--}[`++onlyOracleService()++`] +* {xref-WithRegistry-onlyOracleOwner--}[`++onlyOracleOwner()++`] +* {xref-WithRegistry-onlyProductOwner--}[`++onlyProductOwner()++`] +-- + +[.contract-index] +.Functions +-- +* {xref-WithRegistry-constructor-address-}[`++constructor(_registry)++`] +* {xref-WithRegistry-getContractFromRegistry-bytes32-}[`++getContractFromRegistry(_contractName)++`] +* {xref-WithRegistry-getContractInReleaseFromRegistry-bytes32-bytes32-}[`++getContractInReleaseFromRegistry(_release, _contractName)++`] +* {xref-WithRegistry-getReleaseFromRegistry--}[`++getReleaseFromRegistry()++`] + +-- + +[.contract-item] +[[WithRegistry-onlyInstanceOperator--]] +==== `[.contract-item-name]#++onlyInstanceOperator++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[WithRegistry-onlyOracleService--]] +==== `[.contract-item-name]#++onlyOracleService++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[WithRegistry-onlyOracleOwner--]] +==== `[.contract-item-name]#++onlyOracleOwner++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[WithRegistry-onlyProductOwner--]] +==== `[.contract-item-name]#++onlyProductOwner++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[WithRegistry-constructor-address-]] +==== `[.contract-item-name]#++constructor++#++(address _registry)++` [.item-kind]#public# + +Constructor function that sets the address of the registry contract. + +[.contract-item] +[[WithRegistry-getContractFromRegistry-bytes32-]] +==== `[.contract-item-name]#++getContractFromRegistry++#++(bytes32 _contractName) → address _addr++` [.item-kind]#public# + +Returns the address of a contract registered in the registry by its name. + +[.contract-item] +[[WithRegistry-getContractInReleaseFromRegistry-bytes32-bytes32-]] +==== `[.contract-item-name]#++getContractInReleaseFromRegistry++#++(bytes32 _release, bytes32 _contractName) → address _addr++` [.item-kind]#internal# + +Returns the address of a contract with a given name in a specific release of the registry. + +[.contract-item] +[[WithRegistry-getReleaseFromRegistry--]] +==== `[.contract-item-name]#++getReleaseFromRegistry++#++() → bytes32 _release++` [.item-kind]#internal# + +Returns the current release identifier from the registry. + diff --git a/docs/modules/api/pages/test.adoc b/docs/modules/api/pages/test.adoc new file mode 100644 index 00000000..932f3cbd --- /dev/null +++ b/docs/modules/api/pages/test.adoc @@ -0,0 +1,1419 @@ +:github-icon: pass:[] +:xref-TestCoin-constructor--: xref:test.adoc#TestCoin-constructor-- +:xref-TestCoinAlternativeImplementation-constructor--: xref:test.adoc#TestCoinAlternativeImplementation-constructor-- +:xref-TestCoinAlternativeImplementation-transferFrom-address-address-uint256-: xref:test.adoc#TestCoinAlternativeImplementation-transferFrom-address-address-uint256- +:xref-TestCompromisedProduct-onlyPolicyHolder-bytes32-: xref:test.adoc#TestCompromisedProduct-onlyPolicyHolder-bytes32- +:xref-TestCompromisedProduct-constructor-bytes32-address-uint256-uint256-address-: xref:test.adoc#TestCompromisedProduct-constructor-bytes32-address-uint256-uint256-address- +:xref-TestCompromisedProduct-applyForPolicy-uint256-uint256-bytes-bytes-: xref:test.adoc#TestCompromisedProduct-applyForPolicy-uint256-uint256-bytes-bytes- +:xref-TestCompromisedProduct-collectPremium-bytes32-: xref:test.adoc#TestCompromisedProduct-collectPremium-bytes32- +:xref-TestCompromisedProduct-submitClaim-bytes32-uint256-: xref:test.adoc#TestCompromisedProduct-submitClaim-bytes32-uint256- +:xref-TestCompromisedProduct-getToken--: xref:test.adoc#TestCompromisedProduct-getToken-- +:xref-TestCompromisedProduct-getPolicyFlow--: xref:test.adoc#TestCompromisedProduct-getPolicyFlow-- +:xref-TestCompromisedProduct-getRiskpoolId--: xref:test.adoc#TestCompromisedProduct-getRiskpoolId-- +:xref-TestCompromisedProduct-getApplicationDataStructure--: xref:test.adoc#TestCompromisedProduct-getApplicationDataStructure-- +:xref-TestCompromisedProduct-getClaimDataStructure--: xref:test.adoc#TestCompromisedProduct-getClaimDataStructure-- +:xref-TestCompromisedProduct-getPayoutDataStructure--: xref:test.adoc#TestCompromisedProduct-getPayoutDataStructure-- +:xref-TestCompromisedProduct-riskPoolCapacityCallback-uint256-: xref:test.adoc#TestCompromisedProduct-riskPoolCapacityCallback-uint256- +:xref-TestCompromisedProduct-setId-uint256-: xref:test.adoc#TestCompromisedProduct-setId-uint256- +:xref-TestCompromisedProduct-getName--: xref:test.adoc#TestCompromisedProduct-getName-- +:xref-TestCompromisedProduct-getId--: xref:test.adoc#TestCompromisedProduct-getId-- +:xref-TestCompromisedProduct-getType--: xref:test.adoc#TestCompromisedProduct-getType-- +:xref-TestCompromisedProduct-getState--: xref:test.adoc#TestCompromisedProduct-getState-- +:xref-TestCompromisedProduct-getOwner--: xref:test.adoc#TestCompromisedProduct-getOwner-- +:xref-TestCompromisedProduct-getRegistry--: xref:test.adoc#TestCompromisedProduct-getRegistry-- +:xref-TestCompromisedProduct-isProduct--: xref:test.adoc#TestCompromisedProduct-isProduct-- +:xref-TestCompromisedProduct-isOracle--: xref:test.adoc#TestCompromisedProduct-isOracle-- +:xref-TestCompromisedProduct-isRiskpool--: xref:test.adoc#TestCompromisedProduct-isRiskpool-- +:xref-TestCompromisedProduct-proposalCallback--: xref:test.adoc#TestCompromisedProduct-proposalCallback-- +:xref-TestCompromisedProduct-approvalCallback--: xref:test.adoc#TestCompromisedProduct-approvalCallback-- +:xref-TestCompromisedProduct-declineCallback--: xref:test.adoc#TestCompromisedProduct-declineCallback-- +:xref-TestCompromisedProduct-suspendCallback--: xref:test.adoc#TestCompromisedProduct-suspendCallback-- +:xref-TestCompromisedProduct-resumeCallback--: xref:test.adoc#TestCompromisedProduct-resumeCallback-- +:xref-TestCompromisedProduct-pauseCallback--: xref:test.adoc#TestCompromisedProduct-pauseCallback-- +:xref-TestCompromisedProduct-unpauseCallback--: xref:test.adoc#TestCompromisedProduct-unpauseCallback-- +:xref-TestCompromisedProduct-archiveCallback--: xref:test.adoc#TestCompromisedProduct-archiveCallback-- +:xref-TestOracle-constructor-bytes32-address-: xref:test.adoc#TestOracle-constructor-bytes32-address- +:xref-TestOracle-request-uint256-bytes-: xref:test.adoc#TestOracle-request-uint256-bytes- +:xref-TestOracle-cancel-uint256-: xref:test.adoc#TestOracle-cancel-uint256- +:xref-TestOracle-respond-uint256-bool-: xref:test.adoc#TestOracle-respond-uint256-bool- +:xref-TestOracle-_oracleCalculation-uint256-: xref:test.adoc#TestOracle-_oracleCalculation-uint256- +:xref-TestProduct-constructor-bytes32-address-address-uint256-uint256-address-: xref:test.adoc#TestProduct-constructor-bytes32-address-address-uint256-uint256-address- +:xref-TestProduct-applyForPolicy-uint256-uint256-bytes-bytes-: xref:test.adoc#TestProduct-applyForPolicy-uint256-uint256-bytes-bytes- +:xref-TestProduct-applyForPolicy-address-payable-uint256-uint256-bytes-bytes-: xref:test.adoc#TestProduct-applyForPolicy-address-payable-uint256-uint256-bytes-bytes- +:xref-TestProduct-newAppliation-uint256-uint256-bytes-bytes-: xref:test.adoc#TestProduct-newAppliation-uint256-uint256-bytes-bytes- +:xref-TestProduct-revoke-bytes32-: xref:test.adoc#TestProduct-revoke-bytes32- +:xref-TestProduct-decline-bytes32-: xref:test.adoc#TestProduct-decline-bytes32- +:xref-TestProduct-underwrite-bytes32-: xref:test.adoc#TestProduct-underwrite-bytes32- +:xref-TestProduct-collectPremium-bytes32-: xref:test.adoc#TestProduct-collectPremium-bytes32- +:xref-TestProduct-collectPremium-bytes32-uint256-: xref:test.adoc#TestProduct-collectPremium-bytes32-uint256- +:xref-TestProduct-adjustPremiumSumInsured-bytes32-uint256-uint256-: xref:test.adoc#TestProduct-adjustPremiumSumInsured-bytes32-uint256-uint256- +:xref-TestProduct-expire-bytes32-: xref:test.adoc#TestProduct-expire-bytes32- +:xref-TestProduct-close-bytes32-: xref:test.adoc#TestProduct-close-bytes32- +:xref-TestProduct-submitClaim-bytes32-uint256-: xref:test.adoc#TestProduct-submitClaim-bytes32-uint256- +:xref-TestProduct-submitClaimNoOracle-bytes32-uint256-: xref:test.adoc#TestProduct-submitClaimNoOracle-bytes32-uint256- +:xref-TestProduct-submitClaimWithDeferredResponse-bytes32-uint256-: xref:test.adoc#TestProduct-submitClaimWithDeferredResponse-bytes32-uint256- +:xref-TestProduct-confirmClaim-bytes32-uint256-uint256-: xref:test.adoc#TestProduct-confirmClaim-bytes32-uint256-uint256- +:xref-TestProduct-declineClaim-bytes32-uint256-: xref:test.adoc#TestProduct-declineClaim-bytes32-uint256- +:xref-TestProduct-closeClaim-bytes32-uint256-: xref:test.adoc#TestProduct-closeClaim-bytes32-uint256- +:xref-TestProduct-createPayout-bytes32-uint256-uint256-: xref:test.adoc#TestProduct-createPayout-bytes32-uint256-uint256- +:xref-TestProduct-newPayout-bytes32-uint256-uint256-: xref:test.adoc#TestProduct-newPayout-bytes32-uint256-uint256- +:xref-TestProduct-processPayout-bytes32-uint256-: xref:test.adoc#TestProduct-processPayout-bytes32-uint256- +:xref-TestProduct-oracleCallback-uint256-bytes32-bytes-: xref:test.adoc#TestProduct-oracleCallback-uint256-bytes32-bytes- +:xref-TestProduct-getClaimId-bytes32-: xref:test.adoc#TestProduct-getClaimId-bytes32- +:xref-TestProduct-getPayoutId-bytes32-: xref:test.adoc#TestProduct-getPayoutId-bytes32- +:xref-TestProduct-applications--: xref:test.adoc#TestProduct-applications-- +:xref-TestProduct-policies--: xref:test.adoc#TestProduct-policies-- +:xref-TestProduct-claims--: xref:test.adoc#TestProduct-claims-- +:xref-TestProduct-LogTestProductFundingReceived-address-uint256-: xref:test.adoc#TestProduct-LogTestProductFundingReceived-address-uint256- +:xref-TestProduct-LogTestOracleCallbackReceived-uint256-bytes32-bytes-: xref:test.adoc#TestProduct-LogTestOracleCallbackReceived-uint256-bytes32-bytes- +:xref-TestRegistryCompromisedController-getContract-bytes32-: xref:test.adoc#TestRegistryCompromisedController-getContract-bytes32- +:xref-TestRegistryCompromisedController-upgradeToV2-address-address-: xref:test.adoc#TestRegistryCompromisedController-upgradeToV2-address-address- +:xref-TestRegistryControllerUpdated-setMessage-string-: xref:test.adoc#TestRegistryControllerUpdated-setMessage-string- +:xref-TestRegistryControllerUpdated-getMessage--: xref:test.adoc#TestRegistryControllerUpdated-getMessage-- +:xref-TestRegistryControllerUpdated-upgradeToV2-string-: xref:test.adoc#TestRegistryControllerUpdated-upgradeToV2-string- +:xref-RegistryController-initializeRegistry-bytes32-: xref:modules.adoc#RegistryController-initializeRegistry-bytes32- +:xref-RegistryController-ensureSender-address-bytes32-: xref:modules.adoc#RegistryController-ensureSender-address-bytes32- +:xref-RegistryController-getRelease--: xref:modules.adoc#RegistryController-getRelease-- +:xref-RegistryController-getContract-bytes32-: xref:modules.adoc#RegistryController-getContract-bytes32- +:xref-RegistryController-register-bytes32-address-: xref:modules.adoc#RegistryController-register-bytes32-address- +:xref-RegistryController-deregister-bytes32-: xref:modules.adoc#RegistryController-deregister-bytes32- +:xref-RegistryController-getContractInRelease-bytes32-bytes32-: xref:modules.adoc#RegistryController-getContractInRelease-bytes32-bytes32- +:xref-RegistryController-registerInRelease-bytes32-bytes32-address-: xref:modules.adoc#RegistryController-registerInRelease-bytes32-bytes32-address- +:xref-RegistryController-deregisterInRelease-bytes32-bytes32-: xref:modules.adoc#RegistryController-deregisterInRelease-bytes32-bytes32- +:xref-RegistryController-prepareRelease-bytes32-: xref:modules.adoc#RegistryController-prepareRelease-bytes32- +:xref-RegistryController-contracts--: xref:modules.adoc#RegistryController-contracts-- +:xref-RegistryController-contractName-uint256-: xref:modules.adoc#RegistryController-contractName-uint256- +:xref-RegistryController-_getContractInRelease-bytes32-bytes32-: xref:modules.adoc#RegistryController-_getContractInRelease-bytes32-bytes32- +:xref-RegistryController-_registerInRelease-bytes32-bool-bytes32-address-: xref:modules.adoc#RegistryController-_registerInRelease-bytes32-bool-bytes32-address- +:xref-RegistryController-_deregisterInRelease-bytes32-bytes32-: xref:modules.adoc#RegistryController-_deregisterInRelease-bytes32-bytes32- +:xref-CoreController-initialize-address-: xref:shared.adoc#CoreController-initialize-address- +:xref-CoreController-_getName--: xref:shared.adoc#CoreController-_getName-- +:xref-CoreController-_afterInitialize--: xref:shared.adoc#CoreController-_afterInitialize-- +:xref-CoreController-_getContractAddress-bytes32-: xref:shared.adoc#CoreController-_getContractAddress-bytes32- +:xref-TestRiskpool-constructor-bytes32-uint256-address-address-address-: xref:test.adoc#TestRiskpool-constructor-bytes32-uint256-address-address-address- +:xref-TestRiskpool-bundleMatchesApplication-struct-IBundle-Bundle-struct-IPolicy-Application-: xref:test.adoc#TestRiskpool-bundleMatchesApplication-struct-IBundle-Bundle-struct-IPolicy-Application- +:xref-TestTransferFrom-unifiedTransferFrom-contract-IERC20-address-address-uint256-: xref:test.adoc#TestTransferFrom-unifiedTransferFrom-contract-IERC20-address-address-uint256- +:xref-TestTransferFrom-LogTransferHelperInputValidation1Failed-bool-address-address-: xref:test.adoc#TestTransferFrom-LogTransferHelperInputValidation1Failed-bool-address-address- +:xref-TestTransferFrom-LogTransferHelperInputValidation2Failed-uint256-uint256-: xref:test.adoc#TestTransferFrom-LogTransferHelperInputValidation2Failed-uint256-uint256- +:xref-TestTransferFrom-LogTransferHelperCallFailed-bool-uint256-bytes-: xref:test.adoc#TestTransferFrom-LogTransferHelperCallFailed-bool-uint256-bytes- += Test + +[.readme-notice] +NOTE: This document is better viewed at https://docs.etherisc.com/contracts/api/test + +== Contracts + +:NAME: pass:normal[xref:#TestCoin-NAME-string[`++NAME++`]] +:SYMBOL: pass:normal[xref:#TestCoin-SYMBOL-string[`++SYMBOL++`]] +:INITIAL_SUPPLY: pass:normal[xref:#TestCoin-INITIAL_SUPPLY-uint256[`++INITIAL_SUPPLY++`]] +:constructor: pass:normal[xref:#TestCoin-constructor--[`++constructor++`]] + +[.contract] +[[TestCoin]] +=== `++TestCoin++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/test/TestCoin.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/test/TestCoin.sol"; +``` + +[.contract-index] +.Functions +-- +* {xref-TestCoin-constructor--}[`++constructor()++`] + +[.contract-subindex-inherited] +.ERC20 +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-name--[`++name()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-symbol--[`++symbol()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-decimals--[`++decimals()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-totalSupply--[`++totalSupply()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-balanceOf-address-[`++balanceOf(account)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-transfer-address-uint256-[`++transfer(to, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-allowance-address-address-[`++allowance(owner, spender)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-approve-address-uint256-[`++approve(spender, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-transferFrom-address-address-uint256-[`++transferFrom(from, to, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-increaseAllowance-address-uint256-[`++increaseAllowance(spender, addedValue)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-decreaseAllowance-address-uint256-[`++decreaseAllowance(spender, subtractedValue)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_transfer-address-address-uint256-[`++_transfer(from, to, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_mint-address-uint256-[`++_mint(account, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_burn-address-uint256-[`++_burn(account, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_approve-address-address-uint256-[`++_approve(owner, spender, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_spendAllowance-address-address-uint256-[`++_spendAllowance(owner, spender, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_beforeTokenTransfer-address-address-uint256-[`++_beforeTokenTransfer(from, to, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_afterTokenTransfer-address-address-uint256-[`++_afterTokenTransfer(from, to, amount)++`] + +[.contract-subindex-inherited] +.IERC20Metadata + +[.contract-subindex-inherited] +.IERC20 + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.ERC20 + +[.contract-subindex-inherited] +.IERC20Metadata + +[.contract-subindex-inherited] +.IERC20 +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#IERC20-Transfer-address-address-uint256-[`++Transfer(from, to, value)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#IERC20-Approval-address-address-uint256-[`++Approval(owner, spender, value)++`] + +-- + +[.contract-item] +[[TestCoin-constructor--]] +==== `[.contract-item-name]#++constructor++#++()++` [.item-kind]#public# + +Constructor function that initializes the ERC20 token with a given name, symbol, and initial supply. + +:NAME: pass:normal[xref:#TestCoinAlternativeImplementation-NAME-string[`++NAME++`]] +:SYMBOL: pass:normal[xref:#TestCoinAlternativeImplementation-SYMBOL-string[`++SYMBOL++`]] +:INITIAL_SUPPLY: pass:normal[xref:#TestCoinAlternativeImplementation-INITIAL_SUPPLY-uint256[`++INITIAL_SUPPLY++`]] +:constructor: pass:normal[xref:#TestCoinAlternativeImplementation-constructor--[`++constructor++`]] +:transferFrom: pass:normal[xref:#TestCoinAlternativeImplementation-transferFrom-address-address-uint256-[`++transferFrom++`]] + +[.contract] +[[TestCoinAlternativeImplementation]] +=== `++TestCoinAlternativeImplementation++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/test/TestCoinAlternativeImplementation.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/test/TestCoinAlternativeImplementation.sol"; +``` + +[.contract-index] +.Functions +-- +* {xref-TestCoinAlternativeImplementation-constructor--}[`++constructor()++`] +* {xref-TestCoinAlternativeImplementation-transferFrom-address-address-uint256-}[`++transferFrom(_from, _to, _value)++`] + +[.contract-subindex-inherited] +.ERC20 +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-name--[`++name()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-symbol--[`++symbol()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-decimals--[`++decimals()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-totalSupply--[`++totalSupply()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-balanceOf-address-[`++balanceOf(account)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-transfer-address-uint256-[`++transfer(to, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-allowance-address-address-[`++allowance(owner, spender)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-approve-address-uint256-[`++approve(spender, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-increaseAllowance-address-uint256-[`++increaseAllowance(spender, addedValue)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-decreaseAllowance-address-uint256-[`++decreaseAllowance(spender, subtractedValue)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_transfer-address-address-uint256-[`++_transfer(from, to, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_mint-address-uint256-[`++_mint(account, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_burn-address-uint256-[`++_burn(account, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_approve-address-address-uint256-[`++_approve(owner, spender, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_spendAllowance-address-address-uint256-[`++_spendAllowance(owner, spender, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_beforeTokenTransfer-address-address-uint256-[`++_beforeTokenTransfer(from, to, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_afterTokenTransfer-address-address-uint256-[`++_afterTokenTransfer(from, to, amount)++`] + +[.contract-subindex-inherited] +.IERC20Metadata + +[.contract-subindex-inherited] +.IERC20 + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.ERC20 + +[.contract-subindex-inherited] +.IERC20Metadata + +[.contract-subindex-inherited] +.IERC20 +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#IERC20-Transfer-address-address-uint256-[`++Transfer(from, to, value)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#IERC20-Approval-address-address-uint256-[`++Approval(owner, spender, value)++`] + +-- + +[.contract-item] +[[TestCoinAlternativeImplementation-constructor--]] +==== `[.contract-item-name]#++constructor++#++()++` [.item-kind]#public# + +Constructor function that creates a new ERC20 token with the given name and symbol, and mints the initial supply to the sender. + +[.contract-item] +[[TestCoinAlternativeImplementation-transferFrom-address-address-uint256-]] +==== `[.contract-item-name]#++transferFrom++#++(address _from, address _to, uint256 _value) → bool++` [.item-kind]#public# + +Transfer tokens from one address to another. + +:FAKE_STATE: pass:normal[xref:#TestCompromisedProduct-FAKE_STATE-enum-IComponent-ComponentState[`++FAKE_STATE++`]] +:POLICY_FLOW: pass:normal[xref:#TestCompromisedProduct-POLICY_FLOW-bytes32[`++POLICY_FLOW++`]] +:onlyPolicyHolder: pass:normal[xref:#TestCompromisedProduct-onlyPolicyHolder-bytes32-[`++onlyPolicyHolder++`]] +:constructor: pass:normal[xref:#TestCompromisedProduct-constructor-bytes32-address-uint256-uint256-address-[`++constructor++`]] +:applyForPolicy: pass:normal[xref:#TestCompromisedProduct-applyForPolicy-uint256-uint256-bytes-bytes-[`++applyForPolicy++`]] +:collectPremium: pass:normal[xref:#TestCompromisedProduct-collectPremium-bytes32-[`++collectPremium++`]] +:submitClaim: pass:normal[xref:#TestCompromisedProduct-submitClaim-bytes32-uint256-[`++submitClaim++`]] +:getToken: pass:normal[xref:#TestCompromisedProduct-getToken--[`++getToken++`]] +:getPolicyFlow: pass:normal[xref:#TestCompromisedProduct-getPolicyFlow--[`++getPolicyFlow++`]] +:getRiskpoolId: pass:normal[xref:#TestCompromisedProduct-getRiskpoolId--[`++getRiskpoolId++`]] +:getApplicationDataStructure: pass:normal[xref:#TestCompromisedProduct-getApplicationDataStructure--[`++getApplicationDataStructure++`]] +:getClaimDataStructure: pass:normal[xref:#TestCompromisedProduct-getClaimDataStructure--[`++getClaimDataStructure++`]] +:getPayoutDataStructure: pass:normal[xref:#TestCompromisedProduct-getPayoutDataStructure--[`++getPayoutDataStructure++`]] +:riskPoolCapacityCallback: pass:normal[xref:#TestCompromisedProduct-riskPoolCapacityCallback-uint256-[`++riskPoolCapacityCallback++`]] +:setId: pass:normal[xref:#TestCompromisedProduct-setId-uint256-[`++setId++`]] +:getName: pass:normal[xref:#TestCompromisedProduct-getName--[`++getName++`]] +:getId: pass:normal[xref:#TestCompromisedProduct-getId--[`++getId++`]] +:getType: pass:normal[xref:#TestCompromisedProduct-getType--[`++getType++`]] +:getState: pass:normal[xref:#TestCompromisedProduct-getState--[`++getState++`]] +:getOwner: pass:normal[xref:#TestCompromisedProduct-getOwner--[`++getOwner++`]] +:getRegistry: pass:normal[xref:#TestCompromisedProduct-getRegistry--[`++getRegistry++`]] +:isProduct: pass:normal[xref:#TestCompromisedProduct-isProduct--[`++isProduct++`]] +:isOracle: pass:normal[xref:#TestCompromisedProduct-isOracle--[`++isOracle++`]] +:isRiskpool: pass:normal[xref:#TestCompromisedProduct-isRiskpool--[`++isRiskpool++`]] +:proposalCallback: pass:normal[xref:#TestCompromisedProduct-proposalCallback--[`++proposalCallback++`]] +:approvalCallback: pass:normal[xref:#TestCompromisedProduct-approvalCallback--[`++approvalCallback++`]] +:declineCallback: pass:normal[xref:#TestCompromisedProduct-declineCallback--[`++declineCallback++`]] +:suspendCallback: pass:normal[xref:#TestCompromisedProduct-suspendCallback--[`++suspendCallback++`]] +:resumeCallback: pass:normal[xref:#TestCompromisedProduct-resumeCallback--[`++resumeCallback++`]] +:pauseCallback: pass:normal[xref:#TestCompromisedProduct-pauseCallback--[`++pauseCallback++`]] +:unpauseCallback: pass:normal[xref:#TestCompromisedProduct-unpauseCallback--[`++unpauseCallback++`]] +:archiveCallback: pass:normal[xref:#TestCompromisedProduct-archiveCallback--[`++archiveCallback++`]] + +[.contract] +[[TestCompromisedProduct]] +=== `++TestCompromisedProduct++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/test/TestCompromisedProduct.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/test/TestCompromisedProduct.sol"; +``` + +[.contract-index] +.Modifiers +-- +* {xref-TestCompromisedProduct-onlyPolicyHolder-bytes32-}[`++onlyPolicyHolder(policyId)++`] +-- + +[.contract-index] +.Functions +-- +* {xref-TestCompromisedProduct-constructor-bytes32-address-uint256-uint256-address-}[`++constructor(fakeProductName, tokenAddress, fakeComponentId, fakeRiskpoolId, registryAddress)++`] +* {xref-TestCompromisedProduct-applyForPolicy-uint256-uint256-bytes-bytes-}[`++applyForPolicy(premium, sumInsured, metaData, applicationData)++`] +* {xref-TestCompromisedProduct-collectPremium-bytes32-}[`++collectPremium(policyId)++`] +* {xref-TestCompromisedProduct-submitClaim-bytes32-uint256-}[`++submitClaim(policyId, claimAmount)++`] +* {xref-TestCompromisedProduct-getToken--}[`++getToken()++`] +* {xref-TestCompromisedProduct-getPolicyFlow--}[`++getPolicyFlow()++`] +* {xref-TestCompromisedProduct-getRiskpoolId--}[`++getRiskpoolId()++`] +* {xref-TestCompromisedProduct-getApplicationDataStructure--}[`++getApplicationDataStructure()++`] +* {xref-TestCompromisedProduct-getClaimDataStructure--}[`++getClaimDataStructure()++`] +* {xref-TestCompromisedProduct-getPayoutDataStructure--}[`++getPayoutDataStructure()++`] +* {xref-TestCompromisedProduct-riskPoolCapacityCallback-uint256-}[`++riskPoolCapacityCallback(capacity)++`] +* {xref-TestCompromisedProduct-setId-uint256-}[`++setId(id)++`] +* {xref-TestCompromisedProduct-getName--}[`++getName()++`] +* {xref-TestCompromisedProduct-getId--}[`++getId()++`] +* {xref-TestCompromisedProduct-getType--}[`++getType()++`] +* {xref-TestCompromisedProduct-getState--}[`++getState()++`] +* {xref-TestCompromisedProduct-getOwner--}[`++getOwner()++`] +* {xref-TestCompromisedProduct-getRegistry--}[`++getRegistry()++`] +* {xref-TestCompromisedProduct-isProduct--}[`++isProduct()++`] +* {xref-TestCompromisedProduct-isOracle--}[`++isOracle()++`] +* {xref-TestCompromisedProduct-isRiskpool--}[`++isRiskpool()++`] +* {xref-TestCompromisedProduct-proposalCallback--}[`++proposalCallback()++`] +* {xref-TestCompromisedProduct-approvalCallback--}[`++approvalCallback()++`] +* {xref-TestCompromisedProduct-declineCallback--}[`++declineCallback()++`] +* {xref-TestCompromisedProduct-suspendCallback--}[`++suspendCallback()++`] +* {xref-TestCompromisedProduct-resumeCallback--}[`++resumeCallback()++`] +* {xref-TestCompromisedProduct-pauseCallback--}[`++pauseCallback()++`] +* {xref-TestCompromisedProduct-unpauseCallback--}[`++unpauseCallback()++`] +* {xref-TestCompromisedProduct-archiveCallback--}[`++archiveCallback()++`] + +[.contract-subindex-inherited] +.Ownable +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-owner--[`++owner()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-_checkOwner--[`++_checkOwner()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-renounceOwnership--[`++renounceOwnership()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-transferOwnership-address-[`++transferOwnership(newOwner)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-_transferOwnership-address-[`++_transferOwnership(newOwner)++`] + +[.contract-subindex-inherited] +.IProduct + +[.contract-subindex-inherited] +.IComponent + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.Ownable +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-OwnershipTransferred-address-address-[`++OwnershipTransferred(previousOwner, newOwner)++`] + +[.contract-subindex-inherited] +.IProduct +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IProduct.sol[`++LogProductCreated(productAddress)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IProduct.sol[`++LogProductProposed(componentId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IProduct.sol[`++LogProductApproved(componentId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IProduct.sol[`++LogProductDeclined(componentId)++`] + +[.contract-subindex-inherited] +.IComponent +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IComponent.sol[`++LogComponentCreated(componentName, componentType, componentAddress, registryAddress)++`] + +-- + +[.contract-item] +[[TestCompromisedProduct-onlyPolicyHolder-bytes32-]] +==== `[.contract-item-name]#++onlyPolicyHolder++#++(bytes32 policyId)++` [.item-kind]#modifier# + +[.contract-item] +[[TestCompromisedProduct-constructor-bytes32-address-uint256-uint256-address-]] +==== `[.contract-item-name]#++constructor++#++(bytes32 fakeProductName, address tokenAddress, uint256 fakeComponentId, uint256 fakeRiskpoolId, address registryAddress)++` [.item-kind]#public# + +Constructor function to initialize the component with the given parameters. + +[.contract-item] +[[TestCompromisedProduct-applyForPolicy-uint256-uint256-bytes-bytes-]] +==== `[.contract-item-name]#++applyForPolicy++#++(uint256 premium, uint256 sumInsured, bytes metaData, bytes applicationData) → bytes32 processId++` [.item-kind]#external# + +Allows a policy holder to apply for a new policy by submitting an application with the specified premium, sum insured, metaData, and applicationData. + +[.contract-item] +[[TestCompromisedProduct-collectPremium-bytes32-]] +==== `[.contract-item-name]#++collectPremium++#++(bytes32 policyId)++` [.item-kind]#external# + +Collects the premium for a given policy. + +[.contract-item] +[[TestCompromisedProduct-submitClaim-bytes32-uint256-]] +==== `[.contract-item-name]#++submitClaim++#++(bytes32 policyId, uint256 claimAmount)++` [.item-kind]#external# + +Allows a policy holder to submit a claim for the specified policy. + +[.contract-item] +[[TestCompromisedProduct-getToken--]] +==== `[.contract-item-name]#++getToken++#++() → address token++` [.item-kind]#external# + +Returns the address of the token used by this contract. + +[.contract-item] +[[TestCompromisedProduct-getPolicyFlow--]] +==== `[.contract-item-name]#++getPolicyFlow++#++() → address policyFlow++` [.item-kind]#external# + +Returns the address of the policy flow contract. + +[.contract-item] +[[TestCompromisedProduct-getRiskpoolId--]] +==== `[.contract-item-name]#++getRiskpoolId++#++() → uint256 riskpoolId++` [.item-kind]#external# + +Returns the ID of the risk pool. + +[.contract-item] +[[TestCompromisedProduct-getApplicationDataStructure--]] +==== `[.contract-item-name]#++getApplicationDataStructure++#++() → string dataStructure++` [.item-kind]#external# + +Returns the data structure of the application. + +[.contract-item] +[[TestCompromisedProduct-getClaimDataStructure--]] +==== `[.contract-item-name]#++getClaimDataStructure++#++() → string dataStructure++` [.item-kind]#external# + +Returns the data structure of the claim data. + +[.contract-item] +[[TestCompromisedProduct-getPayoutDataStructure--]] +==== `[.contract-item-name]#++getPayoutDataStructure++#++() → string dataStructure++` [.item-kind]#external# + +Returns the data structure of the payout information. + +[.contract-item] +[[TestCompromisedProduct-riskPoolCapacityCallback-uint256-]] +==== `[.contract-item-name]#++riskPoolCapacityCallback++#++(uint256 capacity)++` [.item-kind]#external# + +Callback function to update the risk pool's capacity. + +[.contract-item] +[[TestCompromisedProduct-setId-uint256-]] +==== `[.contract-item-name]#++setId++#++(uint256 id)++` [.item-kind]#external# + +Sets the ID of the contract. + +[.contract-item] +[[TestCompromisedProduct-getName--]] +==== `[.contract-item-name]#++getName++#++() → bytes32++` [.item-kind]#external# + +Returns the name of the component. + +[.contract-item] +[[TestCompromisedProduct-getId--]] +==== `[.contract-item-name]#++getId++#++() → uint256++` [.item-kind]#external# + +Returns the ID of the component. + +[.contract-item] +[[TestCompromisedProduct-getType--]] +==== `[.contract-item-name]#++getType++#++() → enum IComponent.ComponentType++` [.item-kind]#external# + +Returns the ComponentType of the product. + +[.contract-item] +[[TestCompromisedProduct-getState--]] +==== `[.contract-item-name]#++getState++#++() → enum IComponent.ComponentState++` [.item-kind]#external# + +Returns the current state of the component. + +[.contract-item] +[[TestCompromisedProduct-getOwner--]] +==== `[.contract-item-name]#++getOwner++#++() → address++` [.item-kind]#external# + +Returns the address of the contract owner. + +[.contract-item] +[[TestCompromisedProduct-getRegistry--]] +==== `[.contract-item-name]#++getRegistry++#++() → contract IRegistry++` [.item-kind]#external# + +Returns the current registry contract instance. + +[.contract-item] +[[TestCompromisedProduct-isProduct--]] +==== `[.contract-item-name]#++isProduct++#++() → bool++` [.item-kind]#public# + +Checks if the contract is a product. + +[.contract-item] +[[TestCompromisedProduct-isOracle--]] +==== `[.contract-item-name]#++isOracle++#++() → bool++` [.item-kind]#public# + +Returns a boolean value indicating whether the contract is an oracle. + +[.contract-item] +[[TestCompromisedProduct-isRiskpool--]] +==== `[.contract-item-name]#++isRiskpool++#++() → bool++` [.item-kind]#public# + +Check if the contract is a risk pool. + +[.contract-item] +[[TestCompromisedProduct-proposalCallback--]] +==== `[.contract-item-name]#++proposalCallback++#++()++` [.item-kind]#external# + +This function is a callback function for proposals. + +Returns: None + +[.contract-item] +[[TestCompromisedProduct-approvalCallback--]] +==== `[.contract-item-name]#++approvalCallback++#++()++` [.item-kind]#external# + +This function is a callback function that is called after an approval has been made. + +[.contract-item] +[[TestCompromisedProduct-declineCallback--]] +==== `[.contract-item-name]#++declineCallback++#++()++` [.item-kind]#external# + +This function is called when a user declines a transaction in the dApp. + +[.contract-item] +[[TestCompromisedProduct-suspendCallback--]] +==== `[.contract-item-name]#++suspendCallback++#++()++` [.item-kind]#external# + +Suspends the callback function. + +[.contract-item] +[[TestCompromisedProduct-resumeCallback--]] +==== `[.contract-item-name]#++resumeCallback++#++()++` [.item-kind]#external# + +This function is a callback function that is triggered when a paused contract is resumed. + +[.contract-item] +[[TestCompromisedProduct-pauseCallback--]] +==== `[.contract-item-name]#++pauseCallback++#++()++` [.item-kind]#external# + +Callback function that is called when the contract is paused. This function does not take any parameters. + +[.contract-item] +[[TestCompromisedProduct-unpauseCallback--]] +==== `[.contract-item-name]#++unpauseCallback++#++()++` [.item-kind]#external# + +This function is called by the owner of the contract to unpause the contract after it has been paused. + +[.contract-item] +[[TestCompromisedProduct-archiveCallback--]] +==== `[.contract-item-name]#++archiveCallback++#++()++` [.item-kind]#external# + +This function is a callback function that is executed when a contract is archived. + +:constructor: pass:normal[xref:#TestOracle-constructor-bytes32-address-[`++constructor++`]] +:request: pass:normal[xref:#TestOracle-request-uint256-bytes-[`++request++`]] +:cancel: pass:normal[xref:#TestOracle-cancel-uint256-[`++cancel++`]] +:respond: pass:normal[xref:#TestOracle-respond-uint256-bool-[`++respond++`]] +:_oracleCalculation: pass:normal[xref:#TestOracle-_oracleCalculation-uint256-[`++_oracleCalculation++`]] + +[.contract] +[[TestOracle]] +=== `++TestOracle++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/test/TestOracle.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/test/TestOracle.sol"; +``` + +[.contract-index] +.Functions +-- +* {xref-TestOracle-constructor-bytes32-address-}[`++constructor(oracleName, registry)++`] +* {xref-TestOracle-request-uint256-bytes-}[`++request(requestId, input)++`] +* {xref-TestOracle-cancel-uint256-}[`++cancel(requestId)++`] +* {xref-TestOracle-respond-uint256-bool-}[`++respond(requestId, isLossEvent)++`] +* {xref-TestOracle-_oracleCalculation-uint256-}[`++_oracleCalculation(counter)++`] + +[.contract-subindex-inherited] +.Oracle +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Oracle.sol[`++_afterApprove()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Oracle.sol[`++_afterPropose()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Oracle.sol[`++_afterDecline()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Oracle.sol[`++_respond(requestId, data)++`] + +[.contract-subindex-inherited] +.Component +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++setId(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getName()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getId()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getType()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getState()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getOwner()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++isProduct()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++isOracle()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++isRiskpool()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getRegistry()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++proposalCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++approvalCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++declineCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++suspendCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++resumeCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++pauseCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++unpauseCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++archiveCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_afterSuspend()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_afterResume()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_afterPause()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_afterUnpause()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_afterArchive()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_getAccess()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_getInstanceService()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_getComponentOwnerService()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Ownable +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-owner--[`++owner()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-_checkOwner--[`++_checkOwner()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-renounceOwnership--[`++renounceOwnership()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-transferOwnership-address-[`++transferOwnership(newOwner)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-_transferOwnership-address-[`++_transferOwnership(newOwner)++`] + +[.contract-subindex-inherited] +.IComponentEvents + +[.contract-subindex-inherited] +.IOracle + +[.contract-subindex-inherited] +.IComponent + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.Oracle + +[.contract-subindex-inherited] +.Component + +[.contract-subindex-inherited] +.Ownable +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-OwnershipTransferred-address-address-[`++OwnershipTransferred(previousOwner, newOwner)++`] + +[.contract-subindex-inherited] +.IComponentEvents +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentProposed(componentName, componentType, componentAddress, id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentApproved(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentDeclined(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentSuspended(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentResumed(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentPaused(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentUnpaused(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentArchived(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentStateChanged(id, stateOld, stateNew)++`] + +[.contract-subindex-inherited] +.IOracle +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IOracle.sol[`++LogOracleCreated(oracleAddress)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IOracle.sol[`++LogOracleProposed(componentId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IOracle.sol[`++LogOracleApproved(componentId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IOracle.sol[`++LogOracleDeclined(componentId)++`] + +[.contract-subindex-inherited] +.IComponent +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IComponent.sol[`++LogComponentCreated(componentName, componentType, componentAddress, registryAddress)++`] + +-- + +[.contract-item] +[[TestOracle-constructor-bytes32-address-]] +==== `[.contract-item-name]#++constructor++#++(bytes32 oracleName, address registry)++` [.item-kind]#public# + +Constructor function for creating an Oracle contract. + +[.contract-item] +[[TestOracle-request-uint256-bytes-]] +==== `[.contract-item-name]#++request++#++(uint256 requestId, bytes input)++` [.item-kind]#external# + +Requests data from the oracle contract. + +[.contract-item] +[[TestOracle-cancel-uint256-]] +==== `[.contract-item-name]#++cancel++#++(uint256 requestId)++` [.item-kind]#external# + +Cancels a Chainlink request. + +[.contract-item] +[[TestOracle-respond-uint256-bool-]] +==== `[.contract-item-name]#++respond++#++(uint256 requestId, bool isLossEvent)++` [.item-kind]#public# + +Responds to an oracle request with a boolean value indicating whether a loss event occurred. + +[.contract-item] +[[TestOracle-_oracleCalculation-uint256-]] +==== `[.contract-item-name]#++_oracleCalculation++#++(uint256 counter) → bool isLossEvent++` [.item-kind]#internal# + +Performs an oracle calculation to determine if a loss event occurred. + +:POLICY_FLOW: pass:normal[xref:#TestProduct-POLICY_FLOW-bytes32[`++POLICY_FLOW++`]] +:ORACLE_CALLBACK_METHOD_NAME: pass:normal[xref:#TestProduct-ORACLE_CALLBACK_METHOD_NAME-string[`++ORACLE_CALLBACK_METHOD_NAME++`]] +:LogTestProductFundingReceived: pass:normal[xref:#TestProduct-LogTestProductFundingReceived-address-uint256-[`++LogTestProductFundingReceived++`]] +:LogTestOracleCallbackReceived: pass:normal[xref:#TestProduct-LogTestOracleCallbackReceived-uint256-bytes32-bytes-[`++LogTestOracleCallbackReceived++`]] +:constructor: pass:normal[xref:#TestProduct-constructor-bytes32-address-address-uint256-uint256-address-[`++constructor++`]] +:applyForPolicy: pass:normal[xref:#TestProduct-applyForPolicy-uint256-uint256-bytes-bytes-[`++applyForPolicy++`]] +:applyForPolicy: pass:normal[xref:#TestProduct-applyForPolicy-address-payable-uint256-uint256-bytes-bytes-[`++applyForPolicy++`]] +:newAppliation: pass:normal[xref:#TestProduct-newAppliation-uint256-uint256-bytes-bytes-[`++newAppliation++`]] +:revoke: pass:normal[xref:#TestProduct-revoke-bytes32-[`++revoke++`]] +:decline: pass:normal[xref:#TestProduct-decline-bytes32-[`++decline++`]] +:underwrite: pass:normal[xref:#TestProduct-underwrite-bytes32-[`++underwrite++`]] +:collectPremium: pass:normal[xref:#TestProduct-collectPremium-bytes32-[`++collectPremium++`]] +:collectPremium: pass:normal[xref:#TestProduct-collectPremium-bytes32-uint256-[`++collectPremium++`]] +:adjustPremiumSumInsured: pass:normal[xref:#TestProduct-adjustPremiumSumInsured-bytes32-uint256-uint256-[`++adjustPremiumSumInsured++`]] +:expire: pass:normal[xref:#TestProduct-expire-bytes32-[`++expire++`]] +:close: pass:normal[xref:#TestProduct-close-bytes32-[`++close++`]] +:submitClaim: pass:normal[xref:#TestProduct-submitClaim-bytes32-uint256-[`++submitClaim++`]] +:submitClaimNoOracle: pass:normal[xref:#TestProduct-submitClaimNoOracle-bytes32-uint256-[`++submitClaimNoOracle++`]] +:submitClaimWithDeferredResponse: pass:normal[xref:#TestProduct-submitClaimWithDeferredResponse-bytes32-uint256-[`++submitClaimWithDeferredResponse++`]] +:confirmClaim: pass:normal[xref:#TestProduct-confirmClaim-bytes32-uint256-uint256-[`++confirmClaim++`]] +:declineClaim: pass:normal[xref:#TestProduct-declineClaim-bytes32-uint256-[`++declineClaim++`]] +:closeClaim: pass:normal[xref:#TestProduct-closeClaim-bytes32-uint256-[`++closeClaim++`]] +:createPayout: pass:normal[xref:#TestProduct-createPayout-bytes32-uint256-uint256-[`++createPayout++`]] +:newPayout: pass:normal[xref:#TestProduct-newPayout-bytes32-uint256-uint256-[`++newPayout++`]] +:processPayout: pass:normal[xref:#TestProduct-processPayout-bytes32-uint256-[`++processPayout++`]] +:oracleCallback: pass:normal[xref:#TestProduct-oracleCallback-uint256-bytes32-bytes-[`++oracleCallback++`]] +:getClaimId: pass:normal[xref:#TestProduct-getClaimId-bytes32-[`++getClaimId++`]] +:getPayoutId: pass:normal[xref:#TestProduct-getPayoutId-bytes32-[`++getPayoutId++`]] +:applications: pass:normal[xref:#TestProduct-applications--[`++applications++`]] +:policies: pass:normal[xref:#TestProduct-policies--[`++policies++`]] +:claims: pass:normal[xref:#TestProduct-claims--[`++claims++`]] + +[.contract] +[[TestProduct]] +=== `++TestProduct++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/test/TestProduct.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/test/TestProduct.sol"; +``` + +[.contract-index] +.Functions +-- +* {xref-TestProduct-constructor-bytes32-address-address-uint256-uint256-address-}[`++constructor(productName, tokenAddress, capitalOwner, oracleId, riskpoolId, registryAddress)++`] +* {xref-TestProduct-applyForPolicy-uint256-uint256-bytes-bytes-}[`++applyForPolicy(premium, sumInsured, metaData, applicationData)++`] +* {xref-TestProduct-applyForPolicy-address-payable-uint256-uint256-bytes-bytes-}[`++applyForPolicy(policyHolder, premium, sumInsured, metaData, applicationData)++`] +* {xref-TestProduct-newAppliation-uint256-uint256-bytes-bytes-}[`++newAppliation(premium, sumInsured, metaData, applicationData)++`] +* {xref-TestProduct-revoke-bytes32-}[`++revoke(processId)++`] +* {xref-TestProduct-decline-bytes32-}[`++decline(processId)++`] +* {xref-TestProduct-underwrite-bytes32-}[`++underwrite(processId)++`] +* {xref-TestProduct-collectPremium-bytes32-}[`++collectPremium(policyId)++`] +* {xref-TestProduct-collectPremium-bytes32-uint256-}[`++collectPremium(policyId, amount)++`] +* {xref-TestProduct-adjustPremiumSumInsured-bytes32-uint256-uint256-}[`++adjustPremiumSumInsured(processId, expectedPremiumAmount, sumInsuredAmount)++`] +* {xref-TestProduct-expire-bytes32-}[`++expire(policyId)++`] +* {xref-TestProduct-close-bytes32-}[`++close(policyId)++`] +* {xref-TestProduct-submitClaim-bytes32-uint256-}[`++submitClaim(policyId, claimAmount)++`] +* {xref-TestProduct-submitClaimNoOracle-bytes32-uint256-}[`++submitClaimNoOracle(policyId, claimAmount)++`] +* {xref-TestProduct-submitClaimWithDeferredResponse-bytes32-uint256-}[`++submitClaimWithDeferredResponse(policyId, claimAmount)++`] +* {xref-TestProduct-confirmClaim-bytes32-uint256-uint256-}[`++confirmClaim(policyId, claimId, confirmedAmount)++`] +* {xref-TestProduct-declineClaim-bytes32-uint256-}[`++declineClaim(policyId, claimId)++`] +* {xref-TestProduct-closeClaim-bytes32-uint256-}[`++closeClaim(policyId, claimId)++`] +* {xref-TestProduct-createPayout-bytes32-uint256-uint256-}[`++createPayout(policyId, claimId, payoutAmount)++`] +* {xref-TestProduct-newPayout-bytes32-uint256-uint256-}[`++newPayout(policyId, claimId, payoutAmount)++`] +* {xref-TestProduct-processPayout-bytes32-uint256-}[`++processPayout(policyId, payoutId)++`] +* {xref-TestProduct-oracleCallback-uint256-bytes32-bytes-}[`++oracleCallback(requestId, policyId, responseData)++`] +* {xref-TestProduct-getClaimId-bytes32-}[`++getClaimId(policyId)++`] +* {xref-TestProduct-getPayoutId-bytes32-}[`++getPayoutId(policyId)++`] +* {xref-TestProduct-applications--}[`++applications()++`] +* {xref-TestProduct-policies--}[`++policies()++`] +* {xref-TestProduct-claims--}[`++claims()++`] + +[.contract-subindex-inherited] +.Product +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++getToken()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++getPolicyFlow()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++getRiskpoolId()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_afterApprove()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_afterPropose()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_afterDecline()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_newApplication(applicationOwner, premiumAmount, sumInsuredAmount, metaData, applicationData)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_collectPremium(processId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_collectPremium(processId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_adjustPremiumSumInsured(processId, expectedPremiumAmount, sumInsuredAmount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_revoke(processId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_underwrite(processId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_decline(processId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_expire(processId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_close(processId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_newClaim(processId, claimAmount, data)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_confirmClaim(processId, claimId, payoutAmount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_declineClaim(processId, claimId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_closeClaim(processId, claimId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_newPayout(processId, claimId, amount, data)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_processPayout(processId, payoutId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_request(processId, input, callbackMethodName, responsibleOracleId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_cancelRequest(requestId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_getMetadata(processId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_getApplication(processId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_getPolicy(processId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_getClaim(processId, claimId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++_getPayout(processId, payoutId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++getApplicationDataStructure()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++getClaimDataStructure()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++getPayoutDataStructure()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Product.sol[`++riskPoolCapacityCallback(capacity)++`] + +[.contract-subindex-inherited] +.Component +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++setId(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getName()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getId()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getType()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getState()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getOwner()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++isProduct()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++isOracle()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++isRiskpool()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getRegistry()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++proposalCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++approvalCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++declineCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++suspendCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++resumeCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++pauseCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++unpauseCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++archiveCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_afterSuspend()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_afterResume()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_afterPause()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_afterUnpause()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_afterArchive()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_getAccess()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_getInstanceService()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_getComponentOwnerService()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Ownable +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-owner--[`++owner()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-_checkOwner--[`++_checkOwner()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-renounceOwnership--[`++renounceOwnership()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-transferOwnership-address-[`++transferOwnership(newOwner)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-_transferOwnership-address-[`++_transferOwnership(newOwner)++`] + +[.contract-subindex-inherited] +.IComponentEvents + +[.contract-subindex-inherited] +.IProduct + +[.contract-subindex-inherited] +.IComponent + +-- + +[.contract-index] +.Events +-- +* {xref-TestProduct-LogTestProductFundingReceived-address-uint256-}[`++LogTestProductFundingReceived(sender, amount)++`] +* {xref-TestProduct-LogTestOracleCallbackReceived-uint256-bytes32-bytes-}[`++LogTestOracleCallbackReceived(requestId, policyId, response)++`] + +[.contract-subindex-inherited] +.Product + +[.contract-subindex-inherited] +.Component + +[.contract-subindex-inherited] +.Ownable +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-OwnershipTransferred-address-address-[`++OwnershipTransferred(previousOwner, newOwner)++`] + +[.contract-subindex-inherited] +.IComponentEvents +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentProposed(componentName, componentType, componentAddress, id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentApproved(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentDeclined(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentSuspended(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentResumed(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentPaused(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentUnpaused(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentArchived(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentStateChanged(id, stateOld, stateNew)++`] + +[.contract-subindex-inherited] +.IProduct +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IProduct.sol[`++LogProductCreated(productAddress)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IProduct.sol[`++LogProductProposed(componentId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IProduct.sol[`++LogProductApproved(componentId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IProduct.sol[`++LogProductDeclined(componentId)++`] + +[.contract-subindex-inherited] +.IComponent +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IComponent.sol[`++LogComponentCreated(componentName, componentType, componentAddress, registryAddress)++`] + +-- + +[.contract-item] +[[TestProduct-constructor-bytes32-address-address-uint256-uint256-address-]] +==== `[.contract-item-name]#++constructor++#++(bytes32 productName, address tokenAddress, address capitalOwner, uint256 oracleId, uint256 riskpoolId, address registryAddress)++` [.item-kind]#public# + +Constructor function for creating a new instance of the Product contract. + +[.contract-item] +[[TestProduct-applyForPolicy-uint256-uint256-bytes-bytes-]] +==== `[.contract-item-name]#++applyForPolicy++#++(uint256 premium, uint256 sumInsured, bytes metaData, bytes applicationData) → bytes32 processId++` [.item-kind]#external# + +Allows a policy holder to apply for a new insurance policy by submitting an application with the specified premium, sum insured, metadata and application data. + +[.contract-item] +[[TestProduct-applyForPolicy-address-payable-uint256-uint256-bytes-bytes-]] +==== `[.contract-item-name]#++applyForPolicy++#++(address payable policyHolder, uint256 premium, uint256 sumInsured, bytes metaData, bytes applicationData) → bytes32 processId++` [.item-kind]#external# + +Creates a new insurance application and underwrites it if possible. + +[.contract-item] +[[TestProduct-newAppliation-uint256-uint256-bytes-bytes-]] +==== `[.contract-item-name]#++newAppliation++#++(uint256 premium, uint256 sumInsured, bytes metaData, bytes applicationData) → bytes32 processId++` [.item-kind]#external# + +Creates a new insurance application. + +[.contract-item] +[[TestProduct-revoke-bytes32-]] +==== `[.contract-item-name]#++revoke++#++(bytes32 processId)++` [.item-kind]#external# + +Revokes a process identified by its processId. Only the policy holder can revoke a process. + +[.contract-item] +[[TestProduct-decline-bytes32-]] +==== `[.contract-item-name]#++decline++#++(bytes32 processId)++` [.item-kind]#external# + +Declines a specific process by its ID. + +[.contract-item] +[[TestProduct-underwrite-bytes32-]] +==== `[.contract-item-name]#++underwrite++#++(bytes32 processId)++` [.item-kind]#external# + +Underwrites a policy for a given process ID. + +[.contract-item] +[[TestProduct-collectPremium-bytes32-]] +==== `[.contract-item-name]#++collectPremium++#++(bytes32 policyId) → bool success, uint256 fee, uint256 netPremium++` [.item-kind]#external# + +Collects the premium for a specific policy. + +[.contract-item] +[[TestProduct-collectPremium-bytes32-uint256-]] +==== `[.contract-item-name]#++collectPremium++#++(bytes32 policyId, uint256 amount) → bool success, uint256 fee, uint256 netPremium++` [.item-kind]#external# + +Collects the premium for a specific policy. + +[.contract-item] +[[TestProduct-adjustPremiumSumInsured-bytes32-uint256-uint256-]] +==== `[.contract-item-name]#++adjustPremiumSumInsured++#++(bytes32 processId, uint256 expectedPremiumAmount, uint256 sumInsuredAmount)++` [.item-kind]#external# + +Adjusts the premium and sum insured amounts for a given process ID. + +[.contract-item] +[[TestProduct-expire-bytes32-]] +==== `[.contract-item-name]#++expire++#++(bytes32 policyId)++` [.item-kind]#external# + +Expire a policy by its ID. + +[.contract-item] +[[TestProduct-close-bytes32-]] +==== `[.contract-item-name]#++close++#++(bytes32 policyId)++` [.item-kind]#external# + +Closes a policy with the given ID. + +[.contract-item] +[[TestProduct-submitClaim-bytes32-uint256-]] +==== `[.contract-item-name]#++submitClaim++#++(bytes32 policyId, uint256 claimAmount) → uint256 claimId++` [.item-kind]#external# + +Allows a policy holder to submit a claim for a specific policy. + +[.contract-item] +[[TestProduct-submitClaimNoOracle-bytes32-uint256-]] +==== `[.contract-item-name]#++submitClaimNoOracle++#++(bytes32 policyId, uint256 claimAmount) → uint256 claimId++` [.item-kind]#external# + +Allows a policy holder to submit a claim without the need for an oracle. + +[.contract-item] +[[TestProduct-submitClaimWithDeferredResponse-bytes32-uint256-]] +==== `[.contract-item-name]#++submitClaimWithDeferredResponse++#++(bytes32 policyId, uint256 claimAmount) → uint256 claimId, uint256 requestId++` [.item-kind]#external# + +Submits a claim for a specific policy with a deferred response from the oracle. +Increases the claims counter and creates a new claim application. +Then, requests a response from the oracle via an external call with encoded query data. + +[.contract-item] +[[TestProduct-confirmClaim-bytes32-uint256-uint256-]] +==== `[.contract-item-name]#++confirmClaim++#++(bytes32 policyId, uint256 claimId, uint256 confirmedAmount)++` [.item-kind]#external# + +Confirms the amount to be paid out for a specific claim. + +[.contract-item] +[[TestProduct-declineClaim-bytes32-uint256-]] +==== `[.contract-item-name]#++declineClaim++#++(bytes32 policyId, uint256 claimId)++` [.item-kind]#external# + +Allows the owner of the contract to decline a claim. + +[.contract-item] +[[TestProduct-closeClaim-bytes32-uint256-]] +==== `[.contract-item-name]#++closeClaim++#++(bytes32 policyId, uint256 claimId)++` [.item-kind]#external# + +Closes a specific claim for a given policy. + +[.contract-item] +[[TestProduct-createPayout-bytes32-uint256-uint256-]] +==== `[.contract-item-name]#++createPayout++#++(bytes32 policyId, uint256 claimId, uint256 payoutAmount) → uint256 payoutId++` [.item-kind]#external# + +Creates a new payout for a specific policy and claim. + +[.contract-item] +[[TestProduct-newPayout-bytes32-uint256-uint256-]] +==== `[.contract-item-name]#++newPayout++#++(bytes32 policyId, uint256 claimId, uint256 payoutAmount) → uint256 payoutId++` [.item-kind]#external# + +Creates a new payout for a claim under a policy. + +[.contract-item] +[[TestProduct-processPayout-bytes32-uint256-]] +==== `[.contract-item-name]#++processPayout++#++(bytes32 policyId, uint256 payoutId)++` [.item-kind]#external# + +Processes a payout for a specific policy. + +[.contract-item] +[[TestProduct-oracleCallback-uint256-bytes32-bytes-]] +==== `[.contract-item-name]#++oracleCallback++#++(uint256 requestId, bytes32 policyId, bytes responseData)++` [.item-kind]#external# + +This function is called by the oracle to provide the response data for a specified policy ID and request ID. + +[.contract-item] +[[TestProduct-getClaimId-bytes32-]] +==== `[.contract-item-name]#++getClaimId++#++(bytes32 policyId) → uint256++` [.item-kind]#external# + +Returns the claim ID associated with a given policy ID. + +[.contract-item] +[[TestProduct-getPayoutId-bytes32-]] +==== `[.contract-item-name]#++getPayoutId++#++(bytes32 policyId) → uint256++` [.item-kind]#external# + +Returns the payout ID associated with a given policy ID. + +[.contract-item] +[[TestProduct-applications--]] +==== `[.contract-item-name]#++applications++#++() → uint256++` [.item-kind]#external# + +Returns the number of applications that have been submitted. + +[.contract-item] +[[TestProduct-policies--]] +==== `[.contract-item-name]#++policies++#++() → uint256++` [.item-kind]#external# + +Returns the number of policies in the _policies array. + +[.contract-item] +[[TestProduct-claims--]] +==== `[.contract-item-name]#++claims++#++() → uint256++` [.item-kind]#external# + +Returns the number of claims made by users. + +[.contract-item] +[[TestProduct-LogTestProductFundingReceived-address-uint256-]] +==== `[.contract-item-name]#++LogTestProductFundingReceived++#++(address sender, uint256 amount)++` [.item-kind]#event# + +[.contract-item] +[[TestProduct-LogTestOracleCallbackReceived-uint256-bytes32-bytes-]] +==== `[.contract-item-name]#++LogTestOracleCallbackReceived++#++(uint256 requestId, bytes32 policyId, bytes response)++` [.item-kind]#event# + +:POLICY: pass:normal[xref:#TestRegistryCompromisedController-POLICY-bytes32[`++POLICY++`]] +:QUERY: pass:normal[xref:#TestRegistryCompromisedController-QUERY-bytes32[`++QUERY++`]] +:contracts: pass:normal[xref:#TestRegistryCompromisedController-contracts-mapping-bytes32----address-[`++contracts++`]] +:getContract: pass:normal[xref:#TestRegistryCompromisedController-getContract-bytes32-[`++getContract++`]] +:upgradeToV2: pass:normal[xref:#TestRegistryCompromisedController-upgradeToV2-address-address-[`++upgradeToV2++`]] + +[.contract] +[[TestRegistryCompromisedController]] +=== `++TestRegistryCompromisedController++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/test/TestRegistryCompromisedController.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/test/TestRegistryCompromisedController.sol"; +``` + +[.contract-index] +.Functions +-- +* {xref-TestRegistryCompromisedController-getContract-bytes32-}[`++getContract(contractName)++`] +* {xref-TestRegistryCompromisedController-upgradeToV2-address-address-}[`++upgradeToV2(compromisedPolicyModuleAddress, originalQueryModuleAddress)++`] + +-- + +[.contract-item] +[[TestRegistryCompromisedController-getContract-bytes32-]] +==== `[.contract-item-name]#++getContract++#++(bytes32 contractName) → address moduleAddress++` [.item-kind]#external# + +Returns the address of a registered contract. + +[.contract-item] +[[TestRegistryCompromisedController-upgradeToV2-address-address-]] +==== `[.contract-item-name]#++upgradeToV2++#++(address compromisedPolicyModuleAddress, address originalQueryModuleAddress)++` [.item-kind]#public# + +Upgrades the Policy Manager contract to version 2. + +:message: pass:normal[xref:#TestRegistryControllerUpdated-message-string[`++message++`]] +:upgradeV2: pass:normal[xref:#TestRegistryControllerUpdated-upgradeV2-bool[`++upgradeV2++`]] +:setMessage: pass:normal[xref:#TestRegistryControllerUpdated-setMessage-string-[`++setMessage++`]] +:getMessage: pass:normal[xref:#TestRegistryControllerUpdated-getMessage--[`++getMessage++`]] +:upgradeToV2: pass:normal[xref:#TestRegistryControllerUpdated-upgradeToV2-string-[`++upgradeToV2++`]] + +[.contract] +[[TestRegistryControllerUpdated]] +=== `++TestRegistryControllerUpdated++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/test/TestRegistryControllerUpdated.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/test/TestRegistryControllerUpdated.sol"; +``` + +[.contract-index] +.Functions +-- +* {xref-TestRegistryControllerUpdated-setMessage-string-}[`++setMessage(_message)++`] +* {xref-TestRegistryControllerUpdated-getMessage--}[`++getMessage()++`] +* {xref-TestRegistryControllerUpdated-upgradeToV2-string-}[`++upgradeToV2(_message)++`] + +[.contract-subindex-inherited] +.RegistryController +* {xref-RegistryController-initializeRegistry-bytes32-}[`++initializeRegistry(_initialRelease)++`] +* {xref-RegistryController-ensureSender-address-bytes32-}[`++ensureSender(sender, _contractName)++`] +* {xref-RegistryController-getRelease--}[`++getRelease()++`] +* {xref-RegistryController-getContract-bytes32-}[`++getContract(_contractName)++`] +* {xref-RegistryController-register-bytes32-address-}[`++register(_contractName, _contractAddress)++`] +* {xref-RegistryController-deregister-bytes32-}[`++deregister(_contractName)++`] +* {xref-RegistryController-getContractInRelease-bytes32-bytes32-}[`++getContractInRelease(_release, _contractName)++`] +* {xref-RegistryController-registerInRelease-bytes32-bytes32-address-}[`++registerInRelease(_release, _contractName, _contractAddress)++`] +* {xref-RegistryController-deregisterInRelease-bytes32-bytes32-}[`++deregisterInRelease(_release, _contractName)++`] +* {xref-RegistryController-prepareRelease-bytes32-}[`++prepareRelease(_newRelease)++`] +* {xref-RegistryController-contracts--}[`++contracts()++`] +* {xref-RegistryController-contractName-uint256-}[`++contractName(idx)++`] +* {xref-RegistryController-_getContractInRelease-bytes32-bytes32-}[`++_getContractInRelease(_release, _contractName)++`] +* {xref-RegistryController-_registerInRelease-bytes32-bool-bytes32-address-}[`++_registerInRelease(_release, isNewRelease, _contractName, _contractAddress)++`] +* {xref-RegistryController-_deregisterInRelease-bytes32-bytes32-}[`++_deregisterInRelease(_release, _contractName)++`] + +[.contract-subindex-inherited] +.CoreController +* {xref-CoreController-initialize-address-}[`++initialize(registry)++`] +* {xref-CoreController-_getName--}[`++_getName()++`] +* {xref-CoreController-_afterInitialize--}[`++_afterInitialize()++`] +* {xref-CoreController-_getContractAddress-bytes32-}[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-_disableInitializers--[`++_disableInitializers()++`] + +[.contract-subindex-inherited] +.IRegistry + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.RegistryController + +[.contract-subindex-inherited] +.CoreController + +[.contract-subindex-inherited] +.Initializable +* https://docs.openzeppelin.com/contracts/3.x/api/proxy#Initializable-Initialized-uint8-[`++Initialized(version)++`] + +[.contract-subindex-inherited] +.IRegistry +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IRegistry.sol[`++LogContractRegistered(release, contractName, contractAddress, isNew)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IRegistry.sol[`++LogContractDeregistered(release, contractName)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IRegistry.sol[`++LogReleasePrepared(release)++`] + +-- + +[.contract-item] +[[TestRegistryControllerUpdated-setMessage-string-]] +==== `[.contract-item-name]#++setMessage++#++(string _message)++` [.item-kind]#public# + +Sets the message variable to a given string. + +[.contract-item] +[[TestRegistryControllerUpdated-getMessage--]] +==== `[.contract-item-name]#++getMessage++#++() → string++` [.item-kind]#public# + +Returns the current message stored in the contract. + +[.contract-item] +[[TestRegistryControllerUpdated-upgradeToV2-string-]] +==== `[.contract-item-name]#++upgradeToV2++#++(string _message)++` [.item-kind]#public# + +Upgrades the contract to version 2. + +:SUM_OF_SUM_INSURED_CAP: pass:normal[xref:#TestRiskpool-SUM_OF_SUM_INSURED_CAP-uint256[`++SUM_OF_SUM_INSURED_CAP++`]] +:constructor: pass:normal[xref:#TestRiskpool-constructor-bytes32-uint256-address-address-address-[`++constructor++`]] +:bundleMatchesApplication: pass:normal[xref:#TestRiskpool-bundleMatchesApplication-struct-IBundle-Bundle-struct-IPolicy-Application-[`++bundleMatchesApplication++`]] + +[.contract] +[[TestRiskpool]] +=== `++TestRiskpool++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/test/TestRiskpool.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/test/TestRiskpool.sol"; +``` + +[.contract-index] +.Functions +-- +* {xref-TestRiskpool-constructor-bytes32-uint256-address-address-address-}[`++constructor(name, collateralization, erc20Token, wallet, registry)++`] +* {xref-TestRiskpool-bundleMatchesApplication-struct-IBundle-Bundle-struct-IPolicy-Application-}[`++bundleMatchesApplication(bundle, application)++`] + +[.contract-subindex-inherited] +.BasicRiskpool +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/BasicRiskpool.sol[`++_lockCollateral(processId, collateralAmount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/BasicRiskpool.sol[`++_processPayout(processId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/BasicRiskpool.sol[`++_processPremium(processId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/BasicRiskpool.sol[`++_releaseCollateral(processId)++`] + +[.contract-subindex-inherited] +.Riskpool +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++_afterPropose()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++createBundle(filter, initialAmount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++fundBundle(bundleId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++defundBundle(bundleId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++lockBundle(bundleId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++unlockBundle(bundleId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++closeBundle(bundleId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++burnBundle(bundleId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++collateralizePolicy(processId, collateralAmount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++processPolicyPayout(processId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++processPolicyPremium(processId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++releasePolicy(processId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++setMaximumNumberOfActiveBundles(maximumNumberOfActiveBundles)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++getMaximumNumberOfActiveBundles()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++getWallet()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++getErc20Token()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++getSumOfSumInsuredCap()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++getFullCollateralizationLevel()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++getCollateralizationLevel()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++bundles()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++getBundle(idx)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++activeBundles()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++getActiveBundleId(idx)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++getFilterDataStructure()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++getCapital()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++getTotalValueLocked()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++getCapacity()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++getBalance()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Riskpool.sol[`++_afterArchive()++`] + +[.contract-subindex-inherited] +.Component +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++setId(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getName()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getId()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getType()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getState()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getOwner()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++isProduct()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++isOracle()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++isRiskpool()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++getRegistry()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++proposalCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++approvalCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++declineCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++suspendCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++resumeCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++pauseCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++unpauseCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++archiveCallback()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_afterApprove()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_afterDecline()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_afterSuspend()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_afterResume()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_afterPause()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_afterUnpause()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_getAccess()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_getInstanceService()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_getComponentOwnerService()++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/Component.sol[`++_getContractAddress(contractName)++`] + +[.contract-subindex-inherited] +.Ownable +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-owner--[`++owner()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-_checkOwner--[`++_checkOwner()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-renounceOwnership--[`++renounceOwnership()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-transferOwnership-address-[`++transferOwnership(newOwner)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-_transferOwnership-address-[`++_transferOwnership(newOwner)++`] + +[.contract-subindex-inherited] +.IComponentEvents + +[.contract-subindex-inherited] +.IRiskpool + +[.contract-subindex-inherited] +.IComponent + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.BasicRiskpool +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/BasicRiskpool.sol[`++LogBasicRiskpoolBundlesAndPolicies(activeBundles, bundleId)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/BasicRiskpool.sol[`++LogBasicRiskpoolCandidateBundleAmountCheck(index, bundleId, maxAmount, collateralAmount)++`] + +[.contract-subindex-inherited] +.Riskpool + +[.contract-subindex-inherited] +.Component + +[.contract-subindex-inherited] +.Ownable +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-OwnershipTransferred-address-address-[`++OwnershipTransferred(previousOwner, newOwner)++`] + +[.contract-subindex-inherited] +.IComponentEvents +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentProposed(componentName, componentType, componentAddress, id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentApproved(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentDeclined(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentSuspended(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentResumed(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentPaused(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentUnpaused(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentArchived(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/modules/IComponentEvents.sol[`++LogComponentStateChanged(id, stateOld, stateNew)++`] + +[.contract-subindex-inherited] +.IRiskpool +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IRiskpool.sol[`++LogRiskpoolCreated(riskpoolAddress)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IRiskpool.sol[`++LogRiskpoolProposed(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IRiskpool.sol[`++LogRiskpoolApproved(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IRiskpool.sol[`++LogRiskpoolDeclined(id)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IRiskpool.sol[`++LogRiskpoolBundleCreated(bundleId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IRiskpool.sol[`++LogRiskpoolBundleMatchesPolicy(bundleId, isMatching)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IRiskpool.sol[`++LogRiskpoolCollateralLocked(processId, collateralAmount, isSecured)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IRiskpool.sol[`++LogRiskpoolPremiumProcessed(processId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IRiskpool.sol[`++LogRiskpoolPayoutProcessed(processId, amount)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IRiskpool.sol[`++LogRiskpoolCollateralReleased(processId, collateralAmount)++`] + +[.contract-subindex-inherited] +.IComponent +* https://github.com/etherisc/gif-interface/blob/develop/contracts/components/IComponent.sol[`++LogComponentCreated(componentName, componentType, componentAddress, registryAddress)++`] + +-- + +[.contract-item] +[[TestRiskpool-constructor-bytes32-uint256-address-address-address-]] +==== `[.contract-item-name]#++constructor++#++(bytes32 name, uint256 collateralization, address erc20Token, address wallet, address registry)++` [.item-kind]#public# + +Constructor function for the Riskpool contract. + +[.contract-item] +[[TestRiskpool-bundleMatchesApplication-struct-IBundle-Bundle-struct-IPolicy-Application-]] +==== `[.contract-item-name]#++bundleMatchesApplication++#++(struct IBundle.Bundle bundle, struct IPolicy.Application application) → bool isMatching++` [.item-kind]#public# + +This function checks if a given bundle matches a given application. + +:LogTransferHelperInputValidation1Failed: pass:normal[xref:#TestTransferFrom-LogTransferHelperInputValidation1Failed-bool-address-address-[`++LogTransferHelperInputValidation1Failed++`]] +:LogTransferHelperInputValidation2Failed: pass:normal[xref:#TestTransferFrom-LogTransferHelperInputValidation2Failed-uint256-uint256-[`++LogTransferHelperInputValidation2Failed++`]] +:LogTransferHelperCallFailed: pass:normal[xref:#TestTransferFrom-LogTransferHelperCallFailed-bool-uint256-bytes-[`++LogTransferHelperCallFailed++`]] +:unifiedTransferFrom: pass:normal[xref:#TestTransferFrom-unifiedTransferFrom-contract-IERC20-address-address-uint256-[`++unifiedTransferFrom++`]] + +[.contract] +[[TestTransferFrom]] +=== `++TestTransferFrom++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/test/TestTransferFrom.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/test/TestTransferFrom.sol"; +``` + +[.contract-index] +.Functions +-- +* {xref-TestTransferFrom-unifiedTransferFrom-contract-IERC20-address-address-uint256-}[`++unifiedTransferFrom(token, from, to, amount)++`] + +-- + +[.contract-index] +.Events +-- +* {xref-TestTransferFrom-LogTransferHelperInputValidation1Failed-bool-address-address-}[`++LogTransferHelperInputValidation1Failed(tokenIsContract, from, to)++`] +* {xref-TestTransferFrom-LogTransferHelperInputValidation2Failed-uint256-uint256-}[`++LogTransferHelperInputValidation2Failed(balance, allowance)++`] +* {xref-TestTransferFrom-LogTransferHelperCallFailed-bool-uint256-bytes-}[`++LogTransferHelperCallFailed(callSuccess, returnDataLength, returnData)++`] + +-- + +[.contract-item] +[[TestTransferFrom-unifiedTransferFrom-contract-IERC20-address-address-uint256-]] +==== `[.contract-item-name]#++unifiedTransferFrom++#++(contract IERC20 token, address from, address to, uint256 amount) → bool++` [.item-kind]#external# + +Transfers tokens from a specified address to another specified address using the TransferHelper library. + +[.contract-item] +[[TestTransferFrom-LogTransferHelperInputValidation1Failed-bool-address-address-]] +==== `[.contract-item-name]#++LogTransferHelperInputValidation1Failed++#++(bool tokenIsContract, address from, address to)++` [.item-kind]#event# + +[.contract-item] +[[TestTransferFrom-LogTransferHelperInputValidation2Failed-uint256-uint256-]] +==== `[.contract-item-name]#++LogTransferHelperInputValidation2Failed++#++(uint256 balance, uint256 allowance)++` [.item-kind]#event# + +[.contract-item] +[[TestTransferFrom-LogTransferHelperCallFailed-bool-uint256-bytes-]] +==== `[.contract-item-name]#++LogTransferHelperCallFailed++#++(bool callSuccess, uint256 returnDataLength, bytes returnData)++` [.item-kind]#event# + diff --git a/docs/modules/api/pages/tokens.adoc b/docs/modules/api/pages/tokens.adoc new file mode 100644 index 00000000..f9a54584 --- /dev/null +++ b/docs/modules/api/pages/tokens.adoc @@ -0,0 +1,277 @@ +:github-icon: pass:[] +:xref-BundleToken-onlyBundleModule--: xref:tokens.adoc#BundleToken-onlyBundleModule-- +:xref-BundleToken-constructor--: xref:tokens.adoc#BundleToken-constructor-- +:xref-BundleToken-setBundleModule-address-: xref:tokens.adoc#BundleToken-setBundleModule-address- +:xref-BundleToken-mint-uint256-address-: xref:tokens.adoc#BundleToken-mint-uint256-address- +:xref-BundleToken-burn-uint256-: xref:tokens.adoc#BundleToken-burn-uint256- +:xref-BundleToken-burned-uint256-: xref:tokens.adoc#BundleToken-burned-uint256- +:xref-BundleToken-getBundleId-uint256-: xref:tokens.adoc#BundleToken-getBundleId-uint256- +:xref-BundleToken-getBundleModuleAddress--: xref:tokens.adoc#BundleToken-getBundleModuleAddress-- +:xref-BundleToken-exists-uint256-: xref:tokens.adoc#BundleToken-exists-uint256- +:xref-BundleToken-totalSupply--: xref:tokens.adoc#BundleToken-totalSupply-- +:xref-RiskpoolToken-constructor--: xref:tokens.adoc#RiskpoolToken-constructor-- += Tokens + +[.readme-notice] +NOTE: This document is better viewed at https://docs.etherisc.com/contracts/api/tokens + +== Contracts + +:NAME: pass:normal[xref:#BundleToken-NAME-string[`++NAME++`]] +:SYMBOL: pass:normal[xref:#BundleToken-SYMBOL-string[`++SYMBOL++`]] +:bundleIdForTokenId: pass:normal[xref:#BundleToken-bundleIdForTokenId-mapping-uint256----uint256-[`++bundleIdForTokenId++`]] +:onlyBundleModule: pass:normal[xref:#BundleToken-onlyBundleModule--[`++onlyBundleModule++`]] +:constructor: pass:normal[xref:#BundleToken-constructor--[`++constructor++`]] +:setBundleModule: pass:normal[xref:#BundleToken-setBundleModule-address-[`++setBundleModule++`]] +:mint: pass:normal[xref:#BundleToken-mint-uint256-address-[`++mint++`]] +:burn: pass:normal[xref:#BundleToken-burn-uint256-[`++burn++`]] +:burned: pass:normal[xref:#BundleToken-burned-uint256-[`++burned++`]] +:getBundleId: pass:normal[xref:#BundleToken-getBundleId-uint256-[`++getBundleId++`]] +:getBundleModuleAddress: pass:normal[xref:#BundleToken-getBundleModuleAddress--[`++getBundleModuleAddress++`]] +:exists: pass:normal[xref:#BundleToken-exists-uint256-[`++exists++`]] +:totalSupply: pass:normal[xref:#BundleToken-totalSupply--[`++totalSupply++`]] + +[.contract] +[[BundleToken]] +=== `++BundleToken++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/tokens/BundleToken.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/tokens/BundleToken.sol"; +``` + +[.contract-index] +.Modifiers +-- +* {xref-BundleToken-onlyBundleModule--}[`++onlyBundleModule()++`] +-- + +[.contract-index] +.Functions +-- +* {xref-BundleToken-constructor--}[`++constructor()++`] +* {xref-BundleToken-setBundleModule-address-}[`++setBundleModule(bundleModule)++`] +* {xref-BundleToken-mint-uint256-address-}[`++mint(bundleId, to)++`] +* {xref-BundleToken-burn-uint256-}[`++burn(tokenId)++`] +* {xref-BundleToken-burned-uint256-}[`++burned(tokenId)++`] +* {xref-BundleToken-getBundleId-uint256-}[`++getBundleId(tokenId)++`] +* {xref-BundleToken-getBundleModuleAddress--}[`++getBundleModuleAddress()++`] +* {xref-BundleToken-exists-uint256-}[`++exists(tokenId)++`] +* {xref-BundleToken-totalSupply--}[`++totalSupply()++`] + +[.contract-subindex-inherited] +.Ownable +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-owner--[`++owner()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-_checkOwner--[`++_checkOwner()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-renounceOwnership--[`++renounceOwnership()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-transferOwnership-address-[`++transferOwnership(newOwner)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-_transferOwnership-address-[`++_transferOwnership(newOwner)++`] + +[.contract-subindex-inherited] +.ERC721 +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-supportsInterface-bytes4-[`++supportsInterface(interfaceId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-balanceOf-address-[`++balanceOf(owner)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-ownerOf-uint256-[`++ownerOf(tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-name--[`++name()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-symbol--[`++symbol()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-tokenURI-uint256-[`++tokenURI(tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-_baseURI--[`++_baseURI()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-approve-address-uint256-[`++approve(to, tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-getApproved-uint256-[`++getApproved(tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-setApprovalForAll-address-bool-[`++setApprovalForAll(operator, approved)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-isApprovedForAll-address-address-[`++isApprovedForAll(owner, operator)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-transferFrom-address-address-uint256-[`++transferFrom(from, to, tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-safeTransferFrom-address-address-uint256-[`++safeTransferFrom(from, to, tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-safeTransferFrom-address-address-uint256-bytes-[`++safeTransferFrom(from, to, tokenId, data)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-_safeTransfer-address-address-uint256-bytes-[`++_safeTransfer(from, to, tokenId, data)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-_exists-uint256-[`++_exists(tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-_isApprovedOrOwner-address-uint256-[`++_isApprovedOrOwner(spender, tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-_safeMint-address-uint256-[`++_safeMint(to, tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-_safeMint-address-uint256-bytes-[`++_safeMint(to, tokenId, data)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-_mint-address-uint256-[`++_mint(to, tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-_burn-uint256-[`++_burn(tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-_transfer-address-address-uint256-[`++_transfer(from, to, tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-_approve-address-uint256-[`++_approve(to, tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-_setApprovalForAll-address-address-bool-[`++_setApprovalForAll(owner, operator, approved)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-_requireMinted-uint256-[`++_requireMinted(tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-_beforeTokenTransfer-address-address-uint256-[`++_beforeTokenTransfer(from, to, tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#ERC721-_afterTokenTransfer-address-address-uint256-[`++_afterTokenTransfer(from, to, tokenId)++`] + +[.contract-subindex-inherited] +.IERC721Metadata + +[.contract-subindex-inherited] +.IBundleToken + +[.contract-subindex-inherited] +.IERC721 + +[.contract-subindex-inherited] +.ERC165 + +[.contract-subindex-inherited] +.IERC165 + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.Ownable +* https://docs.openzeppelin.com/contracts/3.x/api/access#Ownable-OwnershipTransferred-address-address-[`++OwnershipTransferred(previousOwner, newOwner)++`] + +[.contract-subindex-inherited] +.ERC721 + +[.contract-subindex-inherited] +.IERC721Metadata + +[.contract-subindex-inherited] +.IBundleToken +* https://github.com/etherisc/gif-interface/blob/develop/contracts/tokens/IBundleToken.sol[`++LogBundleTokenMinted(bundleId, tokenId, tokenOwner)++`] +* https://github.com/etherisc/gif-interface/blob/develop/contracts/tokens/IBundleToken.sol[`++LogBundleTokenBurned(bundleId, tokenId)++`] + +[.contract-subindex-inherited] +.IERC721 +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#IERC721-Transfer-address-address-uint256-[`++Transfer(from, to, tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#IERC721-Approval-address-address-uint256-[`++Approval(owner, approved, tokenId)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC721#IERC721-ApprovalForAll-address-address-bool-[`++ApprovalForAll(owner, operator, approved)++`] + +[.contract-subindex-inherited] +.ERC165 + +[.contract-subindex-inherited] +.IERC165 + +-- + +[.contract-item] +[[BundleToken-onlyBundleModule--]] +==== `[.contract-item-name]#++onlyBundleModule++#++()++` [.item-kind]#modifier# + +[.contract-item] +[[BundleToken-constructor--]] +==== `[.contract-item-name]#++constructor++#++()++` [.item-kind]#public# + +Constructor function for the ERC721 token contract. It sets the name and symbol of the token and initializes the Ownable contract. + +[.contract-item] +[[BundleToken-setBundleModule-address-]] +==== `[.contract-item-name]#++setBundleModule++#++(address bundleModule)++` [.item-kind]#external# + +Sets the bundle module address. + +[.contract-item] +[[BundleToken-mint-uint256-address-]] +==== `[.contract-item-name]#++mint++#++(uint256 bundleId, address to) → uint256 tokenId++` [.item-kind]#external# + +Mints a new bundle token and assigns ownership to the specified address. + +[.contract-item] +[[BundleToken-burn-uint256-]] +==== `[.contract-item-name]#++burn++#++(uint256 tokenId)++` [.item-kind]#external# + +Burns a bundle token. + +[.contract-item] +[[BundleToken-burned-uint256-]] +==== `[.contract-item-name]#++burned++#++(uint256 tokenId) → bool isBurned++` [.item-kind]#external# + +Checks if a token has been burned. + +[.contract-item] +[[BundleToken-getBundleId-uint256-]] +==== `[.contract-item-name]#++getBundleId++#++(uint256 tokenId) → uint256++` [.item-kind]#external# + +Returns the bundle ID associated with a given token ID. + +[.contract-item] +[[BundleToken-getBundleModuleAddress--]] +==== `[.contract-item-name]#++getBundleModuleAddress++#++() → address++` [.item-kind]#external# + +Returns the address of the bundle module. + +[.contract-item] +[[BundleToken-exists-uint256-]] +==== `[.contract-item-name]#++exists++#++(uint256 tokenId) → bool++` [.item-kind]#external# + +Checks if a given token ID exists. + +[.contract-item] +[[BundleToken-totalSupply--]] +==== `[.contract-item-name]#++totalSupply++#++() → uint256 tokenCount++` [.item-kind]#external# + +Returns the total number of tokens in circulation. + +:NAME: pass:normal[xref:#RiskpoolToken-NAME-string[`++NAME++`]] +:SYMBOL: pass:normal[xref:#RiskpoolToken-SYMBOL-string[`++SYMBOL++`]] +:constructor: pass:normal[xref:#RiskpoolToken-constructor--[`++constructor++`]] + +[.contract] +[[RiskpoolToken]] +=== `++RiskpoolToken++` link:https://github.com/etherisc/gif-contracts/blob/release-v2.0.0-rc.1-0/contracts/tokens/RiskpoolToken.sol[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/contracts/tokens/RiskpoolToken.sol"; +``` + +[.contract-index] +.Functions +-- +* {xref-RiskpoolToken-constructor--}[`++constructor()++`] + +[.contract-subindex-inherited] +.ERC20 +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-name--[`++name()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-symbol--[`++symbol()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-decimals--[`++decimals()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-totalSupply--[`++totalSupply()++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-balanceOf-address-[`++balanceOf(account)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-transfer-address-uint256-[`++transfer(to, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-allowance-address-address-[`++allowance(owner, spender)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-approve-address-uint256-[`++approve(spender, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-transferFrom-address-address-uint256-[`++transferFrom(from, to, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-increaseAllowance-address-uint256-[`++increaseAllowance(spender, addedValue)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-decreaseAllowance-address-uint256-[`++decreaseAllowance(spender, subtractedValue)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_transfer-address-address-uint256-[`++_transfer(from, to, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_mint-address-uint256-[`++_mint(account, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_burn-address-uint256-[`++_burn(account, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_approve-address-address-uint256-[`++_approve(owner, spender, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_spendAllowance-address-address-uint256-[`++_spendAllowance(owner, spender, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_beforeTokenTransfer-address-address-uint256-[`++_beforeTokenTransfer(from, to, amount)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#ERC20-_afterTokenTransfer-address-address-uint256-[`++_afterTokenTransfer(from, to, amount)++`] + +[.contract-subindex-inherited] +.IERC20Metadata + +[.contract-subindex-inherited] +.IERC20 + +-- + +[.contract-index] +.Events +-- + +[.contract-subindex-inherited] +.ERC20 + +[.contract-subindex-inherited] +.IERC20Metadata + +[.contract-subindex-inherited] +.IERC20 +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#IERC20-Transfer-address-address-uint256-[`++Transfer(from, to, value)++`] +* https://docs.openzeppelin.com/contracts/3.x/api/token/ERC20#IERC20-Approval-address-address-uint256-[`++Approval(owner, spender, value)++`] + +-- + +[.contract-item] +[[RiskpoolToken-constructor--]] +==== `[.contract-item-name]#++constructor++#++()++` [.item-kind]#public# + +Constructor function that sets the name and symbol of the ERC20 token. + diff --git a/docs/templates/contract.hbs b/docs/templates/contract.hbs new file mode 100644 index 00000000..dd34a520 --- /dev/null +++ b/docs/templates/contract.hbs @@ -0,0 +1,93 @@ +{{#each items}} +:{{name}}: pass:normal[xref:#{{anchor}}[`++{{name}}++`]] +{{/each}} + +[.contract] +[[{{anchor}}]] +=== `++{{name}}++` link:https://github.com/etherisc/gif-contracts/blob/release-v{{gif-version}}/{{__item_context.file.absolutePath}}[{github-icon},role=heading-link] + +[.hljs-theme-light.nopadding] +```solidity +import "@etherisc/gif-contracts/{{__item_context.file.absolutePath}}"; +``` + +{{{natspec.dev}}} + +{{#if modifiers}} +[.contract-index] +.Modifiers +-- +{{#each modifiers}} +* {xref-{{anchor~}} }[`++{{name}}({{names params}})++`] +{{/each}} +-- +{{/if}} + +{{#if has-functions}} +[.contract-index] +.Functions +-- +{{#each inherited-functions}} +{{#unless @first}} +[.contract-subindex-inherited] +.{{contract.name}} +{{/unless}} +{{#each functions}} +{{#if isInternal}} +* {xref-{{anchor~}} }[`++{{name}}({{names params}})++`] +{{else}} +* {{externalLink~}} [`++{{name}}({{names params}})++`] +{{/if}} +{{/each}} + +{{/each}} +-- +{{/if}} + +{{#if has-events}} +[.contract-index] +.Events +-- +{{#each inheritance}} +{{#unless @first}} +[.contract-subindex-inherited] +.{{name}} +{{/unless}} +{{#each events}} +{{#if isInternal}} +* {xref-{{anchor~}} }[`++{{name}}({{names params}})++`] +{{else}} +* {{externalLink~}} [`++{{name}}({{names params}})++`] +{{/if}} +{{/each}} + +{{/each}} +-- +{{/if}} + +{{#each modifiers}} +[.contract-item] +[[{{anchor}}]] +==== `[.contract-item-name]#++{{name}}++#++({{typed-params params}})++` [.item-kind]#modifier# + +{{{natspec.dev}}} + +{{/each}} + +{{#each functions}} +[.contract-item] +[[{{anchor}}]] +==== `[.contract-item-name]#++{{name}}++#++({{typed-params params}}){{#if returns}} → {{typed-params returns}}{{/if}}++` [.item-kind]#{{visibility}}# + +{{{natspec.dev}}} + +{{/each}} + +{{#each events}} +[.contract-item] +[[{{anchor}}]] +==== `[.contract-item-name]#++{{name}}++#++({{typed-params params}})++` [.item-kind]#event# + +{{{natspec.dev}}} + +{{/each}} \ No newline at end of file diff --git a/docs/templates/helpers.js b/docs/templates/helpers.js new file mode 100644 index 00000000..dda19673 --- /dev/null +++ b/docs/templates/helpers.js @@ -0,0 +1,47 @@ +const { version } = require('../../package.json'); + +module.exports['gif-version'] = () => version; + +module.exports['readme-path'] = (opts) => { + return 'contracts/' + opts.data.root.id.replace(/\.adoc$/, '') + '/README.adoc'; +}; + +module.exports.names = (params) => params.map(p => p.name).join(', '); + +module.exports['typed-params'] = (params) => { + return params?.map(p => `${p.type}${p.indexed ? ' indexed' : ''}${p.name ? ' ' + p.name : ''}`).join(', '); +}; + +const slug = module.exports.slug = (str) => { + if (str === undefined) { + throw new Error('Missing argument'); + } + return str.replace(/\W/g, '-'); +}; + +const linksCache = new WeakMap(); + +function getAllLinks(items) { + if (linksCache.has(items)) { + return linksCache.get(items); + } + const res = {}; + linksCache.set(items, res); + for (const item of items) { + res[`xref-${item.anchor}`] = `xref:${item.__item_context.page}#${item.anchor}`; + res[slug(item.fullName)] = `pass:normal[xref:${item.__item_context.page}#${item.anchor}[\`${item.fullName}\`]]`; + } + return res; +} + +module.exports['with-prelude'] = (opts) => { + const links = getAllLinks(opts.data.site.items); + const contents = opts.fn(); + const match = contents.match(/\{[-._a-z0-9]+\}/ig) + if (!match) return contents; + const neededLinks = match + .map(m => m.replace(/^\{(.+)\}$/, '$1')) + .filter(k => k in links); + const prelude = neededLinks.map(k => `:${k}: ${links[k]}`).join('\n'); + return prelude + '\n' + contents; +}; \ No newline at end of file diff --git a/docs/templates/page.hbs b/docs/templates/page.hbs new file mode 100644 index 00000000..68e59957 --- /dev/null +++ b/docs/templates/page.hbs @@ -0,0 +1,4 @@ +:github-icon: pass:[] +{{#with-prelude}} +{{readme (readme-path)}} +{{/with-prelude}} \ No newline at end of file diff --git a/docs/templates/properties.js b/docs/templates/properties.js new file mode 100644 index 00000000..c8116afc --- /dev/null +++ b/docs/templates/properties.js @@ -0,0 +1,81 @@ +const { isNodeType } = require('solidity-ast/utils'); +const { slug } = require('./helpers'); + +module.exports.anchor = function anchor({ item, contract }) { + let res = ''; + if (contract) { + res += contract.name + '-'; + } + res += item.name; + if ('parameters' in item) { + const signature = item.parameters.parameters.map(v => v.typeName.typeDescriptions.typeString).join(','); + res += slug('(' + signature + ')'); + } + if (isNodeType('VariableDeclaration', item)) { + res += '-' + slug(item.typeName.typeDescriptions.typeString); + } + return res; +}; + +module.exports.externalLink = function ({ item, contract }) { + + const anchor = module.exports.anchor({ item, contract }); + // TODO: exchange this against links to the actual docs + const links = { + '@etherisc/gif-interface': 'https://github.com/etherisc/gif-interface/blob/develop', + '@openzeppelin': 'https://docs.openzeppelin.com/contracts/3.x/api' + }; + + const path = item.__item_context.file.absolutePath; + for (const [key, value] of Object.entries(links)) { + if (path.startsWith(key)) { + if (key === '@openzeppelin') { + const s1 = /contracts\/([^\/]+)\/.*$/; + const s2 = /contracts\/(.*)\/.*$/; + const mod1 = path.match(s1)[1]; + const mod2 = path.match(s2)[1]; + console.log(path, mod1, mod2) + return value + '/' + (mod1 === 'token' ? mod2 : mod1) + '#' + anchor; + } else { + return value + path.slice(key.length); + } + } + } + return ""; +}; + +module.exports.isInternal = function ({ item, contract }) { + return module.exports.externalLink({ item, contract }) === ""; +} + +module.exports.inheritance = function ({ item, build }) { + if (!isNodeType('ContractDefinition', item)) { + throw new Error('used inherited-items on non-contract'); + } + + return item.linearizedBaseContracts + .map(id => build.deref('ContractDefinition', id)) + .filter((c, i) => c.name !== 'Context' || i === 0); +}; + +module.exports['has-functions'] = function ({ item }) { + // console.log(item.inheritance) + return item.inheritance.some(c => c.functions.length > 0); +}; + +module.exports['has-events'] = function ({ item }) { + return item.inheritance.some(c => c.events.length > 0); +}; + +module.exports['inherited-functions'] = function ({ item }) { + const { inheritance } = item; + const baseFunctions = new Set( + inheritance.flatMap(c => c.functions.flatMap(f => f.baseFunctions ?? [])), + ); + return inheritance.map((contract, i) => ({ + contract, + functions: contract.functions.filter(f => + !baseFunctions.has(f.id) && (f.name !== 'constructor' || i === 0), + ), + })); +}; \ No newline at end of file diff --git a/hardhat.config.js b/hardhat.config.js new file mode 100644 index 00000000..4fadd05b --- /dev/null +++ b/hardhat.config.js @@ -0,0 +1,18 @@ +const fs = require('fs'); +const path = require('path'); + +require('solidity-docgen'); + +module.exports = { + solidity: { + version: '0.8.2', + settings: { + optimizer: { + enabled: true, + runs: 200, + }, + }, + }, + docgen: require('./docs/config'), +}; + diff --git a/package-lock.json b/package-lock.json index 18ea5ab4..34022171 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,22 @@ { "name": "@etherisc/gif-contracts", - "version": "2.0.0-rc.1", + "version": "2.0.0-rc.1-0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@etherisc/gif-contracts", - "version": "2.0.0-rc.1", + "version": "2.0.0-rc.1-0", "license": "Apache-2.0", "dependencies": { "@chainlink/contracts": "0.4.1", "@etherisc/gif-interface": "2.0.0-rc.1-0", "@openzeppelin/contracts": "4.7.3" + }, + "devDependencies": { + "solidity-docgen": "^0.6.0-beta.35", + "ts-node": "^10.9.1", + "typescript": "^5.1.3" } }, "node_modules/@chainlink/contracts": { @@ -19,6 +24,47 @@ "resolved": "https://registry.npmjs.org/@chainlink/contracts/-/contracts-0.4.1.tgz", "integrity": "sha512-eC8biY6Ks8k9kZKVt5305veCP3z57yyiy6Os5aR6auta6Bp34xWQ/s4qvrifcW4FNgWw1HJPwMPXDGfiehcLjg==" }, + "node_modules/@chainsafe/as-sha256": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz", + "integrity": "sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==", + "dev": true, + "peer": true + }, + "node_modules/@chainsafe/persistent-merkle-tree": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz", + "integrity": "sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ==", + "dev": true, + "peer": true, + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "node_modules/@chainsafe/ssz": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.9.4.tgz", + "integrity": "sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ==", + "dev": true, + "peer": true, + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.4.2", + "case": "^1.6.3" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@etherisc/gif-interface": { "version": "2.0.0-rc.1-0", "resolved": "https://registry.npmjs.org/@etherisc/gif-interface/-/gif-interface-2.0.0-rc.1-0.tgz", @@ -27,30 +73,8669 @@ "@openzeppelin/contracts": "4.7.3" } }, + "node_modules/@ethersproject/abi": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", + "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/abstract-provider": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", + "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0" + } + }, + "node_modules/@ethersproject/abstract-signer": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", + "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "node_modules/@ethersproject/address": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", + "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/rlp": "^5.7.0" + } + }, + "node_modules/@ethersproject/base64": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", + "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0" + } + }, + "node_modules/@ethersproject/basex": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", + "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "node_modules/@ethersproject/bignumber": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", + "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "bn.js": "^5.2.1" + } + }, + "node_modules/@ethersproject/bytes": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", + "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/constants": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", + "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bignumber": "^5.7.0" + } + }, + "node_modules/@ethersproject/contracts": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", + "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0" + } + }, + "node_modules/@ethersproject/hash": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/hdnode": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", + "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "node_modules/@ethersproject/json-wallets": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", + "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "aes-js": "3.0.0", + "scrypt-js": "3.0.1" + } + }, + "node_modules/@ethersproject/keccak256": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", + "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "js-sha3": "0.8.0" + } + }, + "node_modules/@ethersproject/logger": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", + "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true + }, + "node_modules/@ethersproject/networks": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", + "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/pbkdf2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", + "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/sha2": "^5.7.0" + } + }, + "node_modules/@ethersproject/properties": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", + "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/providers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", + "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0", + "bech32": "1.1.4", + "ws": "7.4.6" + } + }, + "node_modules/@ethersproject/providers/node_modules/ws": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/@ethersproject/random": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", + "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/rlp": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", + "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/sha2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", + "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "hash.js": "1.1.7" + } + }, + "node_modules/@ethersproject/signing-key": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", + "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "bn.js": "^5.2.1", + "elliptic": "6.5.4", + "hash.js": "1.1.7" + } + }, + "node_modules/@ethersproject/solidity": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", + "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/strings": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", + "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/transactions": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", + "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0" + } + }, + "node_modules/@ethersproject/units": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", + "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/wallet": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", + "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/json-wallets": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "node_modules/@ethersproject/web": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", + "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/wordlists": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", + "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@metamask/eth-sig-util": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz", + "integrity": "sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==", + "dev": true, + "peer": true, + "dependencies": { + "ethereumjs-abi": "^0.6.8", + "ethereumjs-util": "^6.2.1", + "ethjs-util": "^0.1.6", + "tweetnacl": "^1.0.3", + "tweetnacl-util": "^0.15.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@noble/hashes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz", + "integrity": "sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "peer": true + }, + "node_modules/@noble/secp256k1": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz", + "integrity": "sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "peer": true + }, + "node_modules/@nomicfoundation/ethereumjs-block": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.1.tgz", + "integrity": "sha512-u1Yioemi6Ckj3xspygu/SfFvm8vZEO8/Yx5a1QLzi6nVU0jz3Pg2OmHKJ5w+D9Ogk1vhwRiqEBAqcb0GVhCyHw==", + "dev": true, + "peer": true, + "dependencies": { + "@nomicfoundation/ethereumjs-common": "4.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-trie": "6.0.1", + "@nomicfoundation/ethereumjs-tx": "5.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.1", + "ethereum-cryptography": "0.1.3", + "ethers": "^5.7.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@nomicfoundation/ethereumjs-block/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/@nomicfoundation/ethereumjs-blockchain": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.1.tgz", + "integrity": "sha512-NhzndlGg829XXbqJEYrF1VeZhAwSPgsK/OB7TVrdzft3y918hW5KNd7gIZ85sn6peDZOdjBsAXIpXZ38oBYE5A==", + "dev": true, + "peer": true, + "dependencies": { + "@nomicfoundation/ethereumjs-block": "5.0.1", + "@nomicfoundation/ethereumjs-common": "4.0.1", + "@nomicfoundation/ethereumjs-ethash": "3.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-trie": "6.0.1", + "@nomicfoundation/ethereumjs-tx": "5.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.1", + "abstract-level": "^1.0.3", + "debug": "^4.3.3", + "ethereum-cryptography": "0.1.3", + "level": "^8.0.0", + "lru-cache": "^5.1.1", + "memory-level": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@nomicfoundation/ethereumjs-blockchain/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/@nomicfoundation/ethereumjs-common": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.1.tgz", + "integrity": "sha512-OBErlkfp54GpeiE06brBW/TTbtbuBJV5YI5Nz/aB2evTDo+KawyEzPjBlSr84z/8MFfj8wS2wxzQX1o32cev5g==", + "dev": true, + "peer": true, + "dependencies": { + "@nomicfoundation/ethereumjs-util": "9.0.1", + "crc-32": "^1.2.0" + } + }, + "node_modules/@nomicfoundation/ethereumjs-ethash": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.1.tgz", + "integrity": "sha512-KDjGIB5igzWOp8Ik5I6QiRH5DH+XgILlplsHR7TEuWANZA759G6krQ6o8bvj+tRUz08YygMQu/sGd9mJ1DYT8w==", + "dev": true, + "peer": true, + "dependencies": { + "@nomicfoundation/ethereumjs-block": "5.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.1", + "abstract-level": "^1.0.3", + "bigint-crypto-utils": "^3.0.23", + "ethereum-cryptography": "0.1.3" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@nomicfoundation/ethereumjs-ethash/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/@nomicfoundation/ethereumjs-evm": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.1.tgz", + "integrity": "sha512-oL8vJcnk0Bx/onl+TgQOQ1t/534GKFaEG17fZmwtPFeH8S5soiBYPCLUrvANOl4sCp9elYxIMzIiTtMtNNN8EQ==", + "dev": true, + "peer": true, + "dependencies": { + "@ethersproject/providers": "^5.7.1", + "@nomicfoundation/ethereumjs-common": "4.0.1", + "@nomicfoundation/ethereumjs-tx": "5.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.1", + "debug": "^4.3.3", + "ethereum-cryptography": "0.1.3", + "mcl-wasm": "^0.7.1", + "rustbn.js": "~0.2.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@nomicfoundation/ethereumjs-evm/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/@nomicfoundation/ethereumjs-rlp": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.1.tgz", + "integrity": "sha512-xtxrMGa8kP4zF5ApBQBtjlSbN5E2HI8m8FYgVSYAnO6ssUoY5pVPGy2H8+xdf/bmMa22Ce8nWMH3aEW8CcqMeQ==", + "dev": true, + "peer": true, + "bin": { + "rlp": "bin/rlp" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@nomicfoundation/ethereumjs-statemanager": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.1.tgz", + "integrity": "sha512-B5ApMOnlruVOR7gisBaYwFX+L/AP7i/2oAahatssjPIBVDF6wTX1K7Qpa39E/nzsH8iYuL3krkYeUFIdO3EMUQ==", + "dev": true, + "peer": true, + "dependencies": { + "@nomicfoundation/ethereumjs-common": "4.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "debug": "^4.3.3", + "ethereum-cryptography": "0.1.3", + "ethers": "^5.7.1", + "js-sdsl": "^4.1.4" + } + }, + "node_modules/@nomicfoundation/ethereumjs-statemanager/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/@nomicfoundation/ethereumjs-trie": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.1.tgz", + "integrity": "sha512-A64It/IMpDVODzCgxDgAAla8jNjNtsoQZIzZUfIV5AY6Coi4nvn7+VReBn5itlxMiL2yaTlQr9TRWp3CSI6VoA==", + "dev": true, + "peer": true, + "dependencies": { + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.1", + "@types/readable-stream": "^2.3.13", + "ethereum-cryptography": "0.1.3", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@nomicfoundation/ethereumjs-trie/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/@nomicfoundation/ethereumjs-tx": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.1.tgz", + "integrity": "sha512-0HwxUF2u2hrsIM1fsasjXvlbDOq1ZHFV2dd1yGq8CA+MEYhaxZr8OTScpVkkxqMwBcc5y83FyPl0J9MZn3kY0w==", + "dev": true, + "peer": true, + "dependencies": { + "@chainsafe/ssz": "^0.9.2", + "@ethersproject/providers": "^5.7.2", + "@nomicfoundation/ethereumjs-common": "4.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.1", + "ethereum-cryptography": "0.1.3" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@nomicfoundation/ethereumjs-tx/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/@nomicfoundation/ethereumjs-util": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.1.tgz", + "integrity": "sha512-TwbhOWQ8QoSCFhV/DDfSmyfFIHjPjFBj957219+V3jTZYZ2rf9PmDtNOeZWAE3p3vlp8xb02XGpd0v6nTUPbsA==", + "dev": true, + "peer": true, + "dependencies": { + "@chainsafe/ssz": "^0.10.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "ethereum-cryptography": "0.1.3" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@nomicfoundation/ethereumjs-util/node_modules/@chainsafe/persistent-merkle-tree": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.5.0.tgz", + "integrity": "sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw==", + "dev": true, + "peer": true, + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "node_modules/@nomicfoundation/ethereumjs-util/node_modules/@chainsafe/ssz": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.10.2.tgz", + "integrity": "sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg==", + "dev": true, + "peer": true, + "dependencies": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.5.0" + } + }, + "node_modules/@nomicfoundation/ethereumjs-util/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/@nomicfoundation/ethereumjs-vm": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.1.tgz", + "integrity": "sha512-rArhyn0jPsS/D+ApFsz3yVJMQ29+pVzNZ0VJgkzAZ+7FqXSRtThl1C1prhmlVr3YNUlfpZ69Ak+RUT4g7VoOuQ==", + "dev": true, + "peer": true, + "dependencies": { + "@nomicfoundation/ethereumjs-block": "5.0.1", + "@nomicfoundation/ethereumjs-blockchain": "7.0.1", + "@nomicfoundation/ethereumjs-common": "4.0.1", + "@nomicfoundation/ethereumjs-evm": "2.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-statemanager": "2.0.1", + "@nomicfoundation/ethereumjs-trie": "6.0.1", + "@nomicfoundation/ethereumjs-tx": "5.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.1", + "debug": "^4.3.3", + "ethereum-cryptography": "0.1.3", + "mcl-wasm": "^0.7.1", + "rustbn.js": "~0.2.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@nomicfoundation/ethereumjs-vm/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.1.tgz", + "integrity": "sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 12" + }, + "optionalDependencies": { + "@nomicfoundation/solidity-analyzer-darwin-arm64": "0.1.1", + "@nomicfoundation/solidity-analyzer-darwin-x64": "0.1.1", + "@nomicfoundation/solidity-analyzer-freebsd-x64": "0.1.1", + "@nomicfoundation/solidity-analyzer-linux-arm64-gnu": "0.1.1", + "@nomicfoundation/solidity-analyzer-linux-arm64-musl": "0.1.1", + "@nomicfoundation/solidity-analyzer-linux-x64-gnu": "0.1.1", + "@nomicfoundation/solidity-analyzer-linux-x64-musl": "0.1.1", + "@nomicfoundation/solidity-analyzer-win32-arm64-msvc": "0.1.1", + "@nomicfoundation/solidity-analyzer-win32-ia32-msvc": "0.1.1", + "@nomicfoundation/solidity-analyzer-win32-x64-msvc": "0.1.1" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-darwin-arm64": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz", + "integrity": "sha512-KcTodaQw8ivDZyF+D76FokN/HdpgGpfjc/gFCImdLUyqB6eSWVaZPazMbeAjmfhx3R0zm/NYVzxwAokFKgrc0w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-darwin-x64": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.1.tgz", + "integrity": "sha512-XhQG4BaJE6cIbjAVtzGOGbK3sn1BO9W29uhk9J8y8fZF1DYz0Doj8QDMfpMu+A6TjPDs61lbsmeYodIDnfveSA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-freebsd-x64": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-freebsd-x64/-/solidity-analyzer-freebsd-x64-0.1.1.tgz", + "integrity": "sha512-GHF1VKRdHW3G8CndkwdaeLkVBi5A9u2jwtlS7SLhBc8b5U/GcoL39Q+1CSO3hYqePNP+eV5YI7Zgm0ea6kMHoA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "peer": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-linux-arm64-gnu": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.1.tgz", + "integrity": "sha512-g4Cv2fO37ZsUENQ2vwPnZc2zRenHyAxHcyBjKcjaSmmkKrFr64yvzeNO8S3GBFCo90rfochLs99wFVGT/0owpg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-linux-arm64-musl": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.1.tgz", + "integrity": "sha512-WJ3CE5Oek25OGE3WwzK7oaopY8xMw9Lhb0mlYuJl/maZVo+WtP36XoQTb7bW/i8aAdHW5Z+BqrHMux23pvxG3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-linux-x64-gnu": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.1.tgz", + "integrity": "sha512-5WN7leSr5fkUBBjE4f3wKENUy9HQStu7HmWqbtknfXkkil+eNWiBV275IOlpXku7v3uLsXTOKpnnGHJYI2qsdA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-linux-x64-musl": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.1.tgz", + "integrity": "sha512-KdYMkJOq0SYPQMmErv/63CwGwMm5XHenEna9X9aB8mQmhDBrYrlAOSsIPgFCUSL0hjxE3xHP65/EPXR/InD2+w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-win32-arm64-msvc": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-arm64-msvc/-/solidity-analyzer-win32-arm64-msvc-0.1.1.tgz", + "integrity": "sha512-VFZASBfl4qiBYwW5xeY20exWhmv6ww9sWu/krWSesv3q5hA0o1JuzmPHR4LPN6SUZj5vcqci0O6JOL8BPw+APg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-win32-ia32-msvc": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-ia32-msvc/-/solidity-analyzer-win32-ia32-msvc-0.1.1.tgz", + "integrity": "sha512-JnFkYuyCSA70j6Si6cS1A9Gh1aHTEb8kOTBApp/c7NRTFGNMH8eaInKlyuuiIbvYFhlXW4LicqyYuWNNq9hkpQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-win32-x64-msvc": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.1.tgz", + "integrity": "sha512-HrVJr6+WjIXGnw3Q9u6KQcbZCtk0caVWhCdFADySvRyUxJ8PnzlaP+MhwNE8oyT8OZ6ejHBRrrgjSqDCFXGirw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": ">= 10" + } + }, "node_modules/@openzeppelin/contracts": { "version": "4.7.3", "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.7.3.tgz", "integrity": "sha512-dGRS0agJzu8ybo44pCIf3xBaPQN/65AIXNgK8+4gzKd5kbvlqyxryUYVLJv7fK98Seyd2hDZzVEHSWAh0Bt1Yw==" - } - }, - "dependencies": { - "@chainlink/contracts": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@chainlink/contracts/-/contracts-0.4.1.tgz", - "integrity": "sha512-eC8biY6Ks8k9kZKVt5305veCP3z57yyiy6Os5aR6auta6Bp34xWQ/s4qvrifcW4FNgWw1HJPwMPXDGfiehcLjg==" }, - "@etherisc/gif-interface": { - "version": "2.0.0-rc.1-0", - "resolved": "https://registry.npmjs.org/@etherisc/gif-interface/-/gif-interface-2.0.0-rc.1-0.tgz", - "integrity": "sha512-KECt8o+M22Ov6r3j3gLb9bjPtjvqWxdNVx2cSP+dMdXHKEol081+QsiIGbE0bluo+ICgOA9J/F/F+f2FZtGQxg==", - "requires": { - "@openzeppelin/contracts": "4.7.3" + "node_modules/@scure/base": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", + "integrity": "sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "peer": true + }, + "node_modules/@scure/bip32": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.1.5.tgz", + "integrity": "sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "peer": true, + "dependencies": { + "@noble/hashes": "~1.2.0", + "@noble/secp256k1": "~1.7.0", + "@scure/base": "~1.1.0" } }, - "@openzeppelin/contracts": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.7.3.tgz", - "integrity": "sha512-dGRS0agJzu8ybo44pCIf3xBaPQN/65AIXNgK8+4gzKd5kbvlqyxryUYVLJv7fK98Seyd2hDZzVEHSWAh0Bt1Yw==" + "node_modules/@scure/bip39": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.1.tgz", + "integrity": "sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "peer": true, + "dependencies": { + "@noble/hashes": "~1.2.0", + "@scure/base": "~1.1.0" + } + }, + "node_modules/@sentry/core": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", + "integrity": "sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==", + "dev": true, + "peer": true, + "dependencies": { + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/hub": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz", + "integrity": "sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==", + "dev": true, + "peer": true, + "dependencies": { + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/minimal": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.30.0.tgz", + "integrity": "sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw==", + "dev": true, + "peer": true, + "dependencies": { + "@sentry/hub": "5.30.0", + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/node": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-5.30.0.tgz", + "integrity": "sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg==", + "dev": true, + "peer": true, + "dependencies": { + "@sentry/core": "5.30.0", + "@sentry/hub": "5.30.0", + "@sentry/tracing": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "cookie": "^0.4.1", + "https-proxy-agent": "^5.0.0", + "lru_map": "^0.3.3", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/tracing": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz", + "integrity": "sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw==", + "dev": true, + "peer": true, + "dependencies": { + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/types": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", + "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/utils": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz", + "integrity": "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==", + "dev": true, + "peer": true, + "dependencies": { + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, + "node_modules/@types/bn.js": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.1.tgz", + "integrity": "sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g==", + "dev": true, + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==", + "dev": true, + "peer": true + }, + "node_modules/@types/node": { + "version": "20.2.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.5.tgz", + "integrity": "sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==", + "dev": true, + "peer": true + }, + "node_modules/@types/pbkdf2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", + "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/readable-stream": { + "version": "2.3.15", + "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-2.3.15.tgz", + "integrity": "sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/node": "*", + "safe-buffer": "~5.1.1" + } + }, + "node_modules/@types/secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", + "dev": true, + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dev": true, + "peer": true, + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/abstract-level": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/abstract-level/-/abstract-level-1.0.3.tgz", + "integrity": "sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==", + "dev": true, + "peer": true, + "dependencies": { + "buffer": "^6.0.3", + "catering": "^2.1.0", + "is-buffer": "^2.0.5", + "level-supports": "^4.0.0", + "level-transcoder": "^1.0.1", + "module-error": "^1.0.1", + "queue-microtask": "^1.2.3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/adm-zip": { + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", + "integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.3.0" + } + }, + "node_modules/aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==", + "dev": true, + "peer": true + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "peer": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "peer": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "peer": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "peer": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "peer": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "peer": true + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "peer": true + }, + "node_modules/base-x": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", + "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", + "dev": true, + "peer": true, + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true + }, + "node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", + "dev": true, + "peer": true + }, + "node_modules/bigint-crypto-utils": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.2.2.tgz", + "integrity": "sha512-U1RbE3aX9ayCUVcIPHuPDPKcK3SFOXf93J1UK/iHlJuQB7bhagPIX06/CLpLEsDThJ7KA4Dhrnzynl+d2weTiw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/blakejs": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", + "dev": true, + "peer": true + }, + "node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true, + "peer": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "peer": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "dev": true, + "peer": true + }, + "node_modules/browser-level": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browser-level/-/browser-level-1.0.1.tgz", + "integrity": "sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ==", + "dev": true, + "peer": true, + "dependencies": { + "abstract-level": "^1.0.2", + "catering": "^2.1.1", + "module-error": "^1.0.2", + "run-parallel-limit": "^1.1.0" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true, + "peer": true + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "peer": true, + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, + "peer": true, + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dev": true, + "peer": true, + "dependencies": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true, + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "peer": true + }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "dev": true, + "peer": true + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dev": true, + "peer": true, + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "peer": true, + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/case": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/case/-/case-1.6.3.tgz", + "integrity": "sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/catering": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/catering/-/catering-2.1.1.tgz", + "integrity": "sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "peer": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true, + "peer": true + }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "peer": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/classic-level": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.3.0.tgz", + "integrity": "sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==", + "dev": true, + "hasInstallScript": true, + "peer": true, + "dependencies": { + "abstract-level": "^1.0.2", + "catering": "^2.1.0", + "module-error": "^1.0.1", + "napi-macros": "^2.2.2", + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "peer": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "peer": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "peer": true + }, + "node_modules/command-exists": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", + "dev": true, + "peer": true + }, + "node_modules/commander": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", + "dev": true, + "peer": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "peer": true + }, + "node_modules/cookie": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "dev": true, + "peer": true, + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "peer": true, + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "peer": true, + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "peer": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, + "peer": true, + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true, + "peer": true + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "peer": true + }, + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/ethereum-cryptography": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz", + "integrity": "sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw==", + "dev": true, + "peer": true, + "dependencies": { + "@noble/hashes": "1.2.0", + "@noble/secp256k1": "1.7.1", + "@scure/bip32": "1.1.5", + "@scure/bip39": "1.1.1" + } + }, + "node_modules/ethereumjs-abi": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", + "integrity": "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==", + "dev": true, + "peer": true, + "dependencies": { + "bn.js": "^4.11.8", + "ethereumjs-util": "^6.0.0" + } + }, + "node_modules/ethereumjs-abi/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true, + "peer": true + }, + "node_modules/ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "peer": true, + "dependencies": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, + "node_modules/ethereumjs-util/node_modules/@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "dev": true, + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/ethereumjs-util/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true, + "peer": true + }, + "node_modules/ethereumjs-util/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/ethers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", + "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "peer": true, + "dependencies": { + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" + } + }, + "node_modules/ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "dev": true, + "peer": true, + "dependencies": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "peer": true, + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "peer": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", + "dev": true, + "peer": true, + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "peer": true, + "bin": { + "flat": "cli.js" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "peer": true, + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/fp-ts": { + "version": "1.19.3", + "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-1.19.3.tgz", + "integrity": "sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg==", + "dev": true, + "peer": true + }, + "node_modules/fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "peer": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "peer": true + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true, + "peer": true + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "dev": true, + "peer": true + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "peer": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dev": true, + "peer": true, + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "peer": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "peer": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "peer": true + }, + "node_modules/handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/hardhat": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.14.1.tgz", + "integrity": "sha512-H3Qp/UKyQGmPDDBSfMoSyH18rRnac90rsb0LNer+sKe6at6rxLe4D5j+M+1icqZQF02iLPjNRwc/PA8OPf757A==", + "dev": true, + "peer": true, + "dependencies": { + "@ethersproject/abi": "^5.1.2", + "@metamask/eth-sig-util": "^4.0.0", + "@nomicfoundation/ethereumjs-block": "5.0.1", + "@nomicfoundation/ethereumjs-blockchain": "7.0.1", + "@nomicfoundation/ethereumjs-common": "4.0.1", + "@nomicfoundation/ethereumjs-evm": "2.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-statemanager": "2.0.1", + "@nomicfoundation/ethereumjs-trie": "6.0.1", + "@nomicfoundation/ethereumjs-tx": "5.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.1", + "@nomicfoundation/ethereumjs-vm": "7.0.1", + "@nomicfoundation/solidity-analyzer": "^0.1.0", + "@sentry/node": "^5.18.1", + "@types/bn.js": "^5.1.0", + "@types/lru-cache": "^5.1.0", + "abort-controller": "^3.0.0", + "adm-zip": "^0.4.16", + "aggregate-error": "^3.0.0", + "ansi-escapes": "^4.3.0", + "chalk": "^2.4.2", + "chokidar": "^3.4.0", + "ci-info": "^2.0.0", + "debug": "^4.1.1", + "enquirer": "^2.3.0", + "env-paths": "^2.2.0", + "ethereum-cryptography": "^1.0.3", + "ethereumjs-abi": "^0.6.8", + "find-up": "^2.1.0", + "fp-ts": "1.19.3", + "fs-extra": "^7.0.1", + "glob": "7.2.0", + "immutable": "^4.0.0-rc.12", + "io-ts": "1.10.4", + "keccak": "^3.0.2", + "lodash": "^4.17.11", + "mnemonist": "^0.38.0", + "mocha": "^10.0.0", + "p-map": "^4.0.0", + "qs": "^6.7.0", + "raw-body": "^2.4.1", + "resolve": "1.17.0", + "semver": "^6.3.0", + "solc": "0.7.3", + "source-map-support": "^0.5.13", + "stacktrace-parser": "^0.1.10", + "tsort": "0.0.1", + "undici": "^5.14.0", + "uuid": "^8.3.2", + "ws": "^7.4.6" + }, + "bin": { + "hardhat": "internal/cli/bootstrap.js" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "ts-node": "*", + "typescript": "*" + }, + "peerDependenciesMeta": { + "ts-node": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "peer": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "peer": true, + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash-base/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "peer": true, + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "peer": true, + "bin": { + "he": "bin/he" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dev": true, + "peer": true, + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "peer": true, + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "peer": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "peer": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true + }, + "node_modules/immutable": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.0.tgz", + "integrity": "sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg==", + "dev": true, + "peer": true + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "peer": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "peer": true + }, + "node_modules/io-ts": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/io-ts/-/io-ts-1.10.4.tgz", + "integrity": "sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g==", + "dev": true, + "peer": true, + "dependencies": { + "fp-ts": "^1.0.0" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "peer": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-buffer": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "peer": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/js-sdsl": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.1.tgz", + "integrity": "sha512-6Gsx8R0RucyePbWqPssR8DyfuXmLBooYN5cZFZKjHGnQuaf7pEzhtpceagJxVu4LqhYY5EYA7nko3FmeHZ1KbA==", + "dev": true, + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, + "node_modules/js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true, + "peer": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "peer": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "peer": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/keccak": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.3.tgz", + "integrity": "sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ==", + "dev": true, + "hasInstallScript": true, + "peer": true, + "dependencies": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw==", + "dev": true, + "peer": true, + "optionalDependencies": { + "graceful-fs": "^4.1.9" + } + }, + "node_modules/level": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/level/-/level-8.0.0.tgz", + "integrity": "sha512-ypf0jjAk2BWI33yzEaaotpq7fkOPALKAgDBxggO6Q9HGX2MRXn0wbP1Jn/tJv1gtL867+YOjOB49WaUF3UoJNQ==", + "dev": true, + "peer": true, + "dependencies": { + "browser-level": "^1.0.1", + "classic-level": "^1.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/level" + } + }, + "node_modules/level-supports": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-4.0.1.tgz", + "integrity": "sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/level-transcoder": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-transcoder/-/level-transcoder-1.0.1.tgz", + "integrity": "sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==", + "dev": true, + "peer": true, + "dependencies": { + "buffer": "^6.0.3", + "module-error": "^1.0.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "dev": true, + "peer": true, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "peer": true + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "peer": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "peer": true + }, + "node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lru_map": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", + "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==", + "dev": true, + "peer": true + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "peer": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/mcl-wasm": { + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.9.tgz", + "integrity": "sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8.9.0" + } + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "peer": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/memory-level": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/memory-level/-/memory-level-1.0.0.tgz", + "integrity": "sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og==", + "dev": true, + "peer": true, + "dependencies": { + "abstract-level": "^1.0.0", + "functional-red-black-tree": "^1.0.1", + "module-error": "^1.0.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true, + "peer": true + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "dev": true, + "peer": true + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mnemonist": { + "version": "0.38.5", + "resolved": "https://registry.npmjs.org/mnemonist/-/mnemonist-0.38.5.tgz", + "integrity": "sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg==", + "dev": true, + "peer": true, + "dependencies": { + "obliterator": "^2.0.0" + } + }, + "node_modules/mocha": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", + "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.4", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", + "ms": "2.1.3", + "nanoid": "3.3.3", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "workerpool": "6.2.1", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" + } + }, + "node_modules/mocha/node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/mocha/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "peer": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "peer": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "peer": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "peer": true + }, + "node_modules/mocha/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "peer": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "peer": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/module-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/module-error/-/module-error-1.0.2.tgz", + "integrity": "sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "peer": true + }, + "node_modules/nanoid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", + "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", + "dev": true, + "peer": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/napi-macros": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.2.2.tgz", + "integrity": "sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==", + "dev": true, + "peer": true + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "dev": true, + "peer": true + }, + "node_modules/node-gyp-build": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", + "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", + "dev": true, + "peer": true, + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "dev": true, + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/obliterator": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", + "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==", + "dev": true, + "peer": true + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "peer": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "peer": true, + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "dev": true, + "peer": true, + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "peer": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "peer": true + }, + "node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, + "peer": true, + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/qs": { + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", + "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", + "dev": true, + "peer": true, + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "peer": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dev": true, + "peer": true, + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "peer": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "peer": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "peer": true, + "dependencies": { + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "peer": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "peer": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/rlp": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", + "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", + "dev": true, + "peer": true, + "dependencies": { + "bn.js": "^5.2.0" + }, + "bin": { + "rlp": "bin/rlp" + } + }, + "node_modules/run-parallel-limit": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz", + "integrity": "sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true, + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rustbn.js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", + "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==", + "dev": true, + "peer": true + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "peer": true + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "peer": true + }, + "node_modules/scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "dev": true, + "peer": true + }, + "node_modules/secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "dev": true, + "hasInstallScript": true, + "peer": true, + "dependencies": { + "elliptic": "^6.5.4", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "peer": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true, + "peer": true + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true, + "peer": true + }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "peer": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/solc": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.7.3.tgz", + "integrity": "sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA==", + "dev": true, + "peer": true, + "dependencies": { + "command-exists": "^1.2.8", + "commander": "3.0.2", + "follow-redirects": "^1.12.1", + "fs-extra": "^0.30.0", + "js-sha3": "0.8.0", + "memorystream": "^0.3.1", + "require-from-string": "^2.0.0", + "semver": "^5.5.0", + "tmp": "0.0.33" + }, + "bin": { + "solcjs": "solcjs" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/solc/node_modules/fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", + "dev": true, + "peer": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "node_modules/solc/node_modules/jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", + "dev": true, + "peer": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/solc/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "peer": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/solidity-ast": { + "version": "0.4.49", + "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.49.tgz", + "integrity": "sha512-Pr5sCAj1SFqzwFZw1HPKSq0PehlQNdM8GwKyAVYh2DOn7/cCK8LUKD1HeHnKtTgBW7hi9h4nnnan7hpAg5RhWQ==", + "dev": true + }, + "node_modules/solidity-docgen": { + "version": "0.6.0-beta.35", + "resolved": "https://registry.npmjs.org/solidity-docgen/-/solidity-docgen-0.6.0-beta.35.tgz", + "integrity": "sha512-9QdwK1THk/MWIdq1PEW/6dvtND0pUqpFTsbKwwU9YQIMYuRhH1lek9SsgnsGGYtdJ0VTrXXcVT30q20a8Y610A==", + "dev": true, + "dependencies": { + "handlebars": "^4.7.7", + "solidity-ast": "^0.4.38" + }, + "peerDependencies": { + "hardhat": "^2.8.0" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "peer": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/stacktrace-parser": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz", + "integrity": "sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==", + "dev": true, + "peer": true, + "dependencies": { + "type-fest": "^0.7.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/stacktrace-parser/node_modules/type-fest": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", + "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "peer": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "peer": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", + "dev": true, + "peer": true, + "dependencies": { + "is-hex-prefixed": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "peer": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "peer": true, + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "peer": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true, + "peer": true + }, + "node_modules/tsort": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", + "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==", + "dev": true, + "peer": true + }, + "node_modules/tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "dev": true, + "peer": true + }, + "node_modules/tweetnacl-util": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==", + "dev": true, + "peer": true + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", + "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "dev": true, + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/undici": { + "version": "5.22.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.22.1.tgz", + "integrity": "sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw==", + "dev": true, + "peer": true, + "dependencies": { + "busboy": "^1.6.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "peer": true + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "peer": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true + }, + "node_modules/workerpool": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", + "dev": true, + "peer": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "peer": true + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "peer": true + }, + "node_modules/ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "peer": true + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "peer": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "peer": true, + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + }, + "dependencies": { + "@chainlink/contracts": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@chainlink/contracts/-/contracts-0.4.1.tgz", + "integrity": "sha512-eC8biY6Ks8k9kZKVt5305veCP3z57yyiy6Os5aR6auta6Bp34xWQ/s4qvrifcW4FNgWw1HJPwMPXDGfiehcLjg==" + }, + "@chainsafe/as-sha256": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz", + "integrity": "sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==", + "dev": true, + "peer": true + }, + "@chainsafe/persistent-merkle-tree": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz", + "integrity": "sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ==", + "dev": true, + "peer": true, + "requires": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "@chainsafe/ssz": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.9.4.tgz", + "integrity": "sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ==", + "dev": true, + "peer": true, + "requires": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.4.2", + "case": "^1.6.3" + } + }, + "@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "0.3.9" + } + }, + "@etherisc/gif-interface": { + "version": "2.0.0-rc.1-0", + "resolved": "https://registry.npmjs.org/@etherisc/gif-interface/-/gif-interface-2.0.0-rc.1-0.tgz", + "integrity": "sha512-KECt8o+M22Ov6r3j3gLb9bjPtjvqWxdNVx2cSP+dMdXHKEol081+QsiIGbE0bluo+ICgOA9J/F/F+f2FZtGQxg==", + "requires": { + "@openzeppelin/contracts": "4.7.3" + } + }, + "@ethersproject/abi": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", + "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "@ethersproject/abstract-provider": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", + "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0" + } + }, + "@ethersproject/abstract-signer": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", + "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "@ethersproject/address": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", + "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/rlp": "^5.7.0" + } + }, + "@ethersproject/base64": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", + "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/bytes": "^5.7.0" + } + }, + "@ethersproject/basex": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", + "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "@ethersproject/bignumber": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", + "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "bn.js": "^5.2.1" + } + }, + "@ethersproject/bytes": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", + "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/constants": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", + "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/bignumber": "^5.7.0" + } + }, + "@ethersproject/contracts": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", + "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0" + } + }, + "@ethersproject/hash": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "@ethersproject/hdnode": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", + "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "@ethersproject/json-wallets": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", + "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "aes-js": "3.0.0", + "scrypt-js": "3.0.1" + } + }, + "@ethersproject/keccak256": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", + "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/bytes": "^5.7.0", + "js-sha3": "0.8.0" + } + }, + "@ethersproject/logger": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", + "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", + "dev": true, + "peer": true + }, + "@ethersproject/networks": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", + "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/pbkdf2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", + "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/sha2": "^5.7.0" + } + }, + "@ethersproject/properties": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", + "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/providers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", + "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0", + "bech32": "1.1.4", + "ws": "7.4.6" + }, + "dependencies": { + "ws": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "dev": true, + "peer": true, + "requires": {} + } + } + }, + "@ethersproject/random": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", + "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/rlp": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", + "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/sha2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", + "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "hash.js": "1.1.7" + } + }, + "@ethersproject/signing-key": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", + "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "bn.js": "^5.2.1", + "elliptic": "6.5.4", + "hash.js": "1.1.7" + } + }, + "@ethersproject/solidity": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", + "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "@ethersproject/strings": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", + "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/transactions": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", + "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0" + } + }, + "@ethersproject/units": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", + "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/wallet": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", + "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/json-wallets": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "@ethersproject/web": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", + "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "@ethersproject/wordlists": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", + "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "@metamask/eth-sig-util": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz", + "integrity": "sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==", + "dev": true, + "peer": true, + "requires": { + "ethereumjs-abi": "^0.6.8", + "ethereumjs-util": "^6.2.1", + "ethjs-util": "^0.1.6", + "tweetnacl": "^1.0.3", + "tweetnacl-util": "^0.15.1" + } + }, + "@noble/hashes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz", + "integrity": "sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==", + "dev": true, + "peer": true + }, + "@noble/secp256k1": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz", + "integrity": "sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==", + "dev": true, + "peer": true + }, + "@nomicfoundation/ethereumjs-block": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.1.tgz", + "integrity": "sha512-u1Yioemi6Ckj3xspygu/SfFvm8vZEO8/Yx5a1QLzi6nVU0jz3Pg2OmHKJ5w+D9Ogk1vhwRiqEBAqcb0GVhCyHw==", + "dev": true, + "peer": true, + "requires": { + "@nomicfoundation/ethereumjs-common": "4.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-trie": "6.0.1", + "@nomicfoundation/ethereumjs-tx": "5.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.1", + "ethereum-cryptography": "0.1.3", + "ethers": "^5.7.1" + }, + "dependencies": { + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + } + } + }, + "@nomicfoundation/ethereumjs-blockchain": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.1.tgz", + "integrity": "sha512-NhzndlGg829XXbqJEYrF1VeZhAwSPgsK/OB7TVrdzft3y918hW5KNd7gIZ85sn6peDZOdjBsAXIpXZ38oBYE5A==", + "dev": true, + "peer": true, + "requires": { + "@nomicfoundation/ethereumjs-block": "5.0.1", + "@nomicfoundation/ethereumjs-common": "4.0.1", + "@nomicfoundation/ethereumjs-ethash": "3.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-trie": "6.0.1", + "@nomicfoundation/ethereumjs-tx": "5.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.1", + "abstract-level": "^1.0.3", + "debug": "^4.3.3", + "ethereum-cryptography": "0.1.3", + "level": "^8.0.0", + "lru-cache": "^5.1.1", + "memory-level": "^1.0.0" + }, + "dependencies": { + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + } + } + }, + "@nomicfoundation/ethereumjs-common": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.1.tgz", + "integrity": "sha512-OBErlkfp54GpeiE06brBW/TTbtbuBJV5YI5Nz/aB2evTDo+KawyEzPjBlSr84z/8MFfj8wS2wxzQX1o32cev5g==", + "dev": true, + "peer": true, + "requires": { + "@nomicfoundation/ethereumjs-util": "9.0.1", + "crc-32": "^1.2.0" + } + }, + "@nomicfoundation/ethereumjs-ethash": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.1.tgz", + "integrity": "sha512-KDjGIB5igzWOp8Ik5I6QiRH5DH+XgILlplsHR7TEuWANZA759G6krQ6o8bvj+tRUz08YygMQu/sGd9mJ1DYT8w==", + "dev": true, + "peer": true, + "requires": { + "@nomicfoundation/ethereumjs-block": "5.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.1", + "abstract-level": "^1.0.3", + "bigint-crypto-utils": "^3.0.23", + "ethereum-cryptography": "0.1.3" + }, + "dependencies": { + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + } + } + }, + "@nomicfoundation/ethereumjs-evm": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.1.tgz", + "integrity": "sha512-oL8vJcnk0Bx/onl+TgQOQ1t/534GKFaEG17fZmwtPFeH8S5soiBYPCLUrvANOl4sCp9elYxIMzIiTtMtNNN8EQ==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/providers": "^5.7.1", + "@nomicfoundation/ethereumjs-common": "4.0.1", + "@nomicfoundation/ethereumjs-tx": "5.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.1", + "debug": "^4.3.3", + "ethereum-cryptography": "0.1.3", + "mcl-wasm": "^0.7.1", + "rustbn.js": "~0.2.0" + }, + "dependencies": { + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + } + } + }, + "@nomicfoundation/ethereumjs-rlp": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.1.tgz", + "integrity": "sha512-xtxrMGa8kP4zF5ApBQBtjlSbN5E2HI8m8FYgVSYAnO6ssUoY5pVPGy2H8+xdf/bmMa22Ce8nWMH3aEW8CcqMeQ==", + "dev": true, + "peer": true + }, + "@nomicfoundation/ethereumjs-statemanager": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.1.tgz", + "integrity": "sha512-B5ApMOnlruVOR7gisBaYwFX+L/AP7i/2oAahatssjPIBVDF6wTX1K7Qpa39E/nzsH8iYuL3krkYeUFIdO3EMUQ==", + "dev": true, + "peer": true, + "requires": { + "@nomicfoundation/ethereumjs-common": "4.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "debug": "^4.3.3", + "ethereum-cryptography": "0.1.3", + "ethers": "^5.7.1", + "js-sdsl": "^4.1.4" + }, + "dependencies": { + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + } + } + }, + "@nomicfoundation/ethereumjs-trie": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.1.tgz", + "integrity": "sha512-A64It/IMpDVODzCgxDgAAla8jNjNtsoQZIzZUfIV5AY6Coi4nvn7+VReBn5itlxMiL2yaTlQr9TRWp3CSI6VoA==", + "dev": true, + "peer": true, + "requires": { + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.1", + "@types/readable-stream": "^2.3.13", + "ethereum-cryptography": "0.1.3", + "readable-stream": "^3.6.0" + }, + "dependencies": { + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + } + } + }, + "@nomicfoundation/ethereumjs-tx": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.1.tgz", + "integrity": "sha512-0HwxUF2u2hrsIM1fsasjXvlbDOq1ZHFV2dd1yGq8CA+MEYhaxZr8OTScpVkkxqMwBcc5y83FyPl0J9MZn3kY0w==", + "dev": true, + "peer": true, + "requires": { + "@chainsafe/ssz": "^0.9.2", + "@ethersproject/providers": "^5.7.2", + "@nomicfoundation/ethereumjs-common": "4.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.1", + "ethereum-cryptography": "0.1.3" + }, + "dependencies": { + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + } + } + }, + "@nomicfoundation/ethereumjs-util": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.1.tgz", + "integrity": "sha512-TwbhOWQ8QoSCFhV/DDfSmyfFIHjPjFBj957219+V3jTZYZ2rf9PmDtNOeZWAE3p3vlp8xb02XGpd0v6nTUPbsA==", + "dev": true, + "peer": true, + "requires": { + "@chainsafe/ssz": "^0.10.0", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "ethereum-cryptography": "0.1.3" + }, + "dependencies": { + "@chainsafe/persistent-merkle-tree": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.5.0.tgz", + "integrity": "sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw==", + "dev": true, + "peer": true, + "requires": { + "@chainsafe/as-sha256": "^0.3.1" + } + }, + "@chainsafe/ssz": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@chainsafe/ssz/-/ssz-0.10.2.tgz", + "integrity": "sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg==", + "dev": true, + "peer": true, + "requires": { + "@chainsafe/as-sha256": "^0.3.1", + "@chainsafe/persistent-merkle-tree": "^0.5.0" + } + }, + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + } + } + }, + "@nomicfoundation/ethereumjs-vm": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.1.tgz", + "integrity": "sha512-rArhyn0jPsS/D+ApFsz3yVJMQ29+pVzNZ0VJgkzAZ+7FqXSRtThl1C1prhmlVr3YNUlfpZ69Ak+RUT4g7VoOuQ==", + "dev": true, + "peer": true, + "requires": { + "@nomicfoundation/ethereumjs-block": "5.0.1", + "@nomicfoundation/ethereumjs-blockchain": "7.0.1", + "@nomicfoundation/ethereumjs-common": "4.0.1", + "@nomicfoundation/ethereumjs-evm": "2.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-statemanager": "2.0.1", + "@nomicfoundation/ethereumjs-trie": "6.0.1", + "@nomicfoundation/ethereumjs-tx": "5.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.1", + "debug": "^4.3.3", + "ethereum-cryptography": "0.1.3", + "mcl-wasm": "^0.7.1", + "rustbn.js": "~0.2.0" + }, + "dependencies": { + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + } + } + }, + "@nomicfoundation/solidity-analyzer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.1.tgz", + "integrity": "sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg==", + "dev": true, + "peer": true, + "requires": { + "@nomicfoundation/solidity-analyzer-darwin-arm64": "0.1.1", + "@nomicfoundation/solidity-analyzer-darwin-x64": "0.1.1", + "@nomicfoundation/solidity-analyzer-freebsd-x64": "0.1.1", + "@nomicfoundation/solidity-analyzer-linux-arm64-gnu": "0.1.1", + "@nomicfoundation/solidity-analyzer-linux-arm64-musl": "0.1.1", + "@nomicfoundation/solidity-analyzer-linux-x64-gnu": "0.1.1", + "@nomicfoundation/solidity-analyzer-linux-x64-musl": "0.1.1", + "@nomicfoundation/solidity-analyzer-win32-arm64-msvc": "0.1.1", + "@nomicfoundation/solidity-analyzer-win32-ia32-msvc": "0.1.1", + "@nomicfoundation/solidity-analyzer-win32-x64-msvc": "0.1.1" + } + }, + "@nomicfoundation/solidity-analyzer-darwin-arm64": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz", + "integrity": "sha512-KcTodaQw8ivDZyF+D76FokN/HdpgGpfjc/gFCImdLUyqB6eSWVaZPazMbeAjmfhx3R0zm/NYVzxwAokFKgrc0w==", + "dev": true, + "optional": true, + "peer": true + }, + "@nomicfoundation/solidity-analyzer-darwin-x64": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.1.tgz", + "integrity": "sha512-XhQG4BaJE6cIbjAVtzGOGbK3sn1BO9W29uhk9J8y8fZF1DYz0Doj8QDMfpMu+A6TjPDs61lbsmeYodIDnfveSA==", + "dev": true, + "optional": true, + "peer": true + }, + "@nomicfoundation/solidity-analyzer-freebsd-x64": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-freebsd-x64/-/solidity-analyzer-freebsd-x64-0.1.1.tgz", + "integrity": "sha512-GHF1VKRdHW3G8CndkwdaeLkVBi5A9u2jwtlS7SLhBc8b5U/GcoL39Q+1CSO3hYqePNP+eV5YI7Zgm0ea6kMHoA==", + "dev": true, + "optional": true, + "peer": true + }, + "@nomicfoundation/solidity-analyzer-linux-arm64-gnu": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.1.tgz", + "integrity": "sha512-g4Cv2fO37ZsUENQ2vwPnZc2zRenHyAxHcyBjKcjaSmmkKrFr64yvzeNO8S3GBFCo90rfochLs99wFVGT/0owpg==", + "dev": true, + "optional": true, + "peer": true + }, + "@nomicfoundation/solidity-analyzer-linux-arm64-musl": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.1.tgz", + "integrity": "sha512-WJ3CE5Oek25OGE3WwzK7oaopY8xMw9Lhb0mlYuJl/maZVo+WtP36XoQTb7bW/i8aAdHW5Z+BqrHMux23pvxG3w==", + "dev": true, + "optional": true, + "peer": true + }, + "@nomicfoundation/solidity-analyzer-linux-x64-gnu": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.1.tgz", + "integrity": "sha512-5WN7leSr5fkUBBjE4f3wKENUy9HQStu7HmWqbtknfXkkil+eNWiBV275IOlpXku7v3uLsXTOKpnnGHJYI2qsdA==", + "dev": true, + "optional": true, + "peer": true + }, + "@nomicfoundation/solidity-analyzer-linux-x64-musl": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.1.tgz", + "integrity": "sha512-KdYMkJOq0SYPQMmErv/63CwGwMm5XHenEna9X9aB8mQmhDBrYrlAOSsIPgFCUSL0hjxE3xHP65/EPXR/InD2+w==", + "dev": true, + "optional": true, + "peer": true + }, + "@nomicfoundation/solidity-analyzer-win32-arm64-msvc": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-arm64-msvc/-/solidity-analyzer-win32-arm64-msvc-0.1.1.tgz", + "integrity": "sha512-VFZASBfl4qiBYwW5xeY20exWhmv6ww9sWu/krWSesv3q5hA0o1JuzmPHR4LPN6SUZj5vcqci0O6JOL8BPw+APg==", + "dev": true, + "optional": true, + "peer": true + }, + "@nomicfoundation/solidity-analyzer-win32-ia32-msvc": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-ia32-msvc/-/solidity-analyzer-win32-ia32-msvc-0.1.1.tgz", + "integrity": "sha512-JnFkYuyCSA70j6Si6cS1A9Gh1aHTEb8kOTBApp/c7NRTFGNMH8eaInKlyuuiIbvYFhlXW4LicqyYuWNNq9hkpQ==", + "dev": true, + "optional": true, + "peer": true + }, + "@nomicfoundation/solidity-analyzer-win32-x64-msvc": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.1.tgz", + "integrity": "sha512-HrVJr6+WjIXGnw3Q9u6KQcbZCtk0caVWhCdFADySvRyUxJ8PnzlaP+MhwNE8oyT8OZ6ejHBRrrgjSqDCFXGirw==", + "dev": true, + "optional": true, + "peer": true + }, + "@openzeppelin/contracts": { + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.7.3.tgz", + "integrity": "sha512-dGRS0agJzu8ybo44pCIf3xBaPQN/65AIXNgK8+4gzKd5kbvlqyxryUYVLJv7fK98Seyd2hDZzVEHSWAh0Bt1Yw==" + }, + "@scure/base": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", + "integrity": "sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==", + "dev": true, + "peer": true + }, + "@scure/bip32": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.1.5.tgz", + "integrity": "sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==", + "dev": true, + "peer": true, + "requires": { + "@noble/hashes": "~1.2.0", + "@noble/secp256k1": "~1.7.0", + "@scure/base": "~1.1.0" + } + }, + "@scure/bip39": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.1.tgz", + "integrity": "sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==", + "dev": true, + "peer": true, + "requires": { + "@noble/hashes": "~1.2.0", + "@scure/base": "~1.1.0" + } + }, + "@sentry/core": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", + "integrity": "sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==", + "dev": true, + "peer": true, + "requires": { + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + } + }, + "@sentry/hub": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz", + "integrity": "sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==", + "dev": true, + "peer": true, + "requires": { + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + } + }, + "@sentry/minimal": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.30.0.tgz", + "integrity": "sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw==", + "dev": true, + "peer": true, + "requires": { + "@sentry/hub": "5.30.0", + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + } + }, + "@sentry/node": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-5.30.0.tgz", + "integrity": "sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg==", + "dev": true, + "peer": true, + "requires": { + "@sentry/core": "5.30.0", + "@sentry/hub": "5.30.0", + "@sentry/tracing": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "cookie": "^0.4.1", + "https-proxy-agent": "^5.0.0", + "lru_map": "^0.3.3", + "tslib": "^1.9.3" + } + }, + "@sentry/tracing": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz", + "integrity": "sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw==", + "dev": true, + "peer": true, + "requires": { + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + } + }, + "@sentry/types": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", + "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==", + "dev": true, + "peer": true + }, + "@sentry/utils": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz", + "integrity": "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==", + "dev": true, + "peer": true, + "requires": { + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + } + }, + "@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, + "@types/bn.js": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.1.tgz", + "integrity": "sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g==", + "dev": true, + "peer": true, + "requires": { + "@types/node": "*" + } + }, + "@types/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==", + "dev": true, + "peer": true + }, + "@types/node": { + "version": "20.2.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.5.tgz", + "integrity": "sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==", + "dev": true, + "peer": true + }, + "@types/pbkdf2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", + "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "dev": true, + "peer": true, + "requires": { + "@types/node": "*" + } + }, + "@types/readable-stream": { + "version": "2.3.15", + "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-2.3.15.tgz", + "integrity": "sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==", + "dev": true, + "peer": true, + "requires": { + "@types/node": "*", + "safe-buffer": "~5.1.1" + } + }, + "@types/secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", + "dev": true, + "peer": true, + "requires": { + "@types/node": "*" + } + }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dev": true, + "peer": true, + "requires": { + "event-target-shim": "^5.0.0" + } + }, + "abstract-level": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/abstract-level/-/abstract-level-1.0.3.tgz", + "integrity": "sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==", + "dev": true, + "peer": true, + "requires": { + "buffer": "^6.0.3", + "catering": "^2.1.0", + "is-buffer": "^2.0.5", + "level-supports": "^4.0.0", + "level-transcoder": "^1.0.1", + "module-error": "^1.0.1", + "queue-microtask": "^1.2.3" + } + }, + "acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "dev": true + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true + }, + "adm-zip": { + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", + "integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==", + "dev": true, + "peer": true + }, + "aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==", + "dev": true, + "peer": true + }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "peer": true, + "requires": { + "debug": "4" + } + }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "peer": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "peer": true + }, + "ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "peer": true, + "requires": { + "type-fest": "^0.21.3" + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "peer": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "peer": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "peer": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "peer": true + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "peer": true + }, + "base-x": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", + "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", + "dev": true, + "peer": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "peer": true + }, + "bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", + "dev": true, + "peer": true + }, + "bigint-crypto-utils": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.2.2.tgz", + "integrity": "sha512-U1RbE3aX9ayCUVcIPHuPDPKcK3SFOXf93J1UK/iHlJuQB7bhagPIX06/CLpLEsDThJ7KA4Dhrnzynl+d2weTiw==", + "dev": true, + "peer": true + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "peer": true + }, + "blakejs": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", + "dev": true, + "peer": true + }, + "bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true, + "peer": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "peer": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "peer": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "dev": true, + "peer": true + }, + "browser-level": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browser-level/-/browser-level-1.0.1.tgz", + "integrity": "sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ==", + "dev": true, + "peer": true, + "requires": { + "abstract-level": "^1.0.2", + "catering": "^2.1.1", + "module-error": "^1.0.2", + "run-parallel-limit": "^1.1.0" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true, + "peer": true + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "peer": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, + "peer": true, + "requires": { + "base-x": "^3.0.2" + } + }, + "bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dev": true, + "peer": true, + "requires": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "peer": true, + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "peer": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "dev": true, + "peer": true + }, + "busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dev": true, + "peer": true, + "requires": { + "streamsearch": "^1.1.0" + } + }, + "bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "peer": true + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "peer": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "peer": true + }, + "case": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/case/-/case-1.6.3.tgz", + "integrity": "sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==", + "dev": true, + "peer": true + }, + "catering": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/catering/-/catering-2.1.1.tgz", + "integrity": "sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==", + "dev": true, + "peer": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "peer": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "peer": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true, + "peer": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "peer": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "classic-level": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.3.0.tgz", + "integrity": "sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==", + "dev": true, + "peer": true, + "requires": { + "abstract-level": "^1.0.2", + "catering": "^2.1.0", + "module-error": "^1.0.1", + "napi-macros": "^2.2.2", + "node-gyp-build": "^4.3.0" + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "peer": true + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "peer": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "peer": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "peer": true + }, + "command-exists": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", + "dev": true, + "peer": true + }, + "commander": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", + "dev": true, + "peer": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "peer": true + }, + "cookie": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "dev": true, + "peer": true + }, + "crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "dev": true, + "peer": true + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "peer": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "peer": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "peer": true, + "requires": { + "ms": "2.1.2" + } + }, + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "peer": true + }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "peer": true + }, + "diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, + "peer": true + }, + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, + "peer": true, + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true, + "peer": true + } + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "peer": true + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "peer": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "peer": true + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "peer": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "peer": true + }, + "ethereum-cryptography": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz", + "integrity": "sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw==", + "dev": true, + "peer": true, + "requires": { + "@noble/hashes": "1.2.0", + "@noble/secp256k1": "1.7.1", + "@scure/bip32": "1.1.5", + "@scure/bip39": "1.1.1" + } + }, + "ethereumjs-abi": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", + "integrity": "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==", + "dev": true, + "peer": true, + "requires": { + "bn.js": "^4.11.8", + "ethereumjs-util": "^6.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true, + "peer": true + } + } + }, + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "peer": true, + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + }, + "dependencies": { + "@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "dev": true, + "peer": true, + "requires": { + "@types/node": "*" + } + }, + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true, + "peer": true + }, + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "peer": true, + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + } + } + }, + "ethers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", + "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" + } + }, + "ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "dev": true, + "peer": true, + "requires": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + } + }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "dev": true, + "peer": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "peer": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "peer": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", + "dev": true, + "peer": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "peer": true + }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "dev": true, + "peer": true + }, + "fp-ts": { + "version": "1.19.3", + "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-1.19.3.tgz", + "integrity": "sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg==", + "dev": true, + "peer": true + }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "peer": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "peer": true + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true, + "peer": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true, + "peer": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "dev": true, + "peer": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "peer": true + }, + "get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dev": true, + "peer": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + } + }, + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "peer": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "peer": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "peer": true + }, + "handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "dev": true, + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + } + }, + "hardhat": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.14.1.tgz", + "integrity": "sha512-H3Qp/UKyQGmPDDBSfMoSyH18rRnac90rsb0LNer+sKe6at6rxLe4D5j+M+1icqZQF02iLPjNRwc/PA8OPf757A==", + "dev": true, + "peer": true, + "requires": { + "@ethersproject/abi": "^5.1.2", + "@metamask/eth-sig-util": "^4.0.0", + "@nomicfoundation/ethereumjs-block": "5.0.1", + "@nomicfoundation/ethereumjs-blockchain": "7.0.1", + "@nomicfoundation/ethereumjs-common": "4.0.1", + "@nomicfoundation/ethereumjs-evm": "2.0.1", + "@nomicfoundation/ethereumjs-rlp": "5.0.1", + "@nomicfoundation/ethereumjs-statemanager": "2.0.1", + "@nomicfoundation/ethereumjs-trie": "6.0.1", + "@nomicfoundation/ethereumjs-tx": "5.0.1", + "@nomicfoundation/ethereumjs-util": "9.0.1", + "@nomicfoundation/ethereumjs-vm": "7.0.1", + "@nomicfoundation/solidity-analyzer": "^0.1.0", + "@sentry/node": "^5.18.1", + "@types/bn.js": "^5.1.0", + "@types/lru-cache": "^5.1.0", + "abort-controller": "^3.0.0", + "adm-zip": "^0.4.16", + "aggregate-error": "^3.0.0", + "ansi-escapes": "^4.3.0", + "chalk": "^2.4.2", + "chokidar": "^3.4.0", + "ci-info": "^2.0.0", + "debug": "^4.1.1", + "enquirer": "^2.3.0", + "env-paths": "^2.2.0", + "ethereum-cryptography": "^1.0.3", + "ethereumjs-abi": "^0.6.8", + "find-up": "^2.1.0", + "fp-ts": "1.19.3", + "fs-extra": "^7.0.1", + "glob": "7.2.0", + "immutable": "^4.0.0-rc.12", + "io-ts": "1.10.4", + "keccak": "^3.0.2", + "lodash": "^4.17.11", + "mnemonist": "^0.38.0", + "mocha": "^10.0.0", + "p-map": "^4.0.0", + "qs": "^6.7.0", + "raw-body": "^2.4.1", + "resolve": "1.17.0", + "semver": "^6.3.0", + "solc": "0.7.3", + "source-map-support": "^0.5.13", + "stacktrace-parser": "^0.1.10", + "tsort": "0.0.1", + "undici": "^5.14.0", + "uuid": "^8.3.2", + "ws": "^7.4.6" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "peer": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "peer": true + }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, + "peer": true + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "peer": true + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "peer": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "peer": true + } + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "peer": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "peer": true + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dev": true, + "peer": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "peer": true, + "requires": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + } + }, + "https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "peer": true, + "requires": { + "agent-base": "6", + "debug": "4" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "peer": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "peer": true + }, + "immutable": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.0.tgz", + "integrity": "sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg==", + "dev": true, + "peer": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "peer": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "peer": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "peer": true + }, + "io-ts": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/io-ts/-/io-ts-1.10.4.tgz", + "integrity": "sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g==", + "dev": true, + "peer": true, + "requires": { + "fp-ts": "^1.0.0" + } + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "peer": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-buffer": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", + "dev": true, + "peer": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "peer": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "peer": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "peer": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", + "dev": true, + "peer": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "peer": true + }, + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "peer": true + }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "peer": true + }, + "js-sdsl": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.1.tgz", + "integrity": "sha512-6Gsx8R0RucyePbWqPssR8DyfuXmLBooYN5cZFZKjHGnQuaf7pEzhtpceagJxVu4LqhYY5EYA7nko3FmeHZ1KbA==", + "dev": true, + "peer": true + }, + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true, + "peer": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "peer": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "peer": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "keccak": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.3.tgz", + "integrity": "sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ==", + "dev": true, + "peer": true, + "requires": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0", + "readable-stream": "^3.6.0" + } + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw==", + "dev": true, + "peer": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "level": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/level/-/level-8.0.0.tgz", + "integrity": "sha512-ypf0jjAk2BWI33yzEaaotpq7fkOPALKAgDBxggO6Q9HGX2MRXn0wbP1Jn/tJv1gtL867+YOjOB49WaUF3UoJNQ==", + "dev": true, + "peer": true, + "requires": { + "browser-level": "^1.0.1", + "classic-level": "^1.2.0" + } + }, + "level-supports": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-4.0.1.tgz", + "integrity": "sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==", + "dev": true, + "peer": true + }, + "level-transcoder": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-transcoder/-/level-transcoder-1.0.1.tgz", + "integrity": "sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==", + "dev": true, + "peer": true, + "requires": { + "buffer": "^6.0.3", + "module-error": "^1.0.1" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "dev": true, + "peer": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "peer": true + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "peer": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "peer": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "peer": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "peer": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "peer": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "peer": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "peer": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "lru_map": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", + "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==", + "dev": true, + "peer": true + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "peer": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "mcl-wasm": { + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.9.tgz", + "integrity": "sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ==", + "dev": true, + "peer": true + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "peer": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "memory-level": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/memory-level/-/memory-level-1.0.0.tgz", + "integrity": "sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og==", + "dev": true, + "peer": true, + "requires": { + "abstract-level": "^1.0.0", + "functional-red-black-tree": "^1.0.1", + "module-error": "^1.0.1" + } + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "peer": true + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true, + "peer": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "dev": true, + "peer": true + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "peer": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true + }, + "mnemonist": { + "version": "0.38.5", + "resolved": "https://registry.npmjs.org/mnemonist/-/mnemonist-0.38.5.tgz", + "integrity": "sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg==", + "dev": true, + "peer": true, + "requires": { + "obliterator": "^2.0.0" + } + }, + "mocha": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", + "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", + "dev": true, + "peer": true, + "requires": { + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.4", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", + "ms": "2.1.3", + "nanoid": "3.3.3", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "workerpool": "6.2.1", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "peer": true + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "peer": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "peer": true + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "peer": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "peer": true + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "peer": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dev": true, + "peer": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "peer": true + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "peer": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "peer": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "peer": true + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "peer": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "module-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/module-error/-/module-error-1.0.2.tgz", + "integrity": "sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==", + "dev": true, + "peer": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "peer": true + }, + "nanoid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", + "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", + "dev": true, + "peer": true + }, + "napi-macros": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.2.2.tgz", + "integrity": "sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==", + "dev": true, + "peer": true + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "dev": true, + "peer": true + }, + "node-gyp-build": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", + "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", + "dev": true, + "peer": true + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "peer": true + }, + "object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "dev": true, + "peer": true + }, + "obliterator": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", + "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==", + "dev": true, + "peer": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "peer": true, + "requires": { + "wrappy": "1" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "peer": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "peer": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "dev": true, + "peer": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "peer": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", + "dev": true, + "peer": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true, + "peer": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "peer": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "peer": true + }, + "pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, + "peer": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "peer": true + }, + "qs": { + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", + "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", + "dev": true, + "peer": true, + "requires": { + "side-channel": "^1.0.4" + } + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "peer": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "peer": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dev": true, + "peer": true, + "requires": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "peer": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "peer": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "peer": true + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "peer": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "peer": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "peer": true, + "requires": { + "glob": "^7.1.3" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "peer": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "rlp": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", + "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", + "dev": true, + "peer": true, + "requires": { + "bn.js": "^5.2.0" + } + }, + "run-parallel-limit": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz", + "integrity": "sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw==", + "dev": true, + "peer": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "rustbn.js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", + "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==", + "dev": true, + "peer": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "peer": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "peer": true + }, + "scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "dev": true, + "peer": true + }, + "secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "dev": true, + "peer": true, + "requires": { + "elliptic": "^6.5.4", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "peer": true + }, + "serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "peer": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true, + "peer": true + }, + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true, + "peer": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "peer": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "peer": true, + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, + "solc": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.7.3.tgz", + "integrity": "sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA==", + "dev": true, + "peer": true, + "requires": { + "command-exists": "^1.2.8", + "commander": "3.0.2", + "follow-redirects": "^1.12.1", + "fs-extra": "^0.30.0", + "js-sha3": "0.8.0", + "memorystream": "^0.3.1", + "require-from-string": "^2.0.0", + "semver": "^5.5.0", + "tmp": "0.0.33" + }, + "dependencies": { + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", + "dev": true, + "peer": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", + "dev": true, + "peer": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "peer": true + } + } + }, + "solidity-ast": { + "version": "0.4.49", + "resolved": "https://registry.npmjs.org/solidity-ast/-/solidity-ast-0.4.49.tgz", + "integrity": "sha512-Pr5sCAj1SFqzwFZw1HPKSq0PehlQNdM8GwKyAVYh2DOn7/cCK8LUKD1HeHnKtTgBW7hi9h4nnnan7hpAg5RhWQ==", + "dev": true + }, + "solidity-docgen": { + "version": "0.6.0-beta.35", + "resolved": "https://registry.npmjs.org/solidity-docgen/-/solidity-docgen-0.6.0-beta.35.tgz", + "integrity": "sha512-9QdwK1THk/MWIdq1PEW/6dvtND0pUqpFTsbKwwU9YQIMYuRhH1lek9SsgnsGGYtdJ0VTrXXcVT30q20a8Y610A==", + "dev": true, + "requires": { + "handlebars": "^4.7.7", + "solidity-ast": "^0.4.38" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "peer": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "stacktrace-parser": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz", + "integrity": "sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==", + "dev": true, + "peer": true, + "requires": { + "type-fest": "^0.7.1" + }, + "dependencies": { + "type-fest": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", + "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", + "dev": true, + "peer": true + } + } + }, + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "peer": true + }, + "streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "dev": true, + "peer": true + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "peer": true, + "requires": { + "safe-buffer": "~5.2.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "peer": true + } + } + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "peer": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "peer": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", + "dev": true, + "peer": true, + "requires": { + "is-hex-prefixed": "1.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "peer": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "peer": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "peer": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "peer": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true, + "peer": true + }, + "ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "requires": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "dependencies": { + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + } + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true, + "peer": true + }, + "tsort": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", + "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==", + "dev": true, + "peer": true + }, + "tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "dev": true, + "peer": true + }, + "tweetnacl-util": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==", + "dev": true, + "peer": true + }, + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "peer": true + }, + "typescript": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", + "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", + "dev": true + }, + "uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "dev": true, + "optional": true + }, + "undici": { + "version": "5.22.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.22.1.tgz", + "integrity": "sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw==", + "dev": true, + "peer": true, + "requires": { + "busboy": "^1.6.0" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "peer": true + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true, + "peer": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "peer": true + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "peer": true + }, + "v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true + }, + "workerpool": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", + "dev": true, + "peer": true + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "peer": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "peer": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "peer": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "peer": true + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "peer": true + }, + "ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "dev": true, + "peer": true, + "requires": {} + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "peer": true + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "peer": true + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "peer": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true, + "peer": true + }, + "yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "peer": true, + "requires": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + } + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "peer": true } } } diff --git a/package.json b/package.json index 3dc572dd..8c7c67b5 100644 --- a/package.json +++ b/package.json @@ -28,5 +28,10 @@ "@chainlink/contracts": "0.4.1", "@etherisc/gif-interface": "2.0.0-rc.1-0", "@openzeppelin/contracts": "4.7.3" + }, + "devDependencies": { + "solidity-docgen": "^0.6.0-beta.35", + "ts-node": "^10.9.1", + "typescript": "^5.1.3" } }