Skip to content

Commit

Permalink
contracts: reorganise contracts and update headers to indicate which …
Browse files Browse the repository at this point in the history
…chain they belong on - fixes #2
  • Loading branch information
benjaminbollen committed Nov 24, 2017
1 parent d7b8b67 commit 087e91a
Show file tree
Hide file tree
Showing 25 changed files with 53 additions and 633 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// contracts/BrandedToken.sol
// Utility chain: BrandedToken
//
// http://www.simpletoken.org/
//
// ----------------------------------------------------------------------------

import "../SafeMath.sol";
import "./SafeMath.sol";

// utility chain contracts
import "./EIP20Token.sol";
import "./UtilityTokenAbstract.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/Core.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// contracts/Core.sol
// Common: Core
//
// http://www.simpletoken.org/
//
Expand Down
2 changes: 1 addition & 1 deletion contracts/CoreInterface.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// contracts/CoreInterface.sol
// Common: CoreInterface
//
// http://www.simpletoken.org/
//
Expand Down
2 changes: 1 addition & 1 deletion contracts/EIP20Interface.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// Standard EIP20 Interface
// Common: Standard EIP20 Interface
//
// http://www.simpletoken.org/
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// EIP20 Token Implementation
// Utility chain: EIP20 Token Implementation
//
// http://www.simpletoken.org/
//
// ----------------------------------------------------------------------------

import "../EIP20Interface.sol";
import "../SafeMath.sol";
import "./EIP20Interface.sol";
import "./SafeMath.sol";

/**
@title EIP20Token
Expand Down
2 changes: 1 addition & 1 deletion contracts/Hasher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// contracts/Hasher.sol
// Common: Hasher
//
// http://www.simpletoken.org/
//
Expand Down
22 changes: 0 additions & 22 deletions contracts/OpenSTInterface.sol

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// contracts/utilityChain/OpenSTUtility.sol
// Utility chain: OpenSTUtility
//
// http://www.simpletoken.org/
//
// ----------------------------------------------------------------------------

import "../SafeMath.sol";
import "../Hasher.sol";
import "../OpsManaged.sol";
import "../CoreInterface.sol";
import "./SafeMath.sol";
import "./Hasher.sol";
import "./OpsManaged.sol";
import "./CoreInterface.sol";

// utility chain contracts
import "./STPrime.sol";
import "./STPrimeConfig.sol";
import "./BrandedToken.sol";
Expand Down Expand Up @@ -73,6 +75,7 @@ contract OpenSTUtility is Hasher, OpsManaged {
*/
string public constant STPRIME_SYMBOL = "STP";
string public constant STPRIME_NAME = "SimpleTokenPrime";
uint256 public constant STPRIME_CONVERSION_RATE = 1;
uint8 public constant TOKEN_DECIMALS = 18;
uint256 public constant DECIMALSFACTOR = 10**uint256(TOKEN_DECIMALS);
// ~2 weeks, assuming ~15s per block
Expand Down Expand Up @@ -141,7 +144,7 @@ contract OpenSTUtility is Hasher, OpsManaged {
_chainIdValue,
_chainIdUtility,
address(this),
1);
STPRIME_CONVERSION_RATE);
simpleTokenPrime = new STPrime(
address(this),
uuidSTPrime);
Expand Down Expand Up @@ -343,7 +346,7 @@ contract OpenSTUtility is Hasher, OpsManaged {
unlockHeight: unlockHeight
});

