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: store ipfsCID as a public variable #284

Merged
merged 1 commit into from
Feb 26, 2024
Merged

Conversation

smol-ninja
Copy link
Member

@smol-ninja smol-ninja commented Feb 6, 2024

Closes #281.

Note

  • ipfsCID is included in the MerkleLockup.ConstructorParams struct.
  • ipfsCID is stored as string because of it's nondeterministic CID length.

@andreivladbrg
Copy link
Member

andreivladbrg commented Feb 6, 2024

To keep the createMerkleLockup API unaffected

not sure what you mean. unaffected compared to what?

i haven't properly reviewed it yet, but it doesn't make sense for me to not include it in the struct

@smol-ninja
Copy link
Member Author

not sure what you mean. unaffected compared to what?

// current API
function createMerkleLockupLL(
    MerkleLockup.ConstructorParams memory baseParams,
    ISablierV2LockupLinear lockupLinear,
    LockupLinear.Durations memory streamDurations,
    string memory ipfsCID,
    uint256 aggregateAmount,
    uint256 recipientsCount
)
    external
    returns (ISablierV2MerkleLockupLL merkleLockupLL);

vs

// API if we include ipfsCID in baseParams
function createMerkleLockupLL(
    MerkleLockup.ConstructorParams memory baseParams,
    ISablierV2LockupLinear lockupLinear,
    LockupLinear.Durations memory streamDurations,
    uint256 aggregateAmount,
    uint256 recipientsCount
)
    external
    returns (ISablierV2MerkleLockupLL merkleLockupLL);

By not including ipfsCID in the baseParams, the createMerkleLockupLL API doesn't change. That means these changes wouldn't require integrators and Sablier UI to update their API calls.

What do you think about this?

@andreivladbrg
Copy link
Member

andreivladbrg commented Feb 6, 2024

That means these changes wouldn't require integrators and Sablier UI to update their API calls.
// current API
function createMerkleLockupLL(
MerkleLockup.ConstructorParams memory baseParams,
ISablierV2LockupLinear lockupLinear,
LockupLinear.Durations memory streamDurations,
string memory ipfsCID,
uint256 aggregateAmount,
uint256 recipientsCount
)
external
returns (ISablierV2MerkleLockupLL merkleLockupLL);

this "current" version is not actually current 😅. we are still developing on staging and it has not yet been used in any UI, nor have any integrators started using it

the real current API, is already changed since we've added the struct in the first place, meaning the UI already needs to be updated. so, this is why it doesn't make sense to not add it in the struct

function createMerkleStreamerLL(
address initialAdmin,
ISablierV2LockupLinear lockupLinear,
IERC20 asset,
bytes32 merkleRoot,
uint40 expiration,
LockupLinear.Durations memory streamDurations,
bool cancelable,
bool transferable,
string memory ipfsCID,
uint256 aggregateAmount,
uint256 recipientsCount
)

@smol-ninja
Copy link
Member Author

smol-ninja commented Feb 7, 2024

You are right. I think I got lost in an alternate parallel reality where we have already shipped the staging by now 🤣

I'll update the PR today.

fix: remove additional implementation of name()
@smol-ninja
Copy link
Member Author

smol-ninja commented Feb 24, 2024

@andreivladbrg we can merge this one. I have removed its dependency from #282.

Copy link
Member

@andreivladbrg andreivladbrg left a comment

Choose a reason for hiding this comment

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

lgtm, expect for this one question

src/abstracts/SablierV2MerkleLockup.sol Show resolved Hide resolved
@smol-ninja smol-ninja merged commit 9c3b62d into staging Feb 26, 2024
5 of 6 checks passed
@smol-ninja smol-ninja deleted the feat/store-ipfsCID branch February 26, 2024 20:00
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.

2 participants