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

feat: flow examples #37

Merged
merged 15 commits into from
Dec 12, 2024
Merged

feat: flow examples #37

merged 15 commits into from
Dec 12, 2024

Conversation

andreivladbrg
Copy link
Member

@andreivladbrg andreivladbrg commented Oct 2, 2024

Closes #36

Note: this PR merge must be synchronized with docs reference changes due to v2 rename to lockup (e.g. this one). Will work on that once you finish with your refactor @smol-ninja.


The flow example contracts are represented by these 4:

  1. FlowBatchable
    • different functions (adjustRatePerSecondAndDeposit, createMultiple, createAndDepositViaBroker etc.) to declare the calldata as bytes for multiple function calls into a single tx
  2. FlowManager
    • Manager contract that calls function to manage streams (basically mirror functions)
  3. FlowStreamCreator
    • Contract for creating 2 streams with different rates
  4. FlowUtilities
    • A library (used in the stream creator contract) with a series of utility functions for calculating the rps using a desired amount and duration.

@sablier-labs/solidity lmk if you have anything else in mind, or if the current ones should suffice

build: update PRBMath
build: add flow/lockup foundry profiles
feat: implement a FlowUtilities library
feat: implement flow creator contract
refactor: rename v2 to lockup
chore: add scripts in package json for the new profiles
@andreivladbrg andreivladbrg marked this pull request as draft October 2, 2024 21:41
@andreivladbrg andreivladbrg changed the title Feat/flow feat: flow examples Oct 2, 2024
@andreivladbrg andreivladbrg marked this pull request as ready for review October 3, 2024 13:46
build: install flow repo via package.json
test: add tests for FlowStreamCreator
test: add tests for FlowBatchable
@smol-ninja
Copy link
Member

@andreivladbrg this might need some refactor with the deposit function

@andreivladbrg
Copy link
Member Author

andreivladbrg commented Oct 22, 2024

@andreivladbrg this might need some refactor with the deposit function

indeed it needs, will updated it

also, since the repo is public now, it can be removed via package.json file so the gitmodules can be removed

Copy link
Member

@smol-ninja smol-ninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on Flow examples especially FlowUtilities library. I have an idea for an example:

  • An example to salaries to multiple people through a single contract.

Let me know what you think if it would be useful or an overkill for this repo? I was thinking of examples from the use case point of view. And this may be a useful for users.

@smol-ninja
Copy link
Member

Adding a note that after merging this PR, the links should be updated in sablier-labs/docs#186

@andreivladbrg
Copy link
Member Author

andreivladbrg commented Dec 7, 2024

Adding a note that after merging this PR, the links should be updated in sablier-labs/docs#186

yes, we should update them, also mentioned in the OP:

image

@andreivladbrg
Copy link
Member Author

  • An example to salaries to multiple people through a single contract

well, the stream creator can be used for this case. e.g. createStream_1K_PerMonth can be a salary.

polish code
use the latest deployment
@smol-ninja
Copy link
Member

Fair point about using stream creator for salary example. But see my comment here.

@smol-ninja
Copy link
Member

Should we merge it @andreivladbrg given we are going live in a few hours?

@andreivladbrg
Copy link
Member Author

we will need to update the links in docs#docs/flow-protocol from feat/flow to main

@smol-ninja
Copy link
Member

Yes. We can do that after this is merged.

@andreivladbrg andreivladbrg merged commit cdee078 into main Dec 12, 2024
3 checks passed
@andreivladbrg andreivladbrg deleted the feat/flow branch December 12, 2024 13:15
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.

Include flow examples
2 participants