Contract 0x7334A6A342c15e23Cc550e3dCf892a0cd1E8cbb6

  Note: Our ETH balance display is temporarily unavailable. Please check back later.

Contract Overview

Balance:
Txn Hash Method
Block
From
To
Value
0x41373555eba01444590c7cf2fdba8e02e995dd16911824fd0f9ddfb38b21f1120x60806040166890942023-11-01 2:37:36205 days 11 hrs ago0xd866b2332d4383c1bf719732177e2d9109c99dbc IN  Create: SpeedMarketsAMMUtils0 ETH0.0000000018920.00001
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SpeedMarketsAMMUtils

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 1 : SpeedMarketsAMMUtils.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title An AMM utils for Thales speed markets
contract SpeedMarketsAMMUtils {
    uint private constant SECONDS_PER_MINUTE = 60;

    /// @notice get dynamic fee based on defined time thresholds for a given delta time
    /// @param _deltaTimeSec to search for appropriate time range (in seconds)
    /// @param _timeThresholds array of time thresholds for each fee (in minutes)
    /// @param _fees array of fees for every time range
    /// @param _defaultFee if _deltaTime doesn't have appropriate time range return this value
    /// @return fee defined for specific time range to which _deltaTime belongs to
    function getFeeByTimeThreshold(
        uint64 _deltaTimeSec,
        uint[] calldata _timeThresholds,
        uint[] calldata _fees,
        uint _defaultFee
    ) external pure returns (uint fee) {
        fee = _defaultFee;
        uint _deltaTime = _deltaTimeSec / SECONDS_PER_MINUTE;
        for (uint i = _timeThresholds.length; i > 0; i--) {
            if (_deltaTime >= _timeThresholds[i - 1]) {
                fee = _fees[i - 1];
                break;
            }
        }
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"uint64","name":"_deltaTimeSec","type":"uint64"},{"internalType":"uint256[]","name":"_timeThresholds","type":"uint256[]"},{"internalType":"uint256[]","name":"_fees","type":"uint256[]"},{"internalType":"uint256","name":"_defaultFee","type":"uint256"}],"name":"getFeeByTimeThreshold","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"pure","type":"function"}]

608060405234801561001057600080fd5b50610276806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063336ef50d14610030575b600080fd5b61004361003e36600461014e565b610055565b60405190815260200160405180910390f35b80600061006d603c67ffffffffffffffff8a166101dc565b9050855b80156100f85787876100846001846101fc565b8181106100a157634e487b7160e01b600052603260045260246000fd5b9050602002013582106100e65785856100bb6001846101fc565b8181106100d857634e487b7160e01b600052603260045260246000fd5b9050602002013592506100f8565b806100f081610213565b915050610071565b50509695505050505050565b60008083601f840112610115578182fd5b50813567ffffffffffffffff81111561012c578182fd5b6020830191508360208260051b850101111561014757600080fd5b9250929050565b60008060008060008060808789031215610166578182fd5b863567ffffffffffffffff808216821461017e578384fd5b90965060208801359080821115610193578384fd5b61019f8a838b01610104565b909750955060408901359150808211156101b7578384fd5b506101c489828a01610104565b979a9699509497949695606090950135949350505050565b6000826101f757634e487b7160e01b81526012600452602481fd5b500490565b60008282101561020e5761020e61022a565b500390565b6000816102225761022261022a565b506000190190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220ba8cac458ed476505993a89031e207ab77e88389eba86a541ca3785d635542eb64736f6c63430008040033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063336ef50d14610030575b600080fd5b61004361003e36600461014e565b610055565b60405190815260200160405180910390f35b80600061006d603c67ffffffffffffffff8a166101dc565b9050855b80156100f85787876100846001846101fc565b8181106100a157634e487b7160e01b600052603260045260246000fd5b9050602002013582106100e65785856100bb6001846101fc565b8181106100d857634e487b7160e01b600052603260045260246000fd5b9050602002013592506100f8565b806100f081610213565b915050610071565b50509695505050505050565b60008083601f840112610115578182fd5b50813567ffffffffffffffff81111561012c578182fd5b6020830191508360208260051b850101111561014757600080fd5b9250929050565b60008060008060008060808789031215610166578182fd5b863567ffffffffffffffff808216821461017e578384fd5b90965060208801359080821115610193578384fd5b61019f8a838b01610104565b909750955060408901359150808211156101b7578384fd5b506101c489828a01610104565b979a9699509497949695606090950135949350505050565b6000826101f757634e487b7160e01b81526012600452602481fd5b500490565b60008282101561020e5761020e61022a565b500390565b6000816102225761022261022a565b506000190190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220ba8cac458ed476505993a89031e207ab77e88389eba86a541ca3785d635542eb64736f6c63430008040033

Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading