Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ETHEREUM-CONTRACTS] overhaul of SuperTokenV1Library #2032

Draft
wants to merge 20 commits into
base: dev
Choose a base branch
from

Conversation

d10r
Copy link
Collaborator

@d10r d10r commented Oct 18, 2024

  • remove IDA functionality
  • align GDA function naming
  • add higher abstractions

Also remove IDAv1Library and CFAv1Library

to become 1.12

Copy link

Changelog Reminder

Reminder to update the CHANGELOG.md for any of the modified packages in this PR.

  • CHANGELOG.md modified
  • Double check before merge

@d10r
Copy link
Collaborator Author

d10r commented Oct 23, 2024

analysis of the lib interface:

CFA WRITE
createFlow(ISuperToken token, address receiver, int96 flowRate) (ud) (ctx)
createFlowFrom(ISuperToken token, address sender, address receiver, int96 flowRate) (ud) (ctx)
updateFlow(ISuperToken token, address receiver, int96 flowRate) (ud) (ctx)
updateFlowFrom(ISuperToken token, address sender, address receiver, int96 flowRate) (ud) (ctx)
deleteFlow(ISuperToken token, address sender, address receiver) (ud) (ctx)
deleteFlowFrom(ISuperToken token, address sender, address receiver) (ud) (ctx)
setFlowPermissions(ISuperToken token, address flowOperator, bool allowCreate, bool allowUpdate, bool allowDelete, int96 flowRateAllowance) (ctx)
setMaxFlowPermissions(ISuperToken token, address flowOperator) (ctx)
revokeFlowPermissions(ISuperToken token, address flowOperator) (ctx)
increaseFlowRateAllowance(ISuperToken token, address flowOperator, int96 addedFlowRateAllowance) (ud)
decreaseFlowRateAllowance(ISuperToken token, address flowOperator, int96 subtractedFlowRateAllowance) (ud)
increaseFlowRateAllowanceWithPermissions(ISuperToken token, address flowOperator, uint8 permissionsToAdd, int96 addedFlowRateAllowance) (ud)
decreaseFlowRateAllowanceWithPermissions(ISuperToken token, address flowOperator, uint8 permissionsToRemove, int96 subtractedFlowRateAllowance) (ud)

CFA READ
// to be replaced by combined or renamed
getFlowRate(ISuperToken token, address sender, address receiver)
// to be replaced by combined or renamed
getFlowInfo(ISuperToken token, address sender, address receiver)
getCFANetFlowRate(ISuperToken token, address account)
getCFANetFlowInfo(ISuperToken token, address account)
getFlowPermissions(ISuperToken token, address sender, address flowOperator)


GDA WRITE
createPool(ISuperToken token [, address admin, PoolConfig memory poolConfig])
// TODO: should imo be removed, belongs to pool iface (why is it also in gda iface?). Probably for ctx variant - but do we really need that?
updateMemberUnits[WithCtx](ISuperToken token, ISuperfluidPool pool, address memberAddress, uint128 newUnits) (ud)
// those exist both in pool and gda iface. Belong into TCI
claimAll[WithCtx](ISuperToken token, ISuperfluidPool pool, address memberAddress) (ud)
connectPool[WithCtx](ISuperToken token, ISuperfluidPool pool) (ud)
disconnectPool[WithCtx](ISuperToken token, ISuperfluidPool pool) (ud)
distribute[WithCtx](ISuperToken token, address from, ISuperfluidPool pool, uint256 requestedAmount) (ud)
distributeFlow[WithCtx](ISuperToken token, address from, ISuperfluidPool pool, int96 requestedFlowRate) (ud)

GDA READ
getGDAFlowInfo(ISuperToken token, address distributor, ISuperfluidPool pool)
getGDANetFlowRate(ISuperToken token, address account)
getGDANetFlowInfo(ISuperToken token, address account)
// rename to getGDAFlowRate
getFlowDistributionFlowRate(ISuperToken token, address from, ISuperfluidPool to)
// TODO: find better name
estimateFlowDistributionActualFlowRate(ISuperToken token, address from, ISuperfluidPool to, int96 requestedFlowRate)
// TODO: find better name
estimateDistributionActualAmount(ISuperToken token, address from, ISuperfluidPool to, uint256 requestedAmount)
isMemberConnected(ISuperToken token, address pool, address member)
// TODO: check token matches pool. Name good?
getPoolAdjustmentFlowRate(ISuperToken token, ISuperfluidPool pool)
// TODO: rename to "getTotalAmountReceivedFromPool"
getTotalAmountReceivedByMember(ISuperfluidPool pool, address memberAddr)


COMBINED WRITE (NEW)
// replicated from cfa forwarder: TODO: remove
setFlowrate(ISuperToken token, address receiver, int96 flowrate)
// replicated from cfa forwarder. TODO: remove
setFlowrateFrom(ISuperToken token, address sender, address receiver, int96 flowrate)
flowX(ISuperToken token, address receiverOrPool, int96 flowRate)
transferX(ISuperToken token, address receiverOrPool, uint256 amount)

COMBINED READ
getNetFlowRate(ISuperToken token, address account)
getNetFlowInfo(ISuperToken token, address account)
getBufferAmountByFlowRate(ISuperToken token, int96 flowRate)

COMBINED READ (TODO)
// replaces current CFA getFlowRate
getFlowRate(ISuperToken token, address sender, address receiverOrPool)
getFlowInfo(ISuperToken token, address sender, address receiverOrPool)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant