Contract Information

This is an extension of the market logic contract which supports some auxiliary/independent interfaces for the protocol. This is used to add additional functionality without requiring contract space in the main protocol contract. Do not interact with this contract directly; instead use the cUSDCv3 proxy address with the Comet Interface ABI.
More Info

CometExt Source Code

// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.15; import "./CometExtInterface.sol"; contract CometExt is CometExtInterface { /** Public constants **/ /// @notice The major version of this contract string public override constant version = "0"; /** Internal constants **/ /// @dev The EIP-712 typehash for the contract's domain bytes32 internal constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); /// @dev The EIP-712 typehash for allowBySig Authorization bytes32 internal constant AUTHORIZATION_TYPEHASH = keccak256("Authorization(address owner,address manager,bool isAllowed,uint256 nonce,uint256 expiry)"); /// @dev The highest valid value for s in an ECDSA signature pair (0 < s < secp256k1n √∑ 2 + 1) /// See https://ethereum.github.io/yellowpaper/paper.pdf #307) uint internal constant MAX_VALID_ECDSA_S = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0; /** Immutable symbol **/ /// @dev The ERC20 name for wrapped base token bytes32 internal immutable name32; /// @dev The ERC20 symbol for wrapped base token bytes32 internal immutable symbol32; /** * @notice Construct a new protocol instance * @param config The mapping of initial/constant parameters **/ constructor(ExtConfiguration memory config) { name32 = config.name32; symbol32 = config.symbol32; } /** External getters for internal constants **/ function baseAccrualScale() override external pure returns (uint64) { return BASE_ACCRUAL_SCALE; } function baseIndexScale() override external pure returns (uint64) { return BASE_INDEX_SCALE; } function factorScale() override external pure returns (uint64) { return FACTOR_SCALE; } function priceScale() override external pure returns (uint64) { return PRICE_SCALE; } function maxAssets() override external pure returns (uint8) { return MAX_ASSETS; } /** * @notice Aggregate variables tracked for the entire market **/ function totalsBasic() public override view returns (TotalsBasic memory) { return TotalsBasic({ baseSupplyIndex: baseSupplyIndex, baseBorrowIndex: baseBorrowIndex, trackingSupplyIndex: trackingSupplyIndex, trackingBorrowIndex: trackingBorrowIndex, totalSupplyBase: totalSupplyBase, totalBorrowBase: totalBorrowBase, lastAccrualTime: lastAccrualTime, pauseFlags: pauseFlags }); } /** Additional ERC20 functionality and approval interface **/ /** * @notice Get the ERC20 name for wrapped base token * @return The name as a string */ function name() override public view returns (string memory) { uint8 i; for (i = 0; i < 32; ) { if (name32[i] == 0) { break; } unchecked { i++; } } bytes memory name_ = new bytes(i); for (uint8 j = 0; j < i; ) { name_[j] = name32[j]; unchecked { j++; } } return string(name_); } /** * @notice Get the ERC20 symbol for wrapped base token * @return The symbol as a string */ function symbol() override external view returns (string memory) { uint8 i; for (i = 0; i < 32; ) { if (symbol32[i] == 0) { break; } unchecked { i++; } } bytes memory symbol_ = new bytes(i); for (uint8 j = 0; j < i; ) { symbol_[j] = symbol32[j]; unchecked { j++; } } return string(symbol_); } /** * @notice Query the current collateral balance of an account * @param account The account whose balance to query * @param asset The collateral asset to check the balance for * @return The collateral balance of the account */ function collateralBalanceOf(address account, address asset) override external view returns (uint128) { return userCollateral[account][asset].balance; } /** * @notice Query the total accrued base rewards for an account * @param account The account to query * @return The accrued rewards, scaled by `BASE_ACCRUAL_SCALE` */ function baseTrackingAccrued(address account) override external view returns (uint64) { return userBasic[account].baseTrackingAccrued; } /** * @notice Approve or disallow `spender` to transfer on sender's behalf * @dev Note: this binary approval is unlike most other ERC20 tokens * @dev Note: this grants full approval for spender to manage *all* the owner's assets * @param spender The address of the account which may transfer tokens * @param amount Either uint.max (to allow) or zero (to disallow) * @return Whether or not the approval change succeeded */ function approve(address spender, uint256 amount) override external returns (bool) { if (amount == type(uint256).max) { allowInternal(msg.sender, spender, true); } else if (amount == 0) { allowInternal(msg.sender, spender, false); } else { revert BadAmount(); } return true; } /** * @notice Get the current allowance from `owner` for `spender` * @dev Note: this binary allowance is unlike most other ERC20 tokens * @dev Note: this allowance allows spender to manage *all* the owner's assets * @param owner The address of the account which owns the tokens to be spent * @param spender The address of the account which may transfer tokens * @return Either uint.max (spender is allowed) or zero (spender is disallowed) */ function allowance(address owner, address spender) override external view returns (uint256) { return hasPermission(owner, spender) ? type(uint256).max : 0; } /** * @notice Allow or disallow another address to withdraw, or transfer from the sender * @param manager The account which will be allowed or disallowed * @param isAllowed_ Whether to allow or disallow */ function allow(address manager, bool isAllowed_) override external { allowInternal(msg.sender, manager, isAllowed_); } /** * @dev Stores the flag marking whether the manager is allowed to act on behalf of owner */ function allowInternal(address owner, address manager, bool isAllowed_) internal { isAllowed[owner][manager] = isAllowed_; emit Approval(owner, manager, isAllowed_ ? type(uint256).max : 0); } /** * @notice Sets authorization status for a manager via signature from signatory * @param owner The address that signed the signature * @param manager The address to authorize (or rescind authorization from) * @param isAllowed_ Whether to authorize or rescind authorization from manager * @param nonce The next expected nonce value for the signatory * @param expiry Expiration time for the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function allowBySig( address owner, address manager, bool isAllowed_, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) override external { if (uint256(s) > MAX_VALID_ECDSA_S) revert InvalidValueS(); // v ‚ąą {27, 28} (source: https://ethereum.github.io/yellowpaper/paper.pdf #308) if (v != 27 && v != 28) revert InvalidValueV(); bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name())), keccak256(bytes(version)), block.chainid, address(this))); bytes32 structHash = keccak256(abi.encode(AUTHORIZATION_TYPEHASH, owner, manager, isAllowed_, nonce, expiry)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); if (signatory == address(0)) revert BadSignatory(); if (owner != signatory) revert BadSignatory(); if (nonce != userNonce[signatory]++) revert BadNonce(); if (block.timestamp >= expiry) revert SignatureExpired(); allowInternal(signatory, manager, isAllowed_); } }
< // SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.15;

