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
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