BlockchainGuild / BlockchainGuildCommunity

Blockchain Guild Community
Other
83 stars 16 forks source link

Fetching variable data from one contract another #19

Open yugendar opened 6 years ago

yugendar commented 6 years ago

pragma solidity ^0.4.16; import './bank.sol'; contract reg { uint public test; bank b = new bank(); function chkuser() public returns (bool success) { test = b.UserId; return true; }
}

pragma solidity ^0.4.16; contract bank{ string public UserName; uint public UserId; function setdetails(string _UserName, uint _UserId) public returns (bool success){ UserName = _UserName; UserId = _UserId; return true; } } I want fetch the value of UserId from bank contract to test(uint variable) from reg contract. please i need help