sGuard icon indicating copy to clipboard operation
sGuard copied to clipboard

How to sepeficy main contract ?

Open duytai opened this issue 3 years ago • 1 comments

How can I specify a 'main' contract in a source file?

  • Although a file may contain multiple contracts, only one contract can be designated as main, and the designated main contract is deployed.
  • Or, could you point out what part should be changed to specify the name of a main contract?

duytai avatar Aug 02 '21 07:08 duytai

I select the last contract listed in AST index.js

const { attributes: { name } } = children[children.length - 1]

You can speficy contract that you are interested in:

const { attributes: { name } } = children.find(({attributes: { name }}) => name == <name_of_contract>)

duytai avatar Aug 02 '21 07:08 duytai