I want to retieve data from contract A that has been already stored in the contract B by contract A? #40
-
dex.sol (contract A)
Here when i tried to store a value from dex1 using addmoney() and try to retrieve the value by getbalance() but i'm not getting any.Here i want to access the values stored in the storage contract from the dex1 contract? I have tried to many importing techiniques like using direct addressess and .call functions but they didnt workout but when i removed the parameters in getbalance() in dex1 and _getbalance() in storage_contract and changed the return balances[_address]; as return balances[msg.sender];we can able to retrevieving but i dont want this method of retreiving. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@MahammadKumar Which address are you passing to check the balance? You are using uint balance = contractaddress._addmoney(amount);
|
Beta Was this translation helpful? Give feedback.
-
yeah, I just used msg.sender instead of tx.origin Thank,you |
Beta Was this translation helpful? Give feedback.
@MahammadKumar Which address are you passing to check the balance?
You are using
msg.sender
herebalances[msg.sender] += _money;
and so heremsg.sender
will be contract not the EOA