Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x741A9554...0c03AD316 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
DBOImplementation
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; interface NFR { struct receiptInstance { uint receiptID; uint attachedNFT; uint lockedAmount; uint lockedDate; uint decimals; address vault; address underlying; } function getDataByReceipt( uint receiptID ) external view returns (receiptInstance memory); } interface IDBOFactory { function emitDelete(address _borrowOrder) external; function emitUpdate(address _borrowOrder) external; function deleteBorrowOrder(address _borrowOrder) external; } contract DBOImplementation is ReentrancyGuard, Initializable { address aggregatorContract; address factoryContract; bool public isActive; uint lastUpdate; using SafeERC20 for IERC20; struct BorrowInfo { address borrowOrderAddress; // address of the borrow order bool[] oraclesPerPairActivated; // oracles activated for each pair uint[] LTVs; // LTVs for each pair uint maxApr; // max APR for the borrow order uint duration; // duration of the borrow order address owner; // owner of the borrow order address[] acceptedPrinciples; // accepted principles for the borrow order address collateral; // collateral for the borrow order address valuableAsset; // ERC721: underlying, ERC20: Same as collateral bool isNFT; // is the collateral an NFT uint receiptID; // receipt ID of the NFT (NFT ID, since we accept only receipt type NFTs) address[] oracles_Principles; // oracles for each principle uint[] ratio; // ratio for each principle address oracle_Collateral; // oracle for the collateral uint valuableAssetAmount; // only used for auction sold NFTs uint availableAmount; // amount of the collateral uint startAmount; // amount of the collateral at the start } BorrowInfo public borrowInformation; modifier onlyOwner() { require(msg.sender == borrowInformation.owner, "Only owner"); _; } modifier onlyAggregator() { require(msg.sender == aggregatorContract, "Only aggregator"); _; } // Prevent the offer from being updated before accepted modifier onlyAfterTimeOut() { require( lastUpdate == 0 || (block.timestamp - lastUpdate) > 1 minutes, "Offer has been updated in the last minute" ); _; } function initialize( address _aggregatorContract, address _owner, address[] memory _acceptedPrinciples, address _collateral, bool[] memory _oraclesActivated, bool _isNFT, uint[] memory _LTVs, uint _maxApr, uint _duration, uint _receiptID, address[] memory _oracleIDS_Principles, uint[] memory _ratio, address _oracleID_Collateral, uint _startedBorrowAmount ) public initializer { aggregatorContract = _aggregatorContract; isActive = true; // seguir aca address _valuableAsset; // if the collateral is an NFT, get the underlying asset if (_isNFT) { NFR.receiptInstance memory nftData = NFR(_collateral) .getDataByReceipt(_receiptID); _startedBorrowAmount = nftData.lockedAmount; _valuableAsset = nftData.underlying; } else { _valuableAsset = _collateral; } borrowInformation = BorrowInfo({ borrowOrderAddress: address(this), oraclesPerPairActivated: _oraclesActivated, LTVs: _LTVs, maxApr: _maxApr, duration: _duration, owner: _owner, acceptedPrinciples: _acceptedPrinciples, collateral: _collateral, valuableAsset: _valuableAsset, isNFT: _isNFT, receiptID: _receiptID, oracles_Principles: _oracleIDS_Principles, ratio: _ratio, oracle_Collateral: _oracleID_Collateral, valuableAssetAmount: 0, availableAmount: _isNFT ? 1 : _startedBorrowAmount, startAmount: _startedBorrowAmount }); factoryContract = msg.sender; } /** * @dev Accepts the borrow offer -- only callable from Aggregator * @param amount Amount of the collateral to be accepted */ function acceptBorrowOffer( uint amount ) public onlyAggregator nonReentrant onlyAfterTimeOut { BorrowInfo memory m_borrowInformation = getBorrowInfo(); require( amount <= m_borrowInformation.availableAmount, "Amount exceeds available amount" ); require(amount > 0, "Amount must be greater than 0"); borrowInformation.availableAmount -= amount; // transfer collateral to aggregator if (m_borrowInformation.isNFT) { IERC721(m_borrowInformation.collateral).transferFrom( address(this), aggregatorContract, m_borrowInformation.receiptID ); } else { // has to be at least 5% of the available amount uint minAMOUNT = (m_borrowInformation.availableAmount) / 20; uint decimals = ERC20(m_borrowInformation.collateral).decimals(); uint thousandTokens = 1000 * 10 ** decimals; require( amount >= minAMOUNT || amount >= thousandTokens, "Amount too low" ); // get decimals SafeERC20.safeTransfer( IERC20(m_borrowInformation.collateral), aggregatorContract, amount ); } uint percentageOfAvailableCollateral = (borrowInformation .availableAmount * 10000) / m_borrowInformation.startAmount; // if available amount is less than 0.1% of the start amount, the order is no longer active and will count as completed. if (percentageOfAvailableCollateral <= 10) { isActive = false; // transfer remaining collateral back to owner if (borrowInformation.availableAmount != 0) { SafeERC20.safeTransfer( IERC20(m_borrowInformation.collateral), m_borrowInformation.owner, borrowInformation.availableAmount ); } borrowInformation.availableAmount = 0; IDBOFactory(factoryContract).emitDelete(address(this)); IDBOFactory(factoryContract).deleteBorrowOrder(address(this)); } else { IDBOFactory(factoryContract).emitUpdate(address(this)); } } /** * @dev Cancels the borrow offer -- only callable from owner */ function cancelOffer() public onlyOwner nonReentrant { BorrowInfo memory m_borrowInformation = getBorrowInfo(); uint availableAmount = m_borrowInformation.availableAmount; require(availableAmount > 0, "No available amount"); // set available amount to 0 // set isActive to false borrowInformation.availableAmount = 0; isActive = false; // transfer collateral back to owner if (m_borrowInformation.isNFT) { if (m_borrowInformation.availableAmount > 0) { IERC721(m_borrowInformation.collateral).transferFrom( address(this), msg.sender, m_borrowInformation.receiptID ); } } else { SafeERC20.safeTransfer( IERC20(m_borrowInformation.collateral), msg.sender, availableAmount ); } // emit canceled event on factory IDBOFactory(factoryContract).deleteBorrowOrder(address(this)); IDBOFactory(factoryContract).emitDelete(address(this)); } function getBorrowInfo() public view returns (BorrowInfo memory) { BorrowInfo memory m_borrowInformation = borrowInformation; // get dynamic data for NFTs if (m_borrowInformation.isNFT) { NFR.receiptInstance memory nftData = NFR( m_borrowInformation.collateral ).getDataByReceipt(m_borrowInformation.receiptID); m_borrowInformation.valuableAssetAmount = nftData.lockedAmount; } return m_borrowInformation; } function updateBorrowOrder( uint newMaxApr, uint newDuration, uint[] memory newLTVs, uint[] memory newRatios ) public onlyOwner { require( newLTVs.length == borrowInformation.acceptedPrinciples.length && newRatios.length == newLTVs.length, "Invalid LTVs" ); lastUpdate = block.timestamp; BorrowInfo memory m_borrowInformation = getBorrowInfo(); m_borrowInformation.maxApr = newMaxApr; m_borrowInformation.duration = newDuration; m_borrowInformation.LTVs = newLTVs; m_borrowInformation.ratio = newRatios; borrowInformation = m_borrowInformation; IDBOFactory(factoryContract).emitUpdate(address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "./IERC20.sol"; import {IERC20Metadata} from "./extensions/IERC20Metadata.sol"; import {Context} from "../../utils/Context.sol"; import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC-20 * applications. */ abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors { mapping(address account => uint256) private _balances; mapping(address account => mapping(address spender => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * 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 number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual 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 `value`. */ function transfer(address to, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _transfer(owner, to, value); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `value` 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 value) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, value); return true; } /** * @dev See {IERC20-transferFrom}. * * Skips emitting an {Approval} event indicating an allowance update. This is not * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve]. * * 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 `value`. * - the caller must have allowance for ``from``'s tokens of at least * `value`. */ function transferFrom(address from, address to, uint256 value) public virtual returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, value); _transfer(from, to, value); return true; } /** * @dev Moves a `value` 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. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _transfer(address from, address to, uint256 value) internal { if (from == address(0)) { revert ERC20InvalidSender(address(0)); } if (to == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(from, to, value); } /** * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from` * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding * this function. * * Emits a {Transfer} event. */ function _update(address from, address to, uint256 value) internal virtual { if (from == address(0)) { // Overflow check required: The rest of the code assumes that totalSupply never overflows _totalSupply += value; } else { uint256 fromBalance = _balances[from]; if (fromBalance < value) { revert ERC20InsufficientBalance(from, fromBalance, value); } unchecked { // Overflow not possible: value <= fromBalance <= totalSupply. _balances[from] = fromBalance - value; } } if (to == address(0)) { unchecked { // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply. _totalSupply -= value; } } else { unchecked { // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256. _balances[to] += value; } } emit Transfer(from, to, value); } /** * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0). * Relies on the `_update` mechanism * * Emits a {Transfer} event with `from` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _mint(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(address(0), account, value); } /** * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply. * Relies on the `_update` mechanism. * * Emits a {Transfer} event with `to` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead */ function _burn(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidSender(address(0)); } _update(account, address(0), value); } /** * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, 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. * - `spender` cannot be the zero address. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address owner, address spender, uint256 value) internal { _approve(owner, spender, value, true); } /** * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event. * * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any * `Approval` event during `transferFrom` operations. * * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to * true using the following override: * * ```solidity * function _approve(address owner, address spender, uint256 value, bool) internal virtual override { * super._approve(owner, spender, value, true); * } * ``` * * Requirements are the same as {_approve}. */ function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual { if (owner == address(0)) { revert ERC20InvalidApprover(address(0)); } if (spender == address(0)) { revert ERC20InvalidSpender(address(0)); } _allowances[owner][spender] = value; if (emitEvent) { emit Approval(owner, spender, value); } } /** * @dev Updates `owner` s allowance for `spender` based on spent `value`. * * Does not update the allowance value in case of infinite allowance. * Revert if not enough allowance is available. * * Does not emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 value) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance < type(uint256).max) { if (currentAllowance < value) { revert ERC20InsufficientAllowance(spender, currentAllowance, value); } unchecked { _approve(owner, spender, currentAllowance - value, false); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; import {IERC1363} from "../../../interfaces/IERC1363.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC-20 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 { /** * @dev An operation with an ERC-20 token failed. */ error SafeERC20FailedOperation(address token); /** * @dev Indicates a failed `decreaseAllowance` request. */ error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); /** * @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.encodeCall(token.transfer, (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.encodeCall(token.transferFrom, (from, to, value))); } /** * @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful. */ function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) { return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value))); } /** * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful. */ function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) { return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, 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. * * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client" * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); forceApprove(token, spender, oldAllowance + value); } /** * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no * value, non-reverting calls are assumed to be successful. * * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client" * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { unchecked { uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < requestedDecrease) { revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); } forceApprove(token, spender, currentAllowance - requestedDecrease); } } /** * @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. * * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being * set here. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); _callOptionalReturn(token, approvalCall); } } /** * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * Reverts if the returned value is other than `true`. */ function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal { if (to.code.length == 0) { safeTransfer(token, to, value); } else if (!token.transferAndCall(to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * Reverts if the returned value is other than `true`. */ function transferFromAndCallRelaxed( IERC1363 token, address from, address to, uint256 value, bytes memory data ) internal { if (to.code.length == 0) { safeTransferFrom(token, from, to, value); } else if (!token.transferFromAndCall(from, to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}. * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall} * once without retrying, and relies on the returned value to be true. * * Reverts if the returned value is other than `true`. */ function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal { if (to.code.length == 0) { forceApprove(token, to, value); } else if (!token.approveAndCall(to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @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 {_callOptionalReturnBool} that reverts if call fails to meet the requirements. */ function _callOptionalReturn(IERC20 token, bytes memory data) private { uint256 returnSize; uint256 returnValue; assembly ("memory-safe") { let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20) // bubble errors if iszero(success) { let ptr := mload(0x40) returndatacopy(ptr, 0, returndatasize()) revert(ptr, returndatasize()) } returnSize := returndatasize() returnValue := mload(0) } if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) { revert SafeERC20FailedOperation(address(token)); } } /** * @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 silently catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { bool success; uint256 returnSize; uint256 returnValue; assembly ("memory-safe") { success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20) returnSize := returndatasize() returnValue := mload(0) } return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC-721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC-721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or * {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the address zero. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/utils/ERC721Holder.sol) pragma solidity ^0.8.20; import {IERC721Receiver} from "../IERC721Receiver.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or * {IERC721-setApprovalForAll}. */ abstract contract ERC721Holder is IERC721Receiver { /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) { return this.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at, * consider using {ReentrancyGuardTransient} instead. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._initialized = 1; if (isTopLevelCall) { $._initializing = true; } _; if (isTopLevelCall) { $._initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._initialized = version; $._initializing = true; _; $._initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Pointer to storage slot. Allows integrators to override it with a custom storage location. * * NOTE: Consider following the ERC-7201 formula to derive storage locations. */ function _initializableStorageSlot() internal pure virtual returns (bytes32) { return INITIALIZABLE_STORAGE; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { bytes32 slot = _initializableStorageSlot(); assembly { $.slot := slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-20 standard as defined in the ERC. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC-20 standard. */ 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 v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC-20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC-721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC-1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol) pragma solidity ^0.8.20; import {IERC20} from "./IERC20.sol"; import {IERC165} from "./IERC165.sol"; /** * @title IERC1363 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363]. * * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction. */ interface IERC1363 is IERC20, IERC165 { /* * Note: the ERC-165 identifier for this interface is 0xb0202a11. * 0xb0202a11 === * bytes4(keccak256('transferAndCall(address,uint256)')) ^ * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^ * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^ * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^ * bytes4(keccak256('approveAndCall(address,uint256)')) ^ * bytes4(keccak256('approveAndCall(address,uint256,bytes)')) */ /** * @dev Moves a `value` amount of tokens from the caller's account to `to` * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferAndCall(address to, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from the caller's account to `to` * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @param data Additional data with no specified format, sent in call to `to`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param from The address which you want to send tokens from. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferFromAndCall(address from, address to, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param from The address which you want to send tokens from. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @param data Additional data with no specified format, sent in call to `to`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`. * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function approveAndCall(address spender, uint256 value) external returns (bool); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`. * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. * @param data Additional data with no specified format, sent in call to `spender`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[ERC]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.20; /** * @title ERC-721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC-721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be * reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../token/ERC20/IERC20.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.sol";
{ "remappings": [ "@pythnetwork/pyth-sdk-solidity/=node_modules/@pythnetwork/pyth-sdk-solidity/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "@contracts/=contracts/", "@aerodrome/=lib/contracts/contracts/", "forge-std/=lib/forge-std/src/", "@redstone-finance/evm-connector/dist/contracts/=lib/redstone-oracles-monorepo/packages/evm-connector/contracts/", "@chainlink/=lib/foundry-chainlink-toolkit/", "@opengsn/=lib/contracts/lib/gsn/packages/", "@uniswap/v3-core/=lib/contracts/lib/v3-core/", "chainlink-brownie-contracts/=lib/foundry-chainlink-toolkit/lib/chainlink-brownie-contracts/contracts/src/v0.6/vendor/@arbitrum/nitro-contracts/src/", "contracts/=lib/contracts/contracts/", "ds-test/=lib/contracts/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "foundry-chainlink-toolkit/=lib/foundry-chainlink-toolkit/", "gsn/=lib/contracts/lib/", "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "redstone-oracles-monorepo/=lib/redstone-oracles-monorepo/", "utils/=lib/contracts/test/utils/", "v3-core/=lib/contracts/lib/v3-core/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "shanghai", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"acceptBorrowOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"borrowInformation","outputs":[{"internalType":"address","name":"borrowOrderAddress","type":"address"},{"internalType":"uint256","name":"maxApr","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"collateral","type":"address"},{"internalType":"address","name":"valuableAsset","type":"address"},{"internalType":"bool","name":"isNFT","type":"bool"},{"internalType":"uint256","name":"receiptID","type":"uint256"},{"internalType":"address","name":"oracle_Collateral","type":"address"},{"internalType":"uint256","name":"valuableAssetAmount","type":"uint256"},{"internalType":"uint256","name":"availableAmount","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBorrowInfo","outputs":[{"components":[{"internalType":"address","name":"borrowOrderAddress","type":"address"},{"internalType":"bool[]","name":"oraclesPerPairActivated","type":"bool[]"},{"internalType":"uint256[]","name":"LTVs","type":"uint256[]"},{"internalType":"uint256","name":"maxApr","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address[]","name":"acceptedPrinciples","type":"address[]"},{"internalType":"address","name":"collateral","type":"address"},{"internalType":"address","name":"valuableAsset","type":"address"},{"internalType":"bool","name":"isNFT","type":"bool"},{"internalType":"uint256","name":"receiptID","type":"uint256"},{"internalType":"address[]","name":"oracles_Principles","type":"address[]"},{"internalType":"uint256[]","name":"ratio","type":"uint256[]"},{"internalType":"address","name":"oracle_Collateral","type":"address"},{"internalType":"uint256","name":"valuableAssetAmount","type":"uint256"},{"internalType":"uint256","name":"availableAmount","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"}],"internalType":"struct DBOImplementation.BorrowInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_aggregatorContract","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address[]","name":"_acceptedPrinciples","type":"address[]"},{"internalType":"address","name":"_collateral","type":"address"},{"internalType":"bool[]","name":"_oraclesActivated","type":"bool[]"},{"internalType":"bool","name":"_isNFT","type":"bool"},{"internalType":"uint256[]","name":"_LTVs","type":"uint256[]"},{"internalType":"uint256","name":"_maxApr","type":"uint256"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"uint256","name":"_receiptID","type":"uint256"},{"internalType":"address[]","name":"_oracleIDS_Principles","type":"address[]"},{"internalType":"uint256[]","name":"_ratio","type":"uint256[]"},{"internalType":"address","name":"_oracleID_Collateral","type":"address"},{"internalType":"uint256","name":"_startedBorrowAmount","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxApr","type":"uint256"},{"internalType":"uint256","name":"newDuration","type":"uint256"},{"internalType":"uint256[]","name":"newLTVs","type":"uint256[]"},{"internalType":"uint256[]","name":"newRatios","type":"uint256[]"}],"name":"updateBorrowOrder","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Deployed Bytecode
0x6080806040526004361015610012575f80fd5b5f90813560e01c90816322f3e2d4146116e55750806362d05c78146115255780639c91e8321461104e578063d52604ff146107c8578063dec45ff61461072d578063e1a7f115146105cd5763e6c6ab521461006b575f80fd5b346103b05760803660031901126103b0576044356001600160401b0381116105c95761009b9036906004016117f2565b6064356001600160401b0381116105c5576100ba9036906004016117f2565b6100cf60018060a01b03600954163314611a32565b8151600a54811490816105ba575b501561058657426003556100ef611a6b565b60048035606083015260243560808301526040820193909352610180810191909152805182546001600160a01b0319166001600160a01b039190911617909155602081015180516001600160401b0381116103e257600160401b81116103e25760206005928354838555808410610515575b500191808552845b82821c81106104c35750601f19821682038061046b575b5050505060408101518051906001600160401b0382116103e257600160401b82116103e2576020906101b88360065481600655611963565b0160068452835b82811061044a575050506060810151600755608081015160085560a0810151600980546001600160a01b0319166001600160a01b039290921691909117905560c08101518051906001600160401b0382116103e257600160401b82116103e25760209061023283600a5481600a55611990565b01600a8452835b8281106104205750505060e0810151600b80546001600160a01b0319166001600160a01b03928316179055610100820151600c8054610120850151929093166001600160a81b03199093169290921790151560a01b60ff60a01b16179055610140810151600d556101608101518051906001600160401b0382116103e257600160401b82116103e2576020906102d583600e5481600e556119bb565b01600e8452835b8281106103f6575050506101808101518051906001600160401b0382116103e257600160401b82116103e25760209061031b83600f5481600f556119e6565b01600f8452835b8281106103c1576101a0840151601080546001600160a01b0319166001600160a01b039283161790556101c08501516011556101e08501516012556102008501516013556002548691829116803b156103be57818091602460405180948193630656df0760e51b83523060048401525af180156103b3576103a05750f35b6103a990611709565b6103b05780f35b80fd5b6040513d84823e3d90fd5b50fd5b60019060208351930192815f80516020612507833981519152015501610322565b634e487b7160e01b84526041600452602484fd5b81516001600160a01b03165f805160206124878339815191528201556020909101906001016102dc565b81516001600160a01b03165f805160206124a7833981519152820155602090910190600101610239565b60019060208351930192815f805160206124c78339815191520155016101bf565b928593865b818110610494575050501c5f8051602061246783398151915201555f808080610180565b90919460206104b96001928489511515919060ff809160031b9316831b921b19161790565b9601929101610470565b85865b602081106104e857505f80516020612467833981519152820155600101610169565b9490602061050c6001928885511515919060ff809160031b9316831b921b19161790565b920195016104c6565b61054790601f8501861c601f86168061054d575b50601f5f805160206124678339815191529201871c8201910161194d565b5f610161565b7f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3daf8201908154905f1990880360031b1c1690555f610529565b60405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964204c54567360a01b6044820152606490fd5b90508151145f6100dd565b8280fd5b5080fd5b50346103b057806003193601126103b0576105e6611a6b565b906040519060209283835261024083019060018060a01b03808251168686015285820151936102209384604088015285518091528761026088019601915b818110610717575050508495506106e9610687610653604085015196601f1997888a83030160608b0152611850565b60608501516080890152608085015160a08901528360a08601511660c089015260c0850151878983030160e08a0152611883565b6106d4838060e08701511661010090818b01528601511661012090818a0152850151151561014090818a015285015161016090818a01528501519161018092888a830301848b0152611883565b908401516101a0968883030187890152611850565b93820151166101c090818601528101516101e090818601528101519061020091828601520151908301520390f35b8251151587529588019591880191600101610624565b50346103b057806003193601126103b05761018060018060a01b03806004541690600754906008549080600954169080600b54169060ff600c54600d549280601054169460115496601254986013549a6040519c8d5260208d015260408c015260608b015260808a0152811660a089015260a01c16151560c087015260e0860152610100850152610120840152610140830152610160820152f35b50346103b0576101c03660031901126103b0576004356001600160a01b038116810361101f576024356001600160a01b038116810361101f576044356001600160401b03811161104a57610820903690600401611784565b6064356001600160a01b038116900361101f576001600160401b036084351161104a5736602360843501121561104a5760843560040135906108618261176d565b9061086f604051928361174c565b8282526020820180933660248260051b60843501011161102357602460843501915b60248260051b6084350101831061102f5750505060a435151560a4350361101f576001600160401b0360c4351161102b576108d13660c4356004016117f2565b936001600160401b036101443511611027576108f33661014435600401611784565b6001600160401b0361016435116110235761091436610164356004016117f2565b90610184356001600160a01b038116900361101f575f805160206124e783398151915254976001600160401b0389161580611011575b60016001600160401b038b16149081611007575b159081610ffe575b50610fec5760016001600160401b03198a16175f805160206124e78339815191525560ff8960401c1615610fc0575b600180546001600160a01b0319166001600160a01b039092169190911790556002805460ff60a01b1916600160a01b1790556101a43560a43515610fb6575060405163359549b360e21b81526101243560048201529360e0856024816064356001600160a01b03165afa948515610fab578a95610f7a575b50604085015160c0909501516001600160a01b0316905b60a43515610f73576001945b60405199610a3d8b611730565b308b528860208c015260408b015260e43560608b01526101043560808b015260018060a01b031660a08a015260c089015260018060a01b036064351660e089015260018060a01b031661010088015260a43515156101208801526101243561014088015261016087015261018086015260018060a01b0361018435166101a0860152866101c08601526101e0850152610200840152610af83060018060a01b03166bffffffffffffffffffffffff60a01b6004541617600455565b51906001600160401b038211610dc457600160401b8211610dc45760055482600555808310610ef9575b509060058552845b8160051c8110610ea75750601f1981168103610e4d575b505060408101518051906001600160401b038211610dc457600160401b8211610dc457602090610b778360065481600655611963565b0160068552845b828110610e2c575050506060810151600755608081015160085560a0810151600980546001600160a01b0319166001600160a01b039290921691909117905560c08101518051906001600160401b038211610dc457600160401b8211610dc457602090610bf183600a5481600a55611990565b01600a8552845b828110610e025750505060e0810151600b80546001600160a01b0319166001600160a01b03928316179055610100820151600c8054610120850151929093166001600160a81b03199093169290921790151560a01b60ff60a01b16179055610140810151600d556101608101518051906001600160401b038211610dc457600160401b8211610dc457602090610c9483600e5481600e556119bb565b01600e8552845b828110610dd8575050506101808101518051906001600160401b038211610dc457600160401b8211610dc457602090610cda83600f5481600f556119e6565b01600f8552845b828110610da3576101a0840151601080546001600160a01b0319166001600160a01b03929092169190911790558560ff86610200876101c08101516011556101e08101516012550151601355600280546001600160a01b0319163317905560401c1615610d4b5780f35b68ff0000000000000000195f805160206124e783398151915254165f805160206124e7833981519152557fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602060405160018152a180f35b60019060208351930192815f80516020612507833981519152015501610ce1565b634e487b7160e01b85526041600452602485fd5b81516001600160a01b03165f80516020612487833981519152820155602090910190600101610c9b565b81516001600160a01b03165f805160206124a7833981519152820155602090910190600101610bf8565b60019060208351930192815f805160206124c7833981519152015501610b7e565b8491855b601f19831683038110610e7a57505060051c5f8051602061246783398151915201555f80610b41565b90926020610e9e6001928487511515919060ff809160031b9316831b921b19161790565b94019101610e51565b85865b60208110610ecc57505f80516020612467833981519152820155600101610b2a565b93906020610ef06001928785511515919060ff809160031b9316831b921b19161790565b92019401610eaa565b610f2d90601f841680610f33575b50601f5f80516020612467833981519152910160051c810190601f850160051c0161194d565b5f610b22565b7f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3daf601f860160051c01908154905f199060200360031b1c1690555f610f07565b8594610a30565b610f9d91955060e03d60e011610fa4575b610f95818361174c565b8101906118d3565b935f610a0d565b503d610f8b565b6040513d8c823e3d90fd5b9360643590610a24565b68ffffffffffffffffff19891668010000000000000001175f805160206124e783398151915255610995565b60405163f92ee8a960e01b8152600490fd5b9050155f610966565b303b15915061095e565b5060ff8960401c161561094a565b5f80fd5b8780fd5b8680fd5b8580fd5b823590811515820361101f5790815260209283019201610891565b8380fd5b50346103b057602090816003193601126103b0576001546001600160a01b039060043590821633036114ee57611082612445565b60035480159081156114d9575b50156114825761109d611a6b565b906101e08201948551821161143e5781156113fa576012956110c0838854611a11565b8755610120840151156112e7575050508160e08201511682600154169061014083015191813b1561102b576040516323b872dd60e01b81523060048201526001600160a01b03919091166024820152604481019290925284908290606490829084905af180156112dc579084916112c8575b50505b8354612710908181029181830414901517156112b4576102008201519081156112a15791600a85969286940411155f1461124f576002805460ff60a01b19169055815480611230575b5050558060025416803b1561122c57828091602460405180948193632c52105360e21b83523060048401525af190811561122157839161120d575b505060025416803b156103be57818091602460405180948193631358d50f60e31b83523060048401525af180156103b3576111f9575b50505b6001815580f35b61120290611709565b6103b057805f6111ef565b61121690611709565b6103be57815f6111b9565b6040513d85823e3d90fd5b5050fd5b818560a08160e06112489601511692015116906123b2565b5f8061117e565b50505060025416803b156103be57818091602460405180948193630656df0760e51b83523060048401525af180156103b35761128d575b50506111f2565b61129690611709565b6103b057805f611286565b85634e487b7160e01b5f5260045260245ffd5b634e487b7160e01b84526011600452602484fd5b6112d190611709565b6105c557825f611132565b6040513d86823e3d90fd5b60149051049060e0840191600482878551166040519283809263313ce56760e01b82525afa80156113ef5788906113b7575b60ff915016604d81116113a357600a0a906103e891808302928304036113a357841090811591611398575b50156113635750908361135e9251168460015416906123b2565b611135565b6064906040519062461bcd60e51b82526004820152600e60248201526d416d6f756e7420746f6f206c6f7760901b6044820152fd5b90508310155f611344565b634e487b7160e01b88526011600452602488fd5b508281813d83116113e8575b6113cd818361174c565b81010312611023575160ff811681036110235760ff90611319565b503d6113c3565b6040513d8a823e3d90fd5b6064906040519062461bcd60e51b82526004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152fd5b6064906040519062461bcd60e51b82526004820152601f60248201527f416d6f756e74206578636565647320617661696c61626c6520616d6f756e74006044820152fd5b60405162461bcd60e51b815260048101859052602960248201527f4f6666657220686173206265656e207570646174656420696e20746865206c616044820152687374206d696e75746560b81b6064820152608490fd5b603c91506114e79042611a11565b115f61108f565b60405162461bcd60e51b815260048101859052600f60248201526e27b7363c9030b3b3b932b3b0ba37b960891b6044820152606490fd5b50346103b057806003193601126103b0576009546001600160a01b0391906115509083163314611a32565b611558612445565b611560611a6b565b6101e08101805180156116aa5760128490556002805460ff60a01b1916905561012083015115611690575051611633575b5080915b8060025416803b1561122c57828091602460405180948193631358d50f60e31b83523060048401525af190811561122157839161161f575b505060025416803b156103be57818091602460405180948193632c52105360e21b83523060048401525af180156103b35761160b575b506001905580f35b61161490611709565b6103b057805f611603565b61162890611709565b6103be57815f6115cd565b6101408360e083015116910151813b156105c5576040516323b872dd60e01b815230600482015233602482015260448101919091529082908290606490829084905af180156103b357156115915761168a90611709565b5f611591565b6116a591508492849560e033920151166123b2565b611595565b60405162461bcd60e51b8152602060048201526013602482015272139bc8185d985a5b18589b1948185b5bdd5b9d606a1b6044820152606490fd5b9050346105c957816003193601126105c95760209060ff60025460a01c1615158152f35b6001600160401b03811161171c57604052565b634e487b7160e01b5f52604160045260245ffd5b61022081019081106001600160401b0382111761171c57604052565b90601f801991011681019081106001600160401b0382111761171c57604052565b6001600160401b03811161171c5760051b60200190565b81601f8201121561101f5780359161179b8361176d565b926117a9604051948561174c565b808452602092838086019260051b82010192831161101f578301905b8282106117d3575050505090565b81356001600160a01b038116810361101f5781529083019083016117c5565b81601f8201121561101f578035916118098361176d565b92611817604051948561174c565b808452602092838086019260051b82010192831161101f578301905b828210611841575050505090565b81358152908301908301611833565b9081518082526020808093019301915f5b82811061186f575050505090565b835185529381019392810192600101611861565b9081518082526020808093019301915f5b8281106118a2575050505090565b83516001600160a01b031685529381019392810192600101611894565b51906001600160a01b038216820361101f57565b908160e091031261101f576040519060e082018281106001600160401b0382111761171c576119459160c091604052805184526020810151602085015260408101516040850152606081015160608501526080810151608085015261193a60a082016118bf565b60a0850152016118bf565b60c082015290565b818110611958575050565b5f815560010161194d565b80821061196e575050565b61198e9160065f525f805160206124c7833981519152918201910161194d565b565b80821061199b575050565b61198e91600a5f525f805160206124a7833981519152918201910161194d565b8082106119c6575050565b61198e91600e5f525f80516020612487833981519152918201910161194d565b8082106119f1575050565b61198e91600f5f525f80516020612507833981519152918201910161194d565b91908203918211611a1e57565b634e487b7160e01b5f52601160045260245ffd5b15611a3957565b60405162461bcd60e51b815260206004820152600a60248201526927b7363c9037bbb732b960b11b6044820152606490fd5b5f610200604051611a7b81611730565b82815260606020820152606060408201528260608201528260808201528260a0820152606060c08201528260e082015282610100820152826101208201528261014082015260606101608201526060610180820152826101a0820152826101c0820152826101e08201520152604051611af381611730565b6004546001600160a01b03168152604051600580548083525f9182525f805160206124678339815191529183916020830191905b80601f8301106121ca57611c3d9454918181106121b4575b81811061219b575b818110612182575b818110612169575b818110612151575b818110612138575b81811061211f575b818110612106575b8181106120ed575b8181106120d4575b8181106120bb575b8181106120a2575b818110612089575b818110612070575b818110612057575b81811061203e575b818110612025575b81811061200c575b818110611ff3575b818110611fda575b818110611fc1575b818110611fa8575b818110611f8f575b818110611f76575b818110611f5d575b818110611f44575b818110611f2b575b818110611f12575b818110611ef9575b818110611ee0575b818110611ec7575b10611eb7575b50038261174c565b602082015260405180816020600654928381520160065f525f805160206124c7833981519152925f5b818110611e9e575050611c7b9250038261174c565b60408201526007546060820152600854608082015260018060a01b036009541660a082015260405180816020600a549283815201600a5f525f805160206124a7833981519152925f5b818110611e7c575050611cd99250038261174c565b60c0820152600b546001600160a01b0390811660e0830152600c5490811661010083015260a01c60ff161515610120820152600d54610140820152604051600e80548083525f9182525f8051602061248783398151915291839160208301915b818110611e5a575050611d4e9250038261174c565b61016082015260405180816020600f549283815201600f5f525f80516020612507833981519152925f5b818110611e41575050611d8d9250038261174c565b6101808201526010546001600160a01b03166101a08201526011546101c082019081526012546101e0830152601354610200830152610120820151611dd0575090565b60018060a01b0360e08301511660e061014084015160246040518094819363359549b360e21b835260048301525afa8015611e36576040915f91611e17575b500151905290565b611e30915060e03d60e011610fa457610f95818361174c565b5f611e0f565b6040513d5f823e3d90fd5b8454835260019485019486945060209093019201611d78565b84546001600160a01b0316835260019485019486945060209093019201611d39565b84546001600160a01b0316835260019485019486945060209093019201611cc4565b8454835260019485019486945060209093019201611c66565b60f81c151581526020015f611c35565b92602060019160ff8560f01c1615158152019301611c2f565b92602060019160ff8560e81c1615158152019301611c27565b92602060019160ff8560e01c1615158152019301611c1f565b92602060019160ff8560d81c1615158152019301611c17565b92602060019160ff8560d01c1615158152019301611c0f565b92602060019160ff8560c81c1615158152019301611c07565b92602060019160ff8560c01c1615158152019301611bff565b92602060019160ff8560b81c1615158152019301611bf7565b92602060019160ff8560b01c1615158152019301611bef565b92602060019160ff8560a81c1615158152019301611be7565b92602060019160ff8560a01c1615158152019301611bdf565b92602060019160ff8560981c1615158152019301611bd7565b92602060019160ff8560901c1615158152019301611bcf565b92602060019160ff8560881c1615158152019301611bc7565b92602060019160ff8560801c1615158152019301611bbf565b92602060019160ff8560781c1615158152019301611bb7565b92602060019160ff8560701c1615158152019301611baf565b92602060019160ff8560681c1615158152019301611ba7565b92602060019160ff8560601c1615158152019301611b9f565b92602060019160ff8560581c1615158152019301611b97565b92602060019160ff8560501c1615158152019301611b8f565b92602060019160ff8560481c1615158152019301611b87565b92602060019160ff8560401c1615158152019301611b7f565b92602060019160ff8560381c1615158152019301611b77565b92602060019160ff8560301c1615158152019301611b6f565b92602060019160ff8560281c1615158152019301611b67565b92602060019160ff85831c1615158152019301611b5f565b92602060019160ff8560181c1615158152019301611b57565b92602060019160ff8560101c1615158152019301611b4f565b92602060019160ff8560081c1615158152019301611b47565b92602060019160ff851615158152019301611b3f565b916020919350610400600191865460ff81161515825260ff8160081c1615158583015260ff8160101c161515604083015260ff8160181c161515606083015260ff81861c161515608083015260ff8160281c16151560a083015260ff8160301c16151560c083015260ff8160381c16151560e083015260ff8160401c16151561010083015260ff8160481c16151561012083015260ff8160501c16151561014083015260ff8160581c16151561016083015260ff8160601c16151561018083015260ff8160681c1615156101a083015260ff8160701c1615156101c083015260ff8160781c1615156101e083015260ff8160801c16151561020083015260ff8160881c16151561022083015260ff8160901c16151561024083015260ff8160981c16151561026083015260ff8160a01c16151561028083015260ff8160a81c1615156102a083015260ff8160b01c1615156102c083015260ff8160b81c1615156102e083015260ff8160c01c16151561030083015260ff8160c81c16151561032083015260ff8160d01c16151561034083015260ff8160d81c16151561036083015260ff8160e01c16151561038083015260ff8160e81c1615156103a083015260ff8160f01c1615156103c083015260f81c15156103e0820152019401920184929391611b27565b60405163a9059cbb60e01b602082019081526001600160a01b039384166024830152604480830195909552938152909260808201906001600160401b0382118383101761171c576020925f92604052519082865af115611e36575f513d61243c57508082163b155b612422575050565b604051635274afe760e01b81529116600482015260249150fd5b6001141561241a565b60025f54146124545760025f55565b604051633ee5aeb560e01b8152600490fdfe036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0bb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fdc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8f652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802a2646970667358221220a02fc5598470f01dd86930d08822bc812855e3f6e52122720ea7f53e8ab1a0a764736f6c63430008140033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.