From b4724fd0bcfe3e04eb21bc3b416e6e350783d5a3 Mon Sep 17 00:00:00 2001 From: Roman Storm Date: Sun, 12 Nov 2017 21:32:36 -0800 Subject: [PATCH] change Ownable to Claimable from bokky's audit --- README.md | 8 +++++--- contracts/PresaleOracles.sol | 4 ++-- flat/PresaleOracles_flat.sol | 31 ++++++++++++++++++++++++++++++- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b83fcb2..7530196 100644 --- a/README.md +++ b/README.md @@ -123,12 +123,14 @@ it's totally ok because the transaction is still in the queue and hasn't been mi ``` # Testnet deployment -## Latest Contract deployment -https://kovan.etherscan.io/address/0x6f3f79941f89e03d4af9bdb8be0623dc24f2bef0 - +## Latest Contract deployments +With Claimable: +https://kovan.etherscan.io/address/0x985dbb1c5dda22ff9d529abc1c3539bc525943f4#code ## Previous deployments with old source code: +https://kovan.etherscan.io/address/0x6f3f79941f89e03d4af9bdb8be0623dc24f2bef0 + Contract Deployment: https://kovan.etherscan.io/address/0xb9b49e21e77d2d89a9e4c7ef4f684ad2a4e99663#code Called Initialize by Owner with params: diff --git a/contracts/PresaleOracles.sol b/contracts/PresaleOracles.sol index 666fa42..f00feff 100644 --- a/contracts/PresaleOracles.sol +++ b/contracts/PresaleOracles.sol @@ -1,10 +1,10 @@ import "zeppelin-solidity/contracts/math/SafeMath.sol"; import "zeppelin-solidity/contracts/token/BasicToken.sol"; -import "zeppelin-solidity/contracts/ownership/Ownable.sol"; +import "zeppelin-solidity/contracts/ownership/Claimable.sol"; pragma solidity ^0.4.17; -contract PresaleOracles is Ownable { +contract PresaleOracles is Claimable { /* * PresaleOracles * Simple Presale contract diff --git a/flat/PresaleOracles_flat.sol b/flat/PresaleOracles_flat.sol index 99171e6..a49d20b 100644 --- a/flat/PresaleOracles_flat.sol +++ b/flat/PresaleOracles_flat.sol @@ -63,6 +63,35 @@ contract Ownable { } +contract Claimable is Ownable { + address public pendingOwner; + + /** + * @dev Modifier throws if called by any account other than the pendingOwner. + */ + modifier onlyPendingOwner() { + require(msg.sender == pendingOwner); + _; + } + + /** + * @dev Allows the current owner to set the pendingOwner address. + * @param newOwner The address to transfer ownership to. + */ + function transferOwnership(address newOwner) onlyOwner public { + pendingOwner = newOwner; + } + + /** + * @dev Allows the pendingOwner address to finalize the transfer. + */ + function claimOwnership() onlyPendingOwner public { + OwnershipTransferred(owner, pendingOwner); + owner = pendingOwner; + pendingOwner = 0x0; + } +} + contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); @@ -101,7 +130,7 @@ contract BasicToken is ERC20Basic { } -contract PresaleOracles is Ownable { +contract PresaleOracles is Claimable { /* * PresaleOracles * Simple Presale contract