他のコントラクトのstorageのmappingを使用する方法
勝手にキーを引数に取る関数になるっぽい
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
pragma solidity ^0.4.18; contract Bank { mapping(address => uint) public bank; function Bank() public { bank[msg.sender] = 10000; } } contract SimpleStore { function get(address _bank) public view returns (uint) { Bank b = Bank(_bank); uint amount = 0; amount = b.bank(msg.sender); return amount; } } |