Reputation: 45
I am writing a simple smart contract namely 'inbox.sol'. I am using truffle framework to test and deploy it to the rinkeby network using Infura API. I am having this error. Please help. I'm a beginner.
This is deployed contract in migration
This is my smart contract code
Upvotes: 1
Views: 291
Reputation: 49291
Your contract has a constructor and expects an argument.
constructor(string memory initialMessage) public {
message = initialMessage;
}
So when you deploy it you have to pass an argument.
const Inbox = artifacts.require("Inbox");
module.exports = function (deployer) {
// passing an argument
deployer.deploy(Inbox, "myInitialMessage");
};
Upvotes: 1