0
contract Test
{

   uint public x=21;
   uint age=10;
   
   // constructor()
   // {
   //    x=0;
   // }

   constructor(uint new_x)
   {
      x=new_x;
   }
}
1
  • Hello, given the error, the problem isn't in the solidity file but in the way you deployed the contract. Make sure to not leave empty the value of new_x when you're deploying (in Remix, it's in the box right of the "Deploy" button)
    – 0xSanson
    Commented Jan 22, 2023 at 12:06

1 Answer 1

0

contract.deploy(BigInt(new_x)) should cover your issue.

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.