I need to call a function from another contract (the function take a parameter and need 1 Ether to execute) like this:
pragma solidity ^0.4.4;
contract ContractONE {
uint public i;
function register(uint _i) payable{
if(msg.value > 1 ether){
i = _i;
} else {revert();}
}
...
}
............................................
pragma solidity ^0.4.4;
import "./ContractONE.sol";
Contract contractTwo {
address addofContract1;
uint i ;
....
function changeNum(uint _i) payable{
i = _i;
ContractONE c = ContractONE(addofContract1);
//// problem here:
c.register(_i); //will revert, cause it does not send ether!!
////
}
}
the second Contract has already some Ether in it.
is there a method to do that? maybe like c.register(_i).transfer(amount)!
or a trick with addofContract1.call(.....,.....)