0

How can I deploy a smart contract with constructor predefined parameters values, I am using truffle, ganache!!

constructor (uint256 _targetAmount, uint256 _setDeadline) public {
        totalAmount = _targetAmount;
        deadline = block.timestamp + _setDeadline;
        minDepositAmount = 1 ether;
        manager = payable(msg.sender);
    } 

1 Answers1

1

You can pass the constructor params after the first argument of deployer.deploy().

deployer.deploy(MyContract, targetAmount, setDeadline);
Petr Hejda
  • 40,554
  • 8
  • 72
  • 100