Change onlyOwner -> onlyAuthorized everywhere

This commit is contained in:
Amir Bandeali
2019-09-20 12:45:50 -07:00
parent a70a3c9600
commit 7b81af2cb4
6 changed files with 18 additions and 10 deletions

View File

@@ -54,7 +54,7 @@ contract Staking is
address _zrxVaultAddress
)
external
onlyOwner
onlyAuthorized
{
// DANGER! When performing upgrades, take care to modify this logic
// to prevent accidentally clearing prior state.

View File

@@ -90,7 +90,7 @@ contract StakingProxy is
address _zrxVaultAddress
)
external
onlyOwner
onlyAuthorized
{
_attachStakingContract(
_stakingContract,
@@ -105,7 +105,7 @@ contract StakingProxy is
/// Note that this is callable only by this contract's owner.
function detachStakingContract()
external
onlyOwner
onlyAuthorized
{
stakingContract = NIL_ADDRESS;
emit StakingContractDetachedFromProxy();
@@ -114,7 +114,7 @@ contract StakingProxy is
/// @dev Set read-only mode (state cannot be changed).
function setReadOnlyMode(bool readOnlyMode)
external
onlyOwner
onlyAuthorized
{
if (readOnlyMode) {
stakingContract = readOnlyProxy;

View File

@@ -46,7 +46,7 @@ contract MixinExchangeManager is
/// @param addr Address of exchange contract to add
function addExchangeAddress(address addr)
external
onlyOwner
onlyAuthorized
{
if (validExchanges[addr]) {
LibRichErrors.rrevert(LibStakingRichErrors.ExchangeAddressAlreadyRegisteredError(
@@ -61,7 +61,7 @@ contract MixinExchangeManager is
/// @param addr Address of exchange contract to remove
function removeExchangeAddress(address addr)
external
onlyOwner
onlyAuthorized
{
if (!validExchanges[addr]) {
LibRichErrors.rrevert(LibStakingRichErrors.ExchangeAddressNotRegisteredError(

View File

@@ -21,7 +21,7 @@ pragma experimental ABIEncoderV2;
import "@0x/contracts-asset-proxy/contracts/src/interfaces/IAssetProxy.sol";
import "@0x/contracts-utils/contracts/src/LibRichErrors.sol";
import "@0x/contracts-utils/contracts/src/Ownable.sol";
import "@0x/contracts-utils/contracts/src/Authorizable.sol";
import "./MixinConstants.sol";
import "../interfaces/IZrxVault.sol";
import "../interfaces/IEthVault.sol";
@@ -33,7 +33,7 @@ import "../libs/LibStakingRichErrors.sol";
// solhint-disable max-states-count, no-empty-blocks
contract MixinStorage is
MixinConstants,
Ownable
Authorizable
{
// WETH Asset Proxy
IAssetProxy public wethAssetProxy;
@@ -134,4 +134,12 @@ contract MixinStorage is
// Denominator for cobb douglas alpha factor.
uint32 public cobbDouglasAlphaDenominator;
/// @dev Adds owner as an authorized address.
constructor()
public
Ownable()
{
_addAuthorizedAddress(owner);
}
}

View File

@@ -56,7 +56,7 @@ contract MixinParams is
address _zrxVaultAddress
)
external
onlyOwner
onlyAuthorized
{
_setParams(
_epochDurationInSeconds,

View File

@@ -84,7 +84,7 @@ contract MixinVaultCore is
/// @param _stakingProxyAddress Address of Staking proxy contract.
function setStakingProxy(address payable _stakingProxyAddress)
external
onlyOwner
onlyAuthorized
{
stakingProxyAddress = _stakingProxyAddress;
emit StakingProxySet(_stakingProxyAddress);