I am trying to execute the following smart contract using Truffle:
pragma solidity 0.5.16;
contract Phishable {
address public owner;
constructor (address _owner) public{
owner = _owner;
}
function () external payable {}
function withdrawAll(address payable _recipient) public {
require(tx.origin == owner);
_recipient.transfer(address(this).balance);
} }
== Following is my script:
const vic= artifacts.require("Phishable");
console.log("Point1 ###1")
const att= artifacts.require("PhishableAtt");
console.log("Point2 ###2")
const vicobj = await vic.new();
console.log("Point3 ###1")
When I execute the script, I am getting the following output:
$ truffle exec toolreent3.js
Using network 'development'.
Point1 ###1
Point2 ###2
{ Error: Invalid number of parameters for "undefined". Got 0 expected 1!
at module.exports (/home/zulfi/Truffle_programs/txorigin_assertion_TechyTech_tool/toolreent3.js:400:42)
My 2_deploy_contracts.js is:
const Phishable = artifacts.require("Phishable");
module.exports = function(deployer) {
deployer.deploy(Phisable);
}
Somebody please guide me.
Zulfi.