ETH Price: $3,195.34 (+1.01%)

Contract

0x66A7EcbfE1cF6931211F011e91B6EFfE2a94606f

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
0x60806040257375142022-09-21 17:13:20662 days ago1663780400IN
 Create: Authority
0 ETH0.000448890.1

Parent Transaction Hash Block From To Value
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Authority

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 4 : Authority.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.0;

import "./interfaces/IAuthority.sol";
import "./libraries/CustomErrors.sol";
import "./libraries/AccessControl.sol";

/**
 *  @title Contract used as the source of truth for all protocol authority and access control, based off of OlympusDao Access Control
 */
contract Authority is IAuthority, AccessControl {
	/* ========== STATE VARIABLES ========== */

	address public override governor;

	mapping(address => bool) public override guardian;

	address public override manager;

	address public newGovernor;

	address public newManager;

	/* ========== Constructor ========== */

	constructor(
		address _governor,
		address _guardian,
		address _manager
	) AccessControl(IAuthority(address(this))) {
		if (_governor == address(0) || _guardian == address(0) || _manager == address(0)) {
			revert CustomErrors.InvalidAddress();
		}
		governor = _governor;
		emit GovernorPushed(address(0), _governor);
		emit GovernorPulled(address(0), _governor);
		guardian[_guardian] = true;
		emit GuardianPushed(_guardian);
		manager = _manager;
		emit ManagerPushed(address(0), _manager);
		emit ManagerPulled(address(0), _manager);
	}

	/* ========== GOV ONLY ========== */

	function pushGovernor(address _newGovernor) external {
		_onlyGovernor();
		if (_newGovernor == address(0)) {
			revert CustomErrors.InvalidAddress();
		}
		newGovernor = _newGovernor;
		emit GovernorPushed(governor, newGovernor);
	}

	function pushGuardian(address _newGuardian) external {
		_onlyGovernor();
		if (_newGuardian == address(0)) {
			revert CustomErrors.InvalidAddress();
		}
		guardian[_newGuardian] = true;
		emit GuardianPushed(_newGuardian);
	}

	function pushManager(address _newManager) external {
		_onlyGovernor();
		if (_newManager == address(0)) {
			revert CustomErrors.InvalidAddress();
		}
		newManager = _newManager;
		emit ManagerPushed(manager, newManager);
	}

	function pullGovernor() external {
		require(msg.sender == newGovernor, "!newGovernor");
		emit GovernorPulled(governor, newGovernor);
		governor = newGovernor;
		delete newGovernor;
	}

	function revokeGuardian(address _guardian) external {
		_onlyGovernor();
		emit GuardianRevoked(_guardian);
		guardian[_guardian] = false;
	}

	function pullManager() external {
		require(msg.sender == newManager, "!newManager");
		emit ManagerPulled(manager, newManager);
		manager = newManager;
		delete newManager;
	}
}

File 2 of 4 : IAuthority.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.0;

interface IAuthority {
	/* ========== EVENTS ========== */

	event GovernorPushed(address indexed from, address indexed to);
	event GuardianPushed(address indexed to);
	event ManagerPushed(address indexed from, address indexed to);

	event GovernorPulled(address indexed from, address indexed to);
	event GuardianRevoked(address indexed to);
	event ManagerPulled(address indexed from, address indexed to);

	/* ========== VIEW ========== */

	function governor() external view returns (address);

	function guardian(address _target) external view returns (bool);

	function manager() external view returns (address);
}

File 3 of 4 : CustomErrors.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

