I wrote a contract A that uses
msg.sender for authentication: When A creates an item it stores
itemsOwners mapping (
itemOwners[itemId] = msg.sender;). Later A compares
itemOwners[itemId] to check access rights.
Now I have the trouble that I cannot use my contract B to wrap calls to A, because A wrongly assumes that the item owner is the contract B, when B calls A. So it stores a wrong item owner that should be a user, not contract B.
Should I replace
tx.origin in A? Or what to do? It was not recommended to use
I ask not what is the difference between
tx.origin, but what to do?