web3-loader icon indicating copy to clipboard operation
web3-loader copied to clipboard

Considering removing constructor params for imported contracts. (Reverting #16)

Open uzyn opened this issue 9 years ago • 4 comments

Why

  1. It is not a natural or common use-case to be importing contracts that require constructor params. Or am I mistaken?
  2. The implementation is overly complicated, requiring building of graphs for a feature that is either very hardly used, or is an anti-pattern of import use.

uzyn avatar Oct 25 '16 09:10 uzyn

Any comments? @Antanukas @graup

https://github.com/uzyn/solc-loader/pull/2 is a good one though and does not need #16 to work.

uzyn avatar Oct 25 '16 09:10 uzyn

This feature is needed, at least for me. #16 is about library linking. If you use a library in the code (e.g. like this), after deployment the library contract addresses have to be put into be main contract.

Without this code people cannot deploy contracts that use libraries, as far as I understand.

graup avatar Oct 25 '16 10:10 graup

@graup solc should have done the address linking automagically if I'm not mistaken.

Will verify.

uzyn avatar Oct 25 '16 11:10 uzyn

You are right @graup . Sorry for the misinformation. I was rather confused with inject_.

I, however, do not quite agree with the introduction of inject_ and am thinking about removing it for a couple of reasons:

  1. It is not standard Solidity.
  2. I cannot think of a use case for it. If a contract/library is external, you would need to the address hardcoded or configured somewhere; if a contract/library is part of your project, you can simply use Solidity's standard import().

Any thoughts on this?

uzyn avatar Oct 25 '16 15:10 uzyn