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

Research how to parse toml files #79

Open
gnkz opened this issue Feb 27, 2023 · 3 comments
Open

Research how to parse toml files #79

gnkz opened this issue Feb 27, 2023 · 3 comments

Comments

@gnkz
Copy link
Contributor

gnkz commented Feb 27, 2023

If we could parse toml files we could improve the Config module to obtain settings from
foundry.toml

@saucepoint
Copy link

saucepoint commented Apr 6, 2023

would love to help out on this! have a project that would benefit from being able to read foundry.toml

There's probably 2 ways of approaching this:

  1. PR'ing foundry and exposing the settings via a cheatcode

  2. combining vm.readFile, vulcan, and native solidity to write our own TOML parser

as for the latter, I got a sample TOML parser in typescript via chatgpt and it doesn't seem all that impossible. It probably doesnt catch all edge-cases and nuances with TOML, but foundry's toml is well-known and we can be specific for that

@vdrg
Copy link
Contributor

vdrg commented Apr 6, 2023

would love to help out on this! have a project that would benefit from being able to read foundry.toml

There's probably 2 ways of approaching this:

  1. PR'ing foundry and exposing the settings via a cheatcode
  2. combining vm.readFile, vulcan, and native solidity to write our own TOML parser

as for the latter, I got a sample TOML parser in typescript via chatgpt and it doesn't seem all that impossible. It probably doesnt catch all edge-cases and nuances with TOML, but foundry's toml is well-known and we can be specific for that

nice! I can ask in Foundry's tg channel if they have any plans for or would be interested in exposing the config, otherwise we can go ahead and implement the parser :)

Also feel free to join the Discord if you want to participate in other discussions about Vulcan as well! https://discord.com/invite/aEdVwr6ZzP

@saucepoint
Copy link

started poking around and I will need to write some additional string functions (.equals(), .charAt(), .slice(), etc)

do ya'll prefer that I rewrite/copy existing logic or should I add OZ as a dependency? for example, they have an equals function: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Strings.sol#L82-L84

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

No branches or pull requests

3 participants