ETH Price: $2,238.03 (-9.55%)

Contract

0xf10b634b97627736Ac13c053267e5e87c45D60f7
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TermDiscountRateAdapter

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 10 : TermDiscountRateAdapter.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {ITermDiscountRateAdapter} from "./interface/ITermDiscountRateAdapter.sol";
import {ITermController, AuctionMetadata} from "./interface/ITermController.sol";
import {ITermRepoToken} from "./interface/ITermRepoToken.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";

contract TermDiscountRateAdapter is ITermDiscountRateAdapter, AccessControl {
    bytes32 public constant ORACLE_ROLE = keccak256("ORACLE_ROLE");

    ITermController public immutable TERM_CONTROLLER;
    mapping(address => mapping (bytes32 => bool)) public rateInvalid;
    mapping(address => uint256) public repoRedemptionHaircut;

    constructor(address termController_, address oracleWallet_) {
        TERM_CONTROLLER = ITermController(termController_);
        _grantRole(ORACLE_ROLE, oracleWallet_);        
    }

    /**
     * @notice Retrieves the discount rate for a given repo token
     * @param repoToken The address of the repo token
     * @return The discount rate for the specified repo token
     * @dev This function fetches the auction results for the repo token's term repo ID
     * and returns the clearing rate of the most recent auction
     */
    function getDiscountRate(address repoToken) public view virtual returns (uint256) {
        if (repoToken == address(0)) return 0;
        (AuctionMetadata[] memory auctionMetadata, ) = TERM_CONTROLLER.getTermAuctionResults(ITermRepoToken(repoToken).termRepoId());

        uint256 len = auctionMetadata.length;
        require(len > 0, "No auctions found");

        // If there is a re-opening auction, e.g. 2 or more results for the same token
        if (len > 1) {
            uint256 latestAuctionTime = auctionMetadata[len - 1].auctionClearingBlockTimestamp;
            if ((block.timestamp - latestAuctionTime) < 30 minutes) {
                for (int256 i = int256(len) - 2; i >= 0; i--) {
                    if (!rateInvalid[repoToken][auctionMetadata[uint256(i)].termAuctionId]) {
                        return auctionMetadata[uint256(i)].auctionClearingRate;
                    }
                }
            } else {
                for (int256 i = int256(len) - 1; i >= 0; i--) {
                    if (!rateInvalid[repoToken][auctionMetadata[uint256(i)].termAuctionId]) {
                        return auctionMetadata[uint256(i)].auctionClearingRate;
                    }
                }
            }
            revert("No valid auction rate found");
        }

        // If there is only 1 result (not a re-opening) then always return result
        return auctionMetadata[0].auctionClearingRate;
    }

    /**
    * @notice Sets the invalidity of the result of a specific auction for a given repo token
    * @dev This function is used to mark auction results as invalid or not, typically in cases of suspected manipulation
    * @param repoToken The address of the repo token associated with the auction
    * @param termAuctionId The unique identifier of the term auction to be invalidated
    * @param isInvalid The status of the rate invalidation
    * @custom:access Restricted to accounts with the ORACLE_ROLE
    */
    function setAuctionRateValidator(
        address repoToken, 
        bytes32 termAuctionId, 
        bool isInvalid
    ) external onlyRole(ORACLE_ROLE) {
        // Fetch the auction metadata for the given repo token
        (AuctionMetadata[] memory auctionMetadata, ) = TERM_CONTROLLER.getTermAuctionResults(ITermRepoToken(repoToken).termRepoId());

        // Check if the termAuctionId exists in the metadata
        bool auctionExists = _validateAuctionExistence(auctionMetadata, termAuctionId);

        // Revert if the auction doesn't exist
        require(auctionExists, "Auction ID not found in metadata");

        // Update the rate invalidation status
        rateInvalid[repoToken][termAuctionId] = isInvalid;
    }

    /**
     * @notice Set the repo redemption haircut
     * @param repoToken The address of the repo token
     * @param haircut The repo redemption haircut in 18 decimals
     */
    function setRepoRedemptionHaircut(address repoToken, uint256 haircut) external onlyRole(ORACLE_ROLE) {
        repoRedemptionHaircut[repoToken] = haircut;
    }

    function _validateAuctionExistence(AuctionMetadata[] memory auctionMetadata, bytes32 termAuctionId) private view returns(bool auctionExists) {
        // Check if the termAuctionId exists in the metadata
        bool auctionExists;
        for (uint256 i = 0; i < auctionMetadata.length; i++) {
            if (auctionMetadata[i].termAuctionId == termAuctionId) {
                auctionExists = true;
                break;
            }
        }
    }
}

