Source Code
Overview
ETH Balance
ETH Value
$0.00| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 28430703 | 24 mins ago | 0 ETH | ||||
| 28422191 | 6 hrs ago | 0 ETH | ||||
| 28421760 | 6 hrs ago | 0 ETH | ||||
| 28397024 | 25 hrs ago | 0 ETH | ||||
| 28396687 | 26 hrs ago | 0 ETH | ||||
| 28396633 | 26 hrs ago | 0 ETH | ||||
| 28389589 | 31 hrs ago | 0 ETH | ||||
| 28384581 | 35 hrs ago | 0 ETH | ||||
| 28383645 | 36 hrs ago | 0 ETH | ||||
| 28377460 | 40 hrs ago | 0 ETH | ||||
| 28377348 | 40 hrs ago | 0 ETH | ||||
| 28309559 | 3 days ago | 0 ETH | ||||
| 28302536 | 3 days ago | 0 ETH | ||||
| 28302274 | 3 days ago | 0 ETH | ||||
| 28282745 | 4 days ago | 0 ETH | ||||
| 28263264 | 4 days ago | 0 ETH | ||||
| 28254684 | 4 days ago | 0 ETH | ||||
| 28233555 | 5 days ago | 0 ETH | ||||
| 28231510 | 5 days ago | 0 ETH | ||||
| 28229476 | 5 days ago | 0 ETH | ||||
| 28226055 | 5 days ago | 0 ETH | ||||
| 28223911 | 5 days ago | 0 ETH | ||||
| 28223907 | 5 days ago | 0 ETH | ||||
| 28217154 | 5 days ago | 0 ETH | ||||
| 28210503 | 6 days ago | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
EtherfiL2ExchangeRateProvider
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {L2ExchangeRateProviderUpgradeable} from "../../L2/L2ExchangeRateProviderUpgradeable.sol";
import {IAggregatorV3} from "../../interfaces/IAggregatorV3.sol";
contract EtherfiL2ExchangeRateProvider is L2ExchangeRateProviderUpgradeable {
error EtherfiL2ExchangeRateProvider__InvalidRate();
constructor() {
_disableInitializers();
}
function initialize(address owner) external initializer {
__Ownable_init(owner);
}
/**
* @dev Internal function to get rate and last updated time from a rate oracle
* @param rateOracle Rate oracle contract
* @return rate The exchange rate in 1e18 precision
* @return lastUpdated Last updated time
*/
function _getRateAndLastUpdated(address rateOracle, address)
internal
view
override
returns (uint256 rate, uint256 lastUpdated)
{
(, int256 answer,, uint256 updatedAt,) = IAggregatorV3(rateOracle).latestRoundData();
if (answer <= 0) revert EtherfiL2ExchangeRateProvider__InvalidRate();
// adjust 'answer' based on Oracle feed's precision to have 1e18 precision
// rate * 1e18 / 10**oracle.decimals()
uint8 oracleDecimals = IAggregatorV3(rateOracle).decimals();
return (uint256(uint256(answer) * 1e18 / 10**oracleDecimals), updatedAt);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {IL2ExchangeRateProvider} from "../interfaces/IL2ExchangeRateProvider.sol";
import {Constants} from "../libraries/Constants.sol";
/**
* @title Exchange Rate Provider
* @dev Provides exchange rate for different tokens against a common quote token
* The rates oracles are expected to all use the same quote token.
* For example, if quote is ETH and token is worth 2 ETH, the rate should be 2e18.
*/
abstract contract L2ExchangeRateProviderUpgradeable is OwnableUpgradeable, IL2ExchangeRateProvider {
struct L2ExchangeRateProviderStorage {
/**
* @dev Mapping of token address to rate parameters
* All rate oracles are expected to return rates with the `18 + decimalsIn - decimalsOut` decimals
*/
mapping(address => RateParameters) rateParameters;
}
/**
* @dev Rate parameters for a token
* @param rateOracle Rate oracle contract, providing the exchange rate
* @param depositFee Deposit fee, in 1e18 precision (e.g. 1e16 for 1% fee)
* @param freshPeriod Fresh period, in seconds
*/
struct RateParameters {
address rateOracle;
uint64 depositFee;
uint32 freshPeriod;
}
// keccak256(abi.encode(uint256(keccak256(syncpools.storage.l2exchangerateprovider)) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant L2ExchangeRateProviderStorageLocation =
0xe04a73ceb6eb109286b5315cfafd156065d9e3fbfa5269d3606a1b3095f3ad00;
function _getL2ExchangeRateProviderStorage() internal pure returns (L2ExchangeRateProviderStorage storage $) {
assembly {
$.slot := L2ExchangeRateProviderStorageLocation
}
}
error L2ExchangeRateProvider__DepositFeeExceedsMax();
error L2ExchangeRateProvider__OutdatedRate();
error L2ExchangeRateProvider__NoRateOracle();
event RateParametersSet(address token, address rateOracle, uint64 depositFee, uint32 freshPeriod);
function __L2ExchangeRateProvider_init() internal onlyInitializing {}
function __L2ExchangeRateProvider_init_unchained() internal onlyInitializing {}
/**
* @dev Get rate parameters for a token
* @param token Token address
* @return parameters Rate parameters
*/
function getRateParameters(address token) public view virtual returns (RateParameters memory parameters) {
L2ExchangeRateProviderStorage storage $ = _getL2ExchangeRateProviderStorage();
return $.rateParameters[token];
}
/**
* @dev Get conversion amount for a token, given an amount in of token it should return the amount out.
* It also applies the deposit fee.
* Will revert if:
* - No rate oracle is set for the token
* - The rate is outdated (fresh period has passed)
* @param token Token address
* @param amountIn Amount in
* @return amountOut Amount out
*/
function getConversionAmount(address token, uint256 amountIn)
public
view
virtual
override
returns (uint256 amountOut)
{
L2ExchangeRateProviderStorage storage $ = _getL2ExchangeRateProviderStorage();
RateParameters storage rateParameters = $.rateParameters[token];
address rateOracle = rateParameters.rateOracle;
if (rateOracle == address(0)) revert L2ExchangeRateProvider__NoRateOracle();
(uint256 rate, uint256 lastUpdated) = _getRateAndLastUpdated(rateOracle, token);
if (lastUpdated + rateParameters.freshPeriod < block.timestamp) revert L2ExchangeRateProvider__OutdatedRate();
uint256 feeAmount = (amountIn * rateParameters.depositFee + Constants.PRECISION_SUB_ONE) / Constants.PRECISION;
uint256 amountInAfterFee = amountIn - feeAmount;
amountOut = amountInAfterFee * Constants.PRECISION / rate;
return amountOut;
}
// Skip the test for freshPeriod requirement
function getConversionAmountUnsafe(address token, uint256 amountIn)
public
view
returns (uint256 amountOut)
{
L2ExchangeRateProviderStorage storage $ = _getL2ExchangeRateProviderStorage();
RateParameters storage rateParameters = $.rateParameters[token];
address rateOracle = rateParameters.rateOracle;
if (rateOracle == address(0)) revert L2ExchangeRateProvider__NoRateOracle();
(uint256 rate, uint256 lastUpdated) = _getRateAndLastUpdated(rateOracle, token);
uint256 feeAmount = (amountIn * rateParameters.depositFee + Constants.PRECISION_SUB_ONE) / Constants.PRECISION;
uint256 amountInAfterFee = amountIn - feeAmount;
amountOut = amountInAfterFee * Constants.PRECISION / rate;
return amountOut;
}
/**
* @dev Set rate parameters for a token
* @param token Token address
* @param rateOracle Rate oracle contract, providing the exchange rate
* @param depositFee Deposit fee, in 1e18 precision (e.g. 1e16 for 1% fee)
* @param freshPeriod Fresh period, in seconds
*/
function setRateParameters(address token, address rateOracle, uint64 depositFee, uint32 freshPeriod)
public
virtual
onlyOwner
{
_setRateParameters(token, rateOracle, depositFee, freshPeriod);
}
/**
* @dev Internal function to set rate parameters for a token
* Will revert if:
* - Deposit fee exceeds 100% (1e18)
* @param token Token address
* @param rateOracle Rate oracle contract, providing the exchange rate
* @param depositFee Deposit fee, in 1e18 precision (e.g. 1e16 for 1% fee)
* @param freshPeriod Fresh period, in seconds
*/
function _setRateParameters(address token, address rateOracle, uint64 depositFee, uint32 freshPeriod)
internal
virtual
{
if (depositFee > Constants.PRECISION) revert L2ExchangeRateProvider__DepositFeeExceedsMax();
L2ExchangeRateProviderStorage storage $ = _getL2ExchangeRateProviderStorage();
$.rateParameters[token] = RateParameters(rateOracle, depositFee, freshPeriod);
emit RateParametersSet(token, rateOracle, depositFee, freshPeriod);
}
/**
* @dev Internal function to get rate and last updated time from a rate oracle
* @param rateOracle Rate oracle contract
* @param token The token address which the rate is for
* @return rate The exchange rate in 1e18 precision
* @return lastUpdated Last updated time
*/
function _getRateAndLastUpdated(address rateOracle, address token)
internal
view
virtual
returns (uint256 rate, uint256 lastUpdated);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IAggregatorV3 {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
function getRoundData(uint80 _roundId)
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
function latestRoundData()
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../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.
*
* The initial owner is set to the address provided by the deployer. 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 {
/// @custom:storage-location erc7201:openzeppelin.storage.Ownable
struct OwnableStorage {
address _owner;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;
function _getOwnableStorage() private pure returns (OwnableStorage storage $) {
assembly {
$.slot := OwnableStorageLocation
}
}
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
function __Ownable_init(address initialOwner) internal onlyInitializing {
__Ownable_init_unchained(initialOwner);
}
function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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) {
OwnableStorage storage $ = _getOwnableStorage();
return $._owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
OwnableStorage storage $ = _getOwnableStorage();
address oldOwner = $._owner;
$._owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IL2ExchangeRateProvider {
function getConversionAmount(address tokenIn, uint256 amountIn) external returns (uint256 amountOut);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
library Constants {
address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
uint256 internal constant PRECISION = 1e18;
uint256 internal constant PRECISION_SUB_ONE = PRECISION - 1;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
import {Initializable} from "../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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.20;
/**
* @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.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* 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 prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Storage of the initializable contract.
*
* It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
* when using with upgradeable contracts.
*
* @custom:storage-location erc7201:openzeppelin.storage.Initializable
*/
struct InitializableStorage {
/**
* @dev Indicates that the contract has been initialized.
*/
uint64 _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool _initializing;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;
/**
* @dev The contract is already initialized.
*/
error InvalidInitialization();
/**
* @dev The contract is not initializing.
*/
error NotInitializing();
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint64 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
* number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
* production.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
// Cache values to avoid duplicated sloads
bool isTopLevelCall = !$._initializing;
uint64 initialized = $._initialized;
// Allowed calls:
// - initialSetup: the contract is not in the initializing state and no previous version was
// initialized
// - construction: the contract is initialized at version 1 (no reininitialization) and the
// current contract is just being deployed
bool initialSetup = initialized == 0 && isTopLevelCall;
bool construction = initialized == 1 && address(this).code.length == 0;
if (!initialSetup && !construction) {
revert InvalidInitialization();
}
$._initialized = 1;
if (isTopLevelCall) {
$._initializing = true;
}
_;
if (isTopLevelCall) {
$._initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint64 version) {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing || $._initialized >= version) {
revert InvalidInitialization();
}
$._initialized = version;
$._initializing = true;
_;
$._initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
_checkInitializing();
_;
}
/**
* @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
*/
function _checkInitializing() internal view virtual {
if (!_isInitializing()) {
revert NotInitializing();
}
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing) {
revert InvalidInitialization();
}
if ($._initialized != type(uint64).max) {
$._initialized = type(uint64).max;
emit Initialized(type(uint64).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint64) {
return _getInitializableStorage()._initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _getInitializableStorage()._initializing;
}
/**
* @dev Returns a pointer to the storage namespace.
*/
// solhint-disable-next-line var-name-mixedcase
function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
assembly {
$.slot := INITIALIZABLE_STORAGE
}
}
}{
"remappings": [
"ds-test/=lib/forge-std/lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"@layerzerolabs/lz-evm-oapp-v2/contracts/=node_modules/@layerzerolabs/lz-evm-oapp-v2/contracts/",
"@layerzerolabs/lz-evm-protocol-v2/contracts/=node_modules/@layerzerolabs/lz-evm-protocol-v2/contracts/",
"@layerzerolabs/lz-evm-messagelib-v2/contracts/=node_modules/@layerzerolabs/lz-evm-messagelib-v2/contracts/",
"@layerzerolabs/lz-evm-oapp-v2/contracts-upgradeable/=node_modules/layerzero-v2/oapp/contracts/",
"@axelar-network/=node_modules/@axelar-network/",
"@chainlink/=node_modules/@chainlink/",
"@eth-optimism/=node_modules/@eth-optimism/",
"@openzeppelin/=node_modules/@openzeppelin/",
"hardhat-deploy/=node_modules/hardhat-deploy/",
"layerzero-v2/=node_modules/layerzero-v2/",
"solidity-bytes-utils/=node_modules/solidity-bytes-utils/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EtherfiL2ExchangeRateProvider__InvalidRate","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"L2ExchangeRateProvider__DepositFeeExceedsMax","type":"error"},{"inputs":[],"name":"L2ExchangeRateProvider__NoRateOracle","type":"error"},{"inputs":[],"name":"L2ExchangeRateProvider__OutdatedRate","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","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":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"rateOracle","type":"address"},{"indexed":false,"internalType":"uint64","name":"depositFee","type":"uint64"},{"indexed":false,"internalType":"uint32","name":"freshPeriod","type":"uint32"}],"name":"RateParametersSet","type":"event"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"getConversionAmount","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"getConversionAmountUnsafe","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getRateParameters","outputs":[{"components":[{"internalType":"address","name":"rateOracle","type":"address"},{"internalType":"uint64","name":"depositFee","type":"uint64"},{"internalType":"uint32","name":"freshPeriod","type":"uint32"}],"internalType":"struct L2ExchangeRateProviderUpgradeable.RateParameters","name":"parameters","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"rateOracle","type":"address"},{"internalType":"uint64","name":"depositFee","type":"uint64"},{"internalType":"uint32","name":"freshPeriod","type":"uint32"}],"name":"setRateParameters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b5061001961001e565b6100d0565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161561006e5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100cd5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b610bb0806100df6000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063715018a61161005b578063715018a61461019d5780638da5cb5b146101a5578063c4d66de8146101df578063f2fde38b146101f257600080fd5b806308c356491461008d5780630f9566e6146100b357806316089ef9146100c857806323643524146100db575b600080fd5b6100a061009b3660046108ab565b610205565b6040519081526020015b60405180910390f35b6100c66100c13660046108d5565b610325565b005b6100a06100d63660046108ab565b61033f565b6101626100e9366004610943565b6040805160608082018352600080835260208084018290529284018190526001600160a01b039485168152600080516020610b5b833981519152835283902083519182018452549384168152600160a01b840467ffffffffffffffff1691810191909152600160e01b90920463ffffffff169082015290565b6040805182516001600160a01b0316815260208084015167ffffffffffffffff16908201529181015163ffffffff16908201526060016100aa565b6100c66103b7565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546040516001600160a01b0390911681526020016100aa565b6100c66101ed366004610943565b6103cb565b6100c6610200366004610943565b6104db565b600080600080516020610b5b8339815191526001600160a01b038086166000908152602083905260409020805492935091168061025557604051633d9ecf6560e11b815260040160405180910390fd5b600080610262838961051e565b85549193509150429061028290600160e01b900463ffffffff168361097b565b10156102a1576040516334360deb60e11b815260040160405180910390fd5b6000670de0b6b3a76400006102b760018261098e565b86546102d490600160a01b900467ffffffffffffffff168b6109a1565b6102de919061097b565b6102e891906109b8565b905060006102f6828a61098e565b90508361030b670de0b6b3a7640000836109a1565b61031591906109b8565b9750505050505050505b92915050565b61032d610648565b610339848484846106a3565b50505050565b600080600080516020610b5b8339815191526001600160a01b038086166000908152602083905260409020805492935091168061038f57604051633d9ecf6560e11b815260040160405180910390fd5b60008061039c838961051e565b90925090506000670de0b6b3a76400006102b760018261098e565b6103bf610648565b6103c960006107bc565b565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156104115750825b905060008267ffffffffffffffff16600114801561042e5750303b155b90508115801561043c575080155b1561045a5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561048457845460ff60401b1916600160401b1785555b61048d8661082d565b83156104d357845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b6104e3610648565b6001600160a01b03811661051257604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b61051b816107bc565b50565b600080600080856001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610562573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058691906109f4565b50935050925050600082136105ae5760405163797d2bbf60e11b815260040160405180910390fd5b6000866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106129190610a44565b905061061f81600a610b4b565b61063184670de0b6b3a76400006109a1565b61063b91906109b8565b9791965090945050505050565b3361067a7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146103c95760405163118cdaa760e01b8152336004820152602401610509565b670de0b6b3a76400008267ffffffffffffffff1611156106d6576040516381b20be960e01b815260040160405180910390fd5b60408051606080820183526001600160a01b0386811680845267ffffffffffffffff878116602080870182815263ffffffff8a8116898b018181528f89166000818152600080516020610b5b833981519152808852908e90209c518d54965193519b166001600160e01b031990961695909517600160a01b9290981691909102969096176001600160e01b0316600160e01b98909216979097021790975587519283528201929092529485015290830152907fe32dd0e1ba6b23ac15f09a0c455561d7dbc2ad9b22f20259edfd397ae8ca85169060800160405180910390a15050505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b61083561083e565b61051b81610887565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166103c957604051631afcd79f60e31b815260040160405180910390fd5b6104e361083e565b80356001600160a01b03811681146108a657600080fd5b919050565b600080604083850312156108be57600080fd5b6108c78361088f565b946020939093013593505050565b600080600080608085870312156108eb57600080fd5b6108f48561088f565b93506109026020860161088f565b9250604085013567ffffffffffffffff8116811461091f57600080fd5b9150606085013563ffffffff8116811461093857600080fd5b939692955090935050565b60006020828403121561095557600080fd5b61095e8261088f565b9392505050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561031f5761031f610965565b8181038181111561031f5761031f610965565b808202811582820484141761031f5761031f610965565b6000826109d557634e487b7160e01b600052601260045260246000fd5b500490565b805169ffffffffffffffffffff811681146108a657600080fd5b600080600080600060a08688031215610a0c57600080fd5b610a15866109da565b9450602086015193506040860151925060608601519150610a38608087016109da565b90509295509295909350565b600060208284031215610a5657600080fd5b815160ff8116811461095e57600080fd5b600181815b80851115610aa2578160001904821115610a8857610a88610965565b80851615610a9557918102915b93841c9390800290610a6c565b509250929050565b600082610ab95750600161031f565b81610ac65750600061031f565b8160018114610adc5760028114610ae657610b02565b600191505061031f565b60ff841115610af757610af7610965565b50506001821b61031f565b5060208310610133831016604e8410600b8410161715610b25575081810a61031f565b610b2f8383610a67565b8060001904821115610b4357610b43610965565b029392505050565b600061095e60ff841683610aaa56fee04a73ceb6eb109286b5315cfafd156065d9e3fbfa5269d3606a1b3095f3ad00a2646970667358221220b40f7dcf44c2f277871a387076c9b723f1bc531d63a277cff09e76d5915891b764736f6c63430008180033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063715018a61161005b578063715018a61461019d5780638da5cb5b146101a5578063c4d66de8146101df578063f2fde38b146101f257600080fd5b806308c356491461008d5780630f9566e6146100b357806316089ef9146100c857806323643524146100db575b600080fd5b6100a061009b3660046108ab565b610205565b6040519081526020015b60405180910390f35b6100c66100c13660046108d5565b610325565b005b6100a06100d63660046108ab565b61033f565b6101626100e9366004610943565b6040805160608082018352600080835260208084018290529284018190526001600160a01b039485168152600080516020610b5b833981519152835283902083519182018452549384168152600160a01b840467ffffffffffffffff1691810191909152600160e01b90920463ffffffff169082015290565b6040805182516001600160a01b0316815260208084015167ffffffffffffffff16908201529181015163ffffffff16908201526060016100aa565b6100c66103b7565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546040516001600160a01b0390911681526020016100aa565b6100c66101ed366004610943565b6103cb565b6100c6610200366004610943565b6104db565b600080600080516020610b5b8339815191526001600160a01b038086166000908152602083905260409020805492935091168061025557604051633d9ecf6560e11b815260040160405180910390fd5b600080610262838961051e565b85549193509150429061028290600160e01b900463ffffffff168361097b565b10156102a1576040516334360deb60e11b815260040160405180910390fd5b6000670de0b6b3a76400006102b760018261098e565b86546102d490600160a01b900467ffffffffffffffff168b6109a1565b6102de919061097b565b6102e891906109b8565b905060006102f6828a61098e565b90508361030b670de0b6b3a7640000836109a1565b61031591906109b8565b9750505050505050505b92915050565b61032d610648565b610339848484846106a3565b50505050565b600080600080516020610b5b8339815191526001600160a01b038086166000908152602083905260409020805492935091168061038f57604051633d9ecf6560e11b815260040160405180910390fd5b60008061039c838961051e565b90925090506000670de0b6b3a76400006102b760018261098e565b6103bf610648565b6103c960006107bc565b565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156104115750825b905060008267ffffffffffffffff16600114801561042e5750303b155b90508115801561043c575080155b1561045a5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561048457845460ff60401b1916600160401b1785555b61048d8661082d565b83156104d357845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b6104e3610648565b6001600160a01b03811661051257604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b61051b816107bc565b50565b600080600080856001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610562573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058691906109f4565b50935050925050600082136105ae5760405163797d2bbf60e11b815260040160405180910390fd5b6000866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106129190610a44565b905061061f81600a610b4b565b61063184670de0b6b3a76400006109a1565b61063b91906109b8565b9791965090945050505050565b3361067a7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146103c95760405163118cdaa760e01b8152336004820152602401610509565b670de0b6b3a76400008267ffffffffffffffff1611156106d6576040516381b20be960e01b815260040160405180910390fd5b60408051606080820183526001600160a01b0386811680845267ffffffffffffffff878116602080870182815263ffffffff8a8116898b018181528f89166000818152600080516020610b5b833981519152808852908e90209c518d54965193519b166001600160e01b031990961695909517600160a01b9290981691909102969096176001600160e01b0316600160e01b98909216979097021790975587519283528201929092529485015290830152907fe32dd0e1ba6b23ac15f09a0c455561d7dbc2ad9b22f20259edfd397ae8ca85169060800160405180910390a15050505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b61083561083e565b61051b81610887565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166103c957604051631afcd79f60e31b815260040160405180910390fd5b6104e361083e565b80356001600160a01b03811681146108a657600080fd5b919050565b600080604083850312156108be57600080fd5b6108c78361088f565b946020939093013593505050565b600080600080608085870312156108eb57600080fd5b6108f48561088f565b93506109026020860161088f565b9250604085013567ffffffffffffffff8116811461091f57600080fd5b9150606085013563ffffffff8116811461093857600080fd5b939692955090935050565b60006020828403121561095557600080fd5b61095e8261088f565b9392505050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561031f5761031f610965565b8181038181111561031f5761031f610965565b808202811582820484141761031f5761031f610965565b6000826109d557634e487b7160e01b600052601260045260246000fd5b500490565b805169ffffffffffffffffffff811681146108a657600080fd5b600080600080600060a08688031215610a0c57600080fd5b610a15866109da565b9450602086015193506040860151925060608601519150610a38608087016109da565b90509295509295909350565b600060208284031215610a5657600080fd5b815160ff8116811461095e57600080fd5b600181815b80851115610aa2578160001904821115610a8857610a88610965565b80851615610a9557918102915b93841c9390800290610a6c565b509250929050565b600082610ab95750600161031f565b81610ac65750600061031f565b8160018114610adc5760028114610ae657610b02565b600191505061031f565b60ff841115610af757610af7610965565b50506001821b61031f565b5060208310610133831016604e8410600b8410161715610b25575081810a61031f565b610b2f8383610a67565b8060001904821115610b4357610b43610965565b029392505050565b600061095e60ff841683610aaa56fee04a73ceb6eb109286b5315cfafd156065d9e3fbfa5269d3606a1b3095f3ad00a2646970667358221220b40f7dcf44c2f277871a387076c9b723f1bc531d63a277cff09e76d5915891b764736f6c63430008180033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.