Truffle: Nice to have: Multiple singletons of the same type of contract in migrations

Created on 28 Jul 2017  路  12Comments  路  Source: trufflesuite/truffle

Potential new syntax:

deployer.deploy(A);    // => A.json
deployer.deploy(A, {as: "GoldToken"}); // => GoldToken.json
deployer.deploy(A, {as: "SilverToken"}); // => SilverToken.json 

deployer.deploy(C, GoldToken);    // How do we get this?

Unanswered question: How do you refer to GoldToken after it's created?

Artifacts Migrations

Most helpful comment

That is definitely needed :)

All 12 comments

Seems like a great feature to have.
Not sure if you're looking for syntax, but what about something like this?

deployer.deploy(A, {as: 'GoldToken'}); // => GoldToken.json
GoldToken = deployer.resolve(A, {from: 'GoldToken'})
deployer.deploy(B, GoldToken);

Could also make a new resolver module

cc: #237

factory patterns are quite common, I have 3 different use cases for this already...

That is definitely needed :)

When can we expect this feature ?

Thank you for raising this issue! It has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you would like to keep this issue open, please respond with information about the current state of this problem.

This issue presents alternative possible syntax.

https://github.com/trufflesuite/truffle/issues/237#issuecomment-252607611

Which I see @tcoulter has included here:

https://github.com/trufflesuite/truffle/issues/237#issuecomment-314233073

It could probably be closed as duplicate.

Thanks for your response! This issue is no longer considered stale and someone from the Truffle team will try to respond as soon as they can.

Thank you for raising this issue! It has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you would like to keep this issue open, please respond with information about the current state of this problem.

Bot closing probably not good idea. This deployment system UX can be improved.

Thanks for your response! This issue is no longer considered stale and someone from the Truffle team will try to respond as soon as they can.

Or.... Keep #237 and close this one?

Closing this one in favor of #237, since it seems a duplicate. Thanks all!

Was this page helpful?
0 / 5 - 0 ratings