I have this Script deploy.js
to deploying my contract. Is a SimplePaymentChannel contract.
I need payng an amount when deployng the contract, but I dont know how is the correct way.
// We require the Hardhat Runtime Environment explicitly here. This is optional
// but useful for running the script in a standalone fashion through `node <script>`.
//
// When running the script with `hardhat run <script>` you'll find the Hardhat
// Runtime Environment's members available in the global scope.
const hre = require("hardhat");
async function main() {
// Hardhat always runs the compile task when running scripts with its command
// line interface.
//
// If this script is run directly using `node` you may want to call compile
// manually to make sure everything is compiled
// await hre.run('compile');
// We get the contract to deploy
const Payments = await hre.ethers.getContractFactory("SimplePaymentChannel");
const payments = await Payments.deploy('0xdcf95741E632aA0Fe5a4d9cbD97e0CFaFb20B869', 90061, {value: '1000000000000000000'});
await payments.deployed();
console.log("ReceiverPays contract deployed to:", payments.address);
}
// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main()
.then(() => process.exit(0))
.catch(error => {
console.error(error);
process.exit(1);
});
cause the constructor is:
constructor (address payable _recipient, uint256 duration)
payable
{
sender = payable(msg.sender);
recipient = _recipient;
expiration = block.timestamp + duration;
}
Everytime call me Error HH307: Missing positional argument script
.