ConstantUSDTBPriceFeed

Description:

Multi-signature wallet contract requiring multiple confirmations for transaction execution.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "src/oracle/ConstantUSDTBPriceFeed.sol": {
      "content": "// SPDX-License-Identifier: Apache-2.0

pragma solidity 0.8.26;

import { NAV_POSITIVE_THRESHOLD, NAV_PRICE_DECIMALS } from "../constants.sol";
/**
 * @title  NAV Proxy USDTB Chainlink Compatible Price Feed Constant
 * @notice A constant price feed contract that always returns a fixed NAV (Net Asset Value) threshold,
 *         compatible with the Chainlink AggregatorV3Interface.
 * @dev This contract is a modified version to return a constant in order to offboard the USDTB RWA from the Usual Collateral Tokens.
 * @author Usual Labs
 */

contract ConstantUSDTBPriceFeed {
    /// @notice Returns the number of decimals used in price feed output.
    /// @return The number of decimals.
    function decimals() public view virtual returns (uint8) {
        return NAV_PRICE_DECIMALS;
    }

    /// @notice Returns the description of the price feed.
    /// @return The description.
    function description() public pure returns (string memory) {
        return "USDTB by Ethena / USD Constant Price Feed";
    }

    /// @notice Returns the version of the price feed.
    /// @return The version.
    function version() public pure returns (uint256) {
        return 1;
    }

    /// @notice Returns the threshold for the price feed.
    /// @return The threshold.
    function getThreshold() public pure returns (int256) {
        return NAV_POSITIVE_THRESHOLD;
    }

    /// @notice Returns the round data for a given round ID.
    /// @param _roundId The round ID.
    /// @return roundId The round ID.
    /// @return answer The answer.
    /// @return startedAt The started at.
    /// @return updatedAt The updated at.
    /// @return answeredInRound The answered in round.
    function getRoundData(
        uint80 _roundId
    )
        external
        view
        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
    {
        return (_roundId, NAV_POSITIVE_THRESHOLD, block.timestamp, block.timestamp, _roundId);
    }

    /// @notice Returns the latest round data.
    /// @return roundId The round ID.
    /// @return answer The answer.
    /// @return startedAt The started at.
    /// @return updatedAt The updated at.
    /// @return answeredInRound The answered in round.
    function latestRoundData()
        external
        view
        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
    {
        roundId = uint80(block.timestamp);
        return (roundId, NAV_POSITIVE_THRESHOLD, block.timestamp, block.timestamp, roundId);
    }
}
"
    },
    "src/constants.sol": {
      "content": "// SPDX-License-Identifier: Apache-2.0

pragma solidity 0.8.26;

// The default admin role.
bytes32 constant DEFAULT_ADMIN_ROLE = 0x00;

// The unwrap role. Required to unwrap UsualUSDTB.
bytes32 constant USUAL_USDTB_UNWRAP = keccak256("USUAL_USDTB_UNWRAP");

// The pause role. Required to pause UsualUSDTB.
bytes32 constant USUAL_USDTB_PAUSE = keccak256("USUAL_USDTB_PAUSE");

// The unpause role. Required to unpause UsualUSDTB.
bytes32 constant USUAL_USDTB_UNPAUSE = keccak256("USUAL_USDTB_UNPAUSE");

// The blacklist role. Required to blacklist addresses.
bytes32 constant BLACKLIST_ROLE = keccak256("BLACKLIST_ROLE");

// The mint cap allocator role. Required to set the mint cap.
bytes32 constant USUAL_USDTB_MINTCAP_ALLOCATOR = keccak256("USUAL_USDTB_MINTCAP_ALLOCATOR");

// The number of decimals for the UsualUSDTB token.
uint8 constant USUAL_USDTB_DECIMALS = 18;

// The number of decimals of the NAV price.
uint8 constant NAV_PRICE_DECIMALS = 8;

// NAV price threshold that defines 1$ USDTB price.
int256 constant NAV_POSITIVE_THRESHOLD = 1e8;
"
    }
  },
  "settings": {
    "remappings": [
      "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
      "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
      "@pythnetwork/=node_modules/@pythnetwork/",
      "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
      "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
      "forge-std/=lib/forge-std/src/",
      "halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
      "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
      "openzeppelin-contracts/=lib/openzeppelin-contracts/"
    ],
    "optimizer": {
      "enabled": true,
      "runs": 999999
    },
    "metadata": {
      "useLiteralContent": false,
      "bytecodeHash": "ipfs",
      "appendCBOR": true
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "evmVersion": "cancun",
    "viaIR": false
  }
}}

Tags:
Multisig, Upgradeable, Multi-Signature, Factory, Oracle|addr:0x6ca70270f1e19f2b6c7dc6bb2727fa2ba54d01ce|verified:true|block:23632420|tx:0xa8111e8976cafa6a65b83c468d64d59ac82aca061d48b714b82acaedda51de3d|first_check:1761241151

Submitted on: 2025-10-23 19:39:14

Comments

Log in to comment.

No comments yet.