Skip to content

Commit

Permalink
added getGDAFlowRate
Browse files Browse the repository at this point in the history
  • Loading branch information
d10r committed Nov 21, 2024
1 parent e160f1b commit ef13be0
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions packages/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,20 @@ library SuperTokenV1Library {
(, flowRate, , ) = cfa.getFlow(token, sender, receiver);
}

/**
* @dev get flowrate between a distributor and pool for given token
* @param token The token used in flow
* @param distributor The ditributor of the flow
* @param pool The GDA pool
* @return flowRate The flow rate
*/
function getGDAFlowRate(ISuperToken token, address distributor, ISuperfluidPool pool)

Check warning on line 822 in packages/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol

View check run for this annotation

Codecov / codecov/patch

packages/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol#L822

Added line #L822 was not covered by tests
internal view returns(int96 flowRate)
{
(, IGeneralDistributionAgreementV1 gda) = _getHostAndGDA(token);
return gda.getFlowRate(token, distributor, pool);

Check warning on line 826 in packages/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol

View check run for this annotation

Codecov / codecov/patch

packages/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol#L825-L826

Added lines #L825 - L826 were not covered by tests
}

/**
* @dev get CFA flow info between two accounts for given token
* @param token The token used in flow
Expand All @@ -833,7 +847,7 @@ library SuperTokenV1Library {
/**
* @dev get flow info of a distributor to a pool for given token
* @param token The token used in flow
* @param distributor The sitributor of the flow
* @param distributor The ditributor of the flow
* @param pool The GDA pool
* @return lastUpdated Timestamp of flow creation or last flowrate change
* @return flowRate The flow rate
Expand All @@ -847,10 +861,6 @@ library SuperTokenV1Library {
return gda.getFlow(token, distributor, pool);
}

/* function getGDAFlowInfo(ISuperToken token, address distributor, ISuperfluidPool pool) */
/* { */
/* } */

/**
* @dev get net flow rate for given account for given token (CFA + GDA)
* @param token Super token address
Expand Down

0 comments on commit ef13be0

Please sign in to comment.