I am trying to create a new instance of the Taker contract from the Maker contract and send some value to it.
Then later I would like to send a value back to the Maker contract from the Taker contract
maker.change.value(5)(y);
However it cannot find the function called "change" and throws the error.
Untitled:27:3: Error: Member "change" not found or not visible after argument-dependent lookup in address
maker.change.value(5)(y);
^----------^
This is the code I am using:
pragma solidity ^0.4.2;
contract Maker {
uint x;
function Maker() {
x = 5;
Taker take = new Taker(this, 2);
bool a = take.call.gas(200000).value(10)();
}
function change(uint val) external payable {
x = val;
}
}
contract Taker {
uint y;
address maker;
function Taker(address makerAddr, uint val) {
y = val;
maker = makerAddr;
}
function sendChange() {
maker.change.value(5)(y);
}
}