-
How to determine whether an address is a contract address |
Beta Was this translation helpful? Give feedback.
Answered by
novaknole
Jun 15, 2022
Replies: 2 comments 3 replies
-
Super simple..
|
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
ricmoo
-
// @note ethers v6 hardhat env func.
async function isContract(value: any): Promise<boolean> {
const result = await hre.ethers.provider.getCode(value)
if (result === "0x") {
return false;
}
return true;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Super simple..