Feature Tip: Add private address tag to any address under My Name Tag !
Source Code
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Method | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|---|
0x61012060 | 19282746 | 600 days ago | Contract Creation | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
PermissionedAaveWrapper
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 10000 runs
Other Settings:
london EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // Thanks to ultrasecr.eth pragma solidity ^0.8.19; import { Registry } from "../Registry.sol"; import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol"; import { AaveWrapper } from "./AaveWrapper.sol"; contract PermissionedAaveWrapper is AaveWrapper, AccessControl { bytes32 public constant BORROWER = keccak256("BORROWER"); constructor(address owner, address borrower, Registry reg, string memory name) AaveWrapper(reg, name) { _grantRole(DEFAULT_ADMIN_ROLE, owner); _grantRole(BORROWER, borrower); } function _flashLoan(address asset, uint256 amount, bytes memory data) internal override onlyRole(BORROWER) { super._flashLoan(asset, amount, data); } // This contract will be whitelisted in Aave so it pays 0 fees function _flashFee(uint256) internal pure override returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.19; import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol"; contract Registry is AccessControl { bytes32 public constant USER = keccak256("USER"); event Registered(string key, bytes value); error NotFound(); mapping(string key => bytes value) public get; constructor(address[] memory owners, address[] memory users) { for (uint256 i = 0; i < owners.length; i++) { _grantRole(DEFAULT_ADMIN_ROLE, owners[i]); } for (uint256 i = 0; i < users.length; i++) { _grantRole(USER, users[i]); } } function set(string memory key, bytes memory value) external onlyRole(USER) { get[key] = value; emit Registered(key, value); } function getSafe(string calldata key) external view returns (bytes memory result) { result = get[key]; if (result.length == 0) { revert NotFound(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol) pragma solidity ^0.8.20; import {IAccessControl} from "./IAccessControl.sol"; import {Context} from "../utils/Context.sol"; import {ERC165} from "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address account => bool) hasRole; bytes32 adminRole; } mapping(bytes32 role => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with an {AccessControlUnauthorizedAccount} error including the required role. */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual returns (bool) { return _roles[role].hasRole[account]; } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()` * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier. */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account` * is missing `role`. */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert AccessControlUnauthorizedAccount(account, role); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address callerConfirmation) public virtual { if (callerConfirmation != _msgSender()) { revert AccessControlBadConfirmation(); } _revokeRole(role, callerConfirmation); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual returns (bool) { if (!hasRole(role, account)) { _roles[role].hasRole[account] = true; emit RoleGranted(role, account, _msgSender()); return true; } else { return false; } } /** * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual returns (bool) { if (hasRole(role, account)) { _roles[role].hasRole[account] = false; emit RoleRevoked(role, account, _msgSender()); return true; } else { return false; } } }
// SPDX-License-Identifier: MIT // Thanks to ultrasecr.eth pragma solidity ^0.8.19; import { Registry } from "src/Registry.sol"; import { IPool } from "./interfaces/IPool.sol"; import { IPoolDataProvider } from "./interfaces/IPoolDataProvider.sol"; import { IFlashLoanReceiverV2V3 } from "./interfaces/IFlashLoanReceiverV2V3.sol"; import { Math } from "@openzeppelin/contracts/utils/math/Math.sol"; import { BaseWrapper, IERC7399, IERC20 } from "../BaseWrapper.sol"; import { Arrays } from "../utils/Arrays.sol"; import { WAD } from "../utils/constants.sol"; /// @dev Aave Flash Lender that uses the Aave Pool as source of liquidity. /// Aave doesn't allow flow splitting or pushing repayments, so this wrapper is completely vanilla. contract AaveWrapper is BaseWrapper, IFlashLoanReceiverV2V3 { using Arrays for *; error NotPool(); error NotInitiator(); // solhint-disable-next-line var-name-mixedcase address public immutable ADDRESSES_PROVIDER; // solhint-disable-next-line var-name-mixedcase address public immutable POOL; // solhint-disable-next-line var-name-mixedcase address public immutable LENDING_POOL; IPoolDataProvider public immutable dataProvider; bool public immutable isV2; constructor(Registry reg, string memory name) { address pool; (pool, ADDRESSES_PROVIDER, dataProvider, isV2) = abi.decode(reg.getSafe(string.concat(name, "Wrapper")), (address, address, IPoolDataProvider, bool)); POOL = pool; LENDING_POOL = pool; } /// @inheritdoc IERC7399 function maxFlashLoan(address asset) external view returns (uint256) { return _maxFlashLoan(asset); } /// @inheritdoc IERC7399 function flashFee(address asset, uint256 amount) external view returns (uint256) { uint256 max = _maxFlashLoan(asset); require(max > 0, "Unsupported currency"); return amount >= max ? type(uint256).max : _flashFee(amount); } /// @inheritdoc IFlashLoanReceiverV2V3 function executeOperation( address[] calldata assets, uint256[] calldata amounts, uint256[] calldata fees, address initiator, bytes calldata params ) external override returns (bool) { if (msg.sender != address(POOL)) revert NotPool(); if (initiator != address(this)) revert NotInitiator(); _bridgeToCallback(assets[0], amounts[0], fees[0], params); return true; } function _flashLoan(address asset, uint256 amount, bytes memory data) internal virtual override { IPool(POOL).flashLoan({ receiverAddress: address(this), assets: asset.toArray(), amounts: amount.toArray(), interestRateModes: 0.toArray(), // NONE onBehalfOf: address(this), params: data, referralCode: 0 }); } function _maxFlashLoan(address asset) internal view returns (uint256 max) { (,,,,,,,, bool isActive, bool isFrozen) = dataProvider.getReserveConfigurationData(asset); (address aTokenAddress,,) = dataProvider.getReserveTokensAddresses(asset); bool isFlashLoanEnabled = isV2 ? true : dataProvider.getFlashLoanEnabled(asset); max = !isFrozen && isActive && isFlashLoanEnabled ? IERC20(asset).balanceOf(aTokenAddress) : 0; } function _flashFee(uint256 amount) internal view virtual returns (uint256) { return Math.mulDiv(amount, IPool(POOL).FLASHLOAN_PREMIUM_TOTAL() * 0.0001e18, WAD, Math.Rounding.Ceil); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol) pragma solidity ^0.8.20; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev The `account` is missing a role. */ error AccessControlUnauthorizedAccount(address account, bytes32 neededRole); /** * @dev The caller of a function is not the expected one. * * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}. */ error AccessControlBadConfirmation(); /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. */ function renounceRole(bytes32 role, address callerConfirmation) external; }
// 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.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.19; /** * @title IPool * @author Aave * @notice Defines the basic interface for an Aave Pool. */ interface IPool { /** * @notice Allows smartcontracts to access the liquidity of the pool within one transaction, * as long as the amount taken plus a fee is returned. * @dev IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept * into consideration. For further details please visit https://docs.aave.com/developers/ * @param receiverAddress The address of the contract receiving the funds, implementing IFlashLoanReceiver interface * @param assets The addresses of the assets being flash-borrowed * @param amounts The amounts of the assets being flash-borrowed * @param interestRateModes Types of the debt to open if the flash loan is not returned: * 0 -> Don"t open any debt, just revert if funds can"t be transferred from the receiver * 1 -> Open debt at stable rate for the value of the amount flash-borrowed to the `onBehalfOf` address * 2 -> Open debt at variable rate for the value of the amount flash-borrowed to the `onBehalfOf` address * @param onBehalfOf The address that will receive the debt in the case of using on `modes` 1 or 2 * @param params Variadic packed params to pass to the receiver as extra information * @param referralCode The code used to register the integrator originating the operation, for potential rewards. * 0 if the action is executed directly by the user, without any middle-man */ function flashLoan( address receiverAddress, address[] calldata assets, uint256[] calldata amounts, uint256[] calldata interestRateModes, address onBehalfOf, bytes calldata params, uint16 referralCode ) external; /** * @notice Returns the total fee on flash loans * @return The total fee on flashloans */ function FLASHLOAN_PREMIUM_TOTAL() external view returns (uint128); }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.19; /** * @title IPoolDataProvider * @author Aave * @notice Defines the basic interface of a PoolDataProvider */ interface IPoolDataProvider { /** * @notice Returns the configuration data of the reserve * @dev Not returning borrow and supply caps for compatibility, nor pause flag * @param asset The address of the underlying asset of the reserve * @return decimals The number of decimals of the reserve * @return ltv The ltv of the reserve * @return liquidationThreshold The liquidationThreshold of the reserve * @return liquidationBonus The liquidationBonus of the reserve * @return reserveFactor The reserveFactor of the reserve * @return usageAsCollateralEnabled True if the usage as collateral is enabled, false otherwise * @return borrowingEnabled True if borrowing is enabled, false otherwise * @return stableBorrowRateEnabled True if stable rate borrowing is enabled, false otherwise * @return isActive True if it is active, false otherwise * @return isFrozen True if it is frozen, false otherwise */ function getReserveConfigurationData(address asset) external view returns ( uint256 decimals, uint256 ltv, uint256 liquidationThreshold, uint256 liquidationBonus, uint256 reserveFactor, bool usageAsCollateralEnabled, bool borrowingEnabled, bool stableBorrowRateEnabled, bool isActive, bool isFrozen ); /** * @notice Returns the token addresses of the reserve * @param asset The address of the underlying asset of the reserve * @return aTokenAddress The AToken address of the reserve * @return stableDebtTokenAddress The StableDebtToken address of the reserve * @return variableDebtTokenAddress The VariableDebtToken address of the reserve */ function getReserveTokensAddresses(address asset) external view returns (address aTokenAddress, address stableDebtTokenAddress, address variableDebtTokenAddress); /** * @notice Returns whether the reserve has FlashLoans enabled or disabled * @param asset The address of the underlying asset of the reserve * @return True if FlashLoans are enabled, false otherwise */ function getFlashLoanEnabled(address asset) external view returns (bool); }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.19; /** * @title IFlashLoanReceiver interface * @notice Interface for the Aave fee IFlashLoanReceiver (V2/V3 compatible). * @author Aave * @dev implement this interface to develop a flashloan-compatible flashLoanReceiver contract * */ interface IFlashLoanReceiverV2V3 { function executeOperation( address[] calldata assets, uint256[] calldata amounts, uint256[] calldata premiums, address initiator, bytes calldata params ) external returns (bool); function ADDRESSES_PROVIDER() external view returns (address); function LENDING_POOL() external view returns (address); function POOL() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // Thanks to ultrasecr.eth pragma solidity ^0.8.19; import "erc7399/IERC7399.sol"; import { IERC20Metadata as IERC20 } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { FunctionCodec } from "./utils/FunctionCodec.sol"; /// @dev All ERC7399 flash loan wrappers have the same general structure. /// - The ERC7399 `flash` function is the entry point for the flash loan. /// - The wrapper calls the underlying lender flash lender on their non-ERC7399 flash lending call to borrow the funds. /// - The lender sends the funds to the wrapper. /// - The wrapper receives the callback from the lender. /// - The wrapper sends the funds to the loan receiver. /// - The wrapper calls the callback supplied by the original borrower. /// - The callback from the original borrower executes. /// - Depending on the lender, the wrapper may have to approve it to pull the repayment. /// - If there is any data to return, it is kept in a storage variable. /// - The wrapper exits the callback. /// - The lender verifies or pulls the repayment. /// - The wrapper returns to the original borrower the stored result of its callback. abstract contract BaseWrapper is IERC7399 { using SafeERC20 for IERC20; struct Data { address loanReceiver; address initiator; function(address, address, address, uint256, uint256, bytes memory) external returns (bytes memory) callback; bytes initiatorData; } bytes internal _callbackResult; /// @inheritdoc IERC7399 /// @dev The entry point for the ERC7399 flash loan. Packs data to convert the legacy flash loan into an ERC7399 /// flash loan. Then it calls the legacy flash loan. Once the flash loan is done, checks if there is any return /// data and returns it. function flash( address loanReceiver, address asset, uint256 amount, bytes calldata initiatorData, function(address, address, address, uint256, uint256, bytes memory) external returns (bytes memory) callback ) external returns (bytes memory result) { Data memory data = Data({ loanReceiver: loanReceiver, initiator: msg.sender, callback: callback, initiatorData: initiatorData }); return _flash(asset, amount, data); } /// @dev Alternative entry point for the ERC7399 flash loan, without function pointers. Packs data to convert the /// legacy flash loan into an ERC7399 flash loan. Then it calls the legacy flash loan. Once the flash loan is done, /// checks if there is any return data and returns it. function flash( address loanReceiver, address asset, uint256 amount, bytes calldata initiatorData, address callbackTarget, bytes4 callbackSelector ) external returns (bytes memory result) { Data memory data = Data({ loanReceiver: loanReceiver, initiator: msg.sender, callback: FunctionCodec.decodeFunction(callbackTarget, callbackSelector), initiatorData: initiatorData }); return _flash(asset, amount, data); } function _flash(address asset, uint256 amount, Data memory data) internal virtual returns (bytes memory result) { _flashLoan(asset, amount, abi.encode(data)); result = _callbackResult; // Avoid storage write if not needed if (result.length > 0) { delete _callbackResult; } return result; } /// @dev Call the legacy flashloan function in the child contract. This is where we borrow from Aave, Uniswap, etc. function _flashLoan(address asset, uint256 amount, bytes memory data) internal virtual; /// @dev Handle the common parts of bridging the callback from legacy to ERC7399. Transfer the funds to the loan /// receiver. Call the callback supplied by the original borrower. Approve the repayment if necessary. If there is /// any result, it is kept in a storage variable to be retrieved on `flash` after the legacy flash loan is finished. function _bridgeToCallback(address asset, uint256 amount, uint256 fee, bytes memory params) internal { Data memory data = abi.decode(params, (Data)); _transferAssets(asset, amount, data.loanReceiver); // call the callback and tell the callback receiver to repay the loan to this contract bytes memory result = data.callback(data.initiator, _repayTo(), address(asset), amount, fee, data.initiatorData); _approveRepayment(asset, amount, fee); if (result.length > 0) { // if there's any result, it is kept in a storage variable to be retrieved later in this tx _callbackResult = result; } } /// @dev Transfer the assets to the loan receiver. /// Override it if the provider can send the funds directly function _transferAssets(address asset, uint256 amount, address loanReceiver) internal virtual { IERC20(asset).safeTransfer(loanReceiver, amount); } /// @dev Approve the repayment of the loan to the provider if needed. /// Override it if the provider can receive the funds directly and you want to avoid the if condition function _approveRepayment(address asset, uint256 amount, uint256 fee) internal virtual { if (_repayTo() == address(this)) { IERC20(asset).forceApprove(msg.sender, amount + fee); } } /// @dev Where should the end client send the funds to repay the loan /// Override it if the provider can receive the funds directly function _repayTo() internal view virtual returns (address) { return address(this); } }
// SPDX-License-Identifier: MIT // Thanks to ultrasecr.eth pragma solidity ^0.8.19; library Arrays { function toArray(uint256 n) internal pure returns (uint256[] memory arr) { arr = new uint256[](1); arr[0] = n; } function toArray(address a) internal pure returns (address[] memory arr) { arr = new address[](1); arr[0] = a; } function toArray(address a, address b) internal pure returns (address[] memory arr) { arr = new address[](2); arr[0] = a; arr[1] = b; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; uint256 constant WAD = 1e18;
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * 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[EIP 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: CC0 pragma solidity >=0.6.4; /// @dev Specification for flash lenders compatible with ERC-7399 interface IERC7399 { /// @dev The amount of currency available to be lent. /// @param asset The loan currency. /// @return The amount of `asset` that can be borrowed. function maxFlashLoan(address asset) external view returns (uint256); /// @dev The fee to be charged for a given loan. /// @param asset The loan currency. /// @param amount The amount of assets lent. /// @return The amount of `asset` to be charged for the loan, on top of the returned principal. function flashFee(address asset, uint256 amount) external view returns (uint256); /// @dev Initiate a flash loan. /// @param loanReceiver The address receiving the flash loan /// @param asset The asset to be loaned /// @param amount The amount to loaned /// @param data The ABI encoded user data /// @param callback The address and signature of the callback function /// @return result ABI encoded result of the callback function flash( address loanReceiver, address asset, uint256 amount, bytes calldata data, /// @dev callback. This is a combination of the callback receiver address, and the signature of callback /// function. It is encoded packed as 20 bytes + 4 bytes. /// @dev the return of the callback function is not encoded in the parameter, but must be `returns (bytes /// memory)` for compliance with the standard. /// @param initiator The address that called this function /// @param paymentReceiver The address that needs to receive the amount plus fee at the end of the callback /// @param asset The asset to be loaned /// @param amount The amount to loaned /// @param fee The fee to be paid /// @param data The ABI encoded data to be passed to the callback /// @return result ABI encoded result of the callback function(address, address, address, uint256, uint256, bytes memory) external returns (bytes memory) callback ) external returns (bytes memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.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 ERC20 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.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; import {IERC20Permit} from "../extensions/IERC20Permit.sol"; import {Address} from "../../../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 An operation with an ERC20 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 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); 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. */ 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. */ 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 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); if (returndata.length != 0 && !abi.decode(returndata, (bool))) { 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 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(token).code.length > 0; } }
// SPDX-License-Identifier: MIT // Thanks to ultrasecr.eth pragma solidity ^0.8.19; library FunctionCodec { function encodeParams(address contractAddr, bytes4 selector) internal pure returns (bytes24) { return bytes24(bytes20(contractAddr)) | bytes24(selector) >> 160; } function decodeParams(bytes24 encoded) internal pure returns (address contractAddr, bytes4 selector) { contractAddr = address(bytes20(encoded)); selector = bytes4(encoded << 160); } function encodeFunction( function(address, address, address, uint256, uint256, bytes memory) external returns (bytes memory) f ) internal pure returns (bytes24) { return encodeParams(f.address, f.selector); } function decodeFunction( address contractAddr, bytes4 selector ) internal pure returns (function(address, address, address, uint256, uint256, bytes memory) external returns (bytes memory) f) { uint32 s = uint32(selector); // solhint-disable-next-line no-inline-assembly assembly { f.address := contractAddr f.selector := s } } function decodeFunction(bytes24 encoded) internal pure returns (function(address, address, address, uint256, uint256, bytes memory) external returns (bytes memory) f) { (address contractAddr, bytes4 selector) = decodeParams(encoded); return decodeFunction(contractAddr, selector); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @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 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.0.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.20; /** * @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 v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @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.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @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 or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {FailedInnerCall} error. * * 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. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @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`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert AddressInsufficientBalance(address(this)); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an * unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {FailedInnerCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. */ function _revert(bytes memory returndata) 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 FailedInnerCall(); } } }
{ "remappings": [ "@prb/test/=lib/prb-test/src/", "forge-std/=lib/forge-std/src/", "erc7399/=lib/erc7399/src/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc3156/=lib/erc3156/contracts/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "prb-test/=lib/prb-test/src/" ], "optimizer": { "enabled": true, "runs": 10000 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "none", "appendCBOR": false }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"contract Registry","name":"reg","type":"address"},{"internalType":"string","name":"name","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"NotInitiator","type":"error"},{"inputs":[],"name":"NotPool","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"ADDRESSES_PROVIDER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BORROWER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LENDING_POOL","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POOL","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dataProvider","outputs":[{"internalType":"contract IPoolDataProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"fees","type":"uint256[]"},{"internalType":"address","name":"initiator","type":"address"},{"internalType":"bytes","name":"params","type":"bytes"}],"name":"executeOperation","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"loanReceiver","type":"address"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"initiatorData","type":"bytes"},{"internalType":"function (address,address,address,uint256,uint256,bytes) external returns (bytes)","name":"callback","type":"function"}],"name":"flash","outputs":[{"internalType":"bytes","name":"result","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"loanReceiver","type":"address"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"initiatorData","type":"bytes"},{"internalType":"address","name":"callbackTarget","type":"address"},{"internalType":"bytes4","name":"callbackSelector","type":"bytes4"}],"name":"flash","outputs":[{"internalType":"bytes","name":"result","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"flashFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isV2","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"maxFlashLoan","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6101206040523480156200001257600080fd5b50604051620025cf380380620025cf8339810160408190526200003591620002ba565b81816000826001600160a01b031663375eb9ed836040516020016200005b919062000350565b6040516020818303038152906040526040518263ffffffff1660e01b81526004016200008891906200037d565b600060405180830381865afa158015620000a6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620000d09190810190620003b2565b806020019051810190620000e5919062000407565b1515610100526001600160a01b0390811660e0529081166080521660a081905260c052506200011a9150600090508562000152565b50620001477fbf87e2252b7172d9c61058578b6bef80f9573784ab4e27044251da25a76ed28e8462000152565b505050505062000473565b60008281526001602090815260408083206001600160a01b038516845290915281205460ff16620001df5760008381526001602081815260408084206001600160a01b0387168086529252808420805460ff19169093179092559051339286917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a4506001620001e3565b5060005b92915050565b6001600160a01b0381168114620001ff57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620002355781810151838201526020016200021b565b50506000910152565b60006001600160401b03808411156200025b576200025b62000202565b604051601f8501601f19908116603f0116810190828211818310171562000286576200028662000202565b81604052809350858152868686011115620002a057600080fd5b620002b086602083018762000218565b5050509392505050565b60008060008060808587031215620002d157600080fd5b8451620002de81620001e9565b6020860151909450620002f181620001e9565b60408601519093506200030481620001e9565b60608601519092506001600160401b038111156200032157600080fd5b8501601f810187136200033357600080fd5b62000344878251602084016200023e565b91505092959194509250565b600082516200036481846020870162000218565b662bb930b83832b960c91b920191825250600701919050565b60208152600082518060208401526200039e81604085016020870162000218565b601f01601f19169190910160400192915050565b600060208284031215620003c557600080fd5b81516001600160401b03811115620003dc57600080fd5b8201601f81018413620003ee57600080fd5b620003ff848251602084016200023e565b949350505050565b600080600080608085870312156200041e57600080fd5b84516200042b81620001e9565b60208601519094506200043e81620001e9565b60408601519093506200045181620001e9565b606086015190925080151581146200046857600080fd5b939692955090935050565b60805160a05160c05160e051610100516120ed620004e26000396000818161020d0152610c3e01526000818161032a01528181610b0401528181610b820152610ca60152600061035101526000818161028f0152818161058f0152610fe40152600061016801526120ed6000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80637535d246116100b2578063af2511c011610081578063b4dcfc7711610066578063b4dcfc771461034c578063d547741f14610373578063d9d98ce41461038657600080fd5b8063af2511c014610312578063b334ed861461032557600080fd5b80637535d2461461028a57806391d14854146102b1578063920f5c84146102f7578063a217fddf1461030a57600080fd5b80632d94a2d01161010957806336568abe116100ee57806336568abe1461024457806340a08f1014610257578063613255ab1461027757600080fd5b80632d94a2d0146102085780632f2ff15d1461022f57600080fd5b806301ffc9a71461013b5780630542975c14610163578063065d570f146101af578063248a9ca3146101e4575b600080fd5b61014e6101493660046115e6565b610399565b60405190151581526020015b60405180910390f35b61018a7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161015a565b6101d67fbf87e2252b7172d9c61058578b6bef80f9573784ab4e27044251da25a76ed28e81565b60405190815260200161015a565b6101d66101f2366004611601565b6000908152600160208190526040909120015490565b61014e7f000000000000000000000000000000000000000000000000000000000000000081565b61024261023d36600461163c565b610432565b005b61024261025236600461163c565b61045e565b61026a6102653660046116e3565b6104bc565b60405161015a91906117e9565b6101d66102853660046117fc565b61056a565b61018a7f000000000000000000000000000000000000000000000000000000000000000081565b61014e6102bf36600461163c565b600091825260016020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b61014e61030536600461185e565b610575565b6101d6600081565b61026a610320366004611939565b6106e0565b61018a7f000000000000000000000000000000000000000000000000000000000000000081565b61018a7f000000000000000000000000000000000000000000000000000000000000000081565b61024261038136600461163c565b610770565b6101d66103943660046119ce565b610796565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061042c57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6000828152600160208190526040909120015461044e8161084c565b6104588383610859565b50505050565b73ffffffffffffffffffffffffffffffffffffffff811633146104ad576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104b78282610924565b505050565b6060600060405180608001604052808a73ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff168152602001858563ffffffff169060201b1760401b815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050915250905061055d8888836109e3565b9998505050505050505050565b600061042c82610ab8565b60003373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146105e6576040517f6f61f64100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff84163014610635576040517f42b5e35a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106d08a8a600081811061064b5761064b6119fa565b905060200201602081019061066091906117fc565b89896000818110610673576106736119fa565b905060200201358888600081811061068d5761068d6119fa565b9050602002013586868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610dd492505050565b5060019998505050505050505050565b6040805160808101825273ffffffffffffffffffffffffffffffffffffffff891681523360208201526060916000919081018560e086901c63ffffffff169060201b1760401b815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050915250905061055d8888836109e3565b6000828152600160208190526040909120015461078c8161084c565b6104588383610924565b6000806107a284610ab8565b905060008111610813576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e737570706f727465642063757272656e637900000000000000000000000060448201526064015b60405180910390fd5b80831015610822576000610844565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b949350505050565b6108568133610ed4565b50565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff1661091c57600083815260016020818152604080842073ffffffffffffffffffffffffffffffffffffffff8716808652925280842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169093179092559051339286917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a450600161042c565b50600061042c565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff161561091c57600083815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8616808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161042c565b6060610a0f8484846040516020016109fb9190611a29565b604051602081830303815290604052610f60565b60008054610a1c90611a9e565b80601f0160208091040260200160405190810160405280929190818152602001828054610a4890611a9e565b8015610a955780601f10610a6a57610100808354040283529160200191610a95565b820191906000526020600020905b815481529060010190602001808311610a7857829003601f168201915b50505050509050600081511115610ab157610ab1600080611563565b9392505050565b6040517f3e15014100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8281166004830152600091829182917f000000000000000000000000000000000000000000000000000000000000000090911690633e1501419060240161014060405180830381865afa158015610b4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b729190611b01565b99509950505050505050505060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d2493b6c866040518263ffffffff1660e01b8152600401610bf5919073ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b606060405180830381865afa158015610c12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c369190611b98565b5050905060007f0000000000000000000000000000000000000000000000000000000000000000610d16576040517fd7ed3ef400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063d7ed3ef490602401602060405180830381865afa158015610ced573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d119190611be5565b610d19565b60015b905082158015610d265750835b8015610d2f5750805b610d3a576000610dca565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301528716906370a0823190602401602060405180830381865afa158015610da6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dca9190611c00565b9695505050505050565b600081806020019051810190610dea9190611ce4565b9050610dfb85858360000151610f95565b600081604001518060601c9060401c63ffffffff168360200151610e1c3090565b89898988606001516040518763ffffffff1660e01b8152600401610e4596959493929190611da0565b6000604051808303816000875af1158015610e64573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610eaa9190810190611df9565b9050610eb7868686610fb6565b805115610ecc576000610eca8282611e76565b505b505050505050565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610f5c576040517fe2517d3f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024810183905260440161080a565b5050565b7fbf87e2252b7172d9c61058578b6bef80f9573784ab4e27044251da25a76ed28e610f8a8161084c565b610458848484610fe2565b6104b773ffffffffffffffffffffffffffffffffffffffff841682846110a5565b6104b733610fc48385611f90565b73ffffffffffffffffffffffffffffffffffffffff86169190611126565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663ab9c4b5d3061103e8673ffffffffffffffffffffffffffffffffffffffff166111fe565b61104786611273565b6110516000611273565b308760006040518863ffffffff1660e01b81526004016110779796959493929190612006565b600060405180830381600087803b15801561109157600080fd5b505af1158015610eca573d6000803e3d6000fd5b60405173ffffffffffffffffffffffffffffffffffffffff8381166024830152604482018390526104b791859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506112ba565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790526111b28482611350565b6104585760405173ffffffffffffffffffffffffffffffffffffffff8481166024830152600060448301526111f491869182169063095ea7b3906064016110df565b61045884826112ba565b604080516001808252818301909252606091602080830190803683370190505090508181600081518110611234576112346119fa565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050919050565b6040805160018082528183019092526060916020808301908036833701905050905081816000815181106112a9576112a96119fa565b602002602001018181525050919050565b60006112dc73ffffffffffffffffffffffffffffffffffffffff841683611412565b905080516000141580156113015750808060200190518101906112ff9190611be5565b155b156104b7576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260240161080a565b60008060008473ffffffffffffffffffffffffffffffffffffffff168460405161137a91906120d1565b6000604051808303816000865af19150503d80600081146113b7576040519150601f19603f3d011682016040523d82523d6000602084013e6113bc565b606091505b50915091508180156113e65750805115806113e65750808060200190518101906113e69190611be5565b8015611409575060008573ffffffffffffffffffffffffffffffffffffffff163b115b95945050505050565b6060610ab183836000846000808573ffffffffffffffffffffffffffffffffffffffff16848660405161144591906120d1565b60006040518083038185875af1925050503d8060008114611482576040519150601f19603f3d011682016040523d82523d6000602084013e611487565b606091505b5091509150610dca8683836060826114a7576114a282611521565b610ab1565b81511580156114cb575073ffffffffffffffffffffffffffffffffffffffff84163b155b1561151a576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240161080a565b5080610ab1565b8051156115315780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50805461156f90611a9e565b6000825580601f1061157f575050565b601f01602090049060005260206000209081019061085691905b808211156115ad5760008155600101611599565b5090565b80357fffffffff00000000000000000000000000000000000000000000000000000000811681146115e157600080fd5b919050565b6000602082840312156115f857600080fd5b610ab1826115b1565b60006020828403121561161357600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461085657600080fd5b6000806040838503121561164f57600080fd5b8235915060208301356116618161161a565b809150509250929050565b60008083601f84011261167e57600080fd5b50813567ffffffffffffffff81111561169657600080fd5b6020830191508360208285010111156116ae57600080fd5b9250929050565b7fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008116811461085657600080fd5b600080600080600080600060a0888a0312156116fe57600080fd5b87356117098161161a565b965060208801356117198161161a565b955060408801359450606088013567ffffffffffffffff81111561173c57600080fd5b6117488a828b0161166c565b909550935050608088013561175c816116b5565b8060601c925063ffffffff8160401c1691505092959891949750929550565b60005b8381101561179657818101518382015260200161177e565b50506000910152565b600081518084526117b781602086016020860161177b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610ab1602083018461179f565b60006020828403121561180e57600080fd5b8135610ab18161161a565b60008083601f84011261182b57600080fd5b50813567ffffffffffffffff81111561184357600080fd5b6020830191508360208260051b85010111156116ae57600080fd5b600080600080600080600080600060a08a8c03121561187c57600080fd5b893567ffffffffffffffff8082111561189457600080fd5b6118a08d838e01611819565b909b50995060208c01359150808211156118b957600080fd5b6118c58d838e01611819565b909950975060408c01359150808211156118de57600080fd5b6118ea8d838e01611819565b909750955060608c013591506118ff8261161a565b90935060808b0135908082111561191557600080fd5b506119228c828d0161166c565b915080935050809150509295985092959850929598565b600080600080600080600060c0888a03121561195457600080fd5b873561195f8161161a565b9650602088013561196f8161161a565b955060408801359450606088013567ffffffffffffffff81111561199257600080fd5b61199e8a828b0161166c565b90955093505060808801356119b28161161a565b91506119c060a089016115b1565b905092959891949750929550565b600080604083850312156119e157600080fd5b82356119ec8161161a565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60208152600073ffffffffffffffffffffffffffffffffffffffff808451166020840152806020850151166040840152507fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000006040840151166060830152606083015160808084015261084460a084018261179f565b600181811c90821680611ab257607f821691505b602082108103611aeb577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b805180151581146115e157600080fd5b6000806000806000806000806000806101408b8d031215611b2157600080fd5b8a51995060208b0151985060408b0151975060608b0151965060808b01519550611b4d60a08c01611af1565b9450611b5b60c08c01611af1565b9350611b6960e08c01611af1565b9250611b786101008c01611af1565b9150611b876101208c01611af1565b90509295989b9194979a5092959850565b600080600060608486031215611bad57600080fd5b8351611bb88161161a565b6020850151909350611bc98161161a565b6040850151909250611bda8161161a565b809150509250925092565b600060208284031215611bf757600080fd5b610ab182611af1565b600060208284031215611c1257600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112611c5957600080fd5b815167ffffffffffffffff80821115611c7457611c74611c19565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715611cba57611cba611c19565b81604052838152866020858801011115611cd357600080fd5b610dca84602083016020890161177b565b600060208284031215611cf657600080fd5b815167ffffffffffffffff80821115611d0e57600080fd5b9083019060808286031215611d2257600080fd5b604051608081018181108382111715611d3d57611d3d611c19565b6040528251611d4b8161161a565b81526020830151611d5b8161161a565b60208201526040830151611d6e816116b5565b6040820152606083015182811115611d8557600080fd5b611d9187828601611c48565b60608301525095945050505050565b600073ffffffffffffffffffffffffffffffffffffffff8089168352808816602084015280871660408401525084606083015283608083015260c060a0830152611ded60c083018461179f565b98975050505050505050565b600060208284031215611e0b57600080fd5b815167ffffffffffffffff811115611e2257600080fd5b61084484828501611c48565b601f8211156104b7576000816000526020600020601f850160051c81016020861015611e575750805b601f850160051c820191505b81811015610ecc57828155600101611e63565b815167ffffffffffffffff811115611e9057611e90611c19565b611ea481611e9e8454611a9e565b84611e2e565b602080601f831160018114611ef75760008415611ec15750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610ecc565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015611f4457888601518255948401946001909101908401611f25565b5085821015611f8057878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b8082018082111561042c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008151808452602080850194506020840160005b83811015611ffb57815187529582019590820190600101611fdf565b509495945050505050565b600060e0820173ffffffffffffffffffffffffffffffffffffffff808b168452602060e06020860152828b518085526101008701915060208d01945060005b81811015612063578551851683529483019491830191600101612045565b50508581036040870152612077818c611fca565b9350505050828103606084015261208e8188611fca565b73ffffffffffffffffffffffffffffffffffffffff87166080850152905082810360a08401526120be818661179f565b915050611ded60c083018461ffff169052565b600082516120e381846020870161177b565b919091019291505056000000000000000000000000c0939a4ed0129bc5162f6f693935b3f72a46a90d0000000000000000000000006cae28b3d09d8f8fc74ccd496ac986fc84c0c24e000000000000000000000000a348320114210b8f4eaf1b0795aa8f70803a93ea000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000064161766556330000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101365760003560e01c80637535d246116100b2578063af2511c011610081578063b4dcfc7711610066578063b4dcfc771461034c578063d547741f14610373578063d9d98ce41461038657600080fd5b8063af2511c014610312578063b334ed861461032557600080fd5b80637535d2461461028a57806391d14854146102b1578063920f5c84146102f7578063a217fddf1461030a57600080fd5b80632d94a2d01161010957806336568abe116100ee57806336568abe1461024457806340a08f1014610257578063613255ab1461027757600080fd5b80632d94a2d0146102085780632f2ff15d1461022f57600080fd5b806301ffc9a71461013b5780630542975c14610163578063065d570f146101af578063248a9ca3146101e4575b600080fd5b61014e6101493660046115e6565b610399565b60405190151581526020015b60405180910390f35b61018a7f0000000000000000000000002f39d218133afab8f2b819b1066c7e434ad94e9e81565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161015a565b6101d67fbf87e2252b7172d9c61058578b6bef80f9573784ab4e27044251da25a76ed28e81565b60405190815260200161015a565b6101d66101f2366004611601565b6000908152600160208190526040909120015490565b61014e7f000000000000000000000000000000000000000000000000000000000000000081565b61024261023d36600461163c565b610432565b005b61024261025236600461163c565b61045e565b61026a6102653660046116e3565b6104bc565b60405161015a91906117e9565b6101d66102853660046117fc565b61056a565b61018a7f00000000000000000000000087870bca3f3fd6335c3f4ce8392d69350b4fa4e281565b61014e6102bf36600461163c565b600091825260016020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b61014e61030536600461185e565b610575565b6101d6600081565b61026a610320366004611939565b6106e0565b61018a7f0000000000000000000000007b4eb56e7cd4b454ba8ff71e4518426369a138a381565b61018a7f00000000000000000000000087870bca3f3fd6335c3f4ce8392d69350b4fa4e281565b61024261038136600461163c565b610770565b6101d66103943660046119ce565b610796565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061042c57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6000828152600160208190526040909120015461044e8161084c565b6104588383610859565b50505050565b73ffffffffffffffffffffffffffffffffffffffff811633146104ad576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104b78282610924565b505050565b6060600060405180608001604052808a73ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff168152602001858563ffffffff169060201b1760401b815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050915250905061055d8888836109e3565b9998505050505050505050565b600061042c82610ab8565b60003373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000087870bca3f3fd6335c3f4ce8392d69350b4fa4e216146105e6576040517f6f61f64100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff84163014610635576040517f42b5e35a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106d08a8a600081811061064b5761064b6119fa565b905060200201602081019061066091906117fc565b89896000818110610673576106736119fa565b905060200201358888600081811061068d5761068d6119fa565b9050602002013586868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610dd492505050565b5060019998505050505050505050565b6040805160808101825273ffffffffffffffffffffffffffffffffffffffff891681523360208201526060916000919081018560e086901c63ffffffff169060201b1760401b815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050915250905061055d8888836109e3565b6000828152600160208190526040909120015461078c8161084c565b6104588383610924565b6000806107a284610ab8565b905060008111610813576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e737570706f727465642063757272656e637900000000000000000000000060448201526064015b60405180910390fd5b80831015610822576000610844565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b949350505050565b6108568133610ed4565b50565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff1661091c57600083815260016020818152604080842073ffffffffffffffffffffffffffffffffffffffff8716808652925280842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169093179092559051339286917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a450600161042c565b50600061042c565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff161561091c57600083815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8616808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161042c565b6060610a0f8484846040516020016109fb9190611a29565b604051602081830303815290604052610f60565b60008054610a1c90611a9e565b80601f0160208091040260200160405190810160405280929190818152602001828054610a4890611a9e565b8015610a955780601f10610a6a57610100808354040283529160200191610a95565b820191906000526020600020905b815481529060010190602001808311610a7857829003601f168201915b50505050509050600081511115610ab157610ab1600080611563565b9392505050565b6040517f3e15014100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8281166004830152600091829182917f0000000000000000000000007b4eb56e7cd4b454ba8ff71e4518426369a138a390911690633e1501419060240161014060405180830381865afa158015610b4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b729190611b01565b99509950505050505050505060007f0000000000000000000000007b4eb56e7cd4b454ba8ff71e4518426369a138a373ffffffffffffffffffffffffffffffffffffffff1663d2493b6c866040518263ffffffff1660e01b8152600401610bf5919073ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b606060405180830381865afa158015610c12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c369190611b98565b5050905060007f0000000000000000000000000000000000000000000000000000000000000000610d16576040517fd7ed3ef400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811660048301527f0000000000000000000000007b4eb56e7cd4b454ba8ff71e4518426369a138a3169063d7ed3ef490602401602060405180830381865afa158015610ced573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d119190611be5565b610d19565b60015b905082158015610d265750835b8015610d2f5750805b610d3a576000610dca565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301528716906370a0823190602401602060405180830381865afa158015610da6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dca9190611c00565b9695505050505050565b600081806020019051810190610dea9190611ce4565b9050610dfb85858360000151610f95565b600081604001518060601c9060401c63ffffffff168360200151610e1c3090565b89898988606001516040518763ffffffff1660e01b8152600401610e4596959493929190611da0565b6000604051808303816000875af1158015610e64573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610eaa9190810190611df9565b9050610eb7868686610fb6565b805115610ecc576000610eca8282611e76565b505b505050505050565b600082815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610f5c576040517fe2517d3f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024810183905260440161080a565b5050565b7fbf87e2252b7172d9c61058578b6bef80f9573784ab4e27044251da25a76ed28e610f8a8161084c565b610458848484610fe2565b6104b773ffffffffffffffffffffffffffffffffffffffff841682846110a5565b6104b733610fc48385611f90565b73ffffffffffffffffffffffffffffffffffffffff86169190611126565b7f00000000000000000000000087870bca3f3fd6335c3f4ce8392d69350b4fa4e273ffffffffffffffffffffffffffffffffffffffff1663ab9c4b5d3061103e8673ffffffffffffffffffffffffffffffffffffffff166111fe565b61104786611273565b6110516000611273565b308760006040518863ffffffff1660e01b81526004016110779796959493929190612006565b600060405180830381600087803b15801561109157600080fd5b505af1158015610eca573d6000803e3d6000fd5b60405173ffffffffffffffffffffffffffffffffffffffff8381166024830152604482018390526104b791859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506112ba565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790526111b28482611350565b6104585760405173ffffffffffffffffffffffffffffffffffffffff8481166024830152600060448301526111f491869182169063095ea7b3906064016110df565b61045884826112ba565b604080516001808252818301909252606091602080830190803683370190505090508181600081518110611234576112346119fa565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050919050565b6040805160018082528183019092526060916020808301908036833701905050905081816000815181106112a9576112a96119fa565b602002602001018181525050919050565b60006112dc73ffffffffffffffffffffffffffffffffffffffff841683611412565b905080516000141580156113015750808060200190518101906112ff9190611be5565b155b156104b7576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260240161080a565b60008060008473ffffffffffffffffffffffffffffffffffffffff168460405161137a91906120d1565b6000604051808303816000865af19150503d80600081146113b7576040519150601f19603f3d011682016040523d82523d6000602084013e6113bc565b606091505b50915091508180156113e65750805115806113e65750808060200190518101906113e69190611be5565b8015611409575060008573ffffffffffffffffffffffffffffffffffffffff163b115b95945050505050565b6060610ab183836000846000808573ffffffffffffffffffffffffffffffffffffffff16848660405161144591906120d1565b60006040518083038185875af1925050503d8060008114611482576040519150601f19603f3d011682016040523d82523d6000602084013e611487565b606091505b5091509150610dca8683836060826114a7576114a282611521565b610ab1565b81511580156114cb575073ffffffffffffffffffffffffffffffffffffffff84163b155b1561151a576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240161080a565b5080610ab1565b8051156115315780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50805461156f90611a9e565b6000825580601f1061157f575050565b601f01602090049060005260206000209081019061085691905b808211156115ad5760008155600101611599565b5090565b80357fffffffff00000000000000000000000000000000000000000000000000000000811681146115e157600080fd5b919050565b6000602082840312156115f857600080fd5b610ab1826115b1565b60006020828403121561161357600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff8116811461085657600080fd5b6000806040838503121561164f57600080fd5b8235915060208301356116618161161a565b809150509250929050565b60008083601f84011261167e57600080fd5b50813567ffffffffffffffff81111561169657600080fd5b6020830191508360208285010111156116ae57600080fd5b9250929050565b7fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008116811461085657600080fd5b600080600080600080600060a0888a0312156116fe57600080fd5b87356117098161161a565b965060208801356117198161161a565b955060408801359450606088013567ffffffffffffffff81111561173c57600080fd5b6117488a828b0161166c565b909550935050608088013561175c816116b5565b8060601c925063ffffffff8160401c1691505092959891949750929550565b60005b8381101561179657818101518382015260200161177e565b50506000910152565b600081518084526117b781602086016020860161177b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610ab1602083018461179f565b60006020828403121561180e57600080fd5b8135610ab18161161a565b60008083601f84011261182b57600080fd5b50813567ffffffffffffffff81111561184357600080fd5b6020830191508360208260051b85010111156116ae57600080fd5b600080600080600080600080600060a08a8c03121561187c57600080fd5b893567ffffffffffffffff8082111561189457600080fd5b6118a08d838e01611819565b909b50995060208c01359150808211156118b957600080fd5b6118c58d838e01611819565b909950975060408c01359150808211156118de57600080fd5b6118ea8d838e01611819565b909750955060608c013591506118ff8261161a565b90935060808b0135908082111561191557600080fd5b506119228c828d0161166c565b915080935050809150509295985092959850929598565b600080600080600080600060c0888a03121561195457600080fd5b873561195f8161161a565b9650602088013561196f8161161a565b955060408801359450606088013567ffffffffffffffff81111561199257600080fd5b61199e8a828b0161166c565b90955093505060808801356119b28161161a565b91506119c060a089016115b1565b905092959891949750929550565b600080604083850312156119e157600080fd5b82356119ec8161161a565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60208152600073ffffffffffffffffffffffffffffffffffffffff808451166020840152806020850151166040840152507fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000006040840151166060830152606083015160808084015261084460a084018261179f565b600181811c90821680611ab257607f821691505b602082108103611aeb577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b805180151581146115e157600080fd5b6000806000806000806000806000806101408b8d031215611b2157600080fd5b8a51995060208b0151985060408b0151975060608b0151965060808b01519550611b4d60a08c01611af1565b9450611b5b60c08c01611af1565b9350611b6960e08c01611af1565b9250611b786101008c01611af1565b9150611b876101208c01611af1565b90509295989b9194979a5092959850565b600080600060608486031215611bad57600080fd5b8351611bb88161161a565b6020850151909350611bc98161161a565b6040850151909250611bda8161161a565b809150509250925092565b600060208284031215611bf757600080fd5b610ab182611af1565b600060208284031215611c1257600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112611c5957600080fd5b815167ffffffffffffffff80821115611c7457611c74611c19565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715611cba57611cba611c19565b81604052838152866020858801011115611cd357600080fd5b610dca84602083016020890161177b565b600060208284031215611cf657600080fd5b815167ffffffffffffffff80821115611d0e57600080fd5b9083019060808286031215611d2257600080fd5b604051608081018181108382111715611d3d57611d3d611c19565b6040528251611d4b8161161a565b81526020830151611d5b8161161a565b60208201526040830151611d6e816116b5565b6040820152606083015182811115611d8557600080fd5b611d9187828601611c48565b60608301525095945050505050565b600073ffffffffffffffffffffffffffffffffffffffff8089168352808816602084015280871660408401525084606083015283608083015260c060a0830152611ded60c083018461179f565b98975050505050505050565b600060208284031215611e0b57600080fd5b815167ffffffffffffffff811115611e2257600080fd5b61084484828501611c48565b601f8211156104b7576000816000526020600020601f850160051c81016020861015611e575750805b601f850160051c820191505b81811015610ecc57828155600101611e63565b815167ffffffffffffffff811115611e9057611e90611c19565b611ea481611e9e8454611a9e565b84611e2e565b602080601f831160018114611ef75760008415611ec15750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610ecc565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015611f4457888601518255948401946001909101908401611f25565b5085821015611f8057878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b8082018082111561042c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008151808452602080850194506020840160005b83811015611ffb57815187529582019590820190600101611fdf565b509495945050505050565b600060e0820173ffffffffffffffffffffffffffffffffffffffff808b168452602060e06020860152828b518085526101008701915060208d01945060005b81811015612063578551851683529483019491830191600101612045565b50508581036040870152612077818c611fca565b9350505050828103606084015261208e8188611fca565b73ffffffffffffffffffffffffffffffffffffffff87166080850152905082810360a08401526120be818661179f565b915050611ded60c083018461ffff169052565b600082516120e381846020870161177b565b919091019291505056
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c0939a4ed0129bc5162f6f693935b3f72a46a90d0000000000000000000000006cae28b3d09d8f8fc74ccd496ac986fc84c0c24e000000000000000000000000a348320114210b8f4eaf1b0795aa8f70803a93ea000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000064161766556330000000000000000000000000000000000000000000000000000
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000c0939a4ed0129bc5162f6f693935b3f72a46a90d
Arg [1] : 0000000000000000000000006cae28b3d09d8f8fc74ccd496ac986fc84c0c24e
Arg [2] : 000000000000000000000000a348320114210b8f4eaf1b0795aa8f70803a93ea
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [5] : 4161766556330000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading

Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
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.