I'm here to ask my problem on solidity code.
Here is simple example code. Contract 'Map' has a mapped data. It has each address's T/F values. I created an account X and add it to 'simpleMap'.
Contract 'Ask' lookup mapping data through 'Map' contract. What I expected result when X called askMe() was TRUE but it was always FALSE.
When I called whoIsMsgSender it returns the exact X's account. What's the problem??
pragma solidity ^0.4.24;
contract Map {
mapping (address => bool) simpleMap;
function add(address _address) external {
simpleMap[_address] = true;
}
function isTrue(address _address) external view returns (bool _ret) {
return simpleMap[_address];
}
}
contract Ask {
Map public map = Map(Map's address like 0x~~ just for test);
function askMe() external view returns (bool _ret) {
return map.isTrue(msg.sender);
}
function whoIsMsgSender() external view returns (address _address) {
return msg.sender;
}
}