Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

The only direct options you have are msg.sender and tx.origin (which shouldn't be used basically ever). There is no way to get addresses which are "between" these addresses. Otherwise, as smarx stated, you should pass the desired owner address as a parameter and use that.


address(this).balance and msg.value exclusively relate to ether, so you can't get those to somehow show you token amounts. But to accept tokens, the caller needs to first call approve(<address>, <amount>) on the token, where <address> is the address of your contract, and <amount> is the number of tokens. Then when they call a ...


Yes. It's over-complicated and a little confused about organizing the data. This sort of works, to show you a simple way to complete your function: function getBatchDetails(uint row) public view returns(uint, string, address, string, string) { // require(batchList[batchId], "Batch not found.");, <== it is desirable to check, but not practical until ...

Only top voted, non community-wiki answers of a minimum length are eligible