Error while using sfStore function
ZNAXNOR opened this issue · comments
I followed your instructions and wrote the code, Even refrenced the code from Github repos but I cannot find the fault. Here is the code
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "./SimpleStorage.sol";
contract StorageFactory {
SimpleStorage[] public simpleStorageArray;
function createSimpleStorageContract() public {
SimpleStorage simpleStorage = new SimpleStorage();
simpleStorageArray.push(simpleStorage);
}
function sfStore(uint256 _simpleStorageIndex, uint256 _simpleStorageNumber) public {
// Address
// ABI
simpleStorageArray[_simpleStorageIndex].store(_simpleStorageNumber);
}
function sfGet(uint256 _simpleStorageIndex) public view returns (uint256) {
return simpleStorageArray[_simpleStorageIndex].retrieve();
}
}
It compiles and be deployed just fine. I can even use other functions, but while using the sfStore function, it gives error
transact to StorageFactory.sfStore errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="0.7", code=INVALID_ARGUMENT, version=bignumber/5.5.0)
Sorry! It was just me being an idiot. I used dot instead of comma. Anyway, the issue is solved so I will close this discussion.