wighawag / hardhat-deploy

hardhat deployment plugin
MIT License
1.2k stars 296 forks source link

How to get deployed contract #239

Closed shunkakinoki closed 2 years ago

shunkakinoki commented 2 years ago

https://github.com/ethereum-optimism/contracts/blob/df10de974629615b8597ed9bdbcd1b5ec2c0c9b7/src/hardhat-deploy-ethers.ts#L80

shunkakinoki commented 2 years ago

Is there any function build in like the above?

shunkakinoki commented 2 years ago

Would be nice if we could write and invoke functions directly from the deploy script

zjesko commented 2 years ago

you can use await hre.deployments.get("ContractName"); where hre is the HardhatRuntimeEnvironment to get the deployed contract object