Guys, can anyone know how to call contract’s function in deploy script after I deploy the contract?

Apr 25, 2023, 4:48 AM
You just needed the ABI and call this function in contract:
deployedContract.funcName();
Apr 25, 2023, 4:50 AM
Dm
Apr 25, 2023, 4:51 AM
If you’re deploying and then wanting to call a function after the deployment just await the call like
Await contract.deployed()
Await contract.function()

Otherwise create the contract object witth the address abi and a signer and call it
Apr 25, 2023, 5:04 AM
Dm
Apr 25, 2023, 5:06 AM
No
Apr 25, 2023, 5:06 AM
:(
Apr 25, 2023, 5:07 AM
Look up ethersjs documentation on how to create the contract object
https://docs.ethers.org/v5/api/contract/contract/
Apr 25, 2023, 5:07 AM
...
Apr 25, 2023, 7:14 AM

© 2024 Draquery.com All rights reserved.