From 1c9576a48daca477bb1ece4691bd305179e10c4f Mon Sep 17 00:00:00 2001 From: NYMD Date: Tue, 30 Oct 2018 10:19:53 -0700 Subject: [PATCH 1/3] Removing crowdsale functionality, changing token to PRL2 --- contracts/OysterPearl.sol | 52 +++------------------------------------ 1 file changed, 3 insertions(+), 49 deletions(-) diff --git a/contracts/OysterPearl.sol b/contracts/OysterPearl.sol index c714f3e..d203868 100644 --- a/contracts/OysterPearl.sol +++ b/contracts/OysterPearl.sol @@ -47,7 +47,7 @@ contract OysterPearl { function OysterPearl() public payable { director = msg.sender; name = "Oyster Pearl"; - symbol = "PRL"; + symbol = "PRL2"; decimals = 18; saleClosed = true; directorLock = false; @@ -161,30 +161,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 @@ -273,29 +249,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; } /** @@ -448,4 +402,4 @@ contract OysterPearl { Burn(_from, _value); return true; } -} \ No newline at end of file +} From 745de2c749ec9cb7b9ea29c61cee17c9235944be Mon Sep 17 00:00:00 2001 From: NYMD Date: Tue, 30 Oct 2018 11:21:02 -0700 Subject: [PATCH 2/3] Added event for transferDirector --- contracts/OysterPearl.sol | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contracts/OysterPearl.sol b/contracts/OysterPearl.sol index d203868..99f468a 100644 --- a/contracts/OysterPearl.sol +++ b/contracts/OysterPearl.sol @@ -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 * From 2b3e476f1031d455f9dfdb23f4ac6b96d32121a4 Mon Sep 17 00:00:00 2001 From: Connor H Date: Fri, 9 Nov 2018 18:15:57 -0500 Subject: [PATCH 3/3] Added overflow checks --- contracts/OysterPearl.sol | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contracts/OysterPearl.sol b/contracts/OysterPearl.sol index c714f3e..4fc8ab3 100644 --- a/contracts/OysterPearl.sol +++ b/contracts/OysterPearl.sol @@ -136,6 +136,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); @@ -448,4 +453,4 @@ contract OysterPearl { Burn(_from, _value); return true; } -} \ No newline at end of file +}