-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsendEther.sol
More file actions
37 lines (26 loc) · 932 Bytes
/
Copy pathsendEther.sol
File metadata and controls
37 lines (26 loc) · 932 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
35
36
37
//SPDX-License-Identifier:MIT
pragma solidity 0.8.0;
contract sendEth{
// address payable public getter = payable(0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB);
receive() external payable{}
function checkBalance() public view returns(uint){
return address(this).balance;
}
function SEND(address payable getter) public payable{
bool sent= getter.send(msg.value);
require(sent,"Transaction is failed!!");
}
function TRANSFER(address payable getter) public{
getter.transfer(3000000000000000000);
}
function CALL(address payable getter) public{
(bool sent,) = getter.call{value:1000000000000000000}("");
require(sent,"Transaction is failed!!");
}
}
contract GetEth{
receive() external payable{}
function checkBalance() public view returns(uint){
return address(this).balance;
}
}