-
Notifications
You must be signed in to change notification settings - Fork 183
TypeError: (0 , ethers_1.getAddress) is not a function #175
Comments
here is the whole error message
|
Try to change |
Thank you, so I did that with both |
Here, I ran into the same problem. I've tried everything on the internet and it still doesn't work. |
Bro, have you solved it? |
oh yeah as a matter of fact I’ve solved it …if I remember correctly, I guess that was all I did but if it doesn’t work let’s know, happy coding |
Thanks, I did the same.It works |
Installing this will solve issue "@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@^0.3.0-beta.13s" And please make sure you're using ethers v5 module not v6. |
still using ethersv6, i tried something else, but i cant seem to get the subId, sadly, im getting the address and all btw but not the subId which is missing in the txReceipt: // create VRFV2 Subscription
const deploymentAddress = (await deployments.get('VRFCoordinatorV2Mock'))
.address;
const vrfCoordinatorV2Mock = await ethers.getContractAt(
'VRFCoordinatorV2Mock',
deploymentAddress
);
vrfCoordinatorV2Address = await vrfCoordinatorV2Mock.getAddress();
const txResponse = await vrfCoordinatorV2Mock.createSubscription();
const txReceipt = await txResponse.wait();
console.log(
'reciept',
await txResponse ,
txReceipt?.toJSON()
);
// subscriptionId = transactionReceipt?.logs[0]!.data;
// // Fund the subscription
// // Our mock makes it so we don't actually have to worry about sending fund
// await vrfCoordinatorV2Mock.fundSubscription(subscriptionId!, FUND_AMOUNT);
|
found a workaround: if (chainId == 31337) {
// create VRFV2 Subscription
const deploymentAddress = (await deployments.get('VRFCoordinatorV2Mock'))
.address;
const vrfCoordinatorV2Mock = await ethers.getContractAt(
'VRFCoordinatorV2Mock',
deploymentAddress
);
vrfCoordinatorV2Address = await vrfCoordinatorV2Mock.getAddress();
const txResponse = await vrfCoordinatorV2Mock.createSubscription({
from: deployer,
});
const txReceipt = await txResponse.wait();
const logs = await txReceipt?.logs[0]!;
if (logs && 'args' in logs) {
subscriptionId = logs.args[0];
}
// // Fund the subscription
// // Our mock makes it so we don't actually have to worry about sending fund
await vrfCoordinatorV2Mock.fundSubscription(subscriptionId!, FUND_AMOUNT);
} else {
vrfCoordinatorV2Address =
networkConfig[network.config.chainId!]['vrfCoordinatorV2'];
subscriptionId = networkConfig[network.config.chainId!]['subscriptionId'];
} |
this seems to be the affected part,
I hope I can get your views as soon as you see this. Thanks
The text was updated successfully, but these errors were encountered: