Contract 0x5D7c74d64ae47b3b4Bf60cB15a14dCd6048E5B14

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xc8dc10feded08f3b0507c6efd5fdcaad4f1734dbf8dd821c863679805edf697c0x608060401552945372023-11-29 17:23:20174 days 1 hr ago0x34ad8d8c3e12b5a500fe983c43f2a0306dcf0ad1 IN  Create: SpeedMarketsAMMUtils0 ETH0.000425820.1
[ 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"}]

608060405234801561001057600080fd5b50610276806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063336ef50d14610030575b600080fd5b61004361003e36600461014e565b610055565b60405190815260200160405180910390f35b80600061006d603c67ffffffffffffffff8a166101dc565b9050855b80156100f85787876100846001846101fc565b8181106100a157634e487b7160e01b600052603260045260246000fd5b9050602002013582106100e65785856100bb6001846101fc565b8181106100d857634e487b7160e01b600052603260045260246000fd5b9050602002013592506100f8565b806100f081610213565b915050610071565b50509695505050505050565b60008083601f840112610115578182fd5b50813567ffffffffffffffff81111561012c578182fd5b6020830191508360208260051b850101111561014757600080fd5b9250929050565b60008060008060008060808789031215610166578182fd5b863567ffffffffffffffff808216821461017e578384fd5b90965060208801359080821115610193578384fd5b61019f8a838b01610104565b909750955060408901359150808211156101b7578384fd5b506101c489828a01610104565b979a9699509497949695606090950135949350505050565b6000826101f757634e487b7160e01b81526012600452602481fd5b500490565b60008282101561020e5761020e61022a565b500390565b6000816102225761022261022a565b506000190190565b634e487b7160e01b600052601160045260246000fdfea264697066735822122082f05e2b0f0a871ad0a29a8ce2c892f4c1943dcc39f768943289ec6f1b44d3f564736f6c63430008040033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063336ef50d14610030575b600080fd5b61004361003e36600461014e565b610055565b60405190815260200160405180910390f35b80600061006d603c67ffffffffffffffff8a166101dc565b9050855b80156100f85787876100846001846101fc565b8181106100a157634e487b7160e01b600052603260045260246000fd5b9050602002013582106100e65785856100bb6001846101fc565b8181106100d857634e487b7160e01b600052603260045260246000fd5b9050602002013592506100f8565b806100f081610213565b915050610071565b50509695505050505050565b60008083601f840112610115578182fd5b50813567ffffffffffffffff81111561012c578182fd5b6020830191508360208260051b850101111561014757600080fd5b9250929050565b60008060008060008060808789031215610166578182fd5b863567ffffffffffffffff808216821461017e578384fd5b90965060208801359080821115610193578384fd5b61019f8a838b01610104565b909750955060408901359150808211156101b7578384fd5b506101c489828a01610104565b979a9699509497949695606090950135949350505050565b6000826101f757634e487b7160e01b81526012600452602481fd5b500490565b60008282101561020e5761020e61022a565b500390565b6000816102225761022261022a565b506000190190565b634e487b7160e01b600052601160045260246000fdfea264697066735822122082f05e2b0f0a871ad0a29a8ce2c892f4c1943dcc39f768943289ec6f1b44d3f564736f6c63430008040033

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.