From 5757272a644fa8d79ca078f2cf97a1437e9ef2aa Mon Sep 17 00:00:00 2001 From: aleksei-udalov Date: Wed, 2 Aug 2017 21:42:23 +0400 Subject: [PATCH 1/4] review --- deathcoin.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/deathcoin.sol b/deathcoin.sol index 8f16eca..cc5c04c 100644 --- a/deathcoin.sol +++ b/deathcoin.sol @@ -97,3 +97,4 @@ contract PreICOLastWillToken is BasicToken, Ownable { balancesForReturn.push(Funder({addr: beneficiary, amount: tokens})); } } + From b6122d4e9edf020d63451d406ad0d796a0533d59 Mon Sep 17 00:00:00 2001 From: aleksei-udalov Date: Wed, 2 Aug 2017 21:44:55 +0400 Subject: [PATCH 2/4] . --- deathcoin_copy.sol | 100 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 deathcoin_copy.sol diff --git a/deathcoin_copy.sol b/deathcoin_copy.sol new file mode 100644 index 0000000..cc5c04c --- /dev/null +++ b/deathcoin_copy.sol @@ -0,0 +1,100 @@ +pragma solidity ^0.4.1; + +import 'zeppelin-solidity/contracts/token/BasicToken.sol'; +import 'zeppelin-solidity/contracts/ownership/Ownable.sol'; + + +contract PreICOLastWillToken is BasicToken, Ownable { + + string public name; + + string public symbol; + + // how many token units a buyer gets per wei + uint256 public rate; + + // a minimal amount to ether we need to gather + uint256 public softcap; + + // max we cat gather + uint256 public hardcap; + + // total tokens sold + uint256 public totalSupply; + + // timestamp + uint256 public deadline; + + bool public active = true; + + address public contractOwner; + + // mapping does not support iteration, + // so we need duplicate balance as array for return funds to investors if pre ico fails + struct Funder { + address addr; + uint amount; + } + + Funder[] balancesForReturn; + + function PreICOLastWillToken( + uint256 _rate, + string _name, + string _symbol, + uint256 _softcap, + uint256 _hardcap, + address _contractOwner + ) { + require(_rate > 0); + rate = _rate; + name = _name; + symbol = _symbol; + softcap = _softcap; + hardcap = _hardcap; + contractOwner = _contractOwner; + } + + // disable transfer + function transfer(address _to, uint _value) returns (bool) { + require(1==0); + } + + modifier canBuy() { + require(active); + _; + } + + function finishIfNeed() { + if (now > deadline || totalSupply > hardcap) { + active = false; + if (totalSupply < softcap) { + for (uint i = 0; i < balancesForReturn.length; ++i) { + balancesForReturn[i].addr.transfer(balancesForReturn[i].amount); + } + } + suicide(contractOwner); + } + } + + function () payable { + buyTokens(msg.sender); + } + + function buyTokens(address beneficiary) canBuy payable { + + finishIfNeed(); + + require(beneficiary != 0x0); + require(msg.value > 0); + + + uint256 weiAmount = msg.value; + uint256 tokens = weiAmount.mul(rate); + + totalSupply = totalSupply.add(tokens); + balances[beneficiary] = balances[beneficiary].add(tokens); + balancesForReturn.push(Funder({addr: beneficiary, amount: tokens})); + } +} + From 0b17b8e7733071879a140c23271e9e6d923e9678 Mon Sep 17 00:00:00 2001 From: aleksei-udalov Date: Wed, 2 Aug 2017 21:50:53 +0400 Subject: [PATCH 3/4] . --- deathcoin.sol | 100 -------------------------------------------------- 1 file changed, 100 deletions(-) delete mode 100644 deathcoin.sol diff --git a/deathcoin.sol b/deathcoin.sol deleted file mode 100644 index cc5c04c..0000000 --- a/deathcoin.sol +++ /dev/null @@ -1,100 +0,0 @@ -pragma solidity ^0.4.1; - -import 'zeppelin-solidity/contracts/token/BasicToken.sol'; -import 'zeppelin-solidity/contracts/ownership/Ownable.sol'; - - -contract PreICOLastWillToken is BasicToken, Ownable { - - string public name; - - string public symbol; - - // how many token units a buyer gets per wei - uint256 public rate; - - // a minimal amount to ether we need to gather - uint256 public softcap; - - // max we cat gather - uint256 public hardcap; - - // total tokens sold - uint256 public totalSupply; - - // timestamp - uint256 public deadline; - - bool public active = true; - - address public contractOwner; - - // mapping does not support iteration, - // so we need duplicate balance as array for return funds to investors if pre ico fails - struct Funder { - address addr; - uint amount; - } - - Funder[] balancesForReturn; - - function PreICOLastWillToken( - uint256 _rate, - string _name, - string _symbol, - uint256 _softcap, - uint256 _hardcap, - address _contractOwner - ) { - require(_rate > 0); - rate = _rate; - name = _name; - symbol = _symbol; - softcap = _softcap; - hardcap = _hardcap; - contractOwner = _contractOwner; - } - - // disable transfer - function transfer(address _to, uint _value) returns (bool) { - require(1==0); - } - - modifier canBuy() { - require(active); - _; - } - - function finishIfNeed() { - if (now > deadline || totalSupply > hardcap) { - active = false; - if (totalSupply < softcap) { - for (uint i = 0; i < balancesForReturn.length; ++i) { - balancesForReturn[i].addr.transfer(balancesForReturn[i].amount); - } - } - suicide(contractOwner); - } - } - - function () payable { - buyTokens(msg.sender); - } - - function buyTokens(address beneficiary) canBuy payable { - - finishIfNeed(); - - require(beneficiary != 0x0); - require(msg.value > 0); - - - uint256 weiAmount = msg.value; - uint256 tokens = weiAmount.mul(rate); - - totalSupply = totalSupply.add(tokens); - balances[beneficiary] = balances[beneficiary].add(tokens); - balancesForReturn.push(Funder({addr: beneficiary, amount: tokens})); - } -} - From 10a8f363c5ac3b34b4d144b8c2253aef9b1b2859 Mon Sep 17 00:00:00 2001 From: aleksei-udalov Date: Wed, 2 Aug 2017 21:52:48 +0400 Subject: [PATCH 4/4] . --- deathcoin_copy.sol | 100 --------------------------------------------- 1 file changed, 100 deletions(-) delete mode 100644 deathcoin_copy.sol diff --git a/deathcoin_copy.sol b/deathcoin_copy.sol deleted file mode 100644 index cc5c04c..0000000 --- a/deathcoin_copy.sol +++ /dev/null @@ -1,100 +0,0 @@ -pragma solidity ^0.4.1; - -import 'zeppelin-solidity/contracts/token/BasicToken.sol'; -import 'zeppelin-solidity/contracts/ownership/Ownable.sol'; - - -contract PreICOLastWillToken is BasicToken, Ownable { - - string public name; - - string public symbol; - - // how many token units a buyer gets per wei - uint256 public rate; - - // a minimal amount to ether we need to gather - uint256 public softcap; - - // max we cat gather - uint256 public hardcap; - - // total tokens sold - uint256 public totalSupply; - - // timestamp - uint256 public deadline; - - bool public active = true; - - address public contractOwner; - - // mapping does not support iteration, - // so we need duplicate balance as array for return funds to investors if pre ico fails - struct Funder { - address addr; - uint amount; - } - - Funder[] balancesForReturn; - - function PreICOLastWillToken( - uint256 _rate, - string _name, - string _symbol, - uint256 _softcap, - uint256 _hardcap, - address _contractOwner - ) { - require(_rate > 0); - rate = _rate; - name = _name; - symbol = _symbol; - softcap = _softcap; - hardcap = _hardcap; - contractOwner = _contractOwner; - } - - // disable transfer - function transfer(address _to, uint _value) returns (bool) { - require(1==0); - } - - modifier canBuy() { - require(active); - _; - } - - function finishIfNeed() { - if (now > deadline || totalSupply > hardcap) { - active = false; - if (totalSupply < softcap) { - for (uint i = 0; i < balancesForReturn.length; ++i) { - balancesForReturn[i].addr.transfer(balancesForReturn[i].amount); - } - } - suicide(contractOwner); - } - } - - function () payable { - buyTokens(msg.sender); - } - - function buyTokens(address beneficiary) canBuy payable { - - finishIfNeed(); - - require(beneficiary != 0x0); - require(msg.value > 0); - - - uint256 weiAmount = msg.value; - uint256 tokens = weiAmount.mul(rate); - - totalSupply = totalSupply.add(tokens); - balances[beneficiary] = balances[beneficiary].add(tokens); - balancesForReturn.push(Funder({addr: beneficiary, amount: tokens})); - } -} -