-
Notifications
You must be signed in to change notification settings - Fork 199
Missing 'networks' in contract build files? #1555
Comments
Here's some additional information: If I start with deploying it as 'ugpradeable', it does create the 'networks' object. Subsequently, deploying a regular version of the same contract overwrites this 'networks' object with the new deployment. BUT, if deploying a regular contract from scratch, it does not create the 'networks' object. eg, assume contract 'A':
-> No 'networks' object in build file (contracts/build/A.json).
So, I have to do this work-around. I'm not sure what the desired behaviour should be, but I've been relying on there being a 'networks' object. I could use the network object (eg dev-31337.json) to get addresses, but this requires extra lift in the front-end, because you have to load additional files + also add in a prefix if you rely on getting the network id from the provider. |
Hi @simondlr ! I’m sorry that you had this issue. We have been able to reproduce this issue by following these steps:
// contracts/A.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
contract A {
}
Thanks so much for reporting it! The project owner will review and triage this issue as soon as they can. In the meantime, you can try the following workaround:
If you aren't already, I suggest including |
Thanks @abcoathup. This work-around works perfect. Appreciate the prompt response! |
To load a contract in the dapp, I usually rely on the 'networks' object in the contract's build file. It has worked consistently. However, recently, after a fresh re-install of my code, when deploying a regular contract, it doesn't write the address into the 'networks' object.
I've tried figuring out whether this is a bug, or whether I have incorrect assumptions about the build files? Unsure if whether something I changed stopped it from working? So, uncertain whether this is a bug or working-as-intended.
Is this Truffle? (which I'm not using).
Should it be happening without Truffle?
The text was updated successfully, but these errors were encountered: