TypeError: Member "store" not found or not visible after argument-dependent lookup in contract SimpleStorage. #427
-
Getting the error: from solidity: from the code: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./SimpleStorage.sol"; contract StorageFactory {
} Does anyone know why this is? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
can you also post the code for simpleStorage contract? |
Beta Was this translation helpful? Give feedback.
-
yes of course,
// SPDX-License-Identifier: MIT
pragma solidity 0.8.8;
// pragma solidity ^0.8.0;
// pragma solidity >=0.8.0 <0.9.0;
contract SimpleStorage {
uint256 FavNumber;
struct People {
uint256 FavNumber;
string name;
}
People[] public newperson;
mapping(string => uint256) public nameToFavNumber;
function Store(uint256 _FavNumber) public{
FavNumber = _FavNumber;
}
function retrieve() public view returns (uint256){
return FavNumber;
}
function addPerson(string memory _name, uint256 _FavNumber) public {
newperson.push(People(_FavNumber, _name));
nameToFavNumber[_name] = _FavNumber;
}
}
…On Sat, Jun 18, 2022 at 11:06 PM 369-shar-block ***@***.***> wrote:
can you also post the code for simpleStorage contract?
—
Reply to this email directly, view it on GitHub
<#427 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZUSSL5MUVJBPWB4VBY46ATVPZB6DANCNFSM5ZFLXLTA>
.
You are receiving this because you authored the thread.Message ID:
<smartcontractkit/full-blockchain-solidity-course-js/repo-discussions/427/comments/2978282
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
Jacob, it's showing you that error because in your simpleStorage contract, you have written function name as Store (with a capital S) and whenever you are calling this function in your sotrageFactory you are calling it as store (using lowercase S here). Therefore, just change the function name from Store to store in your simpleStorage contract and your error will be solved. Let me know if it helped you.. :) |
Beta Was this translation helpful? Give feedback.
-
Yes Thank you that has fixed the issue, just getting started with coding
but already abundantly clear that the little details matter a lot
…On Sat, 18 Jun 2022 at 23:12, 369-shar-block ***@***.***> wrote:
Jacob,
it's showing you that error because in your simpleStorage contract, you
have written function name as Store (with a capital S) and whenever you are
calling this function in your sotrageFactory you are calling it as store
(using lowercase S here).
Therefore, just change the function name from Store to store in your
simpleStorage contract and your error will be solved.
Let me know if it helped you.. :)
—
Reply to this email directly, view it on GitHub
<#427 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZUSSL3XHTZKKCWGW6FTMWLVPZCURANCNFSM5ZFLXLTA>
.
You are receiving this because you authored the thread.Message ID:
<smartcontractkit/full-blockchain-solidity-course-js/repo-discussions/427/comments/2978299
@github.com>
|
Beta Was this translation helpful? Give feedback.
Jacob,
it's showing you that error because in your simpleStorage contract, you have written function name as Store (with a capital S) and whenever you are calling this function in your sotrageFactory you are calling it as store (using lowercase S here).
Therefore, just change the function name from Store to store in your simpleStorage contract and your error will be solved.
Let me know if it helped you.. :)