[Ethereum] Invalid Big number

remixsolidity

When i try to deploy my example contract it gives me the error creation of Auction errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="", code=INVALID_ARGUMENT, version=bignumber/5.0.8)

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.5.2;


contract Auction{
    mapping(address=> uint)public bids;

    struct Car{
        string description;
        uint value;
        uint built_year;
    }
    
    Car public private_car;
    mapping(address=> Car) public cars;
    
    
    constructor(string memory _description, uint _value, uint _built_year) public{
    private_car.description = _description;
    private_car.value = _value;
    private_car.built_year = _built_year;
    
       cars[msg.sender] = private_car;
    }
    
    function bid() payable public{
        bids[msg.sender] = msg.value;
    }
    
    
}

Why it gives this error when i pass nothing in the constructor? It works fine if i pass something in the constructor at the time of deployment.

Best Answer

If you have a constructor with arguments and you don't have an empty constructor defined, you have to give the arguments when deploying the contract. If you try to deploy without arguments you get an error - Remix just seems to give a bit strange error.

Related Topic