Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
contract with check
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Yurtaev committed Apr 12, 2016
1 parent 33a6ac8 commit 04d148e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions contract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ contract WavesPresale {
function newSale(bytes16 txidHash, uint amount, uint timestamp) {
if (msg.sender != owner) return;

sales[txidHash] = Sale({
amount: amount,
date: timestamp
});
numberOfSales += 1;
totalTokens += amount;
if sales[txidHash].date == 0 {
sales[txidHash] = Sale({
amount: amount,
date: timestamp
});
numberOfSales += 1;
totalTokens += amount;
}
}

function getSaleDate(bytes16 txidHash) constant returns (uint, uint) {
Expand Down

0 comments on commit 04d148e

Please sign in to comment.