ethers.js
ethers.js copied to clipboard
Please provide Contract.fromEtherscan(address)
Describe the Feature
Please provide Contract.fromEtherscan(address [, provider]) that will pull the contract ABI for a verified contract down from Etherscan and create a new Contract object with that ABI, so that only the address of a deployed and verified contract has to be provided to Ethers.
(Inspiration: ContractFactory.fromSolidity(json))
Code Example
`const myContract = Contract.fromEtherscan(address);`
I like the idea, but would probably make it part of the EtherscanProvider, etherscanProvider.getContract(address, signer = null).
Does Etherscan offer an API for pulling contract abi by address?
Yes:
https://docs.etherscan.io/api-endpoints/contracts
this may be helpful, potentially:
https://www.npmjs.com/package/etherscan-api
This is available in v6. :)
Thanks! :)