Contract 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xa6a63b5f6ff2142e0c944b1a4b5d6e4d6e819e21c6628504613025284b29de3a0x6080604094245682022-04-07 0:54:29722 days 13 hrs agoVesta Finance: Deployer IN  Create: PriceFeedV20 ETH0.008384182864 ETH0.672904774
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xfa288a4ec895a2fbb9d05b4b70f042dd32b66bd7ccfd86343a4f99903d3b9ef8118243752022-05-11 18:59:17687 days 19 hrs ago Vesta Finance: Borrower Operations 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x81d72e4a68e7cc408769d4d0f85186c1a2fd099e2a4551888eabe6d851e90c84118243092022-05-11 18:57:49687 days 19 hrs ago Vesta Finance: Borrower Operations 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x6786d51647e066aa727ff2273f522b0c46d7734ae6f10c48dd5da8255ad106fb118235442022-05-11 18:45:19687 days 19 hrs ago Vesta Finance: Borrower Operations 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0xea822f041fd21d4be692606a47d1822ac80ddb33fe5446dbdbdb366065518739118233112022-05-11 18:40:49687 days 19 hrs ago Vesta Finance: Borrower Operations 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x7ac23bcc151d79de82ef1b37520c883ffb3e2e8f0c94ca8d2f716ee50a2b0610118226842022-05-11 18:30:20687 days 19 hrs ago Vesta Finance: Borrower Operations 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x4a937d7e13b434737fbba183f48d7db87f4769f8294e91aa8717a2783b7673e9118216472022-05-11 18:15:24687 days 20 hrs ago Vesta Finance: Borrower Operations 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x811e9ca84a3ef9895be52e5416a7d206c78d7d449a86e4d0d3322ff57a88a8ba118212192022-05-11 18:07:28687 days 20 hrs ago Vesta Finance: Borrower Operations 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x9b0b0ba0ba3242d7aa0fa3e08b0f0fe06b6790e7e1ad6971327cc2b7d0e3af70118189262022-05-11 17:39:38687 days 20 hrs ago Vesta Finance: Borrower Operations 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x6e9ac24c19d4c17113b043b8762fa8db2ef9945b8902cee72a1be249dd4fa37a118188392022-05-11 17:38:46687 days 20 hrs ago Vesta Finance: Borrower Operations 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x5c49654a9affe54effe55c23d100114ba9e832d2f03c039f1837cfcdb2f5e2e2118187242022-05-11 17:37:22687 days 20 hrs ago 0x6e53d20d674c27b858a005cf4a72cfaaf4434ecb 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x86f26c7e90ac53a59d2a60de662962897f9f9196750b031c5d00f4893682acf7118185112022-05-11 17:33:54687 days 20 hrs ago Vesta Finance: Borrower Operations 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x39ee385f269b6a7ff2c31ba8bcddff402855d050cda3e3f408befbfa230cc432118166252022-05-11 17:06:51687 days 21 hrs ago Vesta Finance: Borrower Operations 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x1a6569cea15d6ebff7eb732c2865540e278d367447bf403810a24efb6b84847b118160612022-05-11 16:58:59687 days 21 hrs ago Vesta Finance: Borrower Operations 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x604d43819e115a1655a41d6cd81ced12806a4644a7cd29212049e21be4267431118148352022-05-11 16:41:14687 days 21 hrs ago Vesta Finance: Borrower Operations 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0xe3b64b955e0c2b4af9d2fcb623e8711a5dce5fca99002dc9c32ff72ebdd0ffc8118141312022-05-11 16:29:36687 days 21 hrs ago Vesta Finance: Borrower Operations 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x134b27b97c0b5d0661005302cbab4a2a65736694a71ef02440dea09e5a026fe8118141072022-05-11 16:29:36687 days 21 hrs ago Vesta Finance: Borrower Operations 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0xd6973d5516702d6b106e80d15e80a1fc88abc5afd5ed4395be745a919ef3a5f3118134152022-05-11 16:20:10687 days 22 hrs ago 0x100ec08129e0fd59959df93a8b914944a3bbd5df 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x9e63bdc8e96e42c5e50963415aff8b40560e651d7ec6f04c2230aabe1aafe0c5118134142022-05-11 16:20:10687 days 22 hrs ago 0x100ec08129e0fd59959df93a8b914944a3bbd5df 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x39ec4c3c046cf6c571e64b9dbf80f703671a1f31719d6c302293f02232cec5da118134132022-05-11 16:20:10687 days 22 hrs ago 0x100ec08129e0fd59959df93a8b914944a3bbd5df 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0xe40ab6650830e4dad037cf6794aa4934605b96f4a81aaf6c286ed6676998e40f118134122022-05-11 16:20:10687 days 22 hrs ago 0x100ec08129e0fd59959df93a8b914944a3bbd5df 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0xf8f1e8afe1e557ed11b040bd85e2f7b676e220beeb838871c0548e2d0137459e118121962022-05-11 16:03:30687 days 22 hrs ago 0x100ec08129e0fd59959df93a8b914944a3bbd5df 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0xaf4b135806c10bdf1686fc6578135644b030a914500dd5e9c3e73b37ff5b1179118121942022-05-11 16:03:30687 days 22 hrs ago 0x100ec08129e0fd59959df93a8b914944a3bbd5df 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x0441ec3c0740e6ec45ea89552d4f06dfc209e81580832c3febc762d4b255f78f118121932022-05-11 16:03:30687 days 22 hrs ago 0x100ec08129e0fd59959df93a8b914944a3bbd5df 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x00b2deb4a5e350abfdb00c3258ac0e64168e48703c8a3c07820f23c4870e439a118121922022-05-11 16:03:30687 days 22 hrs ago 0x100ec08129e0fd59959df93a8b914944a3bbd5df 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
0x3b8a330614c4ceb3e767c23f8d345006b0867518964edfc521fe358cddf7fb66118121902022-05-11 16:03:30687 days 22 hrs ago 0x100ec08129e0fd59959df93a8b914944a3bbd5df 0x2b5f73c7017b7debb0e4d52c0c0029a5fc94345d0 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PriceFeedV2

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 8 : PriceFeedV2.sol
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.13;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

