MATIC Price: $0.68 (+4.37%)
Gas: 77 GWei
 

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 MATIC

MATIC Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
0x60806040505374262023-11-29 15:42:03142 days ago1701272523IN
 Create: SpeedMarketsAMMUtils
0 MATIC0.0178924294.51838919

Parent Txn Hash Block From To Value
View All Internal Transactions
Loading...
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 Security Audit

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 Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.