我如何使用构造函数预定义的参数值部署智能合约,我使用松露,巧克力酱!!
constructor (uint256 _targetAmount, uint256 _setDeadline) public {
totalAmount = _targetAmount;
deadline = block.timestamp + _setDeadline;
minDepositAmount = 1 ether;
manager = payable(msg.sender);
}
可以在deployer.deploy()的第一个参数之后传递构造函数参数。
deployer.deploy(MyContract, targetAmount, setDeadline);