import "./interfaces/IPriceFeedV2.sol";
import { IOracleVerificationV1 as Verificator } from "./interfaces/IOracleVerificationV1.sol";
import "./interfaces/IOracleWrapper.sol";

contract PriceFeedV2 is IPriceFeedV2, OwnableUpgradeable {
	Verificator public verificator;

	mapping(address => bool) public accesses;
	mapping(address => uint256) public lastGoodPrice;
	mapping(address => Oracle) public oracles;

	modifier hasAccess() {
		require(accesses[msg.sender] || owner() == msg.sender, "Invalid access");
		_;
	}

	function setUp(address _verificator) external initializer {
		require(_verificator != address(0), "Invalid Verificator");

		__Ownable_init();
		verificator = Verificator(_verificator);
	}

	function setAccessTo(address _addr, bool _hasAccess) external onlyOwner {
		accesses[_addr] = _hasAccess;
		emit AccessChanged(_addr, _hasAccess);
	}

	function changeVerificator(address _verificator) external onlyOwner {
		require(_verificator != address(0), "Invalid Verificator");
		verificator = Verificator(_verificator);

		emit OracleVerificationChanged(_verificator);
	}

	function addOracle(
		address _token,
		address _primaryOracle,
		address _secondaryOracle
	) external override hasAccess {
		require(_primaryOracle != address(0), "Invalid Primary Oracle");

		Oracle storage oracle = oracles[_token];
		oracle.primaryWrapper = _primaryOracle;
		oracle.secondaryWrapper = _secondaryOracle;
		uint256 price = _getValidPrice(_token, _primaryOracle, _secondaryOracle);

		if (price == 0) revert("Oracle down");

		lastGoodPrice[_token] = price;

		emit OracleAdded(_token, _primaryOracle, _secondaryOracle);
	}

	function removeOracle(address _token) external hasAccess {
		delete oracles[_token];
		emit OracleRemoved(_token);
	}

	function fetchPrice(address _token) external override returns (uint256) {
		Oracle memory oracle = oracles[_token];
		require(oracle.primaryWrapper != address(0), "Oracle not found");

		uint256 goodPrice = _getValidPrice(_token, oracle.primaryWrapper, oracle.secondaryWrapper);
		lastGoodPrice[_token] = goodPrice;

		emit TokenPriceUpdated(_token, goodPrice);
		return goodPrice;
	}

	function _getValidPrice(
		address _token,
		address primary,
		address secondary
	) internal returns (uint256) {
		IOracleWrapper.SavedResponse memory primaryResponse = IOracleWrapper(primary).retriveSavedResponses(_token);

		IOracleWrapper.SavedResponse memory secondaryResponse = secondary == address(0)
			? IOracleWrapper.SavedResponse(0, 0, 0)
			: IOracleWrapper(secondary).retriveSavedResponses(_token);

		return
			verificator.verify(
				Verificator.RequestVerification(lastGoodPrice[_token], primaryResponse, secondaryResponse)
			);
	}
}

