Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- OracleHelper
- Optimization enabled
- true
- Compiler version
- v0.8.20+commit.a1b79de6
- Optimization runs
- 1000
- EVM Version
- shanghai
- Verified at
- 2025-12-17T23:52:05.641461Z
project/contracts/aave/OracleHelper.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
/**
* @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 Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
/**
* @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 Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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);
}
}
interface IOracle {
function update() external;
}
contract OracleHelper is Ownable {
IOracle public oracleATROPA = IOracle(0x09aD286360826206040e2BE51E510529523368cc);
IOracle public oracleWBTC = IOracle(0x383bD53061Bd06FFBa859167BcDd3729757C7038);
IOracle public oraclePUSDC = IOracle(0xBE0F253d93d1Bd59062227c7D06090F490E3095E);
IOracle public oraclePDAI = IOracle(0xC507688fa597cB7455edE76A9A1E3f5Df2aB6D82);
mapping(address => bool) public isApprovedUser;
function setPriceOracle(IOracle _oracleAtropa, IOracle _oracleWBTC, IOracle _oraclePUSDC, IOracle _oraclePDAI) external onlyOwner {
oracleATROPA = _oracleAtropa;
oracleWBTC = _oracleWBTC;
oraclePUSDC = _oraclePUSDC;
oraclePDAI = _oraclePDAI;
}
function allocateSeigniorage() external {
require(isApprovedUser[msg.sender] || msg.sender == owner(), "Oracle: caller not approved");
_updateFavorPrice(oracleATROPA);
_updateFavorPrice(oracleWBTC);
_updateFavorPrice(oraclePUSDC);
_updateFavorPrice(oraclePDAI);
}
function _updateFavorPrice(IOracle _oracle) internal {
try _oracle.update(){
} catch {
revert("Failed to update price");
}
}
function setApprovedUser(address user, bool allowed) external onlyOwner {
require(user != address(0), "Zero address not allowed");
isApprovedUser[user] = allowed;
}
}
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"],"":["ast"]}},"optimizer":{"runs":1000,"enabled":true},"libraries":{},"evmVersion":"shanghai"}
Contract ABI
[{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"allocateSeigniorage","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isApprovedUser","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IOracle"}],"name":"oracleATROPA","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IOracle"}],"name":"oraclePDAI","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IOracle"}],"name":"oraclePUSDC","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IOracle"}],"name":"oracleWBTC","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setApprovedUser","inputs":[{"type":"address","name":"user","internalType":"address"},{"type":"bool","name":"allowed","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPriceOracle","inputs":[{"type":"address","name":"_oracleAtropa","internalType":"contract IOracle"},{"type":"address","name":"_oracleWBTC","internalType":"contract IOracle"},{"type":"address","name":"_oraclePUSDC","internalType":"contract IOracle"},{"type":"address","name":"_oraclePDAI","internalType":"contract IOracle"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Contract Creation Code
0x6080604052600180546001600160a01b03199081167309ad286360826206040e2be51e510529523368cc1790915560028054821673383bd53061bd06ffba859167bcdd3729757c703817905560038054821673be0f253d93d1bd59062227c7d06090f490e3095e1790556004805490911673c507688fa597cb7455ede76a9a1e3f5df2ab6d82179055348015610093575f80fd5b5061009d336100a2565b6100f1565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610663806100fe5f395ff3fe608060405234801561000f575f80fd5b50600436106100c4575f3560e01c80638da5cb5b1161007d578063e5a09fe711610058578063e5a09fe714610185578063e6864ded14610198578063f2fde38b146101ab575f80fd5b80638da5cb5b14610130578063b884112c14610140578063d411a79214610172575f80fd5b80635b756179116100ad5780635b7561791461010b5780636f84abac14610115578063715018a614610128575f80fd5b8063010ff21d146100c857806349327966146100f8575b5f80fd5b6001546100db906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6003546100db906001600160a01b031681565b6101136101be565b005b610113610123366004610577565b61028b565b6101136102f0565b5f546001600160a01b03166100db565b61016261014e3660046105d0565b60056020525f908152604090205460ff1681565b60405190151581526020016100ef565b6004546100db906001600160a01b031681565b6002546100db906001600160a01b031681565b6101136101a63660046105f2565b610301565b6101136101b93660046105d0565b610389565b335f9081526005602052604090205460ff16806101e457505f546001600160a01b031633145b6102355760405162461bcd60e51b815260206004820152601b60248201527f4f7261636c653a2063616c6c6572206e6f7420617070726f766564000000000060448201526064015b60405180910390fd5b60015461024a906001600160a01b0316610419565b60025461025f906001600160a01b0316610419565b600354610274906001600160a01b0316610419565b600454610289906001600160a01b0316610419565b565b6102936104ae565b600180546001600160a01b0395861673ffffffffffffffffffffffffffffffffffffffff19918216179091556002805494861694821694909417909355600380549285169284169290921790915560048054919093169116179055565b6102f86104ae565b6102895f610507565b6103096104ae565b6001600160a01b03821661035f5760405162461bcd60e51b815260206004820152601860248201527f5a65726f2061646472657373206e6f7420616c6c6f7765640000000000000000604482015260640161022c565b6001600160a01b03919091165f908152600560205260409020805460ff1916911515919091179055565b6103916104ae565b6001600160a01b03811661040d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161022c565b61041681610507565b50565b806001600160a01b031663a2e620456040518163ffffffff1660e01b81526004015f604051808303815f87803b158015610451575f80fd5b505af1925050508015610462575060015b6104165760405162461bcd60e51b815260206004820152601660248201527f4661696c656420746f2075706461746520707269636500000000000000000000604482015260640161022c565b5f546001600160a01b031633146102895760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161022c565b5f80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114610416575f80fd5b5f805f806080858703121561058a575f80fd5b843561059581610563565b935060208501356105a581610563565b925060408501356105b581610563565b915060608501356105c581610563565b939692955090935050565b5f602082840312156105e0575f80fd5b81356105eb81610563565b9392505050565b5f8060408385031215610603575f80fd5b823561060e81610563565b915060208301358015158114610622575f80fd5b80915050925092905056fea264697066735822122036601a92be99043c1f00993cc177c0fe6a95fba5983f00f29f3d44eada686a1564736f6c63430008140033
Deployed ByteCode
0x608060405234801561000f575f80fd5b50600436106100c4575f3560e01c80638da5cb5b1161007d578063e5a09fe711610058578063e5a09fe714610185578063e6864ded14610198578063f2fde38b146101ab575f80fd5b80638da5cb5b14610130578063b884112c14610140578063d411a79214610172575f80fd5b80635b756179116100ad5780635b7561791461010b5780636f84abac14610115578063715018a614610128575f80fd5b8063010ff21d146100c857806349327966146100f8575b5f80fd5b6001546100db906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6003546100db906001600160a01b031681565b6101136101be565b005b610113610123366004610577565b61028b565b6101136102f0565b5f546001600160a01b03166100db565b61016261014e3660046105d0565b60056020525f908152604090205460ff1681565b60405190151581526020016100ef565b6004546100db906001600160a01b031681565b6002546100db906001600160a01b031681565b6101136101a63660046105f2565b610301565b6101136101b93660046105d0565b610389565b335f9081526005602052604090205460ff16806101e457505f546001600160a01b031633145b6102355760405162461bcd60e51b815260206004820152601b60248201527f4f7261636c653a2063616c6c6572206e6f7420617070726f766564000000000060448201526064015b60405180910390fd5b60015461024a906001600160a01b0316610419565b60025461025f906001600160a01b0316610419565b600354610274906001600160a01b0316610419565b600454610289906001600160a01b0316610419565b565b6102936104ae565b600180546001600160a01b0395861673ffffffffffffffffffffffffffffffffffffffff19918216179091556002805494861694821694909417909355600380549285169284169290921790915560048054919093169116179055565b6102f86104ae565b6102895f610507565b6103096104ae565b6001600160a01b03821661035f5760405162461bcd60e51b815260206004820152601860248201527f5a65726f2061646472657373206e6f7420616c6c6f7765640000000000000000604482015260640161022c565b6001600160a01b03919091165f908152600560205260409020805460ff1916911515919091179055565b6103916104ae565b6001600160a01b03811661040d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161022c565b61041681610507565b50565b806001600160a01b031663a2e620456040518163ffffffff1660e01b81526004015f604051808303815f87803b158015610451575f80fd5b505af1925050508015610462575060015b6104165760405162461bcd60e51b815260206004820152601660248201527f4661696c656420746f2075706461746520707269636500000000000000000000604482015260640161022c565b5f546001600160a01b031633146102895760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161022c565b5f80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114610416575f80fd5b5f805f806080858703121561058a575f80fd5b843561059581610563565b935060208501356105a581610563565b925060408501356105b581610563565b915060608501356105c581610563565b939692955090935050565b5f602082840312156105e0575f80fd5b81356105eb81610563565b9392505050565b5f8060408385031215610603575f80fd5b823561060e81610563565b915060208301358015158114610622575f80fd5b80915050925092905056fea264697066735822122036601a92be99043c1f00993cc177c0fe6a95fba5983f00f29f3d44eada686a1564736f6c63430008140033