Unable to run Raffle deploy script #5698
Closed
kaushikc44
started this conversation in
General
Replies: 1 comment
-
Never mind hte error was occuring due to the ethers.utils.parseEther(2) as I was passing it as a number instead of string |
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
Uh oh!
There was an error while loading. Please reload this page.
-
The error I am getting is :- Error: ERROR processing skip func of C:\Users\kaush\OneDrive\Desktop\Projects\raffle-hardhat\deploy\01-deploy-raffle.js:
Error: value must be a string (argument="value", value=2, code=INVALID_ARGUMENT, version=units/5.7.0)
My deploy-01 code is:
const {network, ethers } = require("hardhat")
const {networkConfig} = require("../helper-hardhat-config");
// const {verify} = require("utils/verify.js")
const VRF_SUB_FUND_AMOUNT = ethers.utils.parseEther(2);
module.exports = async ({
getNamedAccounts,deployments
}) => {
const {deploy , logs } = deployments
const {deployer} = await getNamedAccounts()
const networkChian = network.config.chainId
let vrfCoordinatorV2Address;
let subscriptionId;
let vrfCoordinatorV2mock;
}
module.exports.tags = ["all","raffle"]
my deploy 00 code (the mock code )
const {network } = require("hardhat")
const {networkConfig} = require("../helper-hardhat-config");
const BASE_FEE = ethers.utils.parseEther("0.25")
const GAS_PRICE_LINK = 1e9
module.exports = async({
getNamedAccounts,deployments
}) =>{
const {deploy , logs } = deployments
const {deployer} = await getNamedAccounts()
const chainId = network.config.chainId
const agrs = [BASE_FEE,GAS_PRICE_LINK]
if (chainId === 31337){
console.log("Deploying in Local host.....")
await deploy("VRFCoordinatorV2",{
from:deployer,
logs:true,
args:args
})
console.log("Mocks are deployed successfully...")
console.log("...........................")
}
}
module.exports.tags = ["all","mocks"]
my smartcontract code is :-
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AutomationCompatibleInterface.sol";
error Raffle_SendMoreEth();
error Raffle__TransferFailed();
error Raffle__CLOSED();
error Raffle__UpkeepNotNeeded(uint256 currentBalance,uint256 numPlayers,uint256 raffleState );
contract Raffle is VRFConsumerBaseV2,AutomationCompatibleInterface {
}
I checked twice If I am passing the params wrong however it was correct, Not sure where the error lies
Beta Was this translation helpful? Give feedback.
All reactions