File 2 of 8 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 3 of 8 : IPriceFeedV2.sol
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity ^0.8.13;

interface IPriceFeedV2 {
	event OracleAdded(address indexed _token, address _primaryWrappedOracle, address _secondaryWrappedOracle);
	event OracleRemoved(address indexed _token);
	event AccessChanged(address indexed _token, bool _hasAccess);
	event OracleVerificationChanged(address indexed _newVerificator);
	event TokenPriceUpdated(address indexed _token, uint256 _price);

	struct Oracle {
		address primaryWrapper;
		address secondaryWrapper;
	}

	function fetchPrice(address _token) external returns (uint256);

	function addOracle(
		address _token,
		address _chainlinkOracle,
		address _chainlinkIndexOracle
	) external;
}

File 4 of 8 : IOracleVerificationV1.sol
// SPDX-License-Identifier:SEE LICENSE IN LICENSE
pragma solidity ^0.8.13;

import "./IOracleWrapper.sol";

interface IOracleVerificationV1 {
	enum Status {
		PrimaryOracleWorking,
		SecondaryOracleWorking,
		BothUntrusted
	}

	struct RequestVerification {
		uint256 lastGoodPrice;
		IOracleWrapper.SavedResponse primaryResponse;
		IOracleWrapper.SavedResponse secondaryResponse;
	}

	function verify(RequestVerification memory request) external view returns (uint256);
}

File 5 of 8 : IOracleWrapper.sol
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity ^0.8.11;

interface IOracleWrapper {
	struct SavedResponse {
		uint256 currentPrice;
		uint256 lastPrice;
		uint256 lastUpdate;
	}

	error TokenIsNotRegistered(address _token);
	error ResponseFromOracleIsInvalid(address _token, address _oracle);

	function fetchPrice(address _token) external;

	//Sad typo
	function retriveSavedResponses(address _token) external returns (SavedResponse memory currentResponse);

	function getLastPrice(address _token) external view returns (uint256);

	function getCurrentPrice(address _token) external view returns (uint256);
}

