ERC-20
Overview
Max Total Supply
24,442,176.032053 ERC20 ***
Holders
80
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 6 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
CusdcV3Wrapper
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BlueOak-1.0.0 pragma solidity 0.8.19; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./vendor/CometInterface.sol"; import "./WrappedERC20.sol"; import "./vendor/ICometRewards.sol"; import "./ICusdcV3Wrapper.sol"; import "./CometHelpers.sol"; /** * @title CusdcV3Wrapper * @notice Wrapper for cUSDCV3 / COMET that acts as a stable-balance ERC20, instead of rebasing * token. {comet} will be used as the unit for the underlying token, and {wComet} will be used * as the unit for wrapped tokens. */ contract CusdcV3Wrapper is ICusdcV3Wrapper, WrappedERC20, CometHelpers { using SafeERC20 for IERC20; /// From cUSDCv3, used in principal <> present calculations uint256 public constant TRACKING_INDEX_SCALE = 1e15; /// From cUSDCv3, scaling factor for USDC rewards uint256 public constant RESCALE_FACTOR = 1e12; CometInterface public immutable underlyingComet; ICometRewards public immutable rewardsAddr; IERC20 public immutable rewardERC20; mapping(address => uint64) public baseTrackingIndex; // uint64 for consistency with CometHelpers mapping(address => uint256) public baseTrackingAccrued; // uint256 to avoid overflow in L:199 mapping(address => uint256) public rewardsClaimed; constructor( address cusdcv3, address rewardsAddr_, address rewardERC20_ ) WrappedERC20("Wrapped cUSDCv3", "wcUSDCv3") { if (cusdcv3 == address(0)) revert ZeroAddress(); rewardsAddr = ICometRewards(rewardsAddr_); rewardERC20 = IERC20(rewardERC20_); underlyingComet = CometInterface(cusdcv3); } /// @return number of decimals function decimals() public pure override(IERC20Metadata, WrappedERC20) returns (uint8) { return 6; } /// @param amount {Comet} The amount of cUSDCv3 to deposit function deposit(uint256 amount) external { _deposit(msg.sender, msg.sender, msg.sender, amount); } /// @param dst The dst to deposit into /// @param amount {Comet} The amount of cUSDCv3 to deposit function depositTo(address dst, uint256 amount) external { _deposit(msg.sender, msg.sender, dst, amount); } /// @param src The address to deposit from /// @param dst The address to deposit to /// @param amount {Comet} The amount of cUSDCv3 to deposit function depositFrom( address src, address dst, uint256 amount ) external { _deposit(msg.sender, src, dst, amount); } /// Only called internally to run the deposit logic /// Takes `amount` fo cUSDCv3 from `src` and deposits to `dst` account in the wrapper. /// @param operator The address calling the contract (msg.sender) /// @param src The address to deposit from /// @param dst The address to deposit to /// @param amount {Comet} The amount of cUSDCv3 to deposit function _deposit( address operator, address src, address dst, uint256 amount ) internal { if (!underlyingComet.hasPermission(src, operator)) revert Unauthorized(); // {Comet} uint256 srcBal = underlyingComet.balanceOf(src); if (amount > srcBal) amount = srcBal; if (amount == 0) revert BadAmount(); underlyingComet.accrueAccount(address(this)); underlyingComet.accrueAccount(src); CometInterface.UserBasic memory wrappedBasic = underlyingComet.userBasic(address(this)); int104 wrapperPrePrinc = wrappedBasic.principal; IERC20(address(underlyingComet)).safeTransferFrom(src, address(this), amount); wrappedBasic = underlyingComet.userBasic(address(this)); int104 wrapperPostPrinc = wrappedBasic.principal; accrueAccountRewards(dst); // safe to cast because amount is positive _mint(dst, uint104(wrapperPostPrinc - wrapperPrePrinc)); } /// @param amount {Comet} The amount of cUSDCv3 to withdraw function withdraw(uint256 amount) external { _withdraw(msg.sender, msg.sender, msg.sender, amount); } /// @param dst The address to withdraw cUSDCv3 to /// @param amount {Comet} The amount of cUSDCv3 to withdraw function withdrawTo(address dst, uint256 amount) external { _withdraw(msg.sender, msg.sender, dst, amount); } /// @param src The address to withdraw from /// @param dst The address to withdraw cUSDCv3 to /// @param amount {Comet} The amount of cUSDCv3 to withdraw function withdrawFrom( address src, address dst, uint256 amount ) external { _withdraw(msg.sender, src, dst, amount); } /// Internally called to run the withdraw logic /// Withdraws `amount` cUSDCv3 from `src` account in the wrapper and sends to `dst` /// @dev Rounds conservatively so as not to over-withdraw from the wrapper /// @param operator The address calling the contract (msg.sender) /// @param src The address to withdraw from /// @param dst The address to withdraw cUSDCv3 to /// @param amount {Comet} The amount of cUSDCv3 to withdraw function _withdraw( address operator, address src, address dst, uint256 amount ) internal { if (!hasPermission(src, operator)) revert Unauthorized(); // {Comet} uint256 srcBalUnderlying = underlyingBalanceOf(src); if (srcBalUnderlying < amount) amount = srcBalUnderlying; if (amount == 0) revert BadAmount(); underlyingComet.accrueAccount(address(this)); underlyingComet.accrueAccount(src); uint256 srcBalPre = balanceOf(src); CometInterface.UserBasic memory wrappedBasic = underlyingComet.userBasic(address(this)); int104 wrapperPrePrinc = wrappedBasic.principal; // conservative rounding in favor of the wrapper IERC20(address(underlyingComet)).safeTransfer(dst, (amount / 10) * 10); wrappedBasic = underlyingComet.userBasic(address(this)); int104 wrapperPostPrinc = wrappedBasic.principal; // safe to cast because principal can't go negative, wrapper is not borrowing uint256 burnAmt = uint256(uint104(wrapperPrePrinc - wrapperPostPrinc)); // occasionally comet will withdraw 1-10 wei more than we asked for. // this is ok because 9 times out of 10 we are rounding in favor of the wrapper. // safe because we have already capped the comet withdraw amount to src underlying bal. // untested: // difficult to trigger, depends on comet rules regarding rounding if (srcBalPre <= burnAmt) burnAmt = srcBalPre; accrueAccountRewards(src); _burn(src, safe104(burnAmt)); } /// Internally called to run transfer logic. /// Accrues rewards for `src` and `dst` before transferring value. function _beforeTokenTransfer( address src, address dst, uint256 amount ) internal virtual override { underlyingComet.accrueAccount(address(this)); super._beforeTokenTransfer(src, dst, amount); accrueAccountRewards(src); accrueAccountRewards(dst); } function claimRewards() external { claimTo(msg.sender, msg.sender); } /// @param src The account to claim from /// @param dst The address to send claimed rewards to function claimTo(address src, address dst) public { if (!hasPermission(src, msg.sender)) revert Unauthorized(); accrueAccount(src); uint256 claimed = rewardsClaimed[src]; uint256 accrued = baseTrackingAccrued[src] * RESCALE_FACTOR; uint256 owed; if (accrued > claimed) { owed = accrued - claimed; rewardsClaimed[src] = accrued; rewardsAddr.claimTo(address(underlyingComet), address(this), address(this), true); uint256 bal = rewardERC20.balanceOf(address(this)); if (owed > bal) owed = bal; rewardERC20.safeTransfer(dst, owed); } emit RewardsClaimed(rewardERC20, owed); } /// Accure the cUSDCv3 account of the wrapper function accrue() public { underlyingComet.accrueAccount(address(this)); } /// @param account The address to accrue, first in cUSDCv3, then locally function accrueAccount(address account) public { underlyingComet.accrueAccount(address(this)); accrueAccountRewards(account); } /// Get the balance of cUSDCv3 that is represented by the `accounts` wrapper value. /// @param account The address to calculate the cUSDCv3 balance of /// @return {Comet} The cUSDCv3 balance that `account` holds in the wrapper function underlyingBalanceOf(address account) public view returns (uint256) { uint256 balance = balanceOf(account); if (balance == 0) { return 0; } return convertStaticToDynamic(safe104(balance)); } /// @return The exchange rate {comet/wComet} function exchangeRate() public view returns (uint256) { (uint64 baseSupplyIndex, ) = getUpdatedSupplyIndicies(); return presentValueSupply(baseSupplyIndex, safe104(10**underlyingComet.decimals())); } /// @param amount The value of {wComet} to convert to {Comet} /// @return {Comet} The amount of cUSDCv3 represented by `amount of {wComet} function convertStaticToDynamic(uint104 amount) public view returns (uint256) { (uint64 baseSupplyIndex, ) = getUpdatedSupplyIndicies(); return presentValueSupply(baseSupplyIndex, amount); } /// @param amount The value of {Comet} to convert to {wComet} /// @return {wComet} The amount of wrapped token represented by `amount` of {Comet} function convertDynamicToStatic(uint256 amount) public view returns (uint104) { (uint64 baseSupplyIndex, ) = getUpdatedSupplyIndicies(); return principalValueSupply(baseSupplyIndex, amount); } /// @param account The address to view the owed rewards of /// @return {reward} The amount of reward tokens owed to `account` function getRewardOwed(address account) external view returns (uint256) { (, uint64 trackingSupplyIndex) = getUpdatedSupplyIndicies(); uint256 indexDelta = uint256(trackingSupplyIndex - baseTrackingIndex[account]); uint256 newBaseTrackingAccrued = baseTrackingAccrued[account] + (safe104(balanceOf(account)) * indexDelta) / TRACKING_INDEX_SCALE; uint256 claimed = rewardsClaimed[account]; uint256 accrued = newBaseTrackingAccrued * RESCALE_FACTOR; uint256 owed = accrued > claimed ? accrued - claimed : 0; return owed; } /// Internally called to get saved indicies /// @return baseSupplyIndex_ {1} The saved baseSupplyIndex /// @return trackingSupplyIndex_ {1} The saved trackingSupplyIndex function getSupplyIndices() internal view returns (uint64 baseSupplyIndex_, uint64 trackingSupplyIndex_) { TotalsBasic memory totals = underlyingComet.totalsBasic(); baseSupplyIndex_ = totals.baseSupplyIndex; trackingSupplyIndex_ = totals.trackingSupplyIndex; } /// Internally called to update the account indicies and accrued rewards for a given address /// @param account The UserBasic struct for a target address function accrueAccountRewards(address account) internal { uint256 accountBal = balanceOf(account); (, uint64 trackingSupplyIndex) = getSupplyIndices(); uint256 indexDelta = uint256(trackingSupplyIndex - baseTrackingIndex[account]); baseTrackingAccrued[account] += (safe104(accountBal) * indexDelta) / TRACKING_INDEX_SCALE; baseTrackingIndex[account] = trackingSupplyIndex; } /// Internally called to get the updated supply indicies /// @return {1} The current baseSupplyIndex /// @return {1} The current trackingSupplyIndex function getUpdatedSupplyIndicies() internal view returns (uint64, uint64) { TotalsBasic memory totals = underlyingComet.totalsBasic(); uint40 timeDelta = uint40(block.timestamp) - totals.lastAccrualTime; uint64 baseSupplyIndex_ = totals.baseSupplyIndex; uint64 trackingSupplyIndex_ = totals.trackingSupplyIndex; if (timeDelta != 0) { uint256 baseTrackingSupplySpeed = underlyingComet.baseTrackingSupplySpeed(); uint256 utilization = underlyingComet.getUtilization(); uint256 supplyRate = underlyingComet.getSupplyRate(utilization); baseSupplyIndex_ += safe64(mulFactor(baseSupplyIndex_, supplyRate * timeDelta)); trackingSupplyIndex_ += safe64( divBaseWei(baseTrackingSupplySpeed * timeDelta, totals.totalSupplyBase) ); } return (baseSupplyIndex_, trackingSupplyIndex_); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * ==== Security Considerations * * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be * considered as an intention to spend the allowance in any specific way. The second is that because permits have * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be * generally recommended is: * * ```solidity * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} * doThing(..., value); * } * * function doThing(..., uint256 value) public { * token.safeTransferFrom(msg.sender, address(this), value); * ... * } * ``` * * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also * {SafeERC20-safeTransferFrom}). * * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so * contracts should have entry points that don't rely on permit. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. * * CAUTION: See Security Considerations above. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ 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 amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` 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 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: BlueOak-1.0.0 pragma solidity 0.8.19; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** * @title IRewardable * @notice A simple interface mixin to support claiming of rewards. */ interface IRewardable { /// Emitted whenever a reward token balance is claimed /// @param erc20 The ERC20 of the reward token /// @param amount {qTok} event RewardsClaimed(IERC20 indexed erc20, uint256 amount); /// Claim rewards earned by holding a balance of the ERC20 token /// Must emit `RewardsClaimed` for each token rewards are claimed for /// @custom:interaction function claimRewards() external; } /** * @title IRewardableComponent * @notice A simple interface mixin to support claiming of rewards. */ interface IRewardableComponent is IRewardable { /// Claim rewards for a single ERC20 /// Must emit `RewardsClaimed` for each token rewards are claimed for /// @custom:interaction function claimRewardsSingle(IERC20 erc20) external; }
// SPDX-License-Identifier: BlueOak-1.0.0 pragma solidity 0.8.19; contract CometHelpers { uint64 internal constant BASE_INDEX_SCALE = 1e15; uint256 public constant EXP_SCALE = 1e18; uint256 public constant BASE_SCALE = 1e6; error InvalidUInt64(); error InvalidUInt104(); error InvalidInt256(); error NegativeNumber(); function safe64(uint256 n) internal pure returns (uint64) { // untested: // comet code, overflow is hard to cover if (n > type(uint64).max) revert InvalidUInt64(); return uint64(n); } function presentValueSupply(uint64 baseSupplyIndex_, uint104 principalValue_) internal pure returns (uint256) { return (uint256(principalValue_) * baseSupplyIndex_) / BASE_INDEX_SCALE; } function principalValueSupply(uint64 baseSupplyIndex_, uint256 presentValue_) internal pure returns (uint104) { return safe104((presentValue_ * BASE_INDEX_SCALE) / baseSupplyIndex_); } function safe104(uint256 n) internal pure returns (uint104) { // untested: // comet code, overflow is hard to cover if (n > type(uint104).max) revert InvalidUInt104(); return uint104(n); } /** * @dev Multiply a number by a factor */ function mulFactor(uint256 n, uint256 factor) internal pure returns (uint256) { return (n * factor) / EXP_SCALE; } function divBaseWei(uint256 n, uint256 baseWei) internal pure returns (uint256) { return (n * BASE_SCALE) / baseWei; } }
// SPDX-License-Identifier: BlueOak-1.0.0 pragma solidity 0.8.19; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "./vendor/CometInterface.sol"; import "./IWrappedERC20.sol"; import "../../../interfaces/IRewardable.sol"; interface ICusdcV3Wrapper is IWrappedERC20, IRewardable { struct UserBasic { uint104 principal; uint64 baseTrackingIndex; uint64 baseTrackingAccrued; uint256 rewardsClaimed; } function deposit(uint256 amount) external; function depositTo(address account, uint256 amount) external; function depositFrom( address from, address dst, uint256 amount ) external; function withdraw(uint256 amount) external; function withdrawTo(address to, uint256 amount) external; function withdrawFrom( address src, address to, uint256 amount ) external; function claimTo(address src, address to) external; function accrue() external; function accrueAccount(address account) external; function underlyingBalanceOf(address account) external view returns (uint256); function getRewardOwed(address account) external view returns (uint256); function exchangeRate() external view returns (uint256); function convertStaticToDynamic(uint104 amount) external view returns (uint256); function convertDynamicToStatic(uint256 amount) external view returns (uint104); function baseTrackingAccrued(address account) external view returns (uint256); function baseTrackingIndex(address account) external view returns (uint64); function underlyingComet() external view returns (CometInterface); function rewardERC20() external view returns (IERC20); }
// SPDX-License-Identifier: BlueOak-1.0.0 pragma solidity 0.8.19; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; interface IWrappedERC20 is IERC20Metadata { function allow(address account, bool isAllowed_) external; function hasPermission(address owner, address manager) external view returns (bool); function isAllowed(address first, address second) external returns (bool); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; struct TotalsBasic { uint64 baseSupplyIndex; uint64 baseBorrowIndex; uint64 trackingSupplyIndex; uint64 trackingBorrowIndex; uint104 totalSupplyBase; uint104 totalBorrowBase; uint40 lastAccrualTime; uint8 pauseFlags; } /** * @title Compound's Comet Ext Interface * @notice An efficient monolithic money market protocol * @author Compound */ abstract contract CometExtInterface { error BadAmount(); error BadNonce(); error BadSignatory(); error InvalidValueS(); error InvalidValueV(); error SignatureExpired(); function allow(address manager, bool isAllowed) external virtual; function allowBySig( address owner, address manager, bool isAllowed, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) external virtual; function collateralBalanceOf(address account, address asset) external view virtual returns (uint128); function baseTrackingAccrued(address account) external view virtual returns (uint64); function baseAccrualScale() external view virtual returns (uint64); function baseIndexScale() external view virtual returns (uint64); function factorScale() external view virtual returns (uint64); function priceScale() external view virtual returns (uint64); function maxAssets() external view virtual returns (uint8); function totalsBasic() external view virtual returns (TotalsBasic memory); function version() external view virtual returns (string memory); /** * ===== ERC20 interfaces ===== * Does not include the following functions/events, which are defined in `CometMainInterface` * instead: * - function decimals() virtual external view returns (uint8) * - function totalSupply() virtual external view returns (uint256) * - function transfer(address dst, uint amount) virtual external returns (bool) * - function transferFrom(address src, address dst, uint amount) virtual external returns (bool) * - function balanceOf(address owner) virtual external view returns (uint256) * - event Transfer(address indexed from, address indexed to, uint256 amount) */ function name() external view virtual returns (string memory); function symbol() external view virtual returns (string memory); /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param amount The number of tokens that are approved (-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint256 amount) external virtual returns (bool); /** * @notice Get the current allowance from `owner` for `spender` * @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 The number of tokens allowed to be spent (-1 means infinite) */ function allowance(address owner, address spender) external view virtual returns (uint256); event Approval(address indexed owner, address indexed spender, uint256 amount); /** * @notice Determine if the manager has permission to act on behalf of the owner * @param owner The owner account * @param manager The manager account * @return Whether or not the manager has permission */ function hasPermission(address owner, address manager) external view virtual returns (bool); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; import "./CometMainInterface.sol"; import "./CometExtInterface.sol"; /** * @title Compound's Comet Interface * @notice An efficient monolithic money market protocol * @author Compound */ abstract contract CometInterface is CometMainInterface, CometExtInterface { struct UserBasic { int104 principal; uint64 baseTrackingIndex; uint64 baseTrackingAccrued; } function userBasic(address account) external view virtual returns (UserBasic memory); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.19; struct AssetInfo { uint8 offset; address asset; address priceFeed; uint64 scale; uint64 borrowCollateralFactor; uint64 liquidateCollateralFactor; uint64 liquidationFactor; uint128 supplyCap; } /** * @title Compound's Comet Main Interface (without Ext) * @notice An efficient monolithic money market protocol * @author Compound */ abstract contract CometMainInterface { error Absurd(); error AlreadyInitialized(); error BadAsset(); error BadDecimals(); error BadDiscount(); error BadMinimum(); error BadPrice(); error BorrowTooSmall(); error BorrowCFTooLarge(); error InsufficientReserves(); error LiquidateCFTooLarge(); error NoSelfTransfer(); error NotCollateralized(); error NotForSale(); error NotLiquidatable(); error Paused(); error SupplyCapExceeded(); error TimestampTooLarge(); error TooManyAssets(); error TooMuchSlippage(); error TransferInFailed(); error TransferOutFailed(); error Unauthorized(); event Supply(address indexed from, address indexed dst, uint256 amount); event Transfer(address indexed from, address indexed to, uint256 amount); event Withdraw(address indexed src, address indexed to, uint256 amount); event SupplyCollateral( address indexed from, address indexed dst, address indexed asset, uint256 amount ); event TransferCollateral( address indexed from, address indexed to, address indexed asset, uint256 amount ); event WithdrawCollateral( address indexed src, address indexed to, address indexed asset, uint256 amount ); /// @notice Event emitted when a borrow position is absorbed by the protocol event AbsorbDebt( address indexed absorber, address indexed borrower, uint256 basePaidOut, uint256 usdValue ); /// @notice Event emitted when a user's collateral is absorbed by the protocol event AbsorbCollateral( address indexed absorber, address indexed borrower, address indexed asset, uint256 collateralAbsorbed, uint256 usdValue ); /// @notice Event emitted when a collateral asset is purchased from the protocol event BuyCollateral( address indexed buyer, address indexed asset, uint256 baseAmount, uint256 collateralAmount ); /// @notice Event emitted when an action is paused/unpaused event PauseAction( bool supplyPaused, bool transferPaused, bool withdrawPaused, bool absorbPaused, bool buyPaused ); /// @notice Event emitted when reserves are withdrawn by the governor event WithdrawReserves(address indexed to, uint256 amount); function supply(address asset, uint256 amount) external virtual; function supplyTo( address dst, address asset, uint256 amount ) external virtual; function supplyFrom( address from, address dst, address asset, uint256 amount ) external virtual; function transfer(address dst, uint256 amount) external virtual returns (bool); function transferFrom( address src, address dst, uint256 amount ) external virtual returns (bool); function transferAsset( address dst, address asset, uint256 amount ) external virtual; function transferAssetFrom( address src, address dst, address asset, uint256 amount ) external virtual; function withdraw(address asset, uint256 amount) external virtual; function withdrawTo( address to, address asset, uint256 amount ) external virtual; function withdrawFrom( address src, address to, address asset, uint256 amount ) external virtual; function approveThis( address manager, address asset, uint256 amount ) external virtual; function withdrawReserves(address to, uint256 amount) external virtual; function absorb(address absorber, address[] calldata accounts) external virtual; function buyCollateral( address asset, uint256 minAmount, uint256 baseAmount, address recipient ) external virtual; function quoteCollateral(address asset, uint256 baseAmount) public view virtual returns (uint256); function getAssetInfo(uint8 i) public view virtual returns (AssetInfo memory); function getAssetInfoByAddress(address asset) public view virtual returns (AssetInfo memory); function getReserves() public view virtual returns (int256); function getPrice(address priceFeed) public view virtual returns (uint256); function isBorrowCollateralized(address account) public view virtual returns (bool); function isLiquidatable(address account) public view virtual returns (bool); function totalSupply() external view virtual returns (uint256); function totalBorrow() external view virtual returns (uint256); function balanceOf(address owner) public view virtual returns (uint256); function borrowBalanceOf(address account) public view virtual returns (uint256); function pause( bool supplyPaused, bool transferPaused, bool withdrawPaused, bool absorbPaused, bool buyPaused ) external virtual; function isSupplyPaused() public view virtual returns (bool); function isTransferPaused() public view virtual returns (bool); function isWithdrawPaused() public view virtual returns (bool); function isAbsorbPaused() public view virtual returns (bool); function isBuyPaused() public view virtual returns (bool); function accrueAccount(address account) external virtual; function getSupplyRate(uint256 utilization) public view virtual returns (uint64); function getBorrowRate(uint256 utilization) public view virtual returns (uint64); function getUtilization() public view virtual returns (uint256); function governor() external view virtual returns (address); function pauseGuardian() external view virtual returns (address); function baseToken() external view virtual returns (address); function baseTokenPriceFeed() external view virtual returns (address); function extensionDelegate() external view virtual returns (address); /// @dev uint64 function supplyKink() external view virtual returns (uint256); /// @dev uint64 function supplyPerSecondInterestRateSlopeLow() external view virtual returns (uint256); /// @dev uint64 function supplyPerSecondInterestRateSlopeHigh() external view virtual returns (uint256); /// @dev uint64 function supplyPerSecondInterestRateBase() external view virtual returns (uint256); /// @dev uint64 function borrowKink() external view virtual returns (uint256); /// @dev uint64 function borrowPerSecondInterestRateSlopeLow() external view virtual returns (uint256); /// @dev uint64 function borrowPerSecondInterestRateSlopeHigh() external view virtual returns (uint256); /// @dev uint64 function borrowPerSecondInterestRateBase() external view virtual returns (uint256); /// @dev uint64 function storeFrontPriceFactor() external view virtual returns (uint256); /// @dev uint64 function baseScale() external view virtual returns (uint256); /// @dev uint64 function trackingIndexScale() external view virtual returns (uint256); /// @dev uint64 function baseTrackingSupplySpeed() external view virtual returns (uint256); /// @dev uint64 function baseTrackingBorrowSpeed() external view virtual returns (uint256); /// @dev uint104 function baseMinForRewards() external view virtual returns (uint256); /// @dev uint104 function baseBorrowMin() external view virtual returns (uint256); /// @dev uint104 function targetReserves() external view virtual returns (uint256); function numAssets() external view virtual returns (uint8); function decimals() external view virtual returns (uint8); function initializeStorage() external virtual; }
// SPDX-License-Identifier: BlueOak-1.0.0 pragma solidity 0.8.19; interface ICometRewards { struct RewardConfig { address token; uint64 rescaleFactor; bool shouldUpscale; } struct RewardOwed { address token; uint256 owed; } function rewardConfig(address) external view returns (RewardConfig memory); function claim( address comet, address src, bool shouldAccrue ) external; function getRewardOwed(address comet, address account) external returns (RewardOwed memory); function claimTo( address comet, address src, address to, bool shouldAccrue ) external; }
// SPDX-License-Identifier: BlueOak-1.0.0 pragma solidity 0.8.19; import "./IWrappedERC20.sol"; /** * @dev Implementation of the {IERC20} interface. * * This is a "soft-fork" of Open Zeppelin's ERC20 contract but with some notable * changes including: * * - The allowance system is changed so that users are either allowed or not. * There are no approved/allowed amounts. `approve` function still exists to * adhere to the ERC-20 interface. * * - Adds `allow` for easier authorization and is an easier-to-use alternative * to `approve`. * * - All hooks are removed except for `_beforeTokenTransfer` in `_transfer`. * This is done to save on gas. * * - All reverts use custom errors instead of strings. Another gas-optimization. * * - Adds `hasPermission` which works the same as `allowance` and checks whether * a user is authorized to make balance transfers. * * - Some state variables are removed in anticipation of this contract * being inherited by the cUSDCv3 wrapper * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. */ abstract contract WrappedERC20 is IWrappedERC20 { error BadAmount(); error Unauthorized(); error ZeroAddress(); error ExceedsBalance(uint256 amount); mapping(address => uint256) private _balances; mapping(address => mapping(address => bool)) public isAllowed; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the decimals places of the token. */ function decimals() public pure virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { _transfer(msg.sender, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return hasPermission(owner, spender) ? type(uint256).max : 0; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { if (spender == address(0)) revert ZeroAddress(); if (amount == type(uint256).max) { _allow(msg.sender, spender, true); } else if (amount == 0) { _allow(msg.sender, spender, false); } else { revert BadAmount(); } return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must be authorized to transfer ``from``'s tokens */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { if (!hasPermission(from, msg.sender)) revert Unauthorized(); _transfer(from, to, amount); return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { if (from == address(0)) revert ZeroAddress(); if (to == address(0)) revert ZeroAddress(); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; if (amount > fromBalance) revert ExceedsBalance(amount); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { if (account == address(0)) revert ZeroAddress(); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { // untestable: // previously validated, account will not be address(0) if (account == address(0)) revert ZeroAddress(); uint256 accountBalance = _balances[account]; // untestable: // ammount previously capped to the account balance if (amount > accountBalance) revert ExceedsBalance(amount); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Allow or disallow another address to withdraw, or transfer from the sender. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `manager` cannot be the zero address. */ function allow(address account, bool isAllowed_) external { _allow(msg.sender, account, isAllowed_); } /** * @dev Gives `manager` control over the `owner` s tokens. * * This internal function is equivalent to `allow`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `manager` cannot be the zero address. */ function _allow( address owner, address manager, bool isAllowed_ ) internal { if (owner == address(0)) revert ZeroAddress(); if (manager == address(0)) revert ZeroAddress(); isAllowed[owner][manager] = isAllowed_; emit Approval(owner, manager, isAllowed_ ? type(uint256).max : 0); } /** * @dev Determine if the `manager` has permission to act on behalf of the `owner`. */ function hasPermission(address owner, address manager) public view returns (bool) { return owner == manager || isAllowed[owner][manager]; } /** * @dev Hook that is called before any transfer of tokens. This does not include * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. */ // solhint-disable no-empty-blocks function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"cusdcv3","type":"address"},{"internalType":"address","name":"rewardsAddr_","type":"address"},{"internalType":"address","name":"rewardERC20_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BadAmount","type":"error"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ExceedsBalance","type":"error"},{"inputs":[],"name":"InvalidInt256","type":"error"},{"inputs":[],"name":"InvalidUInt104","type":"error"},{"inputs":[],"name":"InvalidUInt64","type":"error"},{"inputs":[],"name":"NegativeNumber","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"ZeroAddress","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":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"erc20","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"BASE_SCALE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EXP_SCALE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RESCALE_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TRACKING_INDEX_SCALE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accrue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"accrueAccount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","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":"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":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"baseTrackingAccrued","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"baseTrackingIndex","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"}],"name":"claimTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"convertDynamicToStatic","outputs":[{"internalType":"uint104","name":"","type":"uint104"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint104","name":"amount","type":"uint104"}],"name":"convertStaticToDynamic","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"exchangeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getRewardOwed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardERC20","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsAddr","outputs":[{"internalType":"contract ICometRewards","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardsClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"underlyingBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"underlyingComet","outputs":[{"internalType":"contract CometInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60e06040523480156200001157600080fd5b5060405162002ad238038062002ad2833981016040819052620000349162000102565b6040518060400160405280600f81526020016e57726170706564206355534443763360881b81525060405180604001604052806008815260200167776355534443763360c01b81525081600390816200008e9190620001f1565b5060046200009d8282620001f1565b5050506001600160a01b038316620000c85760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0391821660a052811660c05216608052620002bd565b80516001600160a01b0381168114620000fd57600080fd5b919050565b6000806000606084860312156200011857600080fd5b6200012384620000e5565b92506200013360208501620000e5565b91506200014360408501620000e5565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200017757607f821691505b6020821081036200019857634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001ec57600081815260208120601f850160051c81016020861015620001c75750805b601f850160051c820191505b81811015620001e857828155600101620001d3565b5050505b505050565b81516001600160401b038111156200020d576200020d6200014c565b62000225816200021e845462000162565b846200019e565b602080601f8311600181146200025d5760008415620002445750858301515b600019600386901b1c1916600185901b178555620001e8565b600085815260208120601f198616915b828110156200028e578886015182559484019460019091019084016200026d565b5085821015620002ad5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05161272f620003a3600039600081816105370152818161097f01528181610a0e0152610a390152600081816104bc015261090c01526000818161041c015281816108cd01528181610ac401528181610c2101528181610d1001528181610ec101528181610f4201528181610fe401528181611078015281816110b4015281816112b001528181611361015281816113e70152818161148b015281816116910152818161173a015281816117eb0152818161186c015281816118e101528181611967015281816119a401528181611c2d0152611eb6015261272f6000f3fe608060405234801561001057600080fd5b50600436106102275760003560e01c8063790add0311610130578063b6b55f25116100b8578063d10b5a5b1161007c578063d10b5a5b14610532578063d3f730fd14610559578063dd62ed3e14610579578063f8ba4cff1461058c578063ffaad6a51461059457600080fd5b8063b6b55f25146104de578063bbba205d146104f1578063bc9416b914610500578063bfe69c8d1461050c578063cde680411461051f57600080fd5b806397008d6c116100ff57806397008d6c14610417578063a165437914610456578063a9059cbb14610484578063ab9ba7f414610497578063b15f67b3146104b757600080fd5b8063790add03146103d6578063935a8b84146103e95780639555a942146103fc57806395d89b411461040f57600080fd5b80632e1a7d4d116101b35780633ba0b9a9116101825780633ba0b9a91461032657806343631bfe1461032e5780635f2d5f6e1461035957806368a9674d1461039a57806370a08231146103ad57600080fd5b80632e1a7d4d146102e9578063313ce567146102fc57806334a1ca891461030b578063372500ab1461031e57600080fd5b806318160ddd116101fa57806318160ddd1461029e5780631f986445146102a6578063205c2878146102b057806323b872dd146102c35780632a846398146102d657600080fd5b806306fdde031461022c578063095ea7b31461024a5780630e162e1e1461026d578063110496e514610289575b600080fd5b6102346105a7565b60405161024191906120fd565b60405180910390f35b61025d61025836600461214c565b610639565b6040519015158152602001610241565b61027b66038d7ea4c6800081565b604051908152602001610241565b61029c610297366004612184565b6106b3565b005b60025461027b565b61027b620f424081565b61029c6102be36600461214c565b6106c2565b61025d6102d13660046121bb565b6106ce565b61027b6102e43660046121f7565b61070b565b61029c6102f7366004612212565b610817565b60405160068152602001610241565b61029c61031936600461222b565b610826565b61029c610aa1565b61027b610aad565b61034161033c366004612212565b610b5a565b6040516001600160681b039091168152602001610241565b6103826103673660046121f7565b6005602052600090815260409020546001600160401b031681565b6040516001600160401b039091168152602001610241565b61029c6103a83660046121bb565b610b79565b61027b6103bb3660046121f7565b6001600160a01b031660009081526020819052604090205490565b61027b6103e4366004612273565b610b8a565b61027b6103f73660046121f7565b610ba2565b61029c61040a3660046121bb565b610bd8565b610234610be4565b61043e7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610241565b61025d61046436600461222b565b600160209081526000928352604080842090915290825290205460ff1681565b61025d61049236600461214c565b610bf3565b61027b6104a53660046121f7565b60066020526000908152604090205481565b61043e7f000000000000000000000000000000000000000000000000000000000000000081565b61029c6104ec366004612212565b610c00565b61027b670de0b6b3a764000081565b61027b64e8d4a5100081565b61029c61051a3660046121f7565b610c0c565b61025d61052d36600461222b565b610c8e565b61043e7f000000000000000000000000000000000000000000000000000000000000000081565b61027b6105673660046121f7565b60076020526000908152604090205481565b61027b61058736600461222b565b610cda565b61029c610cfb565b61029c6105a236600461214c565b610d76565b6060600380546105b690612290565b80601f01602080910402602001604051908101604052809291908181526020018280546105e290612290565b801561062f5780601f106106045761010080835404028352916020019161062f565b820191906000526020600020905b81548152906001019060200180831161061257829003601f168201915b5050505050905090565b60006001600160a01b0383166106625760405163d92e233d60e01b815260040160405180910390fd5b600019820361067c5761067733846001610d82565b6106a9565b816000036106905761067733846000610d82565b60405163749b593960e01b815260040160405180910390fd5b5060015b92915050565b6106be338383610d82565b5050565b6106be33338484610e4c565b60006106da8433610c8e565b6106f6576040516282b42960e81b815260040160405180910390fd5b61070184848461117d565b5060019392505050565b6000806107166112a9565b6001600160a01b0385166000908152600560205260408120549193509150610747906001600160401b0316836122e0565b6001600160401b03169050600066038d7ea4c680008261078461077f886001600160a01b031660009081526020819052604090205490565b61157f565b6001600160681b03166107979190612307565b6107a1919061231e565b6001600160a01b0386166000908152600660205260409020546107c49190612340565b6001600160a01b0386166000908152600760205260408120549192506107ef64e8d4a5100084612307565b9050600082821161080157600061080b565b61080b8383612353565b98975050505050505050565b61082333333384610e4c565b50565b6108308233610c8e565b61084c576040516282b42960e81b815260040160405180910390fd5b61085582610c0c565b6001600160a01b038216600090815260076020908152604080832054600690925282205490919061088c9064e8d4a5100090612307565b9050600082821115610a37576108a28383612353565b6001600160a01b0386811660009081526007602052604090819020859055516313fe176560e21b81527f00000000000000000000000000000000000000000000000000000000000000008216600482015230602482018190526044820152600160648201529192507f00000000000000000000000000000000000000000000000000000000000000001690634ff85d9490608401600060405180830381600087803b15801561095057600080fd5b505af1158015610964573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152600092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031691506370a0823190602401602060405180830381865afa1580156109cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f39190612366565b905080821115610a01578091505b610a356001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001686846115ad565b505b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe82604051610a9291815260200190565b60405180910390a25050505050565b610aab3333610826565b565b600080610ab86112a9565b509050610b5481610b4f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b449190612390565b61077f90600a61248f565b611610565b91505090565b600080610b656112a9565b509050610b728184611640565b9392505050565b610b853384848461166a565b505050565b600080610b956112a9565b509050610b728184611610565b6001600160a01b03811660009081526020819052604081205480600003610bcc5750600092915050565b610b726103e48261157f565b610b8533848484610e4c565b6060600480546105b690612290565b60006106a933848461117d565b6108233333338461166a565b60405163bfe69c8d60e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063bfe69c8d90602401600060405180830381600087803b158015610c6d57600080fd5b505af1158015610c81573d6000803e3d6000fd5b5050505061082381611a4b565b6000816001600160a01b0316836001600160a01b03161480610b725750506001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b6000610ce68383610c8e565b610cf1576000610b72565b5060001992915050565b60405163bfe69c8d60e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063bfe69c8d90602401600060405180830381600087803b158015610d5c57600080fd5b505af1158015610d70573d6000803e3d6000fd5b50505050565b6106be3333848461166a565b6001600160a01b038316610da95760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b038216610dd05760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b038381166000818152600160209081526040808320948716808452949091529020805460ff19168415151790557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583610e31576000610e35565b6000195b6040519081526020015b60405180910390a3505050565b610e568385610c8e565b610e72576040516282b42960e81b815260040160405180910390fd5b6000610e7d84610ba2565b905081811015610e8b578091505b81600003610eac5760405163749b593960e01b815260040160405180910390fd5b60405163bfe69c8d60e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063bfe69c8d90602401600060405180830381600087803b158015610f0d57600080fd5b505af1158015610f21573d6000803e3d6000fd5b505060405163bfe69c8d60e01b81526001600160a01b0387811660048301527f000000000000000000000000000000000000000000000000000000000000000016925063bfe69c8d9150602401600060405180830381600087803b158015610f8857600080fd5b505af1158015610f9c573d6000803e3d6000fd5b505050506000610fc1856001600160a01b031660009081526020819052604090205490565b60405163dc4abafd60e01b81523060048201529091506000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063dc4abafd90602401606060405180830381865afa15801561102b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104f91906124b5565b805190915061109f86611063600a8861231e565b61106e90600a612307565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691906115ad565b60405163dc4abafd60e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063dc4abafd90602401606060405180830381865afa158015611103573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112791906124b5565b805190925060006111388284612537565b6001600160681b0316905080851161114d5750835b61115689611a4b565b611171896111638361157f565b6001600160681b0316611b42565b50505050505050505050565b6001600160a01b0383166111a45760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0382166111cb5760405163d92e233d60e01b815260040160405180910390fd5b6111d6838383611c18565b6001600160a01b0383166000908152602081905260409020548082111561121857604051632e7a668d60e21b8152600481018390526024015b60405180910390fd5b6001600160a01b0380851660009081526020819052604080822085850390559185168152908120805484929061124f908490612340565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161129b91815260200190565b60405180910390a350505050565b60008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b9f0baf76040518163ffffffff1660e01b815260040161010060405180830381865afa15801561130d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113319190612590565b905060008160c00151426113459190612667565b825160408401519192509064ffffffffff8316156115745760007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663189bb2f16040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e19190612366565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316637eb711316040518163ffffffff1660e01b8152600401602060405180830381865afa158015611443573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114679190612366565b60405163d955759d60e01b8152600481018290529091506000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d955759d90602401602060405180830381865afa1580156114d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f69190612685565b6001600160401b0316905061152e611529866001600160401b03168864ffffffffff16846115249190612307565b611ca3565b611cb8565b61153890866126a0565b945061156461152961155164ffffffffff891686612307565b89608001516001600160681b0316611ce2565b61156e90856126a0565b93505050505b909590945092505050565b60006001600160681b038211156115a957604051630dc7925560e11b815260040160405180910390fd5b5090565b6040516001600160a01b038316602482015260448101829052610b8590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611cf2565b600066038d7ea4c680006116366001600160401b0385166001600160681b038516612307565b610b72919061231e565b6000610b726001600160401b03841661166066038d7ea4c6800085612307565b61077f919061231e565b60405163cde6804160e01b81526001600160a01b03848116600483015285811660248301527f0000000000000000000000000000000000000000000000000000000000000000169063cde6804190604401602060405180830381865afa1580156116d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116fc91906126c0565b611718576040516282b42960e81b815260040160405180910390fd5b6040516370a0823160e01b81526001600160a01b0384811660048301526000917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015611783573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a79190612366565b9050808211156117b5578091505b816000036117d65760405163749b593960e01b815260040160405180910390fd5b60405163bfe69c8d60e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063bfe69c8d90602401600060405180830381600087803b15801561183757600080fd5b505af115801561184b573d6000803e3d6000fd5b505060405163bfe69c8d60e01b81526001600160a01b0387811660048301527f000000000000000000000000000000000000000000000000000000000000000016925063bfe69c8d9150602401600060405180830381600087803b1580156118b257600080fd5b505af11580156118c6573d6000803e3d6000fd5b505060405163dc4abafd60e01b8152306004820152600092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316915063dc4abafd90602401606060405180830381865afa158015611931573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195591906124b5565b805190915061198f6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016873087611dc7565b60405163dc4abafd60e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063dc4abafd90602401606060405180830381865afa1580156119f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a1791906124b5565b8051909250611a2586611a4b565b611a4186611a338484612537565b6001600160681b0316611dff565b5050505050505050565b6001600160a01b03811660009081526020819052604081205490611a6d611eaf565b6001600160a01b0385166000908152600560205260408120549193509150611a9e906001600160401b0316836122e0565b6001600160401b0316905066038d7ea4c6800081611abb8561157f565b6001600160681b0316611ace9190612307565b611ad8919061231e565b6001600160a01b03851660009081526006602052604081208054909190611b00908490612340565b9091555050506001600160a01b03929092166000908152600560205260409020805467ffffffffffffffff19166001600160401b039093169290921790915550565b6001600160a01b038216611b695760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b03821660009081526020819052604090205480821115611ba657604051632e7a668d60e21b81526004810183905260240161120f565b6001600160a01b0383166000908152602081905260408120838303905560028054849290611bd5908490612353565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610e3f565b60405163bfe69c8d60e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063bfe69c8d90602401600060405180830381600087803b158015611c7957600080fd5b505af1158015611c8d573d6000803e3d6000fd5b50505050611c9a83611a4b565b610b8582611a4b565b6000670de0b6b3a76400006116368385612307565b60006001600160401b038211156115a9576040516372a1cb5160e11b815260040160405180910390fd5b600081611636620f424085612307565b6000611d47826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611f499092919063ffffffff16565b9050805160001480611d68575080806020019051810190611d6891906126c0565b610b855760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161120f565b6040516001600160a01b0380851660248301528316604482015260648101829052610d709085906323b872dd60e01b906084016115d9565b6001600160a01b038216611e265760405163d92e233d60e01b815260040160405180910390fd5b8060026000828254611e389190612340565b90915550506001600160a01b03821660009081526020819052604081208054839290611e65908490612340565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b60008060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b9f0baf76040518163ffffffff1660e01b815260040161010060405180830381865afa158015611f13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f379190612590565b80516040909101519094909350915050565b6060611f588484600085611f60565b949350505050565b606082471015611fc15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161120f565b600080866001600160a01b03168587604051611fdd91906126dd565b60006040518083038185875af1925050503d806000811461201a576040519150601f19603f3d011682016040523d82523d6000602084013e61201f565b606091505b50915091506120308783838761203b565b979650505050505050565b606083156120aa5782516000036120a3576001600160a01b0385163b6120a35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161120f565b5081611f58565b611f5883838151156120bf5781518083602001fd5b8060405162461bcd60e51b815260040161120f91906120fd565b60005b838110156120f45781810151838201526020016120dc565b50506000910152565b602081526000825180602084015261211c8160408501602087016120d9565b601f01601f19169190910160400192915050565b80356001600160a01b038116811461214757600080fd5b919050565b6000806040838503121561215f57600080fd5b61216883612130565b946020939093013593505050565b801515811461082357600080fd5b6000806040838503121561219757600080fd5b6121a083612130565b915060208301356121b081612176565b809150509250929050565b6000806000606084860312156121d057600080fd5b6121d984612130565b92506121e760208501612130565b9150604084013590509250925092565b60006020828403121561220957600080fd5b610b7282612130565b60006020828403121561222457600080fd5b5035919050565b6000806040838503121561223e57600080fd5b61224783612130565b915061225560208401612130565b90509250929050565b6001600160681b038116811461082357600080fd5b60006020828403121561228557600080fd5b8135610b728161225e565b600181811c908216806122a457607f821691505b6020821081036122c457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03828116828216039080821115612300576123006122ca565b5092915050565b80820281158282048414176106ad576106ad6122ca565b60008261233b57634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156106ad576106ad6122ca565b818103818111156106ad576106ad6122ca565b60006020828403121561237857600080fd5b5051919050565b805160ff8116811461214757600080fd5b6000602082840312156123a257600080fd5b610b728261237f565b600181815b808511156123e65781600019048211156123cc576123cc6122ca565b808516156123d957918102915b93841c93908002906123b0565b509250929050565b6000826123fd575060016106ad565b8161240a575060006106ad565b8160018114612420576002811461242a57612446565b60019150506106ad565b60ff84111561243b5761243b6122ca565b50506001821b6106ad565b5060208310610133831016604e8410600b8410161715612469575081810a6106ad565b61247383836123ab565b8060001904821115612487576124876122ca565b029392505050565b6000610b7260ff8416836123ee565b80516001600160401b038116811461214757600080fd5b6000606082840312156124c757600080fd5b604051606081018181106001600160401b03821117156124f757634e487b7160e01b600052604160045260246000fd5b6040528251600c81900b811461250c57600080fd5b815261251a6020840161249e565b602082015261252b6040840161249e565b60408201529392505050565b600c82810b9082900b036c7fffffffffffffffffffffffff1981126c7fffffffffffffffffffffffff821317156106ad576106ad6122ca565b80516121478161225e565b805164ffffffffff8116811461214757600080fd5b60006101008083850312156125a457600080fd5b604051908101906001600160401b03821181831017156125d457634e487b7160e01b600052604160045260246000fd5b816040526125e18461249e565b81526125ef6020850161249e565b60208201526126006040850161249e565b60408201526126116060850161249e565b6060820152608084015191506126268261225e565b81608082015261263860a08501612570565b60a082015261264960c0850161257b565b60c082015261265a60e0850161237f565b60e0820152949350505050565b64ffffffffff828116828216039080821115612300576123006122ca565b60006020828403121561269757600080fd5b610b728261249e565b6001600160401b03818116838216019080821115612300576123006122ca565b6000602082840312156126d257600080fd5b8151610b7281612176565b600082516126ef8184602087016120d9565b919091019291505056fea26469706673582212204c920fc96fef28c092dd79b67e62ecba88206f6f1ffa7a437f0cb693f0388cab64736f6c63430008130033000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc30000000000000000000000001b0e765f6224c21223aea2af16c1c46e38885a40000000000000000000000000c00e94cb662c3520282e6f5717214004a7f26888
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102275760003560e01c8063790add0311610130578063b6b55f25116100b8578063d10b5a5b1161007c578063d10b5a5b14610532578063d3f730fd14610559578063dd62ed3e14610579578063f8ba4cff1461058c578063ffaad6a51461059457600080fd5b8063b6b55f25146104de578063bbba205d146104f1578063bc9416b914610500578063bfe69c8d1461050c578063cde680411461051f57600080fd5b806397008d6c116100ff57806397008d6c14610417578063a165437914610456578063a9059cbb14610484578063ab9ba7f414610497578063b15f67b3146104b757600080fd5b8063790add03146103d6578063935a8b84146103e95780639555a942146103fc57806395d89b411461040f57600080fd5b80632e1a7d4d116101b35780633ba0b9a9116101825780633ba0b9a91461032657806343631bfe1461032e5780635f2d5f6e1461035957806368a9674d1461039a57806370a08231146103ad57600080fd5b80632e1a7d4d146102e9578063313ce567146102fc57806334a1ca891461030b578063372500ab1461031e57600080fd5b806318160ddd116101fa57806318160ddd1461029e5780631f986445146102a6578063205c2878146102b057806323b872dd146102c35780632a846398146102d657600080fd5b806306fdde031461022c578063095ea7b31461024a5780630e162e1e1461026d578063110496e514610289575b600080fd5b6102346105a7565b60405161024191906120fd565b60405180910390f35b61025d61025836600461214c565b610639565b6040519015158152602001610241565b61027b66038d7ea4c6800081565b604051908152602001610241565b61029c610297366004612184565b6106b3565b005b60025461027b565b61027b620f424081565b61029c6102be36600461214c565b6106c2565b61025d6102d13660046121bb565b6106ce565b61027b6102e43660046121f7565b61070b565b61029c6102f7366004612212565b610817565b60405160068152602001610241565b61029c61031936600461222b565b610826565b61029c610aa1565b61027b610aad565b61034161033c366004612212565b610b5a565b6040516001600160681b039091168152602001610241565b6103826103673660046121f7565b6005602052600090815260409020546001600160401b031681565b6040516001600160401b039091168152602001610241565b61029c6103a83660046121bb565b610b79565b61027b6103bb3660046121f7565b6001600160a01b031660009081526020819052604090205490565b61027b6103e4366004612273565b610b8a565b61027b6103f73660046121f7565b610ba2565b61029c61040a3660046121bb565b610bd8565b610234610be4565b61043e7f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc381565b6040516001600160a01b039091168152602001610241565b61025d61046436600461222b565b600160209081526000928352604080842090915290825290205460ff1681565b61025d61049236600461214c565b610bf3565b61027b6104a53660046121f7565b60066020526000908152604090205481565b61043e7f0000000000000000000000001b0e765f6224c21223aea2af16c1c46e38885a4081565b61029c6104ec366004612212565b610c00565b61027b670de0b6b3a764000081565b61027b64e8d4a5100081565b61029c61051a3660046121f7565b610c0c565b61025d61052d36600461222b565b610c8e565b61043e7f000000000000000000000000c00e94cb662c3520282e6f5717214004a7f2688881565b61027b6105673660046121f7565b60076020526000908152604090205481565b61027b61058736600461222b565b610cda565b61029c610cfb565b61029c6105a236600461214c565b610d76565b6060600380546105b690612290565b80601f01602080910402602001604051908101604052809291908181526020018280546105e290612290565b801561062f5780601f106106045761010080835404028352916020019161062f565b820191906000526020600020905b81548152906001019060200180831161061257829003601f168201915b5050505050905090565b60006001600160a01b0383166106625760405163d92e233d60e01b815260040160405180910390fd5b600019820361067c5761067733846001610d82565b6106a9565b816000036106905761067733846000610d82565b60405163749b593960e01b815260040160405180910390fd5b5060015b92915050565b6106be338383610d82565b5050565b6106be33338484610e4c565b60006106da8433610c8e565b6106f6576040516282b42960e81b815260040160405180910390fd5b61070184848461117d565b5060019392505050565b6000806107166112a9565b6001600160a01b0385166000908152600560205260408120549193509150610747906001600160401b0316836122e0565b6001600160401b03169050600066038d7ea4c680008261078461077f886001600160a01b031660009081526020819052604090205490565b61157f565b6001600160681b03166107979190612307565b6107a1919061231e565b6001600160a01b0386166000908152600660205260409020546107c49190612340565b6001600160a01b0386166000908152600760205260408120549192506107ef64e8d4a5100084612307565b9050600082821161080157600061080b565b61080b8383612353565b98975050505050505050565b61082333333384610e4c565b50565b6108308233610c8e565b61084c576040516282b42960e81b815260040160405180910390fd5b61085582610c0c565b6001600160a01b038216600090815260076020908152604080832054600690925282205490919061088c9064e8d4a5100090612307565b9050600082821115610a37576108a28383612353565b6001600160a01b0386811660009081526007602052604090819020859055516313fe176560e21b81527f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc38216600482015230602482018190526044820152600160648201529192507f0000000000000000000000001b0e765f6224c21223aea2af16c1c46e38885a401690634ff85d9490608401600060405180830381600087803b15801561095057600080fd5b505af1158015610964573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152600092507f000000000000000000000000c00e94cb662c3520282e6f5717214004a7f268886001600160a01b031691506370a0823190602401602060405180830381865afa1580156109cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f39190612366565b905080821115610a01578091505b610a356001600160a01b037f000000000000000000000000c00e94cb662c3520282e6f5717214004a7f268881686846115ad565b505b7f000000000000000000000000c00e94cb662c3520282e6f5717214004a7f268886001600160a01b03167ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe82604051610a9291815260200190565b60405180910390a25050505050565b610aab3333610826565b565b600080610ab86112a9565b509050610b5481610b4f7f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc36001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b449190612390565b61077f90600a61248f565b611610565b91505090565b600080610b656112a9565b509050610b728184611640565b9392505050565b610b853384848461166a565b505050565b600080610b956112a9565b509050610b728184611610565b6001600160a01b03811660009081526020819052604081205480600003610bcc5750600092915050565b610b726103e48261157f565b610b8533848484610e4c565b6060600480546105b690612290565b60006106a933848461117d565b6108233333338461166a565b60405163bfe69c8d60e01b81523060048201527f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc36001600160a01b03169063bfe69c8d90602401600060405180830381600087803b158015610c6d57600080fd5b505af1158015610c81573d6000803e3d6000fd5b5050505061082381611a4b565b6000816001600160a01b0316836001600160a01b03161480610b725750506001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b6000610ce68383610c8e565b610cf1576000610b72565b5060001992915050565b60405163bfe69c8d60e01b81523060048201527f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc36001600160a01b03169063bfe69c8d90602401600060405180830381600087803b158015610d5c57600080fd5b505af1158015610d70573d6000803e3d6000fd5b50505050565b6106be3333848461166a565b6001600160a01b038316610da95760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b038216610dd05760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b038381166000818152600160209081526040808320948716808452949091529020805460ff19168415151790557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583610e31576000610e35565b6000195b6040519081526020015b60405180910390a3505050565b610e568385610c8e565b610e72576040516282b42960e81b815260040160405180910390fd5b6000610e7d84610ba2565b905081811015610e8b578091505b81600003610eac5760405163749b593960e01b815260040160405180910390fd5b60405163bfe69c8d60e01b81523060048201527f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc36001600160a01b03169063bfe69c8d90602401600060405180830381600087803b158015610f0d57600080fd5b505af1158015610f21573d6000803e3d6000fd5b505060405163bfe69c8d60e01b81526001600160a01b0387811660048301527f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc316925063bfe69c8d9150602401600060405180830381600087803b158015610f8857600080fd5b505af1158015610f9c573d6000803e3d6000fd5b505050506000610fc1856001600160a01b031660009081526020819052604090205490565b60405163dc4abafd60e01b81523060048201529091506000906001600160a01b037f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc3169063dc4abafd90602401606060405180830381865afa15801561102b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104f91906124b5565b805190915061109f86611063600a8861231e565b61106e90600a612307565b6001600160a01b037f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc31691906115ad565b60405163dc4abafd60e01b81523060048201527f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc36001600160a01b03169063dc4abafd90602401606060405180830381865afa158015611103573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112791906124b5565b805190925060006111388284612537565b6001600160681b0316905080851161114d5750835b61115689611a4b565b611171896111638361157f565b6001600160681b0316611b42565b50505050505050505050565b6001600160a01b0383166111a45760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0382166111cb5760405163d92e233d60e01b815260040160405180910390fd5b6111d6838383611c18565b6001600160a01b0383166000908152602081905260409020548082111561121857604051632e7a668d60e21b8152600481018390526024015b60405180910390fd5b6001600160a01b0380851660009081526020819052604080822085850390559185168152908120805484929061124f908490612340565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161129b91815260200190565b60405180910390a350505050565b60008060007f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc36001600160a01b031663b9f0baf76040518163ffffffff1660e01b815260040161010060405180830381865afa15801561130d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113319190612590565b905060008160c00151426113459190612667565b825160408401519192509064ffffffffff8316156115745760007f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc36001600160a01b031663189bb2f16040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e19190612366565b905060007f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc36001600160a01b0316637eb711316040518163ffffffff1660e01b8152600401602060405180830381865afa158015611443573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114679190612366565b60405163d955759d60e01b8152600481018290529091506000906001600160a01b037f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc3169063d955759d90602401602060405180830381865afa1580156114d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f69190612685565b6001600160401b0316905061152e611529866001600160401b03168864ffffffffff16846115249190612307565b611ca3565b611cb8565b61153890866126a0565b945061156461152961155164ffffffffff891686612307565b89608001516001600160681b0316611ce2565b61156e90856126a0565b93505050505b909590945092505050565b60006001600160681b038211156115a957604051630dc7925560e11b815260040160405180910390fd5b5090565b6040516001600160a01b038316602482015260448101829052610b8590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611cf2565b600066038d7ea4c680006116366001600160401b0385166001600160681b038516612307565b610b72919061231e565b6000610b726001600160401b03841661166066038d7ea4c6800085612307565b61077f919061231e565b60405163cde6804160e01b81526001600160a01b03848116600483015285811660248301527f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc3169063cde6804190604401602060405180830381865afa1580156116d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116fc91906126c0565b611718576040516282b42960e81b815260040160405180910390fd5b6040516370a0823160e01b81526001600160a01b0384811660048301526000917f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc3909116906370a0823190602401602060405180830381865afa158015611783573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a79190612366565b9050808211156117b5578091505b816000036117d65760405163749b593960e01b815260040160405180910390fd5b60405163bfe69c8d60e01b81523060048201527f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc36001600160a01b03169063bfe69c8d90602401600060405180830381600087803b15801561183757600080fd5b505af115801561184b573d6000803e3d6000fd5b505060405163bfe69c8d60e01b81526001600160a01b0387811660048301527f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc316925063bfe69c8d9150602401600060405180830381600087803b1580156118b257600080fd5b505af11580156118c6573d6000803e3d6000fd5b505060405163dc4abafd60e01b8152306004820152600092507f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc36001600160a01b0316915063dc4abafd90602401606060405180830381865afa158015611931573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195591906124b5565b805190915061198f6001600160a01b037f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc316873087611dc7565b60405163dc4abafd60e01b81523060048201527f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc36001600160a01b03169063dc4abafd90602401606060405180830381865afa1580156119f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a1791906124b5565b8051909250611a2586611a4b565b611a4186611a338484612537565b6001600160681b0316611dff565b5050505050505050565b6001600160a01b03811660009081526020819052604081205490611a6d611eaf565b6001600160a01b0385166000908152600560205260408120549193509150611a9e906001600160401b0316836122e0565b6001600160401b0316905066038d7ea4c6800081611abb8561157f565b6001600160681b0316611ace9190612307565b611ad8919061231e565b6001600160a01b03851660009081526006602052604081208054909190611b00908490612340565b9091555050506001600160a01b03929092166000908152600560205260409020805467ffffffffffffffff19166001600160401b039093169290921790915550565b6001600160a01b038216611b695760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b03821660009081526020819052604090205480821115611ba657604051632e7a668d60e21b81526004810183905260240161120f565b6001600160a01b0383166000908152602081905260408120838303905560028054849290611bd5908490612353565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610e3f565b60405163bfe69c8d60e01b81523060048201527f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc36001600160a01b03169063bfe69c8d90602401600060405180830381600087803b158015611c7957600080fd5b505af1158015611c8d573d6000803e3d6000fd5b50505050611c9a83611a4b565b610b8582611a4b565b6000670de0b6b3a76400006116368385612307565b60006001600160401b038211156115a9576040516372a1cb5160e11b815260040160405180910390fd5b600081611636620f424085612307565b6000611d47826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611f499092919063ffffffff16565b9050805160001480611d68575080806020019051810190611d6891906126c0565b610b855760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161120f565b6040516001600160a01b0380851660248301528316604482015260648101829052610d709085906323b872dd60e01b906084016115d9565b6001600160a01b038216611e265760405163d92e233d60e01b815260040160405180910390fd5b8060026000828254611e389190612340565b90915550506001600160a01b03821660009081526020819052604081208054839290611e65908490612340565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b60008060007f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc36001600160a01b031663b9f0baf76040518163ffffffff1660e01b815260040161010060405180830381865afa158015611f13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f379190612590565b80516040909101519094909350915050565b6060611f588484600085611f60565b949350505050565b606082471015611fc15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161120f565b600080866001600160a01b03168587604051611fdd91906126dd565b60006040518083038185875af1925050503d806000811461201a576040519150601f19603f3d011682016040523d82523d6000602084013e61201f565b606091505b50915091506120308783838761203b565b979650505050505050565b606083156120aa5782516000036120a3576001600160a01b0385163b6120a35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161120f565b5081611f58565b611f5883838151156120bf5781518083602001fd5b8060405162461bcd60e51b815260040161120f91906120fd565b60005b838110156120f45781810151838201526020016120dc565b50506000910152565b602081526000825180602084015261211c8160408501602087016120d9565b601f01601f19169190910160400192915050565b80356001600160a01b038116811461214757600080fd5b919050565b6000806040838503121561215f57600080fd5b61216883612130565b946020939093013593505050565b801515811461082357600080fd5b6000806040838503121561219757600080fd5b6121a083612130565b915060208301356121b081612176565b809150509250929050565b6000806000606084860312156121d057600080fd5b6121d984612130565b92506121e760208501612130565b9150604084013590509250925092565b60006020828403121561220957600080fd5b610b7282612130565b60006020828403121561222457600080fd5b5035919050565b6000806040838503121561223e57600080fd5b61224783612130565b915061225560208401612130565b90509250929050565b6001600160681b038116811461082357600080fd5b60006020828403121561228557600080fd5b8135610b728161225e565b600181811c908216806122a457607f821691505b6020821081036122c457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03828116828216039080821115612300576123006122ca565b5092915050565b80820281158282048414176106ad576106ad6122ca565b60008261233b57634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156106ad576106ad6122ca565b818103818111156106ad576106ad6122ca565b60006020828403121561237857600080fd5b5051919050565b805160ff8116811461214757600080fd5b6000602082840312156123a257600080fd5b610b728261237f565b600181815b808511156123e65781600019048211156123cc576123cc6122ca565b808516156123d957918102915b93841c93908002906123b0565b509250929050565b6000826123fd575060016106ad565b8161240a575060006106ad565b8160018114612420576002811461242a57612446565b60019150506106ad565b60ff84111561243b5761243b6122ca565b50506001821b6106ad565b5060208310610133831016604e8410600b8410161715612469575081810a6106ad565b61247383836123ab565b8060001904821115612487576124876122ca565b029392505050565b6000610b7260ff8416836123ee565b80516001600160401b038116811461214757600080fd5b6000606082840312156124c757600080fd5b604051606081018181106001600160401b03821117156124f757634e487b7160e01b600052604160045260246000fd5b6040528251600c81900b811461250c57600080fd5b815261251a6020840161249e565b602082015261252b6040840161249e565b60408201529392505050565b600c82810b9082900b036c7fffffffffffffffffffffffff1981126c7fffffffffffffffffffffffff821317156106ad576106ad6122ca565b80516121478161225e565b805164ffffffffff8116811461214757600080fd5b60006101008083850312156125a457600080fd5b604051908101906001600160401b03821181831017156125d457634e487b7160e01b600052604160045260246000fd5b816040526125e18461249e565b81526125ef6020850161249e565b60208201526126006040850161249e565b60408201526126116060850161249e565b6060820152608084015191506126268261225e565b81608082015261263860a08501612570565b60a082015261264960c0850161257b565b60c082015261265a60e0850161237f565b60e0820152949350505050565b64ffffffffff828116828216039080821115612300576123006122ca565b60006020828403121561269757600080fd5b610b728261249e565b6001600160401b03818116838216019080821115612300576123006122ca565b6000602082840312156126d257600080fd5b8151610b7281612176565b600082516126ef8184602087016120d9565b919091019291505056fea26469706673582212204c920fc96fef28c092dd79b67e62ecba88206f6f1ffa7a437f0cb693f0388cab64736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc30000000000000000000000001b0e765f6224c21223aea2af16c1c46e38885a40000000000000000000000000c00e94cb662c3520282e6f5717214004a7f26888
-----Decoded View---------------
Arg [0] : cusdcv3 (address): 0xc3d688B66703497DAA19211EEdff47f25384cdc3
Arg [1] : rewardsAddr_ (address): 0x1B0e765F6224C21223AeA2af16c1C46E38885a40
Arg [2] : rewardERC20_ (address): 0xc00e94Cb662C3520282E6f5717214004A7f26888
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc3
Arg [1] : 0000000000000000000000001b0e765f6224c21223aea2af16c1c46e38885a40
Arg [2] : 000000000000000000000000c00e94cb662c3520282e6f5717214004a7f26888
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.