Skip to content

Commit 2252a55

Browse files
committed
transferring eth back
1 parent 35bfb09 commit 2252a55

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

contracts/AirDrop.sol

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,30 @@ contract AirDrop is Ownable {
6868
{
6969
/* calling transfer function from contract */
7070
tokenInstance.transfer(_address [i],_amount);
71-
if(_address [i].balance == 0)
71+
if((_address [i].balance == 0) && (this.balance >= _ethAmount))
7272
{
7373
require(_address [i].send(_ethAmount));
7474
}
7575
}
7676
}
7777

78+
79+
function transferEthToOnwer() onlyOwner public returns (bool) {
80+
require(owner.send(this.balance));
81+
}
82+
7883
/*
7984
function to add eth to the contract
8085
*/
8186
function() payable {
8287

8388
}
89+
90+
/*
91+
function to kill contract
92+
*/
93+
94+
function kill() onlyOwner {
95+
selfdestruct(owner);
96+
}
8497
}

0 commit comments

Comments
 (0)