Hi i am trying to update a mapping from another contract. But it is not being updated. Rather a new mapping instance is being created. What am i doing wrong can anyone help
Jan 21, 2023, 9:16 AM
anyone can help?
Jan 21, 2023, 9:38 AM
Without seeing the code it will be hard to say, better share the contract here link or via pastebin
However from the way you are describing it it looks like you are working with a memeroy reference but I can't confirm
However from the way you are describing it it looks like you are working with a memeroy reference but I can't confirm
Jan 21, 2023, 9:40 AM
Are you using a interface to update it?
Jan 21, 2023, 9:51 AM
No, i am importing it and then, pasting its address in constructor to fetch its function.
Jan 21, 2023, 11:15 AM
try set a local variable = INTERFACE(address).. import the interface into the contract
you can look at oppenzeppelin IERC20 for reference
its an interface too
Jan 21, 2023, 11:19 AM
Thanks mate i tried this too.
But it is now resolved. I have now modified the function such that it also takes and address argument where the address is msg.sender. and it worked successfully.
But it is now resolved. I have now modified the function such that it also takes and address argument where the address is msg.sender. and it worked successfully.
Jan 23, 2023, 2:11 AM
Glad it worked out mate
Jan 23, 2023, 2:13 AM