foundry-rs / foundry-rs/book

Improve `--libraries` documentation for linking more than one library

Open
#673 1 comment 1 reaction 0 assignees View on GitHub
A-forge good first issue T-enhancement
Dominant language
MDX
Stars
962
Forks
1k
Avg merge
14h 22m
Merged PRs (30d)
42

Description

`forge create --libraries` tag on contract deployment throws error when linking multiple libraries.

Not sure if lacking proper documentation showing the proper approach, or just a bug. Either way, as a user, I am confused as to how to link more than one external library on contract deployment.

ex.
```
forge create ExampleContract --rpc-url $RPC --private-key $KEY --libraries lib/solmate/src/utils/SafeCastLib.sol:SafeCastLib:0xaBcd0C11d7c8AaABBa176Cb5ab9531BCcF7711f1
lib/solmate/src/utils/SafeTransferLib.sol:SafeTransferLib:0xabCd5E5C3C6d9fcb3150BF64015186f45C8F4273 lib/solmate/src/utils/FixedPointMathLib.sol:FixedPointMathLib:0xABCd3390ea4Ea050E296e1Eeb766193c8C0cb6c6

error: Found argument 'src/utils/SafeTransferLib.sol:SafeTransferLib:0xabCd5E5C3C6d9fcb3150BF64015186f45C8F4273' which wasn't expected, or isn't valid in this context
```

current docs:

```[Linker Options](https://book.getfoundry.sh/reference/forge/forge-script?highlight=forge%20script#linker-options)
--libraries libraries
Set pre-linked libraries.

The parameter must be in the format ::

, e.g. src/Contract.sol:Library:0x....

Can also be set in your configuration file as libraries = ["::

"].
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.