StakingIntentConfirmed(_uuid, _stakingIntentHash, _staker, _beneficiary, _amountST,
StakingIntentConfirmed(_uuid, stakingIntentHash, _staker, _beneficiary, _amountST,
_amountUT, unlockHeight);

return unlockHeight;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// OpenST protocol interface - Utility chain
// Utility chain: OpenSTUtilityInterface
//
// http://www.simpletoken.org/
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// OpenST - Value staking contract for OpenST Platform v0.9 on value chain
// Value chain: OpenSTValue
//
// http://www.simpletoken.org/
//
// ----------------------------------------------------------------------------

import "../SafeMath.sol";
import "../Hasher.sol";
import "../OpsManaged.sol";
import "../EIP20Interface.sol";
import "../CoreInterface.sol";
import "./SafeMath.sol";
import "./Hasher.sol";
import "./OpsManaged.sol";
import "./EIP20Interface.sol";
import "./CoreInterface.sol";

// value chain contracts
import "./SimpleStake.sol";

/// @title OpenSTValue - value staking contract for OpenST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// OpenST protocol interface - Value chain
// Value chain: OpenST protocol interface
//
// http://www.simpletoken.org/
//
Expand Down
2 changes: 1 addition & 1 deletion contracts/OpsManaged.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// Admin / Ops Permission Model
// Common: Admin / Ops Permission Model
//
// http://www.simpletoken.org/
//
Expand Down
2 changes: 1 addition & 1 deletion contracts/Owned.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// Basic Ownership Implementation
// Common: Basic Ownership Implementation
//
// http://www.simpletoken.org/
//
Expand Down
2 changes: 1 addition & 1 deletion contracts/ProtocolVersioned.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// contracts/ProtocolVersioned.sol
// Common: ProtocolVersioned.sol
//
// http://www.simpletoken.org/
//
Expand Down
6 changes: 3 additions & 3 deletions contracts/Registrar.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// Registrar
// Common: Registrar
//
// http://www.simpletoken.org/
//
// ----------------------------------------------------------------------------

import "./OpsManaged.sol";
import "./valueChain/OpenSTValueInterface.sol";
import "./utilityChain/OpenSTUtilityInterface.sol";
import "./OpenSTValueInterface.sol";
import "./OpenSTUtilityInterface.sol";

/// @title Registrar - registers for utility tokens
contract Registrar is OpsManaged {
Expand Down
6 changes: 4 additions & 2 deletions contracts/utilityChain/STPrime.sol → contracts/STPrime.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// contracts/STPrime.sol
// Utility chain: STPrime
//
// http://www.simpletoken.org/
//
Expand All @@ -26,7 +26,9 @@ pragma solidity ^0.4.17;
/// The gasprice on utility chains is set in [ST'-Wei/gas] (like Ether pays for gas
/// on Ethereum mainnet) when sending a transaction on the open utility chain.

import "../SafeMath.sol";
import "./SafeMath.sol";

// utility chain contracts
import "./UtilityTokenAbstract.sol";
import "./STPrimeConfig.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// contracts/utilityChain/STPrimeConfig.sol
// Utility chain: STPrimeConfig
//
// http://www.simpletoken.org/
//
Expand Down
2 changes: 1 addition & 1 deletion contracts/SafeMath.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// SafeMath Library Implementation
// Common: SafeMath Library Implementation
//
// http://www.simpletoken.org/
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// contracts/SimpleStake
// ValueChain: SimpleStake
//
// http://www.simpletoken.org/
//
// ----------------------------------------------------------------------------

import "../EIP20Interface.sol";
import "../SafeMath.sol";
import "../ProtocolVersioned.sol";
import "./EIP20Interface.sol";
import "./SafeMath.sol";
import "./ProtocolVersioned.sol";

/// @title SimpleStake - stakes the value of an EIP20 token on Ethereum
/// for a utility token on the OpenST platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// contracts/UtilityToken.sol
// Utility chain: UtilityTokenAbstract
//
// http://www.simpletoken.org/
//
// ----------------------------------------------------------------------------

import "../SafeMath.sol";
import "../ProtocolVersioned.sol";
import "./SafeMath.sol";
import "./ProtocolVersioned.sol";

// utility chain contracts
import "./UtilityTokenInterface.sol";

/// @title UtilityToken abstract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pragma solidity ^0.4.17;
// limitations under the License.
//
// ----------------------------------------------------------------------------
// contracts/utilityChain/UtilityTokenInterface.sol
// Utility chain: UtilityTokenInterface
//
// http://www.simpletoken.org/
//
Expand Down
Loading

0 comments on commit 087e91a

Please sign in to comment.