import "./CometExtInterface.sol";

contract CometExt is CometExtInterface {
    /** Public constants **/

    /// @notice The major version of this contract
    string public override constant version = "0";

    /** Internal constants **/

    /// @dev The EIP-712 typehash for the contract's domain
    bytes32 internal constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");

    /// @dev The EIP-712 typehash for allowBySig Authorization
    bytes32 internal constant AUTHORIZATION_TYPEHASH = keccak256("Authorization(address owner,address manager,bool isAllowed,uint256 nonce,uint256 expiry)");

    /// @dev The highest valid value for s in an ECDSA signature pair (0 < s < secp256k1n √∑ 2 + 1)
    ///  See https://ethereum.github.io/yellowpaper/paper.pdf #307)
    uint internal constant MAX_VALID_ECDSA_S = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0;

    /** Immutable symbol **/

    /// @dev The ERC20 name for wrapped base token
    bytes32 internal immutable name32;

    /// @dev The ERC20 symbol for wrapped base token
    bytes32 internal immutable symbol32;

    /**
     * @notice Construct a new protocol instance
     * @param config The mapping of initial/constant parameters
     **/
    constructor(ExtConfiguration memory config) {
        name32 = config.name32;
        symbol32 = config.symbol32;
    }

    /** External getters for internal constants **/

    function baseAccrualScale() override external pure returns (uint64) { return BASE_ACCRUAL_SCALE; }
    function baseIndexScale() override external pure returns (uint64) { return BASE_INDEX_SCALE; }
    function factorScale() override external pure returns (uint64) { return FACTOR_SCALE; }
    function priceScale() override external pure returns (uint64) { return PRICE_SCALE; }
    function maxAssets() override external pure returns (uint8) { return MAX_ASSETS; }

    /**
     * @notice Aggregate variables tracked for the entire market
     **/
    function totalsBasic() public override view returns (TotalsBasic memory) {
        return TotalsBasic({
            baseSupplyIndex: baseSupplyIndex,
            baseBorrowIndex: baseBorrowIndex,
            trackingSupplyIndex: trackingSupplyIndex,
            trackingBorrowIndex: trackingBorrowIndex,
            totalSupplyBase: totalSupplyBase,
            totalBorrowBase: totalBorrowBase,
            lastAccrualTime: lastAccrualTime,
            pauseFlags: pauseFlags
        });
    }

    /** Additional ERC20 functionality and approval interface **/

    /**
     * @notice Get the ERC20 name for wrapped base token
     * @return The name as a string
     */
    function name() override public view returns (string memory) {
        uint8 i;
        for (i = 0; i < 32; ) {
            if (name32[i] == 0) {
                break;
            }
            unchecked { i++; }
        }
        bytes memory name_ = new bytes(i);
        for (uint8 j = 0; j < i; ) {
            name_[j] = name32[j];
            unchecked { j++; }
        }
        return string(name_);
    }

    /**
     * @notice Get the ERC20 symbol for wrapped base token
     * @return The symbol as a string
     */
    function symbol() override external view returns (string memory) {
        uint8 i;
        for (i = 0; i < 32; ) {
            if (symbol32[i] == 0) {
                break;
            }
            unchecked { i++; }
        }
        bytes memory symbol_ = new bytes(i);
        for (uint8 j = 0; j < i; ) {
            symbol_[j] = symbol32[j];
            unchecked { j++; }
        }
        return string(symbol_);
    }

    /**
     * @notice Query the current collateral balance of an account
     * @param account The account whose balance to query
     * @param asset The collateral asset to check the balance for
     * @return The collateral balance of the account
     */
    function collateralBalanceOf(address account, address asset) override external view returns (uint128) {
        return userCollateral[account][asset].balance;
    }

    /**
     * @notice Query the total accrued base rewards for an account
     * @param account The account to query
     * @return The accrued rewards, scaled by `BASE_ACCRUAL_SCALE`
     */
    function baseTrackingAccrued(address account) override external view returns (uint64) {
        return userBasic[account].baseTrackingAccrued;
    }

    /**
      * @notice Approve or disallow `spender` to transfer on sender's behalf
      * @dev Note: this binary approval is unlike most other ERC20 tokens
      * @dev Note: this grants full approval for spender to manage *all* the owner's assets
      * @param spender The address of the account which may transfer tokens
      * @param amount Either uint.max (to allow) or zero (to disallow)
      * @return Whether or not the approval change succeeded
      */
    function approve(address spender, uint256 amount) override external returns (bool) {
        if (amount == type(uint256).max) {
            allowInternal(msg.sender, spender, true);
        } else if (amount == 0) {
            allowInternal(msg.sender, spender, false);
        } else {
            revert BadAmount();
        }
        return true;
    }

    /**
      * @notice Get the current allowance from `owner` for `spender`
      * @dev Note: this binary allowance is unlike most other ERC20 tokens
      * @dev Note: this allowance allows spender to manage *all* the owner's assets
      * @param owner The address of the account which owns the tokens to be spent
      * @param spender The address of the account which may transfer tokens
      * @return Either uint.max (spender is allowed) or zero (spender is disallowed)
      */
    function allowance(address owner, address spender) override external view returns (uint256) {
        return hasPermission(owner, spender) ? type(uint256).max : 0;
    }

    /**
     * @notice Allow or disallow another address to withdraw, or transfer from the sender
     * @param manager The account which will be allowed or disallowed
     * @param isAllowed_ Whether to allow or disallow
     */
    function allow(address manager, bool isAllowed_) override external {
        allowInternal(msg.sender, manager, isAllowed_);
    }

    /**
     * @dev Stores the flag marking whether the manager is allowed to act on behalf of owner
     */
    function allowInternal(address owner, address manager, bool isAllowed_) internal {
        isAllowed[owner][manager] = isAllowed_;
        emit Approval(owner, manager, isAllowed_ ? type(uint256).max : 0);
    }

    /**
     * @notice Sets authorization status for a manager via signature from signatory
     * @param owner The address that signed the signature
     * @param manager The address to authorize (or rescind authorization from)
     * @param isAllowed_ Whether to authorize or rescind authorization from manager
     * @param nonce The next expected nonce value for the signatory
     * @param expiry Expiration time for the signature
     * @param v The recovery byte of the signature
     * @param r Half of the ECDSA signature pair
     * @param s Half of the ECDSA signature pair
     */
    function allowBySig(
        address owner,
        address manager,
        bool isAllowed_,
        uint256 nonce,
        uint256 expiry,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) override external {
        if (uint256(s) > MAX_VALID_ECDSA_S) revert InvalidValueS();
        // v ‚ąą {27, 28} (source: https://ethereum.github.io/yellowpaper/paper.pdf #308)
        if (v != 27 && v != 28) revert InvalidValueV();
        bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name())), keccak256(bytes(version)), block.chainid, address(this)));
        bytes32 structHash = keccak256(abi.encode(AUTHORIZATION_TYPEHASH, owner, manager, isAllowed_, nonce, expiry));
        bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
        address signatory = ecrecover(digest, v, r, s);
        if (signatory == address(0)) revert BadSignatory();
        if (owner != signatory) revert BadSignatory();
        if (nonce != userNonce[signatory]++) revert BadNonce();
        if (block.timestamp >= expiry) revert SignatureExpired();
        allowInternal(signatory, manager, isAllowed_);
    }
} < 