File 6 of 8 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 7 of 8 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 8 of 8 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"bool","name":"_hasAccess","type":"bool"}],"name":"AccessChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"address","name":"_primaryWrappedOracle","type":"address"},{"indexed":false,"internalType":"address","name":"_secondaryWrappedOracle","type":"address"}],"name":"OracleAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_token","type":"address"}],"name":"OracleRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_newVerificator","type":"address"}],"name":"OracleVerificationChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_price","type":"uint256"}],"name":"TokenPriceUpdated","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"accesses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_primaryOracle","type":"address"},{"internalType":"address","name":"_secondaryOracle","type":"address"}],"name":"addOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_verificator","type":"address"}],"name":"changeVerificator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"fetchPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastGoodPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"oracles","outputs":[{"internalType":"address","name":"primaryWrapper","type":"address"},{"internalType":"address","name":"secondaryWrapper","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"removeOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"},{"internalType":"bool","name":"_hasAccess","type":"bool"}],"name":"setAccessTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_verificator","type":"address"}],"name":"setUp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"verificator","outputs":[{"internalType":"contract IOracleVerificationV1","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50610dc7806100206000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638429bbf61161008c578063addd509911610066578063addd5099146101cc578063edb7eb2614610220578063f2fde38b14610233578063fdc85fc41461024657600080fd5b80638429bbf61461017a5780638da5cb5b146101a8578063ace1798e146101b957600080fd5b806324de77ee146100d45780633f2601ef146101045780635eb25f511461011957806365bc94811461012c578063715018a61461015f5780637c74cb3414610167575b600080fd5b6065546100e7906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610117610112366004610b99565b610259565b005b610117610127366004610b99565b610387565b61014f61013a366004610b99565b60666020526000908152604090205460ff1681565b60405190151581526020016100fb565b610117610447565b610117610175366004610bbb565b61047d565b61019a610188366004610b99565b60676020526000908152604090205481565b6040519081526020016100fb565b6033546001600160a01b03166100e7565b61019a6101c7366004610b99565b61062d565b6102006101da366004610b99565b606860205260009081526040902080546001909101546001600160a01b03918216911682565b604080516001600160a01b039384168152929091166020830152016100fb565b61011761022e366004610bfe565b61071e565b610117610241366004610b99565b6107a7565b610117610254366004610b99565b610842565b600054610100900460ff166102745760005460ff1615610278565b303b155b6102e05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b600054610100900460ff16158015610302576000805461ffff19166101011790555b6001600160a01b03821661034e5760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b2102b32b934b334b1b0ba37b960691b60448201526064016102d7565b610356610913565b606580546001600160a01b0319166001600160a01b0384161790558015610383576000805461ff00191690555b5050565b6033546001600160a01b031633146103b15760405162461bcd60e51b81526004016102d790610c3a565b6001600160a01b0381166103fd5760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b2102b32b934b334b1b0ba37b960691b60448201526064016102d7565b606580546001600160a01b0319166001600160a01b0383169081179091556040517f1b9a9b496016e01319cea0599d6bdcde6e05d07cdbeeaec1d684d6ec68e518ab90600090a250565b6033546001600160a01b031633146104715760405162461bcd60e51b81526004016102d790610c3a565b61047b6000610942565b565b3360009081526066602052604090205460ff16806104b45750336104a96033546001600160a01b031690565b6001600160a01b0316145b6104f15760405162461bcd60e51b815260206004820152600e60248201526d496e76616c69642061636365737360901b60448201526064016102d7565b6001600160a01b0382166105405760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964205072696d617279204f7261636c6560501b60448201526064016102d7565b6001600160a01b03838116600090815260686020526040812080546001600160a01b03199081168685161782556001820180549091169385169390931790925561058b858585610994565b9050806000036105cb5760405162461bcd60e51b815260206004820152600b60248201526a27b930b1b632903237bbb760a91b60448201526064016102d7565b6001600160a01b03858116600081815260676020908152604091829020859055815188851681529387169084015290917fb4af261139740f02bdfd600c83590a7b42e71fd7798891b2b39cc7203e3de147910160405180910390a25050505050565b6001600160a01b0380821660009081526068602090815260408083208151808301909252805485168083526001909101549094169181019190915290916106a95760405162461bcd60e51b815260206004820152601060248201526f13dc9858db19481b9bdd08199bdd5b9960821b60448201526064016102d7565b60006106be8483600001518460200151610994565b6001600160a01b0385166000818152606760205260409081902083905551919250907fceb40be0a58aa33916c199e469842b614ef313295573c15d82f85cc9d1a89d329061070f9084815260200190565b60405180910390a29392505050565b6033546001600160a01b031633146107485760405162461bcd60e51b81526004016102d790610c3a565b6001600160a01b038216600081815260666020908152604091829020805460ff191685151590811790915591519182527fa4db2f7b38cef7c9aa9b5b2ae37b4a06e94048ba87583a6de6b5fd51e45b29fb910160405180910390a25050565b6033546001600160a01b031633146107d15760405162461bcd60e51b81526004016102d790610c3a565b6001600160a01b0381166108365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102d7565b61083f81610942565b50565b3360009081526066602052604090205460ff168061087957503361086e6033546001600160a01b031690565b6001600160a01b0316145b6108b65760405162461bcd60e51b815260206004820152600e60248201526d496e76616c69642061636365737360901b60448201526064016102d7565b6001600160a01b03811660008181526068602052604080822080546001600160a01b03199081168255600190910180549091169055517f9c8e7d83025bef8a04c664b2f753f64b8814bdb7e27291d7e50935f18cc3c7129190a250565b600054610100900460ff1661093a5760405162461bcd60e51b81526004016102d790610c6f565b61047b610b4d565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604051634aceaf2f60e01b81526001600160a01b0384811660048301526000918291851690634aceaf2f906024016060604051808303816000875af11580156109e1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a059190610cba565b905060006001600160a01b03841615610a8957604051634aceaf2f60e01b81526001600160a01b038781166004830152851690634aceaf2f906024016060604051808303816000875af1158015610a60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a849190610cba565b610aa8565b6040518060600160405280600081526020016000815260200160008152505b606554604080516060810182526001600160a01b038a8116600090815260676020908152908490205483528201879052818301859052915163271fbaf760e01b815293945091169163271fbaf791610b0291600401610d24565b602060405180830381865afa158015610b1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b439190610d78565b9695505050505050565b600054610100900460ff16610b745760405162461bcd60e51b81526004016102d790610c6f565b61047b33610942565b80356001600160a01b0381168114610b9457600080fd5b919050565b600060208284031215610bab57600080fd5b610bb482610b7d565b9392505050565b600080600060608486031215610bd057600080fd5b610bd984610b7d565b9250610be760208501610b7d565b9150610bf560408501610b7d565b90509250925092565b60008060408385031215610c1157600080fd5b610c1a83610b7d565b915060208301358015158114610c2f57600080fd5b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600060608284031215610ccc57600080fd5b6040516060810181811067ffffffffffffffff82111715610cfd57634e487b7160e01b600052604160045260246000fd5b80604052508251815260208301516020820152604083015160408201528091505092915050565b8151815260208083015160e0830191610d53908401828051825260208082015190830152604090810151910152565b5060409283015180516080840152602081015160a08401529092015160c09091015290565b600060208284031215610d8a57600080fd5b505191905056fea26469706673582212205a9616fb535d5eb37816b327ec42d9bd55a68e8bc13e63200b61f98a2974762a64736f6c634300080d0033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638429bbf61161008c578063addd509911610066578063addd5099146101cc578063edb7eb2614610220578063f2fde38b14610233578063fdc85fc41461024657600080fd5b80638429bbf61461017a5780638da5cb5b146101a8578063ace1798e146101b957600080fd5b806324de77ee146100d45780633f2601ef146101045780635eb25f511461011957806365bc94811461012c578063715018a61461015f5780637c74cb3414610167575b600080fd5b6065546100e7906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610117610112366004610b99565b610259565b005b610117610127366004610b99565b610387565b61014f61013a366004610b99565b60666020526000908152604090205460ff1681565b60405190151581526020016100fb565b610117610447565b610117610175366004610bbb565b61047d565b61019a610188366004610b99565b60676020526000908152604090205481565b6040519081526020016100fb565b6033546001600160a01b03166100e7565b61019a6101c7366004610b99565b61062d565b6102006101da366004610b99565b606860205260009081526040902080546001909101546001600160a01b03918216911682565b604080516001600160a01b039384168152929091166020830152016100fb565b61011761022e366004610bfe565b61071e565b610117610241366004610b99565b6107a7565b610117610254366004610b99565b610842565b600054610100900460ff166102745760005460ff1615610278565b303b155b6102e05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b600054610100900460ff16158015610302576000805461ffff19166101011790555b6001600160a01b03821661034e5760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b2102b32b934b334b1b0ba37b960691b60448201526064016102d7565b610356610913565b606580546001600160a01b0319166001600160a01b0384161790558015610383576000805461ff00191690555b5050565b6033546001600160a01b031633146103b15760405162461bcd60e51b81526004016102d790610c3a565b6001600160a01b0381166103fd5760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b2102b32b934b334b1b0ba37b960691b60448201526064016102d7565b606580546001600160a01b0319166001600160a01b0383169081179091556040517f1b9a9b496016e01319cea0599d6bdcde6e05d07cdbeeaec1d684d6ec68e518ab90600090a250565b6033546001600160a01b031633146104715760405162461bcd60e51b81526004016102d790610c3a565b61047b6000610942565b565b3360009081526066602052604090205460ff16806104b45750336104a96033546001600160a01b031690565b6001600160a01b0316145b6104f15760405162461bcd60e51b815260206004820152600e60248201526d496e76616c69642061636365737360901b60448201526064016102d7565b6001600160a01b0382166105405760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964205072696d617279204f7261636c6560501b60448201526064016102d7565b6001600160a01b03838116600090815260686020526040812080546001600160a01b03199081168685161782556001820180549091169385169390931790925561058b858585610994565b9050806000036105cb5760405162461bcd60e51b815260206004820152600b60248201526a27b930b1b632903237bbb760a91b60448201526064016102d7565b6001600160a01b03858116600081815260676020908152604091829020859055815188851681529387169084015290917fb4af261139740f02bdfd600c83590a7b42e71fd7798891b2b39cc7203e3de147910160405180910390a25050505050565b6001600160a01b0380821660009081526068602090815260408083208151808301909252805485168083526001909101549094169181019190915290916106a95760405162461bcd60e51b815260206004820152601060248201526f13dc9858db19481b9bdd08199bdd5b9960821b60448201526064016102d7565b60006106be8483600001518460200151610994565b6001600160a01b0385166000818152606760205260409081902083905551919250907fceb40be0a58aa33916c199e469842b614ef313295573c15d82f85cc9d1a89d329061070f9084815260200190565b60405180910390a29392505050565b6033546001600160a01b031633146107485760405162461bcd60e51b81526004016102d790610c3a565b6001600160a01b038216600081815260666020908152604091829020805460ff191685151590811790915591519182527fa4db2f7b38cef7c9aa9b5b2ae37b4a06e94048ba87583a6de6b5fd51e45b29fb910160405180910390a25050565b6033546001600160a01b031633146107d15760405162461bcd60e51b81526004016102d790610c3a565b6001600160a01b0381166108365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102d7565b61083f81610942565b50565b3360009081526066602052604090205460ff168061087957503361086e6033546001600160a01b031690565b6001600160a01b0316145b6108b65760405162461bcd60e51b815260206004820152600e60248201526d496e76616c69642061636365737360901b60448201526064016102d7565b6001600160a01b03811660008181526068602052604080822080546001600160a01b03199081168255600190910180549091169055517f9c8e7d83025bef8a04c664b2f753f64b8814bdb7e27291d7e50935f18cc3c7129190a250565b600054610100900460ff1661093a5760405162461bcd60e51b81526004016102d790610c6f565b61047b610b4d565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604051634aceaf2f60e01b81526001600160a01b0384811660048301526000918291851690634aceaf2f906024016060604051808303816000875af11580156109e1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a059190610cba565b905060006001600160a01b03841615610a8957604051634aceaf2f60e01b81526001600160a01b038781166004830152851690634aceaf2f906024016060604051808303816000875af1158015610a60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a849190610cba565b610aa8565b6040518060600160405280600081526020016000815260200160008152505b606554604080516060810182526001600160a01b038a8116600090815260676020908152908490205483528201879052818301859052915163271fbaf760e01b815293945091169163271fbaf791610b0291600401610d24565b602060405180830381865afa158015610b1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b439190610d78565b9695505050505050565b600054610100900460ff16610b745760405162461bcd60e51b81526004016102d790610c6f565b61047b33610942565b80356001600160a01b0381168114610b9457600080fd5b919050565b600060208284031215610bab57600080fd5b610bb482610b7d565b9392505050565b600080600060608486031215610bd057600080fd5b610bd984610b7d565b9250610be760208501610b7d565b9150610bf560408501610b7d565b90509250925092565b60008060408385031215610c1157600080fd5b610c1a83610b7d565b915060208301358015158114610c2f57600080fd5b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600060608284031215610ccc57600080fd5b6040516060810181811067ffffffffffffffff82111715610cfd57634e487b7160e01b600052604160045260246000fd5b80604052508251815260208301516020820152604083015160408201528091505092915050565b8151815260208083015160e0830191610d53908401828051825260208082015190830152604090810151910152565b5060409283015180516080840152602081015160a08401529092015160c09091015290565b600060208284031215610d8a57600080fd5b505191905056fea26469706673582212205a9616fb535d5eb37816b327ec42d9bd55a68e8bc13e63200b61f98a2974762a64736f6c634300080d0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.