pragma solidity ^0.4.23;
contract ApprovalContract {
address public sender;
address public receiver;
address public constant approver = 0x5AEDA56215b167893e80B4fE645BA6d5Bab767DE;
constructor() public {
// tbd
}
function deposit(address _receiver) external payable {
require(msg.value > 0);
sender = msg.sender;
receiver = _receiver;
}
function viewApprover() external pure returns(address){
return(approver);
}
function viewRe() external pure returns(address){
return(receiver);
}
function approve() external payable{
require(msg.sender == approver);
receiver.transfer(address(this).balance); // this line not working
}
}
I am getting transfer variable not visible.
Member "transfer" not found or not visible after argument-dependent lookup in address.
address payabledoes not yet exist. That said, the original code compiles fine in 0.4.x modulo apurethat should be aview. So I don't know which compiler version is actually being used. :-) – user19510 Dec 05 '18 at 16:07pragma solidity ^0.4.23;doesn't mean it's using that version. If the contract is being imported into another contract that has a 0.5.0 compiler version, then it'll be compiled with 0.5.0 and throw this error. – natewelch_ Dec 05 '18 at 17:50