I'm using Truffle, Solidity, Web3.js, and Ganache. Whenever I deploy a smart contract, I have to copy and paste the new ABI & address of the contract. How can I dynamically change the value so that every time a new smart contract is deployed it saves me from having to copy and paste these new values into my .js file?
Asked
Active
Viewed 613 times
0
1 Answers
0
artifacts.require("<contract_name>") will fetch the contracts json file(which is generated in build folder after compiling every time) within truffle project.
kappa
- 171
- 3
index.jsit imports the contract artifactimport metaCoinArtifact from "../../build/contracts/MetaCoin.json"directly from the truffle output. – Ismael Jun 02 '21 at 03:08