sGuard
sGuard copied to clipboard
How to sepeficy main contract ?
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?
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>)