Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 11 additions & 49 deletions contracts/OysterPearl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ contract OysterPearl {
// This notifies clients about a claim being made on a buried address
event Claim(address indexed _target, address indexed _payout, address indexed _fee);

// This notifies clients on a change of directorship
event TransferDirector(address indexed _newDirector);

/**
* Constructor function
*
Expand All @@ -47,7 +50,7 @@ contract OysterPearl {
function OysterPearl() public payable {
director = msg.sender;
name = "Oyster Pearl";
symbol = "PRL";
symbol = "PRL2";
decimals = 18;
saleClosed = true;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no reason for leaving this in if there is no more sale functionality?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we decide to remove this we should also remove line 128 and 13.

directorLock = false;
Expand Down Expand Up @@ -136,6 +139,11 @@ contract OysterPearl {
*/
function amendClaim(uint8 claimAmountSet, uint8 payAmountSet, uint8 feeAmountSet, uint8 accuracy) public onlyDirector returns (bool success) {
require(claimAmountSet == (payAmountSet + feeAmountSet));
require(payAmountSet < claimAmountSet);
require(feeAmountSet < claimAmountSet);
require(claimAmountSet > 0);
require(payAmountSet > 0);
require(feeAmountSet > 0);

claimAmount = claimAmountSet * 10 ** (uint256(decimals) - accuracy);
payAmount = payAmountSet * 10 ** (uint256(decimals) - accuracy);
Expand All @@ -161,30 +169,6 @@ contract OysterPearl {
return true;
}

/**
* Director can close the crowdsale
*/
function closeSale() public onlyDirector returns (bool success) {
// The sale must be currently open
require(!saleClosed);

// Lock the crowdsale
saleClosed = true;
return true;
}

/**
* Director can open the crowdsale
*/
function openSale() public onlyDirector returns (bool success) {
// The sale must be currently closed
require(saleClosed);

// Unlock the crowdsale
saleClosed = false;
return true;
}

/**
* Oyster Protocol Function
* More information at https://oyster.ws/OysterWhitepaper.pdf
Expand Down Expand Up @@ -273,29 +257,7 @@ contract OysterPearl {
* Crowdsale function
*/
function () public payable {
// Check if crowdsale is still active
require(!saleClosed);

// Minimum amount is 1 finney
require(msg.value >= 1 finney);

// Price is 1 ETH = 5000 PRL
uint256 amount = msg.value * 5000;

// totalSupply limit is 500 million PRL
require(totalSupply + amount <= (500000000 * 10 ** uint256(decimals)));

// Increases the total supply
totalSupply += amount;

// Adds the amount to the balance
balances[msg.sender] += amount;

// Track ETH amount raised
funds += msg.value;

// Execute an event reflecting the change
Transfer(this, msg.sender, amount);
return false;
}

/**
Expand Down Expand Up @@ -448,4 +410,4 @@ contract OysterPearl {
Burn(_from, _value);
return true;
}
}
}