File 2 of 10 : ITermDiscountRateAdapter.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

interface ITermDiscountRateAdapter {
    function getDiscountRate(address repoToken) external view returns (uint256);
}

File 3 of 10 : ITermController.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;

struct AuctionMetadata {
    bytes32 termAuctionId;
    uint256 auctionClearingRate;
    uint256 auctionClearingBlockTimestamp;
}

interface ITermController {
    function isTermDeployed(address contractAddress) external view returns (bool);

    function getTermAuctionResults(bytes32 termRepoId) external view returns (AuctionMetadata[] memory auctionMetadata, uint8 numOfAuctions);
}

File 4 of 10 : ITermRepoToken.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface ITermRepoToken is IERC20 {
    function redemptionValue() external view returns (uint256);

    function config() external view returns (
        uint256 redemptionTimestamp, 
        address purchaseToken, 
        address termRepoServicer, 
        address termRepoCollateralManager
    );

    function termRepoId() external view returns (bytes32);
}

File 5 of 10 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address account => bool) hasRole;
        bytes32 adminRole;
    }

    mapping(bytes32 role => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with an {AccessControlUnauthorizedAccount} error including the required role.
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual returns (bool) {
        return _roles[role].hasRole[account];
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
     * is missing `role`.
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert AccessControlUnauthorizedAccount(account, role);
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address callerConfirmation) public virtual {
        if (callerConfirmation != _msgSender()) {
            revert AccessControlBadConfirmation();
        }

        _revokeRole(role, callerConfirmation);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
        if (!hasRole(role, account)) {
            _roles[role].hasRole[account] = true;
            emit RoleGranted(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
        if (hasRole(role, account)) {
            _roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}

File 6 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

File 7 of 10 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (access/IAccessControl.sol)

pragma solidity ^0.8.20;

/**
 * @dev External interface of AccessControl declared to support ERC-165 detection.
 */
interface IAccessControl {
    /**
     * @dev The `account` is missing a role.
     */
    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);

    /**
     * @dev The caller of a function is not the expected one.
     *
     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
     */
    error AccessControlBadConfirmation();

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call. This account bears the admin role (for the granted role).
     * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     */
    function renounceRole(bytes32 role, address callerConfirmation) external;
}

File 8 of 10 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 9 of 10 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

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

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 10 of 10 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "forge-std/=lib/forge-std/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"termController_","type":"address"},{"internalType":"address","name":"oracleWallet_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ORACLE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TERM_CONTROLLER","outputs":[{"internalType":"contract ITermController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"repoToken","type":"address"}],"name":"getDiscountRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"rateInvalid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"repoRedemptionHaircut","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"repoToken","type":"address"},{"internalType":"bytes32","name":"termAuctionId","type":"bytes32"},{"internalType":"bool","name":"isInvalid","type":"bool"}],"name":"setAuctionRateValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"repoToken","type":"address"},{"internalType":"uint256","name":"haircut","type":"uint256"}],"name":"setRepoRedemptionHaircut","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60a060405234801561001057600080fd5b50604051610f5b380380610f5b83398101604081905261002f91610136565b6001600160a01b0382166080526100667f68e79a7bf1e0bc45d0a330c573bc367f9cf464fd326078812f301165fbda4ef18261006e565b505050610169565b6000828152602081815260408083206001600160a01b038516845290915281205460ff16610110576000838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556100c83390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610114565b5060005b92915050565b80516001600160a01b038116811461013157600080fd5b919050565b6000806040838503121561014957600080fd5b6101528361011a565b91506101606020840161011a565b90509250929050565b608051610dc9610192600039600081816101e20152818161039a01526105430152610dc96000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806343c2935a1161008c5780638d35248d116100665780638d35248d1461022f57806391d148541461025d578063a217fddf14610270578063d547741f1461027857600080fd5b806343c2935a146101ca5780635c2e63fc146101dd5780636b01d8261461021c57600080fd5b80632f2ff15d116100c85780632f2ff15d1461016f57806331930de91461018457806336568abe1461019757806337e935ee146101aa57600080fd5b806301ffc9a7146100ef57806307e2cea514610117578063248a9ca31461014c575b600080fd5b6101026100fd366004610a5c565b61028b565b60405190151581526020015b60405180910390f35b61013e7f68e79a7bf1e0bc45d0a330c573bc367f9cf464fd326078812f301165fbda4ef181565b60405190815260200161010e565b61013e61015a366004610a8d565b60009081526020819052604090206001015490565b61018261017d366004610ac2565b6102c2565b005b610182610192366004610aee565b6102ed565b6101826101a5366004610ac2565b610334565b61013e6101b8366004610b18565b60026020526000908152604090205481565b6101826101d8366004610b33565b61036c565b6102047f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161010e565b61013e61022a366004610b18565b610527565b61010261023d366004610aee565b600160209081526000928352604080842090915290825290205460ff1681565b61010261026b366004610ac2565b610871565b61013e600081565b610182610286366004610ac2565b61089a565b60006001600160e01b03198216637965db0b60e01b14806102bc57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152602081905260409020600101546102dd816108bf565b6102e783836108cc565b50505050565b7f68e79a7bf1e0bc45d0a330c573bc367f9cf464fd326078812f301165fbda4ef1610317816108bf565b506001600160a01b03909116600090815260026020526040902055565b6001600160a01b038116331461035d5760405163334bd91960e11b815260040160405180910390fd5b610367828261095e565b505050565b7f68e79a7bf1e0bc45d0a330c573bc367f9cf464fd326078812f301165fbda4ef1610396816108bf565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637f2fdf48866001600160a01b031663cc5b6e4a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610405573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104299190610b78565b6040518263ffffffff1660e01b815260040161044791815260200190565b600060405180830381865afa158015610464573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261048c9190810190610c12565b509050600061049b82866109c9565b9050806104ef5760405162461bcd60e51b815260206004820181905260248201527f41756374696f6e204944206e6f7420666f756e6420696e206d6574616461746160448201526064015b60405180910390fd5b5050506001600160a01b0392909216600090815260016020908152604080832093835292905220805460ff1916911515919091179055565b60006001600160a01b03821661053f57506000919050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637f2fdf48846001600160a01b031663cc5b6e4a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d29190610b78565b6040518263ffffffff1660e01b81526004016105f091815260200190565b600060405180830381865afa15801561060d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106359190810190610c12565b5080519091508061067c5760405162461bcd60e51b8152602060048201526011602482015270139bc8185d58dd1a5bdb9cc8199bdd5b99607a1b60448201526064016104e6565b600181111561084957600082610693600184610d0d565b815181106106a3576106a3610d20565b602002602001015160400151905061070881426106c09190610d0d565b10156107715760006106d3600284610d36565b90505b6000811261076b576001600160a01b0386166000908152600160205260408120855190919086908490811061070d5761070d610d20565b6020908102919091018101515182528101919091526040016000205460ff166107595783818151811061074257610742610d20565b602002602001015160200151945050505050919050565b8061076381610d5d565b9150506106d6565b50610801565b600061077e600184610d36565b90505b600081126107ff576001600160a01b038616600090815260016020526040812085519091908690849081106107b8576107b8610d20565b6020908102919091018101515182528101919091526040016000205460ff166107ed5783818151811061074257610742610d20565b806107f781610d5d565b915050610781565b505b60405162461bcd60e51b815260206004820152601b60248201527f4e6f2076616c69642061756374696f6e207261746520666f756e64000000000060448201526064016104e6565b8160008151811061085c5761085c610d20565b60200260200101516020015192505050919050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000828152602081905260409020600101546108b5816108bf565b6102e7838361095e565b6108c98133610a1f565b50565b60006108d88383610871565b610956576000838152602081815260408083206001600160a01b03861684529091529020805460ff1916600117905561090e3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016102bc565b5060006102bc565b600061096a8383610871565b15610956576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016102bc565b60008060005b8451811015610a1757838582815181106109eb576109eb610d20565b60200260200101516000015103610a055760019150610a17565b80610a0f81610d7a565b9150506109cf565b505092915050565b610a298282610871565b610a585760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016104e6565b5050565b600060208284031215610a6e57600080fd5b81356001600160e01b031981168114610a8657600080fd5b9392505050565b600060208284031215610a9f57600080fd5b5035919050565b80356001600160a01b0381168114610abd57600080fd5b919050565b60008060408385031215610ad557600080fd5b82359150610ae560208401610aa6565b90509250929050565b60008060408385031215610b0157600080fd5b610b0a83610aa6565b946020939093013593505050565b600060208284031215610b2a57600080fd5b610a8682610aa6565b600080600060608486031215610b4857600080fd5b610b5184610aa6565b92506020840135915060408401358015158114610b6d57600080fd5b809150509250925092565b600060208284031215610b8a57600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715610bca57610bca610b91565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610bf957610bf9610b91565b604052919050565b805160ff81168114610abd57600080fd5b6000806040808486031215610c2657600080fd5b835167ffffffffffffffff80821115610c3e57600080fd5b818601915086601f830112610c5257600080fd5b8151602082821115610c6657610c66610b91565b610c74818360051b01610bd0565b8281528181019350606092830285018201928a841115610c9357600080fd5b948201945b83861015610cdb5780868c031215610cb05760008081fd5b610cb8610ba7565b865181528387015184820152878701518882015285529485019493820193610c98565b509650610ce9888201610c01565b955050505050509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156102bc576102bc610cf7565b634e487b7160e01b600052603260045260246000fd5b8181036000831280158383131683831282161715610d5657610d56610cf7565b5092915050565b6000600160ff1b8201610d7257610d72610cf7565b506000190190565b600060018201610d8c57610d8c610cf7565b506001019056fea2646970667358221220ba4def28b0c8d1dae9b18faa0b717e185bffda20f7f7893d5b0af7ccdaac209c64736f6c6343000815003300000000000000000000000021fc7b250ccaeecdb2abb38e04617d1f24d987720000000000000000000000006d3df8d321a47ec2b4463ab0ca75986367c86315

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806343c2935a1161008c5780638d35248d116100665780638d35248d1461022f57806391d148541461025d578063a217fddf14610270578063d547741f1461027857600080fd5b806343c2935a146101ca5780635c2e63fc146101dd5780636b01d8261461021c57600080fd5b80632f2ff15d116100c85780632f2ff15d1461016f57806331930de91461018457806336568abe1461019757806337e935ee146101aa57600080fd5b806301ffc9a7146100ef57806307e2cea514610117578063248a9ca31461014c575b600080fd5b6101026100fd366004610a5c565b61028b565b60405190151581526020015b60405180910390f35b61013e7f68e79a7bf1e0bc45d0a330c573bc367f9cf464fd326078812f301165fbda4ef181565b60405190815260200161010e565b61013e61015a366004610a8d565b60009081526020819052604090206001015490565b61018261017d366004610ac2565b6102c2565b005b610182610192366004610aee565b6102ed565b6101826101a5366004610ac2565b610334565b61013e6101b8366004610b18565b60026020526000908152604090205481565b6101826101d8366004610b33565b61036c565b6102047f00000000000000000000000021fc7b250ccaeecdb2abb38e04617d1f24d9877281565b6040516001600160a01b03909116815260200161010e565b61013e61022a366004610b18565b610527565b61010261023d366004610aee565b600160209081526000928352604080842090915290825290205460ff1681565b61010261026b366004610ac2565b610871565b61013e600081565b610182610286366004610ac2565b61089a565b60006001600160e01b03198216637965db0b60e01b14806102bc57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152602081905260409020600101546102dd816108bf565b6102e783836108cc565b50505050565b7f68e79a7bf1e0bc45d0a330c573bc367f9cf464fd326078812f301165fbda4ef1610317816108bf565b506001600160a01b03909116600090815260026020526040902055565b6001600160a01b038116331461035d5760405163334bd91960e11b815260040160405180910390fd5b610367828261095e565b505050565b7f68e79a7bf1e0bc45d0a330c573bc367f9cf464fd326078812f301165fbda4ef1610396816108bf565b60007f00000000000000000000000021fc7b250ccaeecdb2abb38e04617d1f24d987726001600160a01b0316637f2fdf48866001600160a01b031663cc5b6e4a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610405573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104299190610b78565b6040518263ffffffff1660e01b815260040161044791815260200190565b600060405180830381865afa158015610464573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261048c9190810190610c12565b509050600061049b82866109c9565b9050806104ef5760405162461bcd60e51b815260206004820181905260248201527f41756374696f6e204944206e6f7420666f756e6420696e206d6574616461746160448201526064015b60405180910390fd5b5050506001600160a01b0392909216600090815260016020908152604080832093835292905220805460ff1916911515919091179055565b60006001600160a01b03821661053f57506000919050565b60007f00000000000000000000000021fc7b250ccaeecdb2abb38e04617d1f24d987726001600160a01b0316637f2fdf48846001600160a01b031663cc5b6e4a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d29190610b78565b6040518263ffffffff1660e01b81526004016105f091815260200190565b600060405180830381865afa15801561060d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106359190810190610c12565b5080519091508061067c5760405162461bcd60e51b8152602060048201526011602482015270139bc8185d58dd1a5bdb9cc8199bdd5b99607a1b60448201526064016104e6565b600181111561084957600082610693600184610d0d565b815181106106a3576106a3610d20565b602002602001015160400151905061070881426106c09190610d0d565b10156107715760006106d3600284610d36565b90505b6000811261076b576001600160a01b0386166000908152600160205260408120855190919086908490811061070d5761070d610d20565b6020908102919091018101515182528101919091526040016000205460ff166107595783818151811061074257610742610d20565b602002602001015160200151945050505050919050565b8061076381610d5d565b9150506106d6565b50610801565b600061077e600184610d36565b90505b600081126107ff576001600160a01b038616600090815260016020526040812085519091908690849081106107b8576107b8610d20565b6020908102919091018101515182528101919091526040016000205460ff166107ed5783818151811061074257610742610d20565b806107f781610d5d565b915050610781565b505b60405162461bcd60e51b815260206004820152601b60248201527f4e6f2076616c69642061756374696f6e207261746520666f756e64000000000060448201526064016104e6565b8160008151811061085c5761085c610d20565b60200260200101516020015192505050919050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000828152602081905260409020600101546108b5816108bf565b6102e7838361095e565b6108c98133610a1f565b50565b60006108d88383610871565b610956576000838152602081815260408083206001600160a01b03861684529091529020805460ff1916600117905561090e3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016102bc565b5060006102bc565b600061096a8383610871565b15610956576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016102bc565b60008060005b8451811015610a1757838582815181106109eb576109eb610d20565b60200260200101516000015103610a055760019150610a17565b80610a0f81610d7a565b9150506109cf565b505092915050565b610a298282610871565b610a585760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016104e6565b5050565b600060208284031215610a6e57600080fd5b81356001600160e01b031981168114610a8657600080fd5b9392505050565b600060208284031215610a9f57600080fd5b5035919050565b80356001600160a01b0381168114610abd57600080fd5b919050565b60008060408385031215610ad557600080fd5b82359150610ae560208401610aa6565b90509250929050565b60008060408385031215610b0157600080fd5b610b0a83610aa6565b946020939093013593505050565b600060208284031215610b2a57600080fd5b610a8682610aa6565b600080600060608486031215610b4857600080fd5b610b5184610aa6565b92506020840135915060408401358015158114610b6d57600080fd5b809150509250925092565b600060208284031215610b8a57600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715610bca57610bca610b91565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610bf957610bf9610b91565b604052919050565b805160ff81168114610abd57600080fd5b6000806040808486031215610c2657600080fd5b835167ffffffffffffffff80821115610c3e57600080fd5b818601915086601f830112610c5257600080fd5b8151602082821115610c6657610c66610b91565b610c74818360051b01610bd0565b8281528181019350606092830285018201928a841115610c9357600080fd5b948201945b83861015610cdb5780868c031215610cb05760008081fd5b610cb8610ba7565b865181528387015184820152878701518882015285529485019493820193610c98565b509650610ce9888201610c01565b955050505050509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156102bc576102bc610cf7565b634e487b7160e01b600052603260045260246000fd5b8181036000831280158383131683831282161715610d5657610d56610cf7565b5092915050565b6000600160ff1b8201610d7257610d72610cf7565b506000190190565b600060018201610d8c57610d8c610cf7565b506001019056fea2646970667358221220ba4def28b0c8d1dae9b18faa0b717e185bffda20f7f7893d5b0af7ccdaac209c64736f6c63430008150033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000021fc7b250ccaeecdb2abb38e04617d1f24d987720000000000000000000000006d3df8d321a47ec2b4463ab0ca75986367c86315

-----Decoded View---------------
Arg [0] : termController_ (address): 0x21FC7B250CCAeECDb2abb38e04617D1f24D98772
Arg [1] : oracleWallet_ (address): 0x6D3DF8D321a47ec2b4463Ab0cA75986367c86315

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000021fc7b250ccaeecdb2abb38e04617d1f24d98772
Arg [1] : 0000000000000000000000006d3df8d321a47ec2b4463ab0ca75986367c86315


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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.