CometExt ABI

[{"inputs":[{"components":[{"internalType":"bytes32","name":"name32","type":"bytes32"},{"internalType":"bytes32","name":"symbol32","type":"bytes32"}],"internalType":"struct CometConfiguration.ExtConfiguration","name":"config","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BadAmount","type":"error"},{"inputs":[],"name":"BadNonce","type":"error"},{"inputs":[],"name":"BadSignatory","type":"error"},{"inputs":[],"name":"InvalidInt104","type":"error"},{"inputs":[],"name":"InvalidInt256","type":"error"},{"inputs":[],"name":"InvalidUInt104","type":"error"},{"inputs":[],"name":"InvalidUInt128","type":"error"},{"inputs":[],"name":"InvalidUInt64","type":"error"},{"inputs":[],"name":"InvalidValueS","type":"error"},{"inputs":[],"name":"InvalidValueV","type":"error"},{"inputs":[],"name":"NegativeNumber","type":"error"},{"inputs":[],"name":"SignatureExpired","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"inputs":[{"internalType":"address","name":"manager","type":"address"},{"internalType":"bool","name":"isAllowed_","type":"bool"}],"name":"allow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"manager","type":"address"},{"internalType":"bool","name":"isAllowed_","type":"bool"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"allowBySig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"baseAccrualScale","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"baseIndexScale","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"baseTrackingAccrued","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"asset","type":"address"}],"name":"collateralBalanceOf","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factorScale","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"manager","type":"address"}],"name":"hasPermission","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"liquidatorPoints","outputs":[{"internalType":"uint32","name":"numAbsorbs","type":"uint32"},{"internalType":"uint64","name":"numAbsorbed","type":"uint64"},{"internalType":"uint128","name":"approxSpend","type":"uint128"},{"internalType":"uint32","name":"_reserved","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAssets","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceScale","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalsBasic","outputs":[{"components":[{"internalType":"uint64","name":"baseSupplyIndex","type":"uint64"},{"internalType":"uint64","name":"baseBorrowIndex","type":"uint64"},{"internalType":"uint64","name":"trackingSupplyIndex","type":"uint64"},{"internalType":"uint64","name":"trackingBorrowIndex","type":"uint64"},{"internalType":"uint104","name":"totalSupplyBase","type":"uint104"},{"internalType":"uint104","name":"totalBorrowBase","type":"uint104"},{"internalType":"uint40","name":"lastAccrualTime","type":"uint40"},{"internalType":"uint8","name":"pauseFlags","type":"uint8"}],"internalType":"struct CometStorage.TotalsBasic","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalsCollateral","outputs":[{"internalType":"uint128","name":"totalSupplyAsset","type":"uint128"},{"internalType":"uint128","name":"_reserved","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userBasic","outputs":[{"internalType":"int104","name":"principal","type":"int104"},{"internalType":"uint64","name":"baseTrackingIndex","type":"uint64"},{"internalType":"uint64","name":"baseTrackingAccrued","type":"uint64"},{"internalType":"uint16","name":"assetsIn","type":"uint16"},{"internalType":"uint8","name":"_reserved","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"userCollateral","outputs":[{"internalType":"uint128","name":"balance","type":"uint128"},{"internalType":"uint128","name":"_reserved","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
[{"inputs":[{"components":[{"internalType":"bytes32","name":"name32","type":"bytes32"},{"internalType":"bytes32","name":"symbol32","type":"bytes32"}],"internalType":"struct CometConfiguration.ExtConfiguration","name":"config","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BadAmount","type":"error"},{"inputs":[],"name":"BadNonce","type":"error"},{"inputs":[],"name":"BadSignatory","type":"error"},{"inputs":[],"name":"InvalidInt104","type":"error"},{"inputs":[],"name":"InvalidInt256","type":"error"},{"inputs":[],"name":"InvalidUInt104","type":"error"},{"inputs":[],"name":"InvalidUInt128","type":"error"},{"inputs":[],"name":"InvalidUInt64","type":"error"},{"inputs":[],"name":"InvalidValueS","type":"error"},{"inputs":[],"name":"InvalidValueV","type":"error"},{"inputs":[],"name":"NegativeNumber","type":"error"},{"inputs":[],"name":"SignatureExpired","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"inputs":[{"internalType":"address","name":"manager","type":"address"},{"internalType":"bool","name":"isAllowed_","type":"bool"}],"name":"allow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"manager","type":"address"},{"internalType":"bool","name":"isAllowed_","type":"bool"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"allowBySig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"baseAccrualScale","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"baseIndexScale","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"baseTrackingAccrued","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"asset","type":"address"}],"name":"collateralBalanceOf","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factorScale","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"manager","type":"address"}],"name":"hasPermission","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"liquidatorPoints","outputs":[{"internalType":"uint32","name":"numAbsorbs","type":"uint32"},{"internalType":"uint64","name":"numAbsorbed","type":"uint64"},{"internalType":"uint128","name":"approxSpend","type":"uint128"},{"internalType":"uint32","name":"_reserved","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAssets","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceScale","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalsBasic","outputs":[{"components":[{"internalType":"uint64","name":"baseSupplyIndex","type":"uint64"},{"internalType":"uint64","name":"baseBorrowIndex","type":"uint64"},{"internalType":"uint64","name":"trackingSupplyIndex","type":"uint64"},{"internalType":"uint64","name":"trackingBorrowIndex","type":"uint64"},{"internalType":"uint104","name":"totalSupplyBase","type":"uint104"},{"internalType":"uint104","name":"totalBorrowBase","type":"uint104"},{"internalType":"uint40","name":"lastAccrualTime","type":"uint40"},{"internalType":"uint8","name":"pauseFlags","type":"uint8"}],"internalType":"struct CometStorage.TotalsBasic","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalsCollateral","outputs":[{"internalType":"uint128","name":"totalSupplyAsset","type":"uint128"},{"internalType":"uint128","name":"_reserved","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userBasic","outputs":[{"internalType":"int104","name":"principal","type":"int104"},{"internalType":"uint64","name":"baseTrackingIndex","type":"uint64"},{"internalType":"uint64","name":"baseTrackingAccrued","type":"uint64"},{"internalType":"uint16","name":"assetsIn","type":"uint16"},{"internalType":"uint8","name":"_reserved","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"userCollateral","outputs":[{"internalType":"uint128","name":"balance","type":"uint128"},{"internalType":"uint128","name":"_reserved","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

CometExt Bytecode

60c06040523461006c57610e176040813803918261001c81610071565b93849283398101031261006c576100336040610071565b90602080825192838552015192019182526080525160a052604051610d6a90816100ad823960805181610bf7015260a0518161073a0152f35b600080fd5b6040519190601f01601f191682016001600160401b0381118382101761009657604052565b634e487b7160e01b600052604160045260246000fdfe6040608081526004908136101561001557600080fd5b600091823560e01c806306fdde0314610a52578063095ea7b3146109e45780630f21d96b146109c1578063110496e5146109895780632b92a07d146109235780632e04b8e7146108ea57806354fd4d50146108c157806359e017bd146108725780635c2549ee1461081b57806394b2294b146107ff57806395d89b411461072557806396e7a9c114610703578063a0fbddaf146106e4578063a16543791461068f578063a20ed59614610671578063ab9ba7f414610629578063b9f0baf714610514578063bb24d99414610290578063c5fa15cf14610227578063cde68041146101dc578063dc4abafd1461016e5763dd62ed3e1461011357600080fd5b3461016a578160031936011261016a576001600160a01b0390358181168103610166576024359182168203610166576020939161014f91610b5d565b156101605750600019905b51908152f35b9061015a565b8380fd5b8280fd5b503461016a57602036600319011261016a57356001600160a01b0381169081900361016a5782829160a094526005602052205481519181600c0b835260018060401b03808360681c1660208501528260a81c169083015261ffff8160e81c16606083015260f81c6080820152f35b503461016a578160031936011261016a576001600160a01b03929035908382168203610224576024359384168403610224575060209261021b91610b5d565b90519015158152f35b80fd5b503461016a57602036600319011261016a57356001600160a01b0381169081900361016a57828291608094526007602052205481519163ffffffff8216835260018060401b038260201c166020840152600180851b038260601c169083015260e01c6060820152f35b503461016a5761010036600319011261016a5780356001600160a01b038181169291839003610510576024359181831680840361050c57604435948515159182870361050857606435916084359360a43560ff81168091036105045760e435906fa2a8918ca85bafe22016d0b997e4df60600160ff1b0382116104f457601b811415806104e9575b6104d9578b8d9260809261032a610bf5565b958651986020998a8099012061033e610b35565b8981519101208651908a8201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f845288830152606082015246888201523060a082015260a0815261039160c082610ae1565b51902091855190898201927fab8e80cad03d9def1f2f6f14831e15fd29eb88f59ac40032be3f8047b5ee33ed84528b888401526060830152878201528b60a08201528c60c082015260c081526103e860e082610ae1565b5190208451908882019261190160f01b84526022830152604282015260428152610413606282610ae1565b51902092519283528583015260c4358e830152606082015282805260015afa156104cf5789519586169081156104bf5781036104af57895283905286882080549190600019831461049c576001830190550361048d5742101561047f57509061047c9291610c9e565b51f35b8451630819bdcd60e01b8152fd5b5084516312f55d3b60e21b8152fd5b634e487b7160e01b8a526011855260248afd5b88516310188bcb60e21b81528590fd5b89516310188bcb60e21b81528690fd5b88513d8b823e3d90fd5b8b51639c5b7fcf60e01b81528890fd5b50601c811415610318565b8b5163ed9a019560e01b81528890fd5b8b80fd5b8880fd5b8680fd5b8480fd5b50503461062557816003193601126106255780519180610100936105388582610ae1565b81815281602082015281848201528160608201528160808201528160a08201528160c082015260e0015254600160401b6001900390818116906001549283928551926105848885610ae1565b81845260208401968382821c1688528381860192818160801c168452606087019060c01c81526080870192600160681b60019003968795868b16865260a08a0197878c60681c16895260c08b019a64ffffffffff809d60d01c168c5260e0019c60f81c8d528284519e8f928352511690602001525116908b01525116606089015251166080870152511660a0850152511660c08301525160ff1660e0820152f35b5080fd5b503461016a57602036600319011261016a57356001600160a01b0381169081900361016a578252600560209081529181902054905160a89190911c6001600160401b03168152f35b50503461062557816003193601126106255760209051620f42408152f35b503461016a578160031936011261016a576001600160a01b0390358181169081900361016657602435918216809203610166578360ff9284926020965260038652828220908252855220541690519015158152f35b505034610625578160031936011261062557602090516305f5e1008152f35b5050346106255781600319360112610625576020905166038d7ea4c680008152f35b503461016a578260031936011261016a5782917f0000000000000000000000000000000000000000000000000000000000000000935b60ff9081811660208110156107f35786901a60f81b6001600160f81b03191615610788576001011661075b565b9391929490505b60ff8094169061079e82610b9c565b92805b868116848110156107e25760208110156107cf578791816107c7866001941a9189610bce565b5301166107a1565b634e487b7160e01b835260328952602483fd5b8651806107ef8882610a70565b0390f35b5093919294905061078f565b50503461062557816003193601126106255760209051600f8152f35b503461016a578160031936011261016a57356001600160a01b038181169391849003610625576024359081168091036106255760209382526006845282822090825283528160018060801b03912054169051908152f35b503461016a57602036600319011261016a57356001600160a01b0381169081900361016a5782526002602052908190205490519081906107ef90608081901c906001600160801b031683610ac7565b5050346106255781600319360112610625576107ef906108df610b35565b905191829182610a70565b503461016a57602036600319011261016a5780356001600160a01b03811690819003610166579282916020948252845220549051908152f35b503461016a578160031936011261016a576001600160a01b03903581811690819003610166576024359182168092036101665783526006602090815282842091845252908190205490519081906107ef90608081901c906001600160801b031683610ac7565b503461016a578160031936011261016a57356001600160a01b038116810361016a5760243580151581036101665761047c9133610c9e565b50503461062557816003193601126106255760209051670de0b6b3a76400008152f35b503461016a578160031936011261016a578035906001600160a01b0382168203610166576024356000198103610a2d575050602092506001610a269133610c9e565b5160018152f35b610a445750602092610a3f9133610c9e565b610a26565b825163749b593960e01b8152fd5b5050346106255781600319360112610625576107ef906108df610bf5565b919091602080825283519081818401526000945b828610610ab1575050806040939411610aa4575b601f01601f1916010190565b6000838284010152610a98565b8581018201518487016040015294810194610a84565b6001600160801b0391821681529116602082015260400190565b601f909101601f19168101906001600160401b03821190821017610b0457604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b038111610b0457601f01601f191660200190565b610b3f6001610b1a565b90610b4d6040519283610ae1565b60018252600360fc1b6020830152565b6001600160a01b039081169116818114918215610b7957505090565b909150600052600360205260406000209060005260205260ff6040600020541690565b90610ba682610b1a565b610bb36040519182610ae1565b8281528092610bc4601f1991610b1a565b0190602036910137565b908151811015610bdf570160200190565b634e487b7160e01b600052603260045260246000fd5b7f000000000000000000000000000000000000000000000000000000000000000060005b60ff908181166020811015610c955783901a60f81b6001600160f81b03191615610c465760010116610c19565b9290505b60ff80931691610c5983610b9c565b9060005b85811685811015610c8b576020811015610bdf57869181610c83856001941a9187610bce565b530116610c5d565b5050509150915090565b50929050610c4a565b91909160018060a01b03809116916000918383526003602052604083209416938483526020526040822060ff1981541660ff83151516179055600014610cfd5750600080516020610d1583398151915260206000195b604051908152a3565b6020600080516020610d1583398151915291610cf456fe8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a2646970667358221220156cb73b00f14f3b9e15820c0dae0779a9bd18fec2931f1e4a4ac3fb5e4bc5cf64736f6c634300080f0033436f6d706f756e642057455448000000000000000000000000000000000000006357455448763300000000000000000000000000000000000000000000000000
60c06040523461006c57610e176040813803918261001c81610071565b93849283398101031261006c576100336040610071565b90602080825192838552015192019182526080525160a052604051610d6a90816100ad823960805181610bf7015260a0518161073a0152f35b600080fd5b6040519190601f01601f191682016001600160401b0381118382101761009657604052565b634e487b7160e01b600052604160045260246000fdfe6040608081526004908136101561001557600080fd5b600091823560e01c806306fdde0314610a52578063095ea7b3146109e45780630f21d96b146109c1578063110496e5146109895780632b92a07d146109235780632e04b8e7146108ea57806354fd4d50146108c157806359e017bd146108725780635c2549ee1461081b57806394b2294b146107ff57806395d89b411461072557806396e7a9c114610703578063a0fbddaf146106e4578063a16543791461068f578063a20ed59614610671578063ab9ba7f414610629578063b9f0baf714610514578063bb24d99414610290578063c5fa15cf14610227578063cde68041146101dc578063dc4abafd1461016e5763dd62ed3e1461011357600080fd5b3461016a578160031936011261016a576001600160a01b0390358181168103610166576024359182168203610166576020939161014f91610b5d565b156101605750600019905b51908152f35b9061015a565b8380fd5b8280fd5b503461016a57602036600319011261016a57356001600160a01b0381169081900361016a5782829160a094526005602052205481519181600c0b835260018060401b03808360681c1660208501528260a81c169083015261ffff8160e81c16606083015260f81c6080820152f35b503461016a578160031936011261016a576001600160a01b03929035908382168203610224576024359384168403610224575060209261021b91610b5d565b90519015158152f35b80fd5b503461016a57602036600319011261016a57356001600160a01b0381169081900361016a57828291608094526007602052205481519163ffffffff8216835260018060401b038260201c166020840152600180851b038260601c169083015260e01c6060820152f35b503461016a5761010036600319011261016a5780356001600160a01b038181169291839003610510576024359181831680840361050c57604435948515159182870361050857606435916084359360a43560ff81168091036105045760e435906fa2a8918ca85bafe22016d0b997e4df60600160ff1b0382116104f457601b811415806104e9575b6104d9578b8d9260809261032a610bf5565b958651986020998a8099012061033e610b35565b8981519101208651908a8201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f845288830152606082015246888201523060a082015260a0815261039160c082610ae1565b51902091855190898201927fab8e80cad03d9def1f2f6f14831e15fd29eb88f59ac40032be3f8047b5ee33ed84528b888401526060830152878201528b60a08201528c60c082015260c081526103e860e082610ae1565b5190208451908882019261190160f01b84526022830152604282015260428152610413606282610ae1565b51902092519283528583015260c4358e830152606082015282805260015afa156104cf5789519586169081156104bf5781036104af57895283905286882080549190600019831461049c576001830190550361048d5742101561047f57509061047c9291610c9e565b51f35b8451630819bdcd60e01b8152fd5b5084516312f55d3b60e21b8152fd5b634e487b7160e01b8a526011855260248afd5b88516310188bcb60e21b81528590fd5b89516310188bcb60e21b81528690fd5b88513d8b823e3d90fd5b8b51639c5b7fcf60e01b81528890fd5b50601c811415610318565b8b5163ed9a019560e01b81528890fd5b8b80fd5b8880fd5b8680fd5b8480fd5b50503461062557816003193601126106255780519180610100936105388582610ae1565b81815281602082015281848201528160608201528160808201528160a08201528160c082015260e0015254600160401b6001900390818116906001549283928551926105848885610ae1565b81845260208401968382821c1688528381860192818160801c168452606087019060c01c81526080870192600160681b60019003968795868b16865260a08a0197878c60681c16895260c08b019a64ffffffffff809d60d01c168c5260e0019c60f81c8d528284519e8f928352511690602001525116908b01525116606089015251166080870152511660a0850152511660c08301525160ff1660e0820152f35b5080fd5b503461016a57602036600319011261016a57356001600160a01b0381169081900361016a578252600560209081529181902054905160a89190911c6001600160401b03168152f35b50503461062557816003193601126106255760209051620f42408152f35b503461016a578160031936011261016a576001600160a01b0390358181169081900361016657602435918216809203610166578360ff9284926020965260038652828220908252855220541690519015158152f35b505034610625578160031936011261062557602090516305f5e1008152f35b5050346106255781600319360112610625576020905166038d7ea4c680008152f35b503461016a578260031936011261016a5782917f0000000000000000000000000000000000000000000000000000000000000000935b60ff9081811660208110156107f35786901a60f81b6001600160f81b03191615610788576001011661075b565b9391929490505b60ff8094169061079e82610b9c565b92805b868116848110156107e25760208110156107cf578791816107c7866001941a9189610bce565b5301166107a1565b634e487b7160e01b835260328952602483fd5b8651806107ef8882610a70565b0390f35b5093919294905061078f565b50503461062557816003193601126106255760209051600f8152f35b503461016a578160031936011261016a57356001600160a01b038181169391849003610625576024359081168091036106255760209382526006845282822090825283528160018060801b03912054169051908152f35b503461016a57602036600319011261016a57356001600160a01b0381169081900361016a5782526002602052908190205490519081906107ef90608081901c906001600160801b031683610ac7565b5050346106255781600319360112610625576107ef906108df610b35565b905191829182610a70565b503461016a57602036600319011261016a5780356001600160a01b03811690819003610166579282916020948252845220549051908152f35b503461016a578160031936011261016a576001600160a01b03903581811690819003610166576024359182168092036101665783526006602090815282842091845252908190205490519081906107ef90608081901c906001600160801b031683610ac7565b503461016a578160031936011261016a57356001600160a01b038116810361016a5760243580151581036101665761047c9133610c9e565b50503461062557816003193601126106255760209051670de0b6b3a76400008152f35b503461016a578160031936011261016a578035906001600160a01b0382168203610166576024356000198103610a2d575050602092506001610a269133610c9e565b5160018152f35b610a445750602092610a3f9133610c9e565b610a26565b825163749b593960e01b8152fd5b5050346106255781600319360112610625576107ef906108df610bf5565b919091602080825283519081818401526000945b828610610ab1575050806040939411610aa4575b601f01601f1916010190565b6000838284010152610a98565b8581018201518487016040015294810194610a84565b6001600160801b0391821681529116602082015260400190565b601f909101601f19168101906001600160401b03821190821017610b0457604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b038111610b0457601f01601f191660200190565b610b3f6001610b1a565b90610b4d6040519283610ae1565b60018252600360fc1b6020830152565b6001600160a01b039081169116818114918215610b7957505090565b909150600052600360205260406000209060005260205260ff6040600020541690565b90610ba682610b1a565b610bb36040519182610ae1565b8281528092610bc4601f1991610b1a565b0190602036910137565b908151811015610bdf570160200190565b634e487b7160e01b600052603260045260246000fd5b7f000000000000000000000000000000000000000000000000000000000000000060005b60ff908181166020811015610c955783901a60f81b6001600160f81b03191615610c465760010116610c19565b9290505b60ff80931691610c5983610b9c565b9060005b85811685811015610c8b576020811015610bdf57869181610c83856001941a9187610bce565b530116610c5d565b5050509150915090565b50929050610c4a565b91909160018060a01b03809116916000918383526003602052604083209416938483526020526040822060ff1981541660ff83151516179055600014610cfd5750600080516020610d1583398151915260206000195b604051908152a3565b6020600080516020610d1583398151915291610cf456fe8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a2646970667358221220156cb73b00f14f3b9e15820c0dae0779a9bd18fec2931f1e4a4ac3fb5e4bc5cf64736f6c634300080f0033436f6d706f756e642057455448000000000000000000000000000000000000006357455448763300000000000000000000000000000000000000000000000000

Check out more smart contracts

Build blockchain magic with Alchemy

Alchemy combines the most powerful web3 developer products and tools with resources, community and legendary support.