Skip to content

[Feature] - More customization in Foundry #296

@escottalexander

Description

@escottalexander

This applies to any Foundry project that needs to add additional libraries for their contracts besides the default forge-std, openzeppelin-contracts and solidity-bytes-utils submodules.

There are two ways I can add new contract libraries. Neither of these are possible with the extension system currently:

  1. Install library to node_modules and then update foundry.toml libs to include node_modules (libs = ['lib', 'node_modules']). Not possible with current template file:
    https://github.com/scaffold-eth/create-eth/blob/main/templates/solidity-frameworks/foundry/packages/foundry/foundry.toml.template.mjs
    This won't show as a submodule but will still be accessible to the contract.

  2. Add the library as a git submodule to ./.gitmodules and update remappings.txt. Neither of those files have template files and as a result are un-alterable in the extension system.

The quickest path to having something workable may be shipping a new default version of foundry.toml that includes node_modules in libs. I think the cleanest long term way of doing this would be to allow the files mentioned in method 2 to be editable.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions