Home > Blockchain >  Solidity 0.5.10 + call parameter error method call
Solidity 0.5.10 + call parameter error method call

Time:09-23

Pragma solidity ^ 0.5.10;

Contract Call {
Uint public _n;
Address public sender;

The function setN (uint n) public {
_n=n;
Sender=MSG. Sender;
}
}

Contract CallTest {

Int public n;
Address public sender;

The function callSetN (address addr, uint _n) public view {
Bytes4 methodId=bytes4 (keccak256 (" setN (uint256) "));
Addr. Call (methodId _n);
}
}


Compile error:
Wrong argument count for the function call: 2 the arguments given but expected 1. This function requires a single bytes argument. If all your arguments are value types, you can use an abi. Encode (... ) to properly generate it.
Addr. Call (methodId _n);

Don't know what the problem is (,,)
  • Related