Skip to content

feat(cheatcodes): add cheatcode to calculate the IPFS CID V0 of a file content #9862

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

Closed
sakulstra opened this issue Feb 11, 2025 · 11 comments
Closed
Assignees
Labels
A-cheatcodes Area: cheatcodes first issue A good way to start contributing T-feature Type: feature

Comments

@sakulstra
Copy link
Contributor

sakulstra commented Feb 11, 2025

For us it would be quite useful to have a native way of hashing file contents and strings via foundry.
The reason is that in a lot of cases we want to store the ipfs hash of a file on-chain, but automating this is currently pain.
We currently do this via ffi + node, but it's a bit painful ux wise: https://github.com/bgd-labs/aave-cli/blob/main/src/ipfs/onlyHash.ts#L3-L24

Would be great if there was a native ipfsCidV0(string memory filepath):bytes32, so we can get rid of the node tooling we currently use to supplement foundry.

@zerosnacks zerosnacks transferred this issue from foundry-rs/forge-std Feb 11, 2025
@github-project-automation github-project-automation bot moved this to Todo in Foundry Feb 11, 2025
@zerosnacks zerosnacks changed the title Ipfs cheatcodes feat(cheatcodes): add cheatcode to interact with IPFS Feb 11, 2025
@zerosnacks zerosnacks added the A-cheatcodes Area: cheatcodes label Feb 11, 2025
@zerosnacks
Copy link
Member

Hi @sakulstra, I moved this from forge-std to foundry as I think it would require additional features in Foundry - let me know if this is incorrect

@grandizzy grandizzy added T-feature Type: feature T-to-discuss Type: requires discussion labels Feb 13, 2025
@zerosnacks
Copy link
Member

After re-reading it appears onlyHash only precomputes an IPFS hash locally, it does not interact with IPFS.

For this ticket to be actionable I would like to define more clearly what features are requested:

  • Calculating the IPFS CID V0 of a file content
  • Would any interaction with IPFS be necessary? (reading, writing, etc..)

If no interaction is necessary we should update the title to reflect that.

@foundry-rs foundry-rs deleted a comment from JGW97357 Feb 20, 2025
@foundry-rs foundry-rs deleted a comment from JGW97357 Feb 20, 2025
@sakulstra
Copy link
Contributor Author

@zerosnacks for our usecase generating the cid0 of a file/string is the only thing we need.
No interaction with a node or similar is necessary.

@zerosnacks zerosnacks changed the title feat(cheatcodes): add cheatcode to interact with IPFS feat(cheatcodes): add cheatcode to calculate the IPFS CID V0 of a file content Feb 20, 2025
@JGW97357

This comment has been minimized.

@zerosnacks zerosnacks added first issue A good way to start contributing and removed T-to-discuss Type: requires discussion labels Feb 20, 2025
@startup-dreamer
Copy link
Contributor

I'd like to work on this.

@JGW97357

This comment has been minimized.

@jenpaff
Copy link
Collaborator

jenpaff commented Apr 18, 2025

I'd like to work on this.

Hey! Do you still have some capacity to work on this?

@Ayushdubey86
Copy link
Contributor

I'd like to work on this.

Hey! Do you still have some capacity to work on this?

I can look into this , if possible?

@startup-dreamer
Copy link
Contributor

Hi @jenpaff, A little occupied as of now @Ayushdubey86 can work on this if he wants.

@jenpaff
Copy link
Collaborator

jenpaff commented Apr 19, 2025

Hi @jenpaff, A little occupied as of now @Ayushdubey86 can work on this if he wants.

assigned

@DaniPopes
Copy link
Member

DaniPopes commented Apr 29, 2025

As per #10348 (comment) and internal discussion, we decided that this is not worth the complexity and additional dependencies for something already achievable through ffi.

@DaniPopes DaniPopes closed this as not planned Won't fix, can't repro, duplicate, stale Apr 29, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cheatcodes Area: cheatcodes first issue A good way to start contributing T-feature Type: feature
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

8 participants