-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathetherTransfer.sol
More file actions
34 lines (26 loc) · 775 Bytes
/
etherTransfer.sol
File metadata and controls
34 lines (26 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
pragma solidity ^0.4.9;
contract EtherTransferTo {
function () public payable {
}
function getBalance() public returns (uint) {
return address(this).balance;
}
}
contract EtherTransferFrom {
EtherTransferTo private _instance;
function EtherTransferFrom() public {
// _instance = EtherTransferTo(address(this));
_instance = new EtherTransferTo();
}
function getBalance() public returns (uint) {
return address(this).balance;
}
function getBalanceOfInstance() public returns (uint) {
//return address(_instance).balance;
return _instance.getBalance();
}
function () public payable {
//msg.sender.send(msg.value);
address(_instance).send(msg.value);
}
}