Below is a simple contract which I wrote
//SPDX-License-Identifier: MIT
pragma solidity 0.8.17 ;
contract Num
{
uint256 public nuu ;
}
Below is another contract which I wrote
//SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "./Num.sol";
contract Put
{
Num[] public deploy ;
function putfac() public // creating and adding new instances of contract into array
{ Num dd = new Num() ;
deploy.push(dd);
}
function putvalue(uint256 serial , uint256 numput) public
{
Num ss = Num(deploy[serial]);
ss.nuu = numput ; // trying to put value into variable of another contract
}
}
In 2nd contract , I imported the contract Num
, and then I created an array of that contract type , created instance and now in function putvalue
I am trying to add value in variable, however I am getting these errors:-
Can anyone tell me , why these errors are showing , how to remove them and how to add value in variable nuu
from 2nd contract ?