when i deploy using truffle i have a key (in the file where the abi is also stored) called networks with each network where ive deployed the contract so i can easily get the contract address if im using the artifact from the frontend. when migrating from hardhat the only way i could see the address of the contract is to console log in the deployment script
i guess its possible somehow because i saw youtube videos where the dev just imported the address from the artifact but i didnt see anything special they did to have it there
Feb 11, 2022, 3:49 PM
i saw that message recommending hardhat so i had to try asking u because i had no luck on hardhat discord lol
ill try to reformulate the question:
how can i see the contract address of a deployed contract using hardhat?
how can i see the contract address of a deployed contract using hardhat?
so i want to have the address on that file
and i dont know how to do that, do you know how?
😂😂😂😂 i went back to truffle because of that
to be able to use it directly from the frontend
whathever front you're building to your contract
so from the front you would do contract= new Contract(Artifact.address,Artifact.abi)
Feb 11, 2022, 3:58 PM
theoretically truffle tastes better than hardhat
Feb 11, 2022, 3:58 PM
this is the output from truffle
no.... im speaking about the artifact file generated by hardhat (or truffle)
i saw people on github and youtube that somehow have something similar on their artifact generated by hardhat
as i saw you recommending hardhat, i thought u would know but if ure not aware about that no problem (and thanks for helping)
i guess they use some kind of custom script or plugin
Feb 11, 2022, 4:00 PM
video link?
Feb 11, 2022, 4:01 PM
sorry but I never saw that
Feb 11, 2022, 4:01 PM
thanks man no problem! if i find out i will share it here for the sake of knowledge
let me iterate over all my youtube and github history as ive been looking on a lot of videos lol
i think frist time i saw it was in scaffold-eth
Feb 11, 2022, 4:03 PM
you may have million over titles lol
Feb 11, 2022, 4:03 PM
i remember the face from one guy that made a 3 hour video nft market that used hardhat and imported the address directly from the artifact, how i can find him lol
Feb 11, 2022, 4:04 PM
I can assume dappUniversity
Feb 11, 2022, 4:04 PM
no the guy was bald
and was working on aave or any other big defi
llet me come back once i find it
Feb 11, 2022, 4:05 PM
any other traits?
Feb 11, 2022, 4:05 PM
https://youtu.be/GKJBEEXUha0?t=4541
this guy, but my memory tricked me because on that just exact second im sharing he's creating a .config file to add the address lol
this guy, but my memory tricked me because on that just exact second im sharing he's creating a .config file to add the address lol
Feb 11, 2022, 4:08 PM
😅😅
Feb 11, 2022, 4:09 PM
i swear i saw someone importing it directly from the artifact
found the way
always old trustable scaffold-eth
https://github.com/scaffold-eth/scaffold-eth/blob/master/packages/hardhat/scripts/deploy.js
linea 72 and ahead
https://github.com/scaffold-eth/scaffold-eth/blob/master/packages/hardhat/scripts/deploy.js
linea 72 and ahead
so basically the guy from scaffold-eth generates a new file to save the info he needs for the frontend app
Feb 11, 2022, 4:14 PM