interface CustomErrors {
	error NotKeeper();
	error IVNotFound();
	error NotHandler();
	error VaultExpired();
	error InvalidInput();
	error InvalidPrice();
	error InvalidBuyer();
	error InvalidOrder();
	error OrderExpired();
	error InvalidAmount();
	error TradingPaused();
	error InvalidAddress();
	error IssuanceFailed();
	error EpochNotClosed();
	error InvalidDecimals();
	error TradingNotPaused();
	error NotLiquidityPool();
	error DeltaNotDecreased();
	error NonExistentOtoken();
	error OrderExpiryTooLong();
	error InvalidShareAmount();
	error ExistingWithdrawal();
	error TotalSupplyReached();
	error StrikeAssetInvalid();
	error OptionStrikeInvalid();
	error OptionExpiryInvalid();
	error NoExistingWithdrawal();
	error SpotMovedBeyondRange();
	error ReactorAlreadyExists();
	error CollateralAssetInvalid();
	error UnderlyingAssetInvalid();
	error CollateralAmountInvalid();
	error WithdrawExceedsLiquidity();
	error InsufficientShareBalance();
	error MaxLiquidityBufferReached();
	error LiabilitiesGreaterThanAssets();
	error CustomOrderInsufficientPrice();
	error CustomOrderInvalidDeltaValue();
	error DeltaQuoteError(uint256 quote, int256 delta);
	error TimeDeltaExceedsThreshold(uint256 timeDelta);
	error PriceDeltaExceedsThreshold(uint256 priceDelta);
	error StrikeAmountExceedsLiquidity(uint256 strikeAmount, uint256 strikeLiquidity);
	error MinStrikeAmountExceedsLiquidity(uint256 strikeAmount, uint256 strikeAmountMin);
	error UnderlyingAmountExceedsLiquidity(uint256 underlyingAmount, uint256 underlyingLiquidity);
	error MinUnderlyingAmountExceedsLiquidity(uint256 underlyingAmount, uint256 underlyingAmountMin);
}

File 4 of 4 : AccessControl.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

import "../interfaces/IAuthority.sol";

error UNAUTHORIZED();

/**
 *  @title Contract used for access control functionality, based off of OlympusDao Access Control
 */
