TiersManagerV2

Description:

Smart contract deployed on Ethereum with Factory features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "src/ths-staking/tiers-managers/TiersManagerV2.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;

import {ITiersManager} from "./interfaces/ITiersManager.sol";

contract TiersManagerV2 is ITiersManager {
    // Old tier
    uint8 private constant OLD_TIER_ID = 0;
    uint256 private constant OLD_FEE_BPS = 0;

    // New tier
    uint8 private constant NEW_TIER_ID = 1;
    uint256 private constant NEW_FEE_BPS = 1000;
    uint256 private constant MIN_AMOUNT = 1 ether; // 1 THS

    function getTiers() external pure returns (uint8[] memory, uint256[] memory) {
        uint8[] memory tierIds = new uint8[](2);
        uint256[] memory feeBps = new uint256[](2);
        tierIds[0] = OLD_TIER_ID;
        feeBps[0] = OLD_FEE_BPS;
        tierIds[1] = NEW_TIER_ID;
        feeBps[1] = NEW_FEE_BPS;
        return (tierIds, feeBps);
    }

    function getTierIdByAmount(uint256 amount) external pure returns (uint8 tierId) {
        if (amount < MIN_AMOUNT) {
            revert AmountTooLow();
        }
        return NEW_TIER_ID;
    }
}
"
    },
    "src/ths-staking/tiers-managers/interfaces/ITiersManager.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;

import {ITiersManagerErrors} from "./ITiersManagerErrors.sol";

interface ITiersManager is ITiersManagerErrors {
    function getTiers() external view returns (uint8[] memory, uint256[] memory);

    function getTierIdByAmount(uint256 amount) external view returns (uint8 tierId);
}
"
    },
    "src/ths-staking/tiers-managers/interfaces/ITiersManagerErrors.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity 0.8.30;

interface ITiersManagerErrors {
    error AmountTooLow();
}
"
    }
  },
  "settings": {
    "remappings": [
      "forge-std/=lib/forge-std/src/",
      "@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
      "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
      "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
      "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
      "halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
      "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
      "openzeppelin-contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/"
    ],
    "optimizer": {
      "enabled": true,
      "runs": 1000000
    },
    "metadata": {
      "useLiteralContent": false,
      "bytecodeHash": "ipfs",
      "appendCBOR": true
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "evmVersion": "prague",
    "viaIR": true
  }
}}

Tags:
Factory|addr:0xd78beaa259969d96efb29566b7ea2f27d284068e|verified:true|block:23476529|tx:0xd0b0317f74e262febff7a92d4ede52b2966a74410bf08acb50f873088aeda4a3|first_check:1759247682

Submitted on: 2025-09-30 17:54:42

Comments

Log in to comment.

No comments yet.