I started learning solidity but when I use construct im getting the error, please help: here's the code

pragma solidity >=0.7.0 <0.9.0;

contract base{

    uint data;
    constructor (uint _data) public {
        data = _data;

    function getData() public view returns(uint) {
        return data;


Error - creation of Base errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="", code=INVALID_ARGUMENT, version=bignumber/5.5.0)

3 Answers 3


Your contract works fine. As the two previous replies mentioned, you're "deploying" your contract with a void input. In other words, you haven't specified the value of your data.

type any uint value in "deploy" section and it will work fine.

enter image description here

All the best.


enter image description here You need to input value when you deploy the contract.


The error is not on your smart contract, by the way, you're calling your constructor with "", try with numbers instead, e.g, "123", 123, 0...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.