Merge pull request #2256 from 0xProject/feat/staking/immutable
Separate immutable contracts, only inherit as needed
This commit is contained in:
@@ -22,13 +22,15 @@ pragma experimental ABIEncoderV2;
|
||||
import "./libs/LibProxy.sol";
|
||||
import "./libs/LibSafeDowncast.sol";
|
||||
import "./immutable/MixinStorage.sol";
|
||||
import "./immutable/MixinConstants.sol";
|
||||
import "./interfaces/IStorageInit.sol";
|
||||
import "./interfaces/IStakingProxy.sol";
|
||||
|
||||
|
||||
contract StakingProxy is
|
||||
IStakingProxy,
|
||||
MixinStorage
|
||||
MixinStorage,
|
||||
MixinConstants
|
||||
{
|
||||
using LibProxy for address;
|
||||
using LibSafeDowncast for uint256;
|
||||
|
@@ -18,28 +18,15 @@
|
||||
|
||||
pragma solidity ^0.5.9;
|
||||
|
||||
import "./MixinDeploymentConstants.sol";
|
||||
|
||||
contract MixinConstants {
|
||||
|
||||
contract MixinConstants is
|
||||
MixinDeploymentConstants
|
||||
{
|
||||
// 100% in parts-per-million.
|
||||
uint32 constant internal PPM_DENOMINATOR = 10**6;
|
||||
|
||||
// The upper 16 bytes represent the pool id, so this would be pool id 1. See MixinStakinPool for more information.
|
||||
bytes32 constant internal INITIAL_POOL_ID = 0x0000000000000000000000000000000100000000000000000000000000000000;
|
||||
|
||||
// The upper 16 bytes represent the pool id, so this would be an increment of 1. See MixinStakinPool for more information.
|
||||
uint256 constant internal POOL_ID_INCREMENT_AMOUNT = 0x0000000000000000000000000000000100000000000000000000000000000000;
|
||||
|
||||
bytes32 constant internal NIL_POOL_ID = 0x0000000000000000000000000000000000000000000000000000000000000000;
|
||||
|
||||
address constant internal NIL_ADDRESS = 0x0000000000000000000000000000000000000000;
|
||||
|
||||
bytes32 constant internal UNKNOWN_STAKING_POOL_ID = 0x0000000000000000000000000000000000000000000000000000000000000000;
|
||||
|
||||
uint64 constant internal INITIAL_EPOCH = 0;
|
||||
|
||||
uint256 constant internal MIN_TOKEN_VALUE = 10**18;
|
||||
}
|
||||
|
@@ -29,7 +29,6 @@ import "../libs/LibStakingRichErrors.sol";
|
||||
|
||||
// solhint-disable max-states-count, no-empty-blocks
|
||||
contract MixinStorage is
|
||||
MixinConstants,
|
||||
Authorizable
|
||||
{
|
||||
// address of staking contract
|
||||
|
@@ -21,11 +21,13 @@ pragma experimental ABIEncoderV2;
|
||||
|
||||
import "@0x/contracts-utils/contracts/src/LibSafeMath.sol";
|
||||
import "../interfaces/IStructs.sol";
|
||||
import "../immutable/MixinDeploymentConstants.sol";
|
||||
import "./MixinStakeStorage.sol";
|
||||
|
||||
|
||||
contract MixinStakeBalances is
|
||||
MixinStakeStorage
|
||||
MixinStakeStorage,
|
||||
MixinDeploymentConstants
|
||||
{
|
||||
using LibSafeMath for uint256;
|
||||
|
||||
|
@@ -22,10 +22,12 @@ pragma experimental ABIEncoderV2;
|
||||
import "@0x/contracts-utils/contracts/src/LibFractions.sol";
|
||||
import "@0x/contracts-utils/contracts/src/LibSafeMath.sol";
|
||||
import "../stake/MixinStakeBalances.sol";
|
||||
import "../immutable/MixinConstants.sol";
|
||||
|
||||
|
||||
contract MixinCumulativeRewards is
|
||||
MixinStakeBalances
|
||||
MixinStakeBalances,
|
||||
MixinConstants
|
||||
{
|
||||
using LibSafeMath for uint256;
|
||||
|
||||
|
@@ -20,13 +20,15 @@ pragma solidity ^0.5.9;
|
||||
|
||||
import "@0x/contracts-utils/contracts/src/LibRichErrors.sol";
|
||||
import "../immutable/MixinStorage.sol";
|
||||
import "../immutable/MixinConstants.sol";
|
||||
import "../interfaces/IStakingEvents.sol";
|
||||
import "../libs/LibStakingRichErrors.sol";
|
||||
|
||||
|
||||
contract MixinParams is
|
||||
IStakingEvents,
|
||||
MixinStorage
|
||||
MixinStorage,
|
||||
MixinConstants
|
||||
{
|
||||
/// @dev Set all configurable parameters at once.
|
||||
/// @param _epochDurationInSeconds Minimum seconds between epochs.
|
||||
|
Reference in New Issue
Block a user