Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

verifying contracts that was not deployed using truffle #24

Closed
hellwolf opened this issue Dec 10, 2019 · 5 comments
Closed

verifying contracts that was not deployed using truffle #24

hellwolf opened this issue Dec 10, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@hellwolf
Copy link
Contributor

Without something like this:

 24       if (!(options.networkId in artifact.networks)) {
 25         artifact.networks[`${options.networkId}`] = {};
 26       }
 27       if (contractAddress) {
 28         artifact.networks[`${options.networkId}`]
 29         artifact.networks[`${options.networkId}`].address = contractAddress
 30       }

We would have error "Cannot set property 'address' of undefined"

@hellwolf
Copy link
Contributor Author

 24       if (contractAddress) {
 25         if (!(options.networkId in artifact.networks)) {
 26           artifact.networks[`${options.networkId}`] = {};
 27         }
 28         artifact.networks[`${options.networkId}`].address = contractAddress
 29       }
 30       enforce(artifact.networks[`${options.networkId}`].address,
 31         `Cannot obtain contract address for ${contractName}`);

@rkalis
Copy link
Owner

rkalis commented Dec 10, 2019

Good catch, thanks!

I don't think line 30/31 is necessary cause it's already included in line 93 (there should be no way for network.address to be undefined while the network is defined).

  enforceOrThrow(
    artifact.networks && artifact.networks[`${options.networkId}`],
    `No instance of contract ${artifact.contractName} found for network id ${options.networkId}`
  )

Do you want to raise a PR for this, or shall I update it and push it?

@hellwolf
Copy link
Contributor Author

Thanks for the fast response! I didn't fork the code, maybe it is easier if you could include this in your next release.

@rkalis
Copy link
Owner

rkalis commented Dec 10, 2019

Sure, will do. Thanks again!

@rkalis
Copy link
Owner

rkalis commented Dec 10, 2019

This is fixed in v0.3.6.

@rkalis rkalis closed this as completed Dec 10, 2019
@rkalis rkalis added the bug Something isn't working label May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants