starknet-foundry
starknet-foundry copied to clipboard
Throw an error when script does not have [lib] defined
If someone did not state [lib] section in their Scarb.toml file, the script command may fail. We should print a warning/throw an error if that's the case + instruct users what to do to mitigate the problem. https://github.com/foundry-rs/starknet-foundry/pull/1192#issuecomment-1935571457
I would argue that we should just return an error in this case - the only other solution I see is adding stuff to Scarb.toml
which I would consider potentially dangerous
I would argue that we should just return an error in this case - the only other solution I see is adding stuff to
Scarb.toml
which I would consider potentially dangerous
I have discussed the matter briefly with scarb team a few weeks ago, and according to them unless someone explicitly disables the section (with [lib] sierra = false) this should just work. So my plan is to first investigate, and then reach out to the scarb team again with the findings.
This will work if someone hasn't specified any other target, which is a rare case in sncast scripts - usually starknet target is needed to compile contracts. Scarb just defaults to lib target if not other target is specified. In case of sncast scripts user usually will need to define both targets manually