Remove MixinOwnable

This commit is contained in:
Amir Bandeali
2019-08-26 14:20:02 -07:00
parent df039f05c2
commit 9fb933fd06
19 changed files with 18 additions and 67 deletions

View File

@@ -38,7 +38,6 @@ contract Staking is
MixinDeploymentConstants,
MixinConstants,
MixinStorage,
MixinOwnable,
MixinExchangeManager,
MixinScheduler,
MixinStakingPoolRewardVault,

View File

@@ -20,25 +20,21 @@ pragma solidity ^0.5.9;
import "./immutable/MixinStorage.sol";
import "./interfaces/IStakingProxy.sol";
import "./sys/MixinOwnable.sol";
contract StakingProxy is
IStakingProxy,
MixinDeploymentConstants,
MixinConstants,
MixinStorage,
MixinOwnable
MixinStorage
{
/// @dev Constructor.
/// @param _stakingContract Staking contract to delegate calls to.
constructor(address _stakingContract)
public
{
owner = msg.sender;
stakingContract = _stakingContract;
}
MixinStorage(_stakingContract)
{}
/// @dev Delegates calls to the staking contract, if it is set.
// solhint-disable no-complex-fallback

View File

@@ -47,7 +47,6 @@ contract MixinExchangeFees is
MixinDeploymentConstants,
MixinConstants,
MixinStorage,
MixinOwnable,
MixinExchangeManager,
MixinScheduler,
MixinStakingPoolRewardVault,

View File

@@ -23,7 +23,6 @@ import "../libs/LibStakingRichErrors.sol";
import "../interfaces/IStakingEvents.sol";
import "../immutable/MixinConstants.sol";
import "../immutable/MixinStorage.sol";
import "../sys/MixinOwnable.sol";
/// @dev This mixin contains logic for managing exchanges.
@@ -34,8 +33,7 @@ contract MixinExchangeManager is
IStakingEvents,
MixinDeploymentConstants,
MixinConstants,
MixinStorage,
MixinOwnable
MixinStorage
{
/// @dev Asserts that the call is coming from a valid exchange.

View File

@@ -25,8 +25,6 @@ contract MixinConstants is
MixinDeploymentConstants
{
uint64 constant internal MAX_UINT_64 = 0xFFFFFFFFFFFFFFFF;
uint256 constant internal TOKEN_MULTIPLIER = 1000000000000000000; // 10**18
// The upper 16 bytes represent the pool id, so this would be pool id 1. See MixinStakinPool for more information.

View File

@@ -18,6 +18,7 @@
pragma solidity ^0.5.9;
import "@0x/contracts-utils/contracts/src/Ownable.sol";
import "../interfaces/IZrxVault.sol";
import "../interfaces/IStakingPoolRewardVault.sol";
import "./MixinConstants.sol";
@@ -27,11 +28,17 @@ import "../interfaces/IStructs.sol";
// solhint-disable max-states-count
contract MixinStorage is
MixinDeploymentConstants,
MixinConstants
MixinConstants,
Ownable
{
// address of owner
address internal owner;
/// @dev Constructor asserts that all storage variables are in expected slots.
constructor(address _stakingContract)
public
Ownable()
{
stakingContract = _stakingContract;
}
// address of staking contract
address internal stakingContract;

View File

@@ -67,12 +67,6 @@ interface IStakingEvents {
uint256 finalContractBalance
);
/// @dev Emitted by MixinOwnable when the contract's ownership changes
/// @param newOwner New owner of the contract
event OwnershipTransferred(
address newOwner
);
/// @dev Emitted by MixinStakingPool when a new pool is created.
/// @param poolId Unique id generated for pool.
/// @param operatorAddress Address of creator/operator of pool.

View File

@@ -19,7 +19,7 @@
pragma solidity ^0.5.9;
import "@0x/contracts-utils/contracts/src/LibRichErrors.sol";
import "@0x/contracts-utils/contracts/src/LibSafeMathRihErrors.sol";
import "@0x/contracts-utils/contracts/src/LibSafeMathRichErrors.sol";
library LibSafeDowncast {

View File

@@ -43,7 +43,6 @@ contract MixinDelegatedStake is
MixinDeploymentConstants,
MixinConstants,
MixinStorage,
MixinOwnable,
MixinScheduler,
MixinStakingPoolRewardVault,
MixinZrxVault,

View File

@@ -82,7 +82,6 @@ contract MixinStake is
MixinDeploymentConstants,
MixinConstants,
MixinStorage,
MixinOwnable,
MixinScheduler,
MixinStakingPoolRewardVault,
MixinZrxVault,

View File

@@ -20,17 +20,12 @@ pragma solidity ^0.5.9;
import "../interfaces/IZrxVault.sol";
import "../immutable/MixinStorage.sol";
import "../sys/MixinOwnable.sol";
/// @dev This mixin contains logic for managing and interfacing with the Zrx Vault.
/// (see vaults/ZrxVault.sol).
contract MixinZrxVault is
IStakingEvents,
MixinDeploymentConstants,
MixinConstants,
MixinStorage,
MixinOwnable
MixinStorage
{
/// @dev Set the Zrx Vault.

View File

@@ -59,7 +59,6 @@ contract MixinStakingPool is
MixinDeploymentConstants,
MixinConstants,
MixinStorage,
MixinOwnable,
MixinStakingPoolRewardVault
{

View File

@@ -21,7 +21,6 @@ pragma solidity ^0.5.9;
import "../interfaces/IStakingEvents.sol";
import "../interfaces/IStakingPoolRewardVault.sol";
import "../immutable/MixinStorage.sol";
import "../sys/MixinOwnable.sol";
/// @dev This mixin contains logic for interfacing with the Staking Pool Reward Vault (vaults/StakingPoolRewardVault.sol)
@@ -31,8 +30,7 @@ contract MixinStakingPoolRewardVault is
IStakingEvents,
MixinDeploymentConstants,
MixinConstants,
MixinStorage,
MixinOwnable
MixinStorage
{
/// @dev Sets the address of the reward vault.

View File

@@ -65,7 +65,6 @@ contract MixinStakingPoolRewards is
MixinDeploymentConstants,
MixinConstants,
MixinStorage,
MixinOwnable,
MixinScheduler,
MixinStakingPoolRewardVault,
MixinStakingPool,

View File

@@ -1,25 +0,0 @@
pragma solidity ^0.5.9;
import "@0x/contracts-utils/contracts/src/Ownable.sol";
import "../interfaces/IStakingEvents.sol";
import "../immutable/MixinStorage.sol";
/// @dev This mixin contains logic for ownable contracts.
/// Note that unlike the standardized `ownable` contract,
/// there is no state declared here. It is instead located
/// in `immutable/MixinStorage.sol` and its value is set
/// by the delegating proxy (StakingProxy.sol)
contract MixinOwnable is
Ownable,
IStakingEvents,
MixinDeploymentConstants,
MixinConstants,
MixinStorage
{
// solhint-disable no-empty-blocks
constructor()
public
{}
}

View File

@@ -36,7 +36,7 @@
"compile:truffle": "truffle compile"
},
"config": {
"abis": "./generated-artifacts/@(IStaking|IStakingEvents|IStakingPoolRewardVault|IStakingProxy|IStructs|IVaultCore|IWallet|IZrxVault|LibEIP712Hash|LibFeeMath|LibFeeMathTest|LibRewardMath|LibSafeDowncast|LibSafeMath64|LibSafeMath96|LibSignatureValidator|LibStakingRichErrors|MixinConstants|MixinDelegatedStake|MixinDeploymentConstants|MixinExchangeFees|MixinExchangeManager|MixinOwnable|MixinScheduler|MixinStake|MixinStakeBalances|MixinStakingPool|MixinStakingPoolRewardVault|MixinStakingPoolRewards|MixinStorage|MixinTimeLockedStake|MixinVaultCore|MixinZrxVault|Staking|StakingPoolRewardVault|StakingProxy|ZrxVault).json",
"abis": "./generated-artifacts/@(IStaking|IStakingEvents|IStakingPoolRewardVault|IStakingProxy|IStructs|IVaultCore|IWallet|IZrxVault|LibEIP712Hash|LibFeeMath|LibFeeMathTest|LibRewardMath|LibSafeDowncast|LibSafeMath64|LibSafeMath96|LibSignatureValidator|LibStakingRichErrors|MixinConstants|MixinDelegatedStake|MixinDeploymentConstants|MixinExchangeFees|MixinExchangeManager|MixinScheduler|MixinStake|MixinStakeBalances|MixinStakingPool|MixinStakingPoolRewardVault|MixinStakingPoolRewards|MixinStorage|MixinTimeLockedStake|MixinVaultCore|MixinZrxVault|Staking|StakingPoolRewardVault|StakingProxy|ZrxVault).json",
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
},
"repository": {

View File

@@ -27,7 +27,6 @@ import * as MixinDelegatedStake from '../generated-artifacts/MixinDelegatedStake
import * as MixinDeploymentConstants from '../generated-artifacts/MixinDeploymentConstants.json';
import * as MixinExchangeFees from '../generated-artifacts/MixinExchangeFees.json';
import * as MixinExchangeManager from '../generated-artifacts/MixinExchangeManager.json';
import * as MixinOwnable from '../generated-artifacts/MixinOwnable.json';
import * as MixinScheduler from '../generated-artifacts/MixinScheduler.json';
import * as MixinStake from '../generated-artifacts/MixinStake.json';
import * as MixinStakeBalances from '../generated-artifacts/MixinStakeBalances.json';
@@ -74,7 +73,6 @@ export const artifacts = {
MixinStakingPool: MixinStakingPool as ContractArtifact,
MixinStakingPoolRewardVault: MixinStakingPoolRewardVault as ContractArtifact,
MixinStakingPoolRewards: MixinStakingPoolRewards as ContractArtifact,
MixinOwnable: MixinOwnable as ContractArtifact,
MixinScheduler: MixinScheduler as ContractArtifact,
MixinVaultCore: MixinVaultCore as ContractArtifact,
StakingPoolRewardVault: StakingPoolRewardVault as ContractArtifact,

View File

@@ -25,7 +25,6 @@ export * from '../generated-wrappers/mixin_delegated_stake';
export * from '../generated-wrappers/mixin_deployment_constants';
export * from '../generated-wrappers/mixin_exchange_fees';
export * from '../generated-wrappers/mixin_exchange_manager';
export * from '../generated-wrappers/mixin_ownable';
export * from '../generated-wrappers/mixin_scheduler';
export * from '../generated-wrappers/mixin_stake';
export * from '../generated-wrappers/mixin_stake_balances';

View File

@@ -25,7 +25,6 @@
"generated-artifacts/MixinDeploymentConstants.json",
"generated-artifacts/MixinExchangeFees.json",
"generated-artifacts/MixinExchangeManager.json",
"generated-artifacts/MixinOwnable.json",
"generated-artifacts/MixinScheduler.json",
"generated-artifacts/MixinStake.json",
"generated-artifacts/MixinStakeBalances.json",