abstract contract AccessControl {
	/* ========== EVENTS ========== */

	event AuthorityUpdated(IAuthority authority);

	/* ========== STATE VARIABLES ========== */

	IAuthority public authority;

	/* ========== Constructor ========== */

	constructor(IAuthority _authority) {
		authority = _authority;
		emit AuthorityUpdated(_authority);
	}

	/* ========== GOV ONLY ========== */

	function setAuthority(IAuthority _newAuthority) external {
		_onlyGovernor();
		authority = _newAuthority;
		emit AuthorityUpdated(_newAuthority);
	}

	/* ========== INTERNAL CHECKS ========== */

	function _onlyGovernor() internal view {
		if (msg.sender != authority.governor()) revert UNAUTHORIZED();
	}

	function _onlyGuardian() internal view {
		if (!authority.guardian(msg.sender) && msg.sender != authority.governor()) revert UNAUTHORIZED();
	}

	function _onlyManager() internal view {
		if (msg.sender != authority.manager() && msg.sender != authority.governor())
			revert UNAUTHORIZED();
	}
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_governor","type":"address"},{"internalType":"address","name":"_guardian","type":"address"},{"internalType":"address","name":"_manager","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"UNAUTHORIZED","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IAuthority","name":"authority","type":"address"}],"name":"AuthorityUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"GovernorPulled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"GovernorPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"GuardianPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"GuardianRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ManagerPulled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ManagerPushed","type":"event"},{"inputs":[],"name":"authority","outputs":[{"internalType":"contract IAuthority","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"guardian","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"newGovernor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"newManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pullGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pullManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newGovernor","type":"address"}],"name":"pushGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newGuardian","type":"address"}],"name":"pushGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"pushManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_guardian","type":"address"}],"name":"revokeGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IAuthority","name":"_newAuthority","type":"address"}],"name":"setAuthority","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5060405161094538038061094583398101604081905261002f91610230565b600080546001600160a01b031916309081179091556040518181527f2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad9060200160405180910390a1506001600160a01b038316158061009557506001600160a01b038216155b806100a757506001600160a01b038116155b156100c55760405163e6c4247b60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0385169081179091556040516000907f4fbd6e04620907a96d194bfd18fc026ef2836202d9265ffe2d9d9a944a9d9074908290a36040516001600160a01b038416906000907fffd6fed33fe8ec1016718bdd5d04ae6fecd9aba0da6578807daaaa7fc3d16826908290a36001600160a01b038216600081815260026020526040808220805460ff19166001179055517f5c9f32a3d250a9ad9822713bf5585e303ccfedb2cf7ef8742cc05a2d82871a489190a2600380546001600160a01b0319166001600160a01b0383169081179091556040516000907f3c443c1f3228850d21db337f350985c032eafb6da130f503920915959074fac3908290a36040516001600160a01b038216906000907fa976d47ee1d21e4e2d6cf31207af5f1ecce7d21250412b3e796e0096f82d971d908290a3505050610273565b80516001600160a01b038116811461022b57600080fd5b919050565b60008060006060848603121561024557600080fd5b61024e84610214565b925061025c60208501610214565b915061026a60408501610214565b90509250925092565b6106c3806102826000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638fd205771161008c578063bf7e214f11610066578063bf7e214f14610193578063d8a04212146101a6578063e042124f146101ae578063f29e2236146101c157600080fd5b80638fd205771461015a578063a987f55a1461016d578063af648c3d1461018057600080fd5b80630c340a24146100d45780631f5f2ccc14610104578063368ffd70146101195780634290602914610121578063481c6a75146101345780637a9e5e4b14610147575b600080fd5b6001546100e7906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61011761011236600461064c565b6101f4565b005b610117610275565b6005546100e7906001600160a01b031681565b6003546100e7906001600160a01b031681565b61011761015536600461064c565b610328565b6004546100e7906001600160a01b031681565b61011761017b36600461064c565b610384565b61011761018e36600461064c565b6103ff565b6000546100e7906001600160a01b031681565b61011761045c565b6101176101bc36600461064c565b61050b565b6101e46101cf36600461064c565b60026020526000908152604090205460ff1681565b60405190151581526020016100fb565b6101fc61058c565b6001600160a01b0381166102235760405163e6c4247b60e01b815260040160405180910390fd5b600480546001600160a01b0319166001600160a01b03838116918217909255600154604051919216907f4fbd6e04620907a96d194bfd18fc026ef2836202d9265ffe2d9d9a944a9d907490600090a350565b6005546001600160a01b031633146102c25760405162461bcd60e51b815260206004820152600b60248201526a10b732bba6b0b730b3b2b960a91b60448201526064015b60405180910390fd5b6005546003546040516001600160a01b0392831692909116907fa976d47ee1d21e4e2d6cf31207af5f1ecce7d21250412b3e796e0096f82d971d90600090a360058054600380546001600160a01b03199081166001600160a01b03841617909155169055565b61033061058c565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad9060200160405180910390a150565b61038c61058c565b6001600160a01b0381166103b35760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b038116600081815260026020526040808220805460ff19166001179055517f5c9f32a3d250a9ad9822713bf5585e303ccfedb2cf7ef8742cc05a2d82871a489190a250565b61040761058c565b6040516001600160a01b038216907f0c92d12d8037dd6d77aed8d12addd54d5eb2a6801541a1bf87c9822e78eea42190600090a26001600160a01b03166000908152600260205260409020805460ff19169055565b6004546001600160a01b031633146104a55760405162461bcd60e51b815260206004820152600c60248201526b10b732bba3b7bb32b93737b960a11b60448201526064016102b9565b6004546001546040516001600160a01b0392831692909116907fffd6fed33fe8ec1016718bdd5d04ae6fecd9aba0da6578807daaaa7fc3d1682690600090a360048054600180546001600160a01b03199081166001600160a01b03841617909155169055565b61051361058c565b6001600160a01b03811661053a5760405163e6c4247b60e01b815260040160405180910390fd5b600580546001600160a01b0319166001600160a01b03838116918217909255600354604051919216907f3c443c1f3228850d21db337f350985c032eafb6da130f503920915959074fac390600090a350565b60008054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106019190610670565b6001600160a01b0316336001600160a01b0316146106325760405163075fd2b160e01b815260040160405180910390fd5b565b6001600160a01b038116811461064957600080fd5b50565b60006020828403121561065e57600080fd5b813561066981610634565b9392505050565b60006020828403121561068257600080fd5b81516106698161063456fea264697066735822122064309eeb003365bfa626c977831260bd1b738801cdb2f7f7484585acb3501d3864736f6c634300080e0033000000000000000000000000a67d0c1180e0e183f482304a9b5436a3478f0674000000000000000000000000fbde2e477ed031f54ed5ad52f35ee43cd82cf2a6000000000000000000000000fbde2e477ed031f54ed5ad52f35ee43cd82cf2a6

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638fd205771161008c578063bf7e214f11610066578063bf7e214f14610193578063d8a04212146101a6578063e042124f146101ae578063f29e2236146101c157600080fd5b80638fd205771461015a578063a987f55a1461016d578063af648c3d1461018057600080fd5b80630c340a24146100d45780631f5f2ccc14610104578063368ffd70146101195780634290602914610121578063481c6a75146101345780637a9e5e4b14610147575b600080fd5b6001546100e7906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61011761011236600461064c565b6101f4565b005b610117610275565b6005546100e7906001600160a01b031681565b6003546100e7906001600160a01b031681565b61011761015536600461064c565b610328565b6004546100e7906001600160a01b031681565b61011761017b36600461064c565b610384565b61011761018e36600461064c565b6103ff565b6000546100e7906001600160a01b031681565b61011761045c565b6101176101bc36600461064c565b61050b565b6101e46101cf36600461064c565b60026020526000908152604090205460ff1681565b60405190151581526020016100fb565b6101fc61058c565b6001600160a01b0381166102235760405163e6c4247b60e01b815260040160405180910390fd5b600480546001600160a01b0319166001600160a01b03838116918217909255600154604051919216907f4fbd6e04620907a96d194bfd18fc026ef2836202d9265ffe2d9d9a944a9d907490600090a350565b6005546001600160a01b031633146102c25760405162461bcd60e51b815260206004820152600b60248201526a10b732bba6b0b730b3b2b960a91b60448201526064015b60405180910390fd5b6005546003546040516001600160a01b0392831692909116907fa976d47ee1d21e4e2d6cf31207af5f1ecce7d21250412b3e796e0096f82d971d90600090a360058054600380546001600160a01b03199081166001600160a01b03841617909155169055565b61033061058c565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad9060200160405180910390a150565b61038c61058c565b6001600160a01b0381166103b35760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b038116600081815260026020526040808220805460ff19166001179055517f5c9f32a3d250a9ad9822713bf5585e303ccfedb2cf7ef8742cc05a2d82871a489190a250565b61040761058c565b6040516001600160a01b038216907f0c92d12d8037dd6d77aed8d12addd54d5eb2a6801541a1bf87c9822e78eea42190600090a26001600160a01b03166000908152600260205260409020805460ff19169055565b6004546001600160a01b031633146104a55760405162461bcd60e51b815260206004820152600c60248201526b10b732bba3b7bb32b93737b960a11b60448201526064016102b9565b6004546001546040516001600160a01b0392831692909116907fffd6fed33fe8ec1016718bdd5d04ae6fecd9aba0da6578807daaaa7fc3d1682690600090a360048054600180546001600160a01b03199081166001600160a01b03841617909155169055565b61051361058c565b6001600160a01b03811661053a5760405163e6c4247b60e01b815260040160405180910390fd5b600580546001600160a01b0319166001600160a01b03838116918217909255600354604051919216907f3c443c1f3228850d21db337f350985c032eafb6da130f503920915959074fac390600090a350565b60008054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106019190610670565b6001600160a01b0316336001600160a01b0316146106325760405163075fd2b160e01b815260040160405180910390fd5b565b6001600160a01b038116811461064957600080fd5b50565b60006020828403121561065e57600080fd5b813561066981610634565b9392505050565b60006020828403121561068257600080fd5b81516106698161063456fea264697066735822122064309eeb003365bfa626c977831260bd1b738801cdb2f7f7484585acb3501d3864736f6c634300080e0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000a67d0c1180e0e183f482304a9b5436a3478f0674000000000000000000000000fbde2e477ed031f54ed5ad52f35ee43cd82cf2a6000000000000000000000000fbde2e477ed031f54ed5ad52f35ee43cd82cf2a6

-----Decoded View---------------
Arg [0] : _governor (address): 0xA67D0C1180E0e183f482304A9b5436A3478F0674
Arg [1] : _guardian (address): 0xFBdE2e477Ed031f54ed5Ad52f35eE43CD82cF2A6
Arg [2] : _manager (address): 0xFBdE2e477Ed031f54ed5Ad52f35eE43CD82cF2A6

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000a67d0c1180e0e183f482304a9b5436a3478f0674
Arg [1] : 000000000000000000000000fbde2e477ed031f54ed5ad52f35ee43cd82cf2a6
Arg [2] : 000000000000000000000000fbde2e477ed031f54ed5ad52f35ee43cd82cf2a6


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.