Tarandeep singh
Tarandeep singh

Reputation: 9

how can i pass constructor values when deploying through truffle?

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);
    } 

Upvotes: 0

Views: 481

Answers (1)

Petr Hejda
Petr Hejda

Reputation: 43581

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

deployer.deploy(MyContract, targetAmount, setDeadline);

Upvotes: 1

Related Questions