More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 1,812 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw | 21429395 | 9 days ago | IN | 0 ETH | 0.00051749 | ||||
Migrate | 12698751 | 1282 days ago | IN | 0 ETH | 0.014499 | ||||
Pause | 12698724 | 1282 days ago | IN | 0 ETH | 0.0007551 | ||||
Withdraw | 12698534 | 1282 days ago | IN | 0 ETH | 0.00184436 | ||||
Withdraw | 12698055 | 1282 days ago | IN | 0 ETH | 0.00128965 | ||||
Deposit | 12697552 | 1282 days ago | IN | 0 ETH | 0.00104932 | ||||
Withdraw | 12696993 | 1282 days ago | IN | 0 ETH | 0.00180965 | ||||
Deposit | 12695226 | 1282 days ago | IN | 0 ETH | 0.00078502 | ||||
Deposit | 12694900 | 1283 days ago | IN | 0.5 ETH | 0.00077081 | ||||
Deposit | 12694895 | 1283 days ago | IN | 0 ETH | 0.00127276 | ||||
Deposit | 12694838 | 1283 days ago | IN | 0.001 ETH | 0.00084789 | ||||
Deposit | 12694796 | 1283 days ago | IN | 0 ETH | 0.00111553 | ||||
Deposit | 12694456 | 1283 days ago | IN | 0 ETH | 0.00157916 | ||||
Deposit | 12694453 | 1283 days ago | IN | 0 ETH | 0.00108567 | ||||
Withdraw | 12694384 | 1283 days ago | IN | 0 ETH | 0.0005606 | ||||
Withdraw | 12694231 | 1283 days ago | IN | 0 ETH | 0.00094159 | ||||
Withdraw | 12694231 | 1283 days ago | IN | 0 ETH | 0.00114437 | ||||
Deposit | 12692931 | 1283 days ago | IN | 0 ETH | 0.00115692 | ||||
Withdraw | 12692854 | 1283 days ago | IN | 0 ETH | 0.00197658 | ||||
Deposit | 12692544 | 1283 days ago | IN | 0 ETH | 0.00138177 | ||||
Deposit | 12692531 | 1283 days ago | IN | 0 ETH | 0.00138177 | ||||
Withdraw | 12691791 | 1283 days ago | IN | 0 ETH | 0.00067286 | ||||
Withdraw | 12691516 | 1283 days ago | IN | 0 ETH | 0.00151821 | ||||
Withdraw | 12691328 | 1283 days ago | IN | 0 ETH | 0.00143386 | ||||
Withdraw | 12691060 | 1283 days ago | IN | 0 ETH | 0.00298071 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
12698751 | 1282 days ago | 25,212.02494051 ETH | ||||
12698055 | 1282 days ago | 1,000.13667735 ETH | ||||
12698041 | 1282 days ago | 1 wei | ||||
12698041 | 1282 days ago | 21.296 ETH | ||||
12698041 | 1282 days ago | 21.296 ETH | ||||
12697781 | 1282 days ago | 1 wei | ||||
12697781 | 1282 days ago | 23.4256 ETH | ||||
12697781 | 1282 days ago | 23.4256 ETH | ||||
12696631 | 1282 days ago | 1 wei | ||||
12696631 | 1282 days ago | 16 ETH | ||||
12696631 | 1282 days ago | 16 ETH | ||||
12696609 | 1282 days ago | 1 wei | ||||
12696609 | 1282 days ago | 32 ETH | ||||
12696609 | 1282 days ago | 32 ETH | ||||
12695415 | 1282 days ago | 1 wei | ||||
12695415 | 1282 days ago | 128 ETH | ||||
12695415 | 1282 days ago | 128 ETH | ||||
12695411 | 1282 days ago | 1 wei | ||||
12695411 | 1282 days ago | 512 ETH | ||||
12695411 | 1282 days ago | 512 ETH | ||||
12694384 | 1283 days ago | 0.50006827 ETH | ||||
12693690 | 1283 days ago | 1 wei | ||||
12693690 | 1283 days ago | 256 ETH | ||||
12693690 | 1283 days ago | 256 ETH | ||||
12691791 | 1283 days ago | 22.00300421 ETH |
Loading...
Loading
Contract Name:
JITU
Compiler Version
v0.7.4+commit.3f05b770
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.7.4; import "keeperdao/contracts/LiquidityPool.sol"; interface Wallet { function preempt(address _liquidator, address _repayToken, uint _repayAmount, address _cTokenCollateral) external; function underwrite(address _token, uint256 _amount) external; function reclaim() external; function checkBufferValue(address _token, uint256 _amount) external; } /// @dev this contract extends KeeperDAO's LiquidityPool contract, and users would be able /// to deposit supported tokens to this contract. /// @dev this contract allows whitelisted keepers to add buffer to compound positions that /// are slightly above water, so that in the case they go underwater the keepers can /// preempt a liquidation. /// @dev the behaviour of the whitelisted keepers is controlled by the token economics of /// KeeperDAO. contract JITU is LiquidityPoolV3 { using SafeMath for uint256; using SafeERC20 for ERC20; struct BufferProvided { address token; uint256 amount; } mapping (address=>BufferProvided[]) buffer; mapping (address=>bool) isWhitelistedKeeper; mapping (address=>bool) isWhitelistedUnderwriter; event KeeperWhitelisted(address indexed _keeper); event KeeperBlacklisted(address indexed _keeper); event UnderwriterWhitelisted(address indexed _underwriter); event UnderwriterBlacklisted(address indexed _underwriter); event Underwritten(address indexed _wallet, address indexed _underwriter, address indexed _token, uint256 _amount); event Reclaimed(address indexed _wallet, address indexed _underwriter); event Preempted(address indexed _wallet, address indexed _keeper, address _repayToken, uint256 _repayAmount, address _collateralToken); modifier onlyWhitelistedKeeper() { require(isWhitelistedKeeper[msg.sender], "JITU: caller is not a whitelisted keeper"); _; } modifier onlyWhitelistedUnderwriter() { require(isWhitelistedUnderwriter[msg.sender], "JITU: caller is not a whitelisted underwriter"); _; } /// @notice whitelist the given keeper, add to the keeper /// whitelist. /// @param _keeper the address of the keeper function whitelistKeeper(address _keeper) external onlyOperator { isWhitelistedKeeper[_keeper] = true; emit KeeperWhitelisted(_keeper); } /// @notice blacklist the given keeper, remove from the keeper /// whitelist. /// @param _keeper the address of the keeper function blacklistKeeper(address _keeper) external onlyOperator { isWhitelistedKeeper[_keeper] = false; emit KeeperBlacklisted(_keeper); } /// @notice whitelist the given underwriter, add to the underwriter /// whitelist. /// @param _underwriter the address of the underwriter function whitelistUnderwriter(address _underwriter) external onlyOperator { isWhitelistedUnderwriter[_underwriter] = true; emit UnderwriterWhitelisted(_underwriter); } /// @notice blacklist the given underwriter, remove from the underwriter /// whitelist. /// @param _underwriter the address of the underwriter function blacklistUnderwriter(address _underwriter) external onlyOperator { isWhitelistedUnderwriter[_underwriter] = false; emit UnderwriterBlacklisted(_underwriter); } /// @notice underwrite the given wallet, with the given amount of /// compound tokens /// /// @param _wallet the address of the compound wallet /// @param _token the address of the ERC20 token /// @param _amount the amount of ERC20 tokens function underwrite(address _wallet, address _token, uint256 _amount) external onlyWhitelistedUnderwriter nonReentrant whenNotPaused { // This function reverts if the buffer being provided exceeds // the max buffer value (which is 25% of the total compound // position). Wallet(_wallet).checkBufferValue(_token, _amount); ERC20(_token).safeIncreaseAllowance(_wallet, _amount); Wallet(_wallet).underwrite(_token, _amount); loanedAmount[_token] = loanedAmount[_token].add(_amount); buffer[_wallet].push(BufferProvided(_token, _amount)); emit Underwritten(_wallet, msg.sender, _token, _amount); } /// @notice reclaim the given amount of compound tokens /// from the given wallet /// /// @param _wallet the address of the compound wallet function reclaim(address _wallet) external onlyWhitelistedUnderwriter nonReentrant whenNotPaused { Wallet(_wallet).reclaim(); BufferProvided[] memory buffers = buffer[_wallet]; delete(buffer[_wallet]); for (uint i = 0; i < buffers.length; i++) { BufferProvided memory bufferProvided = buffers[i]; loanedAmount[bufferProvided.token] = loanedAmount[bufferProvided.token].sub(bufferProvided.amount); } emit Reclaimed(_wallet, msg.sender); } /// @notice preempt a liquidation that does a liquidation /// without considering the buffer provided by JITU /// /// @param _wallet the address of the compound wallet /// @param _repayToken the address of the token that needs to be repaid /// @param _repayAmount the amount of the token that needs to be repaid /// @param _cTokenCollateral the compound token that the user would /// receive for repaying the loan function preempt(Wallet _wallet, address _repayToken, uint _repayAmount, address _cTokenCollateral) external onlyWhitelistedKeeper nonReentrant whenNotPaused { _wallet.preempt(msg.sender, _repayToken, _repayAmount, _cTokenCollateral); emit Preempted(address(_wallet), msg.sender, _repayToken, _repayAmount, _cTokenCollateral); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/EnumerableSet.sol"; import "../utils/Address.sol"; import "../utils/Context.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * 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: * * ``` * 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}: * * ``` * 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. */ abstract contract AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @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. * * _Available since v3.1._ */ 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 {_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) public view returns (bool) { return _roles[role].members.contains(account); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view returns (uint256) { return _roles[role].members.length(); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view returns (address) { return _roles[role].members.at(index); } /** * @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 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. */ function grantRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant"); _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. */ function revokeRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); _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 granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, _roles[role].adminRole, adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (_roles[role].members.add(account)) { emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (_roles[role].members.remove(account)) { emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // 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. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { 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. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity >=0.4.24 <0.8.0; import "../utils/Address.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /// @dev Returns true if and only if the function is running in the constructor function _isConstructor() private view returns (bool) { return !Address.isContract(address(this)); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../../utils/Context.sol"; import "./IERC20.sol"; import "../../math/SafeMath.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) public { _name = name_; _symbol = symbol_; _decimals = 18; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal virtual { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @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); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./IERC20.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // 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 // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @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 GSN 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 payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor () internal { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor () internal { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT pragma solidity >= 0.4.22 <0.9.0; library console { address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); function _sendLogPayload(bytes memory payload) private view { uint256 payloadLength = payload.length; address consoleAddress = CONSOLE_ADDRESS; assembly { let payloadStart := add(payload, 32) let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0) } } function log() internal view { _sendLogPayload(abi.encodeWithSignature("log()")); } function logInt(int p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(int)", p0)); } function logUint(uint p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); } function logString(string memory p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); } function logBool(bool p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); } function logAddress(address p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); } function logBytes(bytes memory p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes)", p0)); } function logBytes1(bytes1 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0)); } function logBytes2(bytes2 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0)); } function logBytes3(bytes3 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0)); } function logBytes4(bytes4 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0)); } function logBytes5(bytes5 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0)); } function logBytes6(bytes6 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0)); } function logBytes7(bytes7 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0)); } function logBytes8(bytes8 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0)); } function logBytes9(bytes9 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0)); } function logBytes10(bytes10 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0)); } function logBytes11(bytes11 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0)); } function logBytes12(bytes12 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0)); } function logBytes13(bytes13 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0)); } function logBytes14(bytes14 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0)); } function logBytes15(bytes15 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0)); } function logBytes16(bytes16 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0)); } function logBytes17(bytes17 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0)); } function logBytes18(bytes18 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0)); } function logBytes19(bytes19 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0)); } function logBytes20(bytes20 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0)); } function logBytes21(bytes21 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0)); } function logBytes22(bytes22 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0)); } function logBytes23(bytes23 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0)); } function logBytes24(bytes24 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0)); } function logBytes25(bytes25 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0)); } function logBytes26(bytes26 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0)); } function logBytes27(bytes27 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0)); } function logBytes28(bytes28 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0)); } function logBytes29(bytes29 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0)); } function logBytes30(bytes30 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0)); } function logBytes31(bytes31 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0)); } function logBytes32(bytes32 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0)); } function log(uint p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); } function log(string memory p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); } function log(bool p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); } function log(address p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); } function log(uint p0, uint p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint)", p0, p1)); } function log(uint p0, string memory p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string)", p0, p1)); } function log(uint p0, bool p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool)", p0, p1)); } function log(uint p0, address p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address)", p0, p1)); } function log(string memory p0, uint p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint)", p0, p1)); } function log(string memory p0, string memory p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1)); } function log(string memory p0, bool p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1)); } function log(string memory p0, address p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1)); } function log(bool p0, uint p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint)", p0, p1)); } function log(bool p0, string memory p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1)); } function log(bool p0, bool p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1)); } function log(bool p0, address p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1)); } function log(address p0, uint p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint)", p0, p1)); } function log(address p0, string memory p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1)); } function log(address p0, bool p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1)); } function log(address p0, address p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1)); } function log(uint p0, uint p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint)", p0, p1, p2)); } function log(uint p0, uint p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string)", p0, p1, p2)); } function log(uint p0, uint p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool)", p0, p1, p2)); } function log(uint p0, uint p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address)", p0, p1, p2)); } function log(uint p0, string memory p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint)", p0, p1, p2)); } function log(uint p0, string memory p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string)", p0, p1, p2)); } function log(uint p0, string memory p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool)", p0, p1, p2)); } function log(uint p0, string memory p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address)", p0, p1, p2)); } function log(uint p0, bool p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint)", p0, p1, p2)); } function log(uint p0, bool p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string)", p0, p1, p2)); } function log(uint p0, bool p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool)", p0, p1, p2)); } function log(uint p0, bool p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address)", p0, p1, p2)); } function log(uint p0, address p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint)", p0, p1, p2)); } function log(uint p0, address p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string)", p0, p1, p2)); } function log(uint p0, address p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool)", p0, p1, p2)); } function log(uint p0, address p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address)", p0, p1, p2)); } function log(string memory p0, uint p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint)", p0, p1, p2)); } function log(string memory p0, uint p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string)", p0, p1, p2)); } function log(string memory p0, uint p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool)", p0, p1, p2)); } function log(string memory p0, uint p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address)", p0, p1, p2)); } function log(string memory p0, string memory p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint)", p0, p1, p2)); } function log(string memory p0, string memory p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2)); } function log(string memory p0, string memory p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2)); } function log(string memory p0, string memory p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2)); } function log(string memory p0, bool p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint)", p0, p1, p2)); } function log(string memory p0, bool p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2)); } function log(string memory p0, bool p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2)); } function log(string memory p0, bool p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2)); } function log(string memory p0, address p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint)", p0, p1, p2)); } function log(string memory p0, address p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2)); } function log(string memory p0, address p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2)); } function log(string memory p0, address p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2)); } function log(bool p0, uint p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint)", p0, p1, p2)); } function log(bool p0, uint p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string)", p0, p1, p2)); } function log(bool p0, uint p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool)", p0, p1, p2)); } function log(bool p0, uint p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address)", p0, p1, p2)); } function log(bool p0, string memory p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint)", p0, p1, p2)); } function log(bool p0, string memory p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2)); } function log(bool p0, string memory p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2)); } function log(bool p0, string memory p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2)); } function log(bool p0, bool p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint)", p0, p1, p2)); } function log(bool p0, bool p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2)); } function log(bool p0, bool p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2)); } function log(bool p0, bool p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2)); } function log(bool p0, address p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint)", p0, p1, p2)); } function log(bool p0, address p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2)); } function log(bool p0, address p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2)); } function log(bool p0, address p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2)); } function log(address p0, uint p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint)", p0, p1, p2)); } function log(address p0, uint p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string)", p0, p1, p2)); } function log(address p0, uint p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool)", p0, p1, p2)); } function log(address p0, uint p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address)", p0, p1, p2)); } function log(address p0, string memory p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint)", p0, p1, p2)); } function log(address p0, string memory p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2)); } function log(address p0, string memory p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2)); } function log(address p0, string memory p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2)); } function log(address p0, bool p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint)", p0, p1, p2)); } function log(address p0, bool p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2)); } function log(address p0, bool p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2)); } function log(address p0, bool p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2)); } function log(address p0, address p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint)", p0, p1, p2)); } function log(address p0, address p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2)); } function log(address p0, address p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2)); } function log(address p0, address p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2)); } function log(uint p0, uint p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,uint)", p0, p1, p2, p3)); } function log(uint p0, uint p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,string)", p0, p1, p2, p3)); } function log(uint p0, uint p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,bool)", p0, p1, p2, p3)); } function log(uint p0, uint p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,address)", p0, p1, p2, p3)); } function log(uint p0, uint p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,uint)", p0, p1, p2, p3)); } function log(uint p0, uint p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,string)", p0, p1, p2, p3)); } function log(uint p0, uint p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,bool)", p0, p1, p2, p3)); } function log(uint p0, uint p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,address)", p0, p1, p2, p3)); } function log(uint p0, uint p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,uint)", p0, p1, p2, p3)); } function log(uint p0, uint p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,string)", p0, p1, p2, p3)); } function log(uint p0, uint p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,bool)", p0, p1, p2, p3)); } function log(uint p0, uint p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,address)", p0, p1, p2, p3)); } function log(uint p0, uint p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,uint)", p0, p1, p2, p3)); } function log(uint p0, uint p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,string)", p0, p1, p2, p3)); } function log(uint p0, uint p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,bool)", p0, p1, p2, p3)); } function log(uint p0, uint p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,address)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,uint)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,string)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,bool)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,address)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,uint)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,string)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,bool)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,address)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,uint)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,string)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,bool)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,address)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,uint)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,string)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,bool)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,address)", p0, p1, p2, p3)); } function log(uint p0, bool p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,uint)", p0, p1, p2, p3)); } function log(uint p0, bool p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,string)", p0, p1, p2, p3)); } function log(uint p0, bool p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,bool)", p0, p1, p2, p3)); } function log(uint p0, bool p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,address)", p0, p1, p2, p3)); } function log(uint p0, bool p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,uint)", p0, p1, p2, p3)); } function log(uint p0, bool p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,string)", p0, p1, p2, p3)); } function log(uint p0, bool p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,bool)", p0, p1, p2, p3)); } function log(uint p0, bool p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,address)", p0, p1, p2, p3)); } function log(uint p0, bool p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,uint)", p0, p1, p2, p3)); } function log(uint p0, bool p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,string)", p0, p1, p2, p3)); } function log(uint p0, bool p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,bool)", p0, p1, p2, p3)); } function log(uint p0, bool p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,address)", p0, p1, p2, p3)); } function log(uint p0, bool p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,uint)", p0, p1, p2, p3)); } function log(uint p0, bool p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,string)", p0, p1, p2, p3)); } function log(uint p0, bool p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,bool)", p0, p1, p2, p3)); } function log(uint p0, bool p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,address)", p0, p1, p2, p3)); } function log(uint p0, address p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,uint)", p0, p1, p2, p3)); } function log(uint p0, address p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,string)", p0, p1, p2, p3)); } function log(uint p0, address p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,bool)", p0, p1, p2, p3)); } function log(uint p0, address p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,address)", p0, p1, p2, p3)); } function log(uint p0, address p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,uint)", p0, p1, p2, p3)); } function log(uint p0, address p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,string)", p0, p1, p2, p3)); } function log(uint p0, address p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,bool)", p0, p1, p2, p3)); } function log(uint p0, address p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,address)", p0, p1, p2, p3)); } function log(uint p0, address p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,uint)", p0, p1, p2, p3)); } function log(uint p0, address p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,string)", p0, p1, p2, p3)); } function log(uint p0, address p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,bool)", p0, p1, p2, p3)); } function log(uint p0, address p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,address)", p0, p1, p2, p3)); } function log(uint p0, address p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,uint)", p0, p1, p2, p3)); } function log(uint p0, address p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,string)", p0, p1, p2, p3)); } function log(uint p0, address p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,bool)", p0, p1, p2, p3)); } function log(uint p0, address p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,address)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,uint)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,string)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,address)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,uint)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,string)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,address)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,uint)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,uint)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,string)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,uint)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,uint)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,uint)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3)); } function log(bool p0, uint p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,uint)", p0, p1, p2, p3)); } function log(bool p0, uint p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,string)", p0, p1, p2, p3)); } function log(bool p0, uint p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,bool)", p0, p1, p2, p3)); } function log(bool p0, uint p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,address)", p0, p1, p2, p3)); } function log(bool p0, uint p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,uint)", p0, p1, p2, p3)); } function log(bool p0, uint p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,string)", p0, p1, p2, p3)); } function log(bool p0, uint p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,bool)", p0, p1, p2, p3)); } function log(bool p0, uint p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,address)", p0, p1, p2, p3)); } function log(bool p0, uint p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,uint)", p0, p1, p2, p3)); } function log(bool p0, uint p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,string)", p0, p1, p2, p3)); } function log(bool p0, uint p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, uint p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,address)", p0, p1, p2, p3)); } function log(bool p0, uint p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,uint)", p0, p1, p2, p3)); } function log(bool p0, uint p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,string)", p0, p1, p2, p3)); } function log(bool p0, uint p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,bool)", p0, p1, p2, p3)); } function log(bool p0, uint p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,uint)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,uint)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,uint)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3)); } function log(address p0, uint p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,uint)", p0, p1, p2, p3)); } function log(address p0, uint p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,string)", p0, p1, p2, p3)); } function log(address p0, uint p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,bool)", p0, p1, p2, p3)); } function log(address p0, uint p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,address)", p0, p1, p2, p3)); } function log(address p0, uint p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,uint)", p0, p1, p2, p3)); } function log(address p0, uint p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,string)", p0, p1, p2, p3)); } function log(address p0, uint p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,bool)", p0, p1, p2, p3)); } function log(address p0, uint p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,address)", p0, p1, p2, p3)); } function log(address p0, uint p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,uint)", p0, p1, p2, p3)); } function log(address p0, uint p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,string)", p0, p1, p2, p3)); } function log(address p0, uint p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,bool)", p0, p1, p2, p3)); } function log(address p0, uint p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,address)", p0, p1, p2, p3)); } function log(address p0, uint p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,uint)", p0, p1, p2, p3)); } function log(address p0, uint p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,string)", p0, p1, p2, p3)); } function log(address p0, uint p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,bool)", p0, p1, p2, p3)); } function log(address p0, uint p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,uint)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,uint)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3)); } function log(address p0, address p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,uint)", p0, p1, p2, p3)); } function log(address p0, address p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,string)", p0, p1, p2, p3)); } function log(address p0, address p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,address)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3)); } }
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.7.4; contract BorrowerProxy { address liquidityPool; constructor() { liquidityPool = msg.sender; } function lend(address _caller, bytes calldata _data) external payable { require(msg.sender == liquidityPool, "BorrowerProxy: Caller is not the liquidity pool"); (bool success,) = _caller.call{ value: msg.value }(_data); require(success, "BorrowerProxy: Borrower contract reverted during execution"); } }
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.7.4; interface IKToken { function underlying() external view returns (address); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function mint(address recipient, uint256 amount) external returns (bool); function burnFrom(address sender, uint256 amount) external; function addMinter(address sender) external; function renounceMinter() external; } interface ILiquidityPool { receive () external payable; function kToken(address _token) external view returns (IKToken); function register(IKToken _kToken) external; function renounceOperator() external; function deposit(address _token, uint256 _amount) external payable returns (uint256); function withdraw(address payable _to, IKToken _kToken, uint256 _kTokenAmount) external; function borrowableBalance(address _token) external view returns (uint256); function underlyingBalance(address _token, address _owner) external view returns (uint256); } interface ILender { receive () external payable; function borrow(address _token, uint256 _amount, bytes calldata _data) external; }
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.7.4; import "@openzeppelin/contracts/access/AccessControl.sol"; contract KRoles is AccessControl { bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE"); event OperatorAdded(address indexed account); event OperatorRemoved(address indexed account); constructor(address _operator) { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(OPERATOR_ROLE, _operator); } modifier onlyOperator() { require(isOperator(_msgSender()), "OperatorRole: caller does not have the Operator role"); _; } function isOperator(address account) public view returns (bool) { return hasRole(OPERATOR_ROLE, account); } function addOperator(address account) public onlyOperator { _addOperator(account); } function renounceOperator() public virtual { _renounceOperator(msg.sender); } function _addOperator(address account) internal { grantRole(OPERATOR_ROLE, account); emit OperatorAdded(account); } function _renounceOperator(address account) internal { renounceRole(OPERATOR_ROLE, account); emit OperatorRemoved(account); } }
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.7.4; import "./Interf.sol"; import "./common/CanReclaimTokens.sol"; import './BorrowerProxy.sol'; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "hardhat/console.sol"; contract LiquidityPoolV3 is ILiquidityPool, CanReclaimTokens, ReentrancyGuard, Pausable { using SafeMath for uint256; using SafeERC20 for ERC20; mapping (address=>IKToken) public kTokens; mapping (address=>bool) public registeredKTokens; mapping (address=>uint256) public loanedAmount; uint256 public depositFeeInBips; uint256 public poolFeeInBips; uint256 public FEE_BASE = 10000; address[] public registeredTokens; address public ETHEREUM = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE); address payable feePool; BorrowerProxy public borrower; event Deposited(address indexed _depositor, address indexed _token, uint256 _amount, uint256 _mintAmount); event Withdrew(address indexed _reciever, address indexed _withdrawer, address indexed _token, uint256 _amount, uint256 _burnAmount); event Borrowed(address indexed _borrower, address indexed _token, uint256 _amount, uint256 _fee); event EtherReceived(address indexed _from, uint256 _amount); receive () external override payable { emit EtherReceived(_msgSender(), msg.value); } constructor() CanReclaimTokens(_msgSender()) { borrower = new BorrowerProxy(); } /// @notice updates the deposit fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= FEE_BASE] /// @param _depositFeeInBips The new deposit fee. function updateDepositFee(uint256 _depositFeeInBips) external onlyOperator { require(_depositFeeInBips >= 0 && _depositFeeInBips <= FEE_BASE, "LiquidityPoolV1: fee should be between 0 and FEE_BASE"); depositFeeInBips = _depositFeeInBips; } /// @notice updates the pool fee. /// /// @dev fee is in bips so it should /// satisfy [0 <= fee <= FEE_BASE] /// @param _poolFeeInBips The new pool fee. function updatePoolFee(uint256 _poolFeeInBips) external onlyOperator { require(_poolFeeInBips >= 0 && _poolFeeInBips <= FEE_BASE, "LiquidityPoolV1: fee should be between 0 and FEE_BASE"); poolFeeInBips = _poolFeeInBips; } /// @notice updates the fee pool. /// /// @param _newFeePool The new fee pool. function updateFeePool(address payable _newFeePool) external onlyOperator { require(_newFeePool != address(0), "LiquidityPoolV2: feepool cannot be 0x0"); feePool = _newFeePool; } /// @notice pauses this contract. function pause() external onlyOperator { _pause(); } /// @notice unpauses this contract. function unpause() external onlyOperator { _unpause(); } /// @notice register a token on this Keeper. /// /// @param _kToken The keeper ERC20 token. function register(IKToken _kToken) external override onlyOperator { require(address(kTokens[_kToken.underlying()]) == address(0x0), "Underlying asset should not have been registered"); require(!registeredKTokens[address(_kToken)], "kToken should not have been registered"); kTokens[_kToken.underlying()] = _kToken; registeredKTokens[address(_kToken)] = true; registeredTokens.push(address(_kToken.underlying())); blacklistRecoverableToken(_kToken.underlying()); } /// @notice Deposit funds to the Keeper Protocol. /// /// @param _token The address of the token contract. /// @param _amount The value of deposit. function deposit(address _token, uint256 _amount) external payable override nonReentrant whenNotPaused returns (uint256) { IKToken kTok = kTokens[_token]; require(address(kTok) != address(0x0), "Token is not registered"); require(_amount > 0, "Deposit amount should be greater than 0"); if (_token != ETHEREUM) { require(msg.value == 0, "LiquidityPoolV2: Should not allow ETH deposits during ERC20 token deposits"); ERC20(_token).safeTransferFrom(_msgSender(), address(this), _amount); } else { require(_amount == msg.value, "Incorrect eth amount"); } uint256 mintAmount = calculateMintAmount(kTok, _token, _amount); kTok.mint(_msgSender(), mintAmount); emit Deposited(_msgSender(), _token, _amount, mintAmount); return mintAmount; } /// @notice Withdraw funds from the Compound Protocol. /// /// @param _to The address of the amount receiver. /// @param _kToken The address of the kToken contract. /// @param _kTokenAmount The value of the kToken amount to be burned. function withdraw(address payable _to, IKToken _kToken, uint256 _kTokenAmount) external override nonReentrant whenNotPaused { require(registeredKTokens[address(_kToken)], "kToken is not registered"); require(_kTokenAmount > 0, "Withdraw amount should be greater than 0"); address token = _kToken.underlying(); uint256 amount = calculateWithdrawAmount(_kToken, token, _kTokenAmount); _kToken.burnFrom(_msgSender(), _kTokenAmount); if (token != ETHEREUM) { ERC20(token).safeTransfer(_to, amount); } else { (bool success,) = _to.call{ value: amount }(""); require(success, "Transfer Failed"); } emit Withdrew(_to, _msgSender(), token, amount, _kTokenAmount); } /// @notice borrow assets from this LP, and return them within the same transaction. /// /// @param _token The address of the token contract. /// @param _amount The amont of token. /// @param _data The implementation specific data for the Borrower. function borrow(address _token, uint256 _amount, bytes calldata _data) external nonReentrant whenNotPaused { require(address(kTokens[_token]) != address(0x0), "Token is not registered"); uint256 initialBalance = borrowableBalance(_token); if (_token != ETHEREUM) { ERC20(_token).safeTransfer(_msgSender(), _amount); } else { (bool success,) = _msgSender().call{ value: _amount }(""); require(success, "LiquidityPoolV1: failed to send funds to the borrower"); } borrower.lend(_msgSender(), _data); uint256 finalBalance = borrowableBalance(_token); require(finalBalance >= initialBalance, "Borrower failed to return the borrowed funds"); uint256 fee = finalBalance.sub(initialBalance); uint256 poolFee = calculateFee(poolFeeInBips, fee); emit Borrowed(_msgSender(), _token, _amount, fee); if (_token != ETHEREUM) { ERC20(_token).safeTransfer(feePool, poolFee); } else { (bool success,) = feePool.call{value: poolFee}(""); require(success, "LiquidityPoolV1: failed to send funds to the fee pool"); } } /// @notice Calculate the given token's outstanding balance of this contract. /// /// @param _token The address of the token contract. /// /// @return Outstanding balance of the given token. function borrowableBalance(address _token) public view override returns (uint256) { if (_token == ETHEREUM) { return address(this).balance; } return ERC20(_token).balanceOf(address(this)); } /// @notice Calculate the given owner's outstanding balance for the given token on this contract. /// /// @param _token The address of the token contract. /// @param _owner The address of the token contract. /// /// @return Owner's outstanding balance of the given token. function underlyingBalance(address _token, address _owner) public view override returns (uint256) { uint256 kBalance = kTokens[_token].balanceOf(_owner); uint256 kSupply = kTokens[_token].totalSupply(); if (kBalance == 0) { return 0; } return borrowableBalance(_token).add(loanedAmount[_token]).mul(kBalance).div(kSupply); } /// @notice Migrate funds to the new liquidity provider. /// /// @param _newLP The address of the new LiquidityPool contract. function migrate(ILiquidityPool _newLP) public onlyOperator { for (uint256 i = 0; i < registeredTokens.length; i++) { address token = registeredTokens[i]; kTokens[token].addMinter(address(_newLP)); kTokens[token].renounceMinter(); _newLP.register(kTokens[token]); if (token != ETHEREUM) { ERC20(token).safeTransfer(address(_newLP), borrowableBalance(token)); } else { (bool success,) = address(_newLP).call{value: borrowableBalance(token)}(""); require(success, "Transfer Failed"); } } _newLP.renounceOperator(); } // returns the corresponding kToken for the given underlying token if it exists. function kToken(address _token) external view override returns (IKToken) { return kTokens[_token]; } /// Calculates the amount that will be withdrawn when the given amount of kToken /// is burnt. /// @dev used in the withdraw() function to calculate the amount that will be /// withdrawn. function calculateWithdrawAmount(IKToken _kToken, address _token, uint256 _kTokenAmount) internal view returns (uint256) { uint256 kTokenSupply = _kToken.totalSupply(); require(kTokenSupply != 0, "No KTokens to be burnt"); uint256 poolBalance = borrowableBalance(_token); uint256 withdrawAmount = _kTokenAmount.mul(poolBalance.add(loanedAmount[_token])).div(_kToken.totalSupply()); require(withdrawAmount <= poolBalance, "Insufficient pool liquidity"); return withdrawAmount; } /// Calculates the amount of kTokens that will be minted when the given amount /// is deposited. /// @dev used in the deposit() function to calculate the amount of kTokens that /// will be minted. function calculateMintAmount(IKToken _kToken, address _token, uint256 _depositAmount) internal view returns (uint256) { // The borrow balance includes the deposit amount, which is removed here. uint256 initialBalance = borrowableBalance(_token).sub(_depositAmount).add(loanedAmount[_token]); uint256 kTokenSupply = _kToken.totalSupply(); if (kTokenSupply == 0) { return _depositAmount; } // mintAmoount = amountDeposited * (1-fee) * kPool /(pool + amountDeposited * fee) return (applyFee(depositFeeInBips, _depositAmount).mul(kTokenSupply)) .div(initialBalance.add( calculateFee(depositFeeInBips, _depositAmount) )); } /// Applies the fee by subtracting fees from the amount and returns /// the amount after deducting the fee. /// @dev it calculates (1 - fee) * amount function applyFee(uint256 _feeInBips, uint256 _amount) internal view returns (uint256) { return _amount.mul(FEE_BASE.sub(_feeInBips)).div(FEE_BASE); } /// Calculates the fee amount. /// @dev it calculates fee * amount function calculateFee(uint256 _feeInBips, uint256 _amount) internal view returns (uint256) { return _amount.mul(_feeInBips).div(FEE_BASE); } /// Renounces operatorship of this contract function renounceOperator() public override(ILiquidityPool, KRoles) { KRoles.renounceOperator(); } }
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.7.4; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/proxy/Initializable.sol"; import "../KRoles.sol"; contract CanReclaimTokens is KRoles { using SafeERC20 for ERC20; mapping(address => bool) private recoverableTokensBlacklist; constructor(address _nextOwner) KRoles(_nextOwner) {} function blacklistRecoverableToken(address _token) public onlyOperator { recoverableTokensBlacklist[_token] = true; } /// @notice Allow the owner of the contract to recover funds accidentally /// sent to the contract. To withdraw ETH, the token should be set to `0x0`. function recoverTokens(address _token) external onlyOperator { require( !recoverableTokensBlacklist[_token], "CanReclaimTokens: token is not recoverable" ); if (_token == address(0x0)) { (bool success,) = msg.sender.call{ value: address(this).balance }(""); require(success, "Transfer Failed"); } else { ERC20(_token).safeTransfer( msg.sender, ERC20(_token).balanceOf(address(this)) ); } } }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_borrower","type":"address"},{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"Borrowed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_depositor","type":"address"},{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_mintAmount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"EtherReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_keeper","type":"address"}],"name":"KeeperBlacklisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_keeper","type":"address"}],"name":"KeeperWhitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"OperatorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"OperatorRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_wallet","type":"address"},{"indexed":true,"internalType":"address","name":"_keeper","type":"address"},{"indexed":false,"internalType":"address","name":"_repayToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"_repayAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"_collateralToken","type":"address"}],"name":"Preempted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_wallet","type":"address"},{"indexed":true,"internalType":"address","name":"_underwriter","type":"address"}],"name":"Reclaimed","type":"event"},{"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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_underwriter","type":"address"}],"name":"UnderwriterBlacklisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_underwriter","type":"address"}],"name":"UnderwriterWhitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_wallet","type":"address"},{"indexed":true,"internalType":"address","name":"_underwriter","type":"address"},{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Underwritten","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_reciever","type":"address"},{"indexed":true,"internalType":"address","name":"_withdrawer","type":"address"},{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_burnAmount","type":"uint256"}],"name":"Withdrew","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ETHEREUM","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_keeper","type":"address"}],"name":"blacklistKeeper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"blacklistRecoverableToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_underwriter","type":"address"}],"name":"blacklistUnderwriter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"borrow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"borrowableBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"borrower","outputs":[{"internalType":"contract BorrowerProxy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"depositFeeInBips","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":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"kToken","outputs":[{"internalType":"contract IKToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"kTokens","outputs":[{"internalType":"contract IKToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"loanedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ILiquidityPool","name":"_newLP","type":"address"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolFeeInBips","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract Wallet","name":"_wallet","type":"address"},{"internalType":"address","name":"_repayToken","type":"address"},{"internalType":"uint256","name":"_repayAmount","type":"uint256"},{"internalType":"address","name":"_cTokenCollateral","type":"address"}],"name":"preempt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"name":"reclaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"recoverTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IKToken","name":"_kToken","type":"address"}],"name":"register","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"registeredKTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"registeredTokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","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":"address","name":"_token","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"name":"underlyingBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"underwrite","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_depositFeeInBips","type":"uint256"}],"name":"updateDepositFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_newFeePool","type":"address"}],"name":"updateFeePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolFeeInBips","type":"uint256"}],"name":"updatePoolFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_keeper","type":"address"}],"name":"whitelistKeeper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_underwriter","type":"address"}],"name":"whitelistUnderwriter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_to","type":"address"},{"internalType":"contract IKToken","name":"_kToken","type":"address"},{"internalType":"uint256","name":"_kTokenAmount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
6080604052612710600955600b80546001600160a01b03191673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1790553480156200003d57600080fd5b5062000048620000ee565b806200005f600062000059620000ee565b620000f2565b6200008b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92982620000f2565b505060016002556003805460ff19169055604051620000aa9062000202565b604051809103906000f080158015620000c7573d6000803e3d6000fd5b50600d80546001600160a01b0319166001600160a01b039290921691909117905562000210565b3390565b620000fe828262000102565b5050565b6000828152602081815260409091206200012791839062002e5b6200017b821b17901c565b15620000fe5762000137620000ee565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600062000192836001600160a01b0384166200019b565b90505b92915050565b6000620001a98383620001ea565b620001e15750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000195565b50600062000195565b60009081526001919091016020526040902054151590565b61026a806200423383390190565b61401380620002206000396000f3fe60806040526004361061026b5760003560e01c8063834edf4111610144578063c5b1fad1116100b6578063ecefc7051161007a578063ecefc70514610a1b578063f5b541a614610a30578063f65d901c14610a45578063f7cdf47c14610a78578063fc5eb0df14610a8d578063fc772c8b14610ac8576102ba565b8063c5b1fad11461090f578063ca15c87314610942578063ce5494bb1461096c578063d547741f1461099f578063d9caed12146109d8576102ba565b80639a0ba2ea116101085780639a0ba2ea146108055780639df51b271461082f578063a217fddf14610872578063aef67d7814610887578063c07a4c5e1461089c578063c2cac04b146108e5576102ba565b8063834edf41146107215780638456cb59146107545780639010d07c1461076957806391d14854146107995780639870d7fe146107d2576102ba565b806347e86662116101dd5780636d16acfe116101a15780636d16acfe146105ae5780636d70f7ae146105e15780636e2246a714610614578063736158d0146106a657806374fe10d0146106d95780637df1f1b91461070c576102ba565b806347e866621461049d5780635438b9e5146104ec57806355856e991461051f5780635c975abb14610552578063604267771461057b576102ba565b80632ab6f8db1161022f5780632ab6f8db146103a25780632f2ff15d146103b757806336568abe146103f05780633f4ba83a146104295780634420e4861461043e57806347e7ef2414610471576102ba565b8063017def57146102bf5780630534e74e146102eb57806316114acd14610312578063248a9ca31461034557806326a965f01461036f576102ba565b366102ba57610278610afb565b6001600160a01b03167f1e57e3bb474320be3d2c77138f75b7c3941292d647f5f9634e33a8e94e0e069b346040518082815260200191505060405180910390a2005b600080fd5b3480156102cb57600080fd5b506102e9600480360360208110156102e257600080fd5b5035610aff565b005b3480156102f757600080fd5b50610300610b90565b60408051918252519081900360200190f35b34801561031e57600080fd5b506102e96004803603602081101561033557600080fd5b50356001600160a01b0316610b96565b34801561035157600080fd5b506103006004803603602081101561036857600080fd5b5035610d68565b34801561037b57600080fd5b506102e96004803603602081101561039257600080fd5b50356001600160a01b0316610d80565b3480156103ae57600080fd5b506102e9610e0f565b3480156103c357600080fd5b506102e9600480360360408110156103da57600080fd5b50803590602001356001600160a01b0316610e19565b3480156103fc57600080fd5b506102e96004803603604081101561041357600080fd5b50803590602001356001600160a01b0316610e85565b34801561043557600080fd5b506102e9610ee6565b34801561044a57600080fd5b506102e96004803603602081101561046157600080fd5b50356001600160a01b0316610f34565b6103006004803603604081101561048757600080fd5b506001600160a01b03813516906020013561124e565b3480156104a957600080fd5b506104d0600480360360208110156104c057600080fd5b50356001600160a01b031661154b565b604080516001600160a01b039092168252519081900360200190f35b3480156104f857600080fd5b506102e96004803603602081101561050f57600080fd5b50356001600160a01b0316611566565b34801561052b57600080fd5b506102e96004803603602081101561054257600080fd5b50356001600160a01b03166115f8565b34801561055e57600080fd5b50610567611687565b604080519115158252519081900360200190f35b34801561058757600080fd5b506103006004803603602081101561059e57600080fd5b50356001600160a01b0316611690565b3480156105ba57600080fd5b506104d0600480360360208110156105d157600080fd5b50356001600160a01b03166116a2565b3480156105ed57600080fd5b506105676004803603602081101561060457600080fd5b50356001600160a01b03166116c0565b34801561062057600080fd5b506102e96004803603606081101561063757600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561066757600080fd5b82018360208201111561067957600080fd5b8035906020019184600183028401116401000000008311171561069b57600080fd5b5090925090506116e0565b3480156106b257600080fd5b50610300600480360360208110156106c957600080fd5b50356001600160a01b0316611afb565b3480156106e557600080fd5b506102e9600480360360208110156106fc57600080fd5b50356001600160a01b0316611b93565b34801561071857600080fd5b506104d0611c25565b34801561072d57600080fd5b506105676004803603602081101561074457600080fd5b50356001600160a01b0316611c34565b34801561076057600080fd5b506102e9611c49565b34801561077557600080fd5b506104d06004803603604081101561078c57600080fd5b5080359060200135611c97565b3480156107a557600080fd5b50610567600480360360408110156107bc57600080fd5b50803590602001356001600160a01b0316611cb6565b3480156107de57600080fd5b506102e9600480360360208110156107f557600080fd5b50356001600160a01b0316611cce565b34801561081157600080fd5b506104d06004803603602081101561082857600080fd5b5035611d1d565b34801561083b57600080fd5b506102e96004803603606081101561085257600080fd5b506001600160a01b03813581169160208101359091169060400135611d47565b34801561087e57600080fd5b50610300611ffa565b34801561089357600080fd5b50610300611fff565b3480156108a857600080fd5b506102e9600480360360808110156108bf57600080fd5b506001600160a01b03813581169160208101358216916040820135916060013516612005565b3480156108f157600080fd5b506102e96004803603602081101561090857600080fd5b50356121be565b34801561091b57600080fd5b506102e96004803603602081101561093257600080fd5b50356001600160a01b031661224a565b34801561094e57600080fd5b506103006004803603602081101561096557600080fd5b50356122f7565b34801561097857600080fd5b506102e96004803603602081101561098f57600080fd5b50356001600160a01b031661230e565b3480156109ab57600080fd5b506102e9600480360360408110156109c257600080fd5b50803590602001356001600160a01b0316612606565b3480156109e457600080fd5b506102e9600480360360608110156109fb57600080fd5b506001600160a01b0381358116916020810135909116906040013561265f565b348015610a2757600080fd5b506103006129be565b348015610a3c57600080fd5b506103006129c4565b348015610a5157600080fd5b506102e960048036036020811015610a6857600080fd5b50356001600160a01b03166129d6565b348015610a8457600080fd5b506104d0612a43565b348015610a9957600080fd5b5061030060048036036040811015610ab057600080fd5b506001600160a01b0381358116916020013516612a52565b348015610ad457600080fd5b506102e960048036036020811015610aeb57600080fd5b50356001600160a01b0316612bc4565b3390565b610b0f610b0a610afb565b6116c0565b610b4a5760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b600954811115610b8b5760405162461bcd60e51b8152600401808060200182810382526035815260200180613de46035913960400191505060405180910390fd5b600755565b60085481565b610ba1610b0a610afb565b610bdc5760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b6001600160a01b03811660009081526001602052604090205460ff1615610c345760405162461bcd60e51b815260040180806020018281038252602a815260200180613caf602a913960400191505060405180910390fd5b6001600160a01b038116610cd757604051600090339047908381818185875af1925050503d8060008114610c84576040519150601f19603f3d011682016040523d82523d6000602084013e610c89565b606091505b5050905080610cd1576040805162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8811985a5b1959608a1b604482015290519081900360640190fd5b50610d65565b610d6533826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610d2857600080fd5b505afa158015610d3c573d6000803e3d6000fd5b505050506040513d6020811015610d5257600080fd5b50516001600160a01b0384169190612e70565b50565b6000818152602081905260409020600201545b919050565b610d8b610b0a610afb565b610dc65760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b6001600160a01b0381166000818152600f6020526040808220805460ff19169055517f79bf5efab685b39bdd2b7b1aba09ffa5e9dfbd86f7aaebab4b52d7ef679d28449190a250565b610e17612ec7565b565b600082815260208190526040902060020154610e3c90610e37610afb565b611cb6565b610e775760405162461bcd60e51b815260040180806020018281038252602f815260200180613c0c602f913960400191505060405180910390fd5b610e818282612ed0565b5050565b610e8d610afb565b6001600160a01b0316816001600160a01b031614610edc5760405162461bcd60e51b815260040180806020018281038252602f815260200180613faf602f913960400191505060405180910390fd5b610e818282612f39565b610ef1610b0a610afb565b610f2c5760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b610e17612fa2565b610f3f610b0a610afb565b610f7a5760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b60006001600160a01b031660046000836001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc257600080fd5b505afa158015610fd6573d6000803e3d6000fd5b505050506040513d6020811015610fec57600080fd5b50516001600160a01b03908116825260208201929092526040016000205416146110475760405162461bcd60e51b8152600401808060200182810382526030815260200180613ee36030913960400191505060405180910390fd5b6001600160a01b03811660009081526005602052604090205460ff161561109f5760405162461bcd60e51b8152600401808060200182810382526026815260200180613cd96026913960400191505060405180910390fd5b8060046000836001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b1580156110dd57600080fd5b505afa1580156110f1573d6000803e3d6000fd5b505050506040513d602081101561110757600080fd5b50516001600160a01b0390811682526020808301939093526040918201600090812080546001600160a01b0319169583169590951790945584168084526005835292819020805460ff191660011790558051636f307dc360e01b81529051600a9392636f307dc39260048082019391829003018186803b15801561118a57600080fd5b505afa15801561119e573d6000803e3d6000fd5b505050506040513d60208110156111b457600080fd5b5051815460018101835560009283526020928390200180546001600160a01b0319166001600160a01b0392831617905560408051636f307dc360e01b81529051610d659392851692636f307dc39260048082019391829003018186803b15801561121d57600080fd5b505afa158015611231573d6000803e3d6000fd5b505050506040513d602081101561124757600080fd5b50516129d6565b6000600280541415611295576040805162461bcd60e51b815260206004820152601f6024820152600080516020613c3b833981519152604482015290519081900360640190fd5b600280556112a1611687565b156112e6576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6001600160a01b03808416600090815260046020526040902054168061134d576040805162461bcd60e51b8152602060048201526017602482015276151bdad95b881a5cc81b9bdd081c9959da5cdd195c9959604a1b604482015290519081900360640190fd5b6000831161138c5760405162461bcd60e51b8152600401808060200182810382526027815260200180613c5b6027913960400191505060405180910390fd5b600b546001600160a01b038581169116146114005734156113de5760405162461bcd60e51b815260040180806020018281038252604a815260200180613f65604a913960600191505060405180910390fd5b6113fb6113e9610afb565b6001600160a01b038616903086613042565b61144b565b34831461144b576040805162461bcd60e51b8152602060048201526014602482015273125b98dbdc9c9958dd08195d1a08185b5bdd5b9d60621b604482015290519081900360640190fd5b60006114588286866130a2565b9050816001600160a01b03166340c10f19611471610afb565b836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156114b857600080fd5b505af11580156114cc573d6000803e3d6000fd5b505050506040513d60208110156114e257600080fd5b50506001600160a01b0385166114f6610afb565b6001600160a01b03167ff5681f9d0db1b911ac18ee83d515a1cf1051853a9eae418316a2fdf7dea427c58684604051808381526020018281526020019250505060405180910390a36001600255949350505050565b6004602052600090815260409020546001600160a01b031681565b611571610b0a610afb565b6115ac5760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b6001600160a01b0381166000818152600f6020526040808220805460ff19166001179055517f2a2bdc1c5305d6bc286de7c1efdeea7b3e248488284891625ce2e0ce38ffafe29190a250565b611603610b0a610afb565b61163e5760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b6001600160a01b038116600081815260106020526040808220805460ff19169055517f513d24f92767da445cdd7d7d20aef2adde58d95ab5557373adf11e549906f7649190a250565b60035460ff1690565b60066020526000908152604090205481565b6001600160a01b039081166000908152600460205260409020541690565b60006116da600080516020613ec383398151915283611cb6565b92915050565b600280541415611725576040805162461bcd60e51b815260206004820152601f6024820152600080516020613c3b833981519152604482015290519081900360640190fd5b60028055611731611687565b15611776576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6001600160a01b03848116600090815260046020526040902054166117dc576040805162461bcd60e51b8152602060048201526017602482015276151bdad95b881a5cc81b9bdd081c9959da5cdd195c9959604a1b604482015290519081900360640190fd5b60006117e785611afb565b600b549091506001600160a01b038681169116146118205761181b61180a610afb565b6001600160a01b0387169086612e70565b6118bc565b600061182a610afb565b6040516001600160a01b0391909116908690600081818185875af1925050503d8060008114611875576040519150601f19603f3d011682016040523d82523d6000602084013e61187a565b606091505b50509050806118ba5760405162461bcd60e51b8152600401808060200182810382526035815260200180613daf6035913960400191505060405180910390fd5b505b600d546001600160a01b031663d5badabc6118d5610afb565b85856040518463ffffffff1660e01b815260040180846001600160a01b03168152602001806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050945050505050600060405180830381600087803b15801561194857600080fd5b505af115801561195c573d6000803e3d6000fd5b50505050600061196b86611afb565b9050818110156119ac5760405162461bcd60e51b815260040180806020018281038252602c815260200180613e76602c913960400191505060405180910390fd5b60006119b88284613181565b905060006119c8600854836131de565b9050876001600160a01b03166119dc610afb565b6001600160a01b03167fc14e9e6b4d98a542b05a0f6b64acd5f4cbdb914be88432d87486b664e97071a78985604051808381526020018281526020019250505060405180910390a3600b546001600160a01b03898116911614611a5857600c54611a53906001600160a01b038a8116911683612e70565b611aec565b600c546040516000916001600160a01b03169083908381818185875af1925050503d8060008114611aa5576040519150601f19603f3d011682016040523d82523d6000602084013e611aaa565b606091505b5050905080611aea5760405162461bcd60e51b8152600401808060200182810382526035815260200180613e196035913960400191505060405180910390fd5b505b50506001600255505050505050565b600b546000906001600160a01b0383811691161415611b1b575047610d7b565b604080516370a0823160e01b815230600482015290516001600160a01b038416916370a08231916024808301926020929190829003018186803b158015611b6157600080fd5b505afa158015611b75573d6000803e3d6000fd5b505050506040513d6020811015611b8b57600080fd5b505192915050565b611b9e610b0a610afb565b611bd95760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b6001600160a01b038116600081815260106020526040808220805460ff19166001179055517fb1ca29f3640ee298435a000f39125155cfa037ae91b01a14e90e61783d3a86199190a250565b600d546001600160a01b031681565b60056020526000908152604090205460ff1681565b611c54610b0a610afb565b611c8f5760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b610e176131f2565b6000828152602081905260408120611caf9083613275565b9392505050565b6000828152602081905260408120611caf9083613281565b611cd9610b0a610afb565b611d145760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b610d6581613296565b600a8181548110611d2d57600080fd5b6000918252602090912001546001600160a01b0316905081565b3360009081526010602052604090205460ff16611d955760405162461bcd60e51b815260040180806020018281038252602d815260200180613c82602d913960400191505060405180910390fd5b600280541415611dda576040805162461bcd60e51b815260206004820152601f6024820152600080516020613c3b833981519152604482015290519081900360640190fd5b60028055611de6611687565b15611e2b576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b826001600160a01b031663f516b2ee83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015611e8257600080fd5b505af1158015611e96573d6000803e3d6000fd5b50611eaf925050506001600160a01b03831684836132e5565b826001600160a01b03166388180ff683836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015611f0657600080fd5b505af1158015611f1a573d6000803e3d6000fd5b5050506001600160a01b038316600090815260066020526040902054611f419150826133d0565b6001600160a01b03838116600081815260066020908152604080832095909555878416808352600e825285832086518088018852858152808401898152825460018082018555938752958590209151600290960290910180546001600160a01b0319169590971694909417865592519490920193909355835185815293519193339391927fb10e597c7b0d304913e7bdf6f11b0294d08f6494413b33e0ca6ba6918ef3db46929181900390910190a45050600160025550565b600081565b60075481565b336000908152600f602052604090205460ff166120535760405162461bcd60e51b8152600401808060200182810382526028815260200180613f136028913960400191505060405180910390fd5b600280541415612098576040805162461bcd60e51b815260206004820152601f6024820152600080516020613c3b833981519152604482015290519081900360640190fd5b600280556120a4611687565b156120e9576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6040805163603d262f60e11b81523360048201526001600160a01b03858116602483015260448201859052838116606483015291519186169163c07a4c5e9160848082019260009290919082900301818387803b15801561214957600080fd5b505af115801561215d573d6000803e3d6000fd5b5050604080516001600160a01b0387811682526020820187905285811682840152915133945091881692507f488f4cb3bd06b31ff94bcb19ad4a9a453a700637ca4dce451a611e9ae58c9874919081900360600190a3505060016002555050565b6121c9610b0a610afb565b6122045760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b6009548111156122455760405162461bcd60e51b8152600401808060200182810382526035815260200180613de46035913960400191505060405180910390fd5b600855565b612255610b0a610afb565b6122905760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b6001600160a01b0381166122d55760405162461bcd60e51b8152600401808060200182810382526026815260200180613d896026913960400191505060405180910390fd5b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b60008181526020819052604081206116da9061342a565b612319610b0a610afb565b6123545760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b60005b600a548110156125af576000600a828154811061237057fe5b60009182526020808320909101546001600160a01b039081168084526004928390526040808520548151634c1d96ab60e11b81528985169581019590955290519195509091169263983b2d56926024808201939182900301818387803b1580156123d957600080fd5b505af11580156123ed573d6000803e3d6000fd5b505050506001600160a01b038181166000908152600460208190526040808320548151639865027560e01b8152915194169363986502759382840193909282900301818387803b15801561244057600080fd5b505af1158015612454573d6000803e3d6000fd5b505050506001600160a01b038181166000908152600460208190526040808320548151632210724360e11b8152908516928101929092525192861692634420e4869260248084019391929182900301818387803b1580156124b457600080fd5b505af11580156124c8573d6000803e3d6000fd5b5050600b546001600160a01b038481169116149150612506905057612501836124f083611afb565b6001600160a01b0384169190612e70565b6125a6565b6000836001600160a01b031661251b83611afb565b604051600081818185875af1925050503d8060008114612557576040519150601f19603f3d011682016040523d82523d6000602084013e61255c565b606091505b50509050806125a4576040805162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8811985a5b1959608a1b604482015290519081900360640190fd5b505b50600101612357565b50806001600160a01b0316632ab6f8db6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156125eb57600080fd5b505af11580156125ff573d6000803e3d6000fd5b5050505050565b60008281526020819052604090206002015461262490610e37610afb565b610edc5760405162461bcd60e51b8152600401808060200182810382526030815260200180613d596030913960400191505060405180910390fd5b6002805414156126a4576040805162461bcd60e51b815260206004820152601f6024820152600080516020613c3b833981519152604482015290519081900360640190fd5b600280556126b0611687565b156126f5576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6001600160a01b03821660009081526005602052604090205460ff16612762576040805162461bcd60e51b815260206004820152601860248201527f6b546f6b656e206973206e6f7420726567697374657265640000000000000000604482015290519081900360640190fd5b600081116127a15760405162461bcd60e51b8152600401808060200182810382526028815260200180613e4e6028913960400191505060405180910390fd5b6000826001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b1580156127dc57600080fd5b505afa1580156127f0573d6000803e3d6000fd5b505050506040513d602081101561280657600080fd5b505190506000612817848385613435565b9050836001600160a01b03166379cc6790612830610afb565b856040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561287757600080fd5b505af115801561288b573d6000803e3d6000fd5b5050600b546001600160a01b0385811691161491506128bf9050576128ba6001600160a01b0383168683612e70565b612959565b6040516000906001600160a01b0387169083908381818185875af1925050503d806000811461290a576040519150601f19603f3d011682016040523d82523d6000602084013e61290f565b606091505b5050905080612957576040805162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8811985a5b1959608a1b604482015290519081900360640190fd5b505b816001600160a01b031661296b610afb565b604080518481526020810187905281516001600160a01b03938416938a16927f66d8849e904432a33a6c0adbb12d9cf486cc99e88c79160e8b1933b6c6644d59928290030190a450506001600255505050565b60095481565b600080516020613ec383398151915281565b6129e1610b0a610afb565b612a1c5760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b6001600160a01b03166000908152600160208190526040909120805460ff19169091179055565b600b546001600160a01b031681565b6001600160a01b0380831660009081526004602081815260408084205481516370a0823160e01b8152878716948101949094529051939485949116926370a08231926024808301939192829003018186803b158015612ab057600080fd5b505afa158015612ac4573d6000803e3d6000fd5b505050506040513d6020811015612ada57600080fd5b50516001600160a01b0380861660009081526004602081815260408084205481516318160ddd60e01b81529151969750939593909416936318160ddd93818401939091829003018186803b158015612b3157600080fd5b505afa158015612b45573d6000803e3d6000fd5b505050506040513d6020811015612b5b57600080fd5b5051905081612b6f576000925050506116da565b612bbb81612bb584612baf600660008b6001600160a01b03166001600160a01b0316815260200190815260200160002054612ba98b611afb565b906133d0565b906135e7565b90613640565b95945050505050565b3360009081526010602052604090205460ff16612c125760405162461bcd60e51b815260040180806020018281038252602d815260200180613c82602d913960400191505060405180910390fd5b600280541415612c57576040805162461bcd60e51b815260206004820152601f6024820152600080516020613c3b833981519152604482015290519081900360640190fd5b60028055612c63611687565b15612ca8576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b806001600160a01b03166380e9071b6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612ce357600080fd5b505af1158015612cf7573d6000803e3d6000fd5b5050506001600160a01b0382166000908152600e602090815260408083208054825181850281018501909352808352606095509193909284015b82821015612d79576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101612d31565b5050506001600160a01b0384166000908152600e60205260408120929350612da2929150613b87565b60005b8151811015612e1b57612db6613ba8565b828281518110612dc257fe5b6020908102919091018101518082015181516001600160a01b031660009081526006909352604090922054909250612df991613181565b90516001600160a01b0316600090815260066020526040902055600101612da5565b5060405133906001600160a01b038416907fbd017690b083822e9e6492566f5c0f4b3e2a7ed256a360f458eb627ce9037cd390600090a350506001600255565b6000611caf836001600160a01b0384166136a7565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612ec29084906136f1565b505050565b610e17336137a2565b6000828152602081905260409020612ee89082612e5b565b15610e8157612ef5610afb565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081905260409020612f5190826137f1565b15610e8157612f5e610afb565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b612faa611687565b612ff2576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6003805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa613025610afb565b604080516001600160a01b039092168252519081900360200190a1565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261309c9085906136f1565b50505050565b6001600160a01b03821660009081526006602052604081205481906130d490612ba9856130ce88611afb565b90613181565b90506000856001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561311157600080fd5b505afa158015613125573d6000803e3d6000fd5b505050506040513d602081101561313b57600080fd5b505190508061314e578392505050611caf565b613177613167613160600754876131de565b84906133d0565b612bb583612baf60075489613806565b9695505050505050565b6000828211156131d8576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600954600090611caf90612bb584866135e7565b6131fa611687565b1561323f576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6003805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613025610afb565b6000611caf8383613824565b6000611caf836001600160a01b038416613888565b6132ae600080516020613ec383398151915282610e19565b6040516001600160a01b038216907fac6fa858e9350a46cec16539926e0fde25b7629f84b5a72bffaae4df888ae86d90600090a250565b600061337b82856001600160a01b031663dd62ed3e30876040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b15801561334957600080fd5b505afa15801561335d573d6000803e3d6000fd5b505050506040513d602081101561337357600080fd5b5051906133d0565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905290915061309c9085906136f1565b600082820183811015611caf576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006116da826138a0565b600080846001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561347157600080fd5b505afa158015613485573d6000803e3d6000fd5b505050506040513d602081101561349b57600080fd5b50519050806134ea576040805162461bcd60e51b8152602060048201526016602482015275139bc812d51bdad95b9cc81d1bc8189948189d5c9b9d60521b604482015290519081900360640190fd5b60006134f585611afb565b90506000613590876001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561353557600080fd5b505afa158015613549573d6000803e3d6000fd5b505050506040513d602081101561355f57600080fd5b50516001600160a01b038816600090815260066020526040902054612bb5906135899086906133d0565b88906135e7565b905081811115613177576040805162461bcd60e51b815260206004820152601b60248201527f496e73756666696369656e7420706f6f6c206c69717569646974790000000000604482015290519081900360640190fd5b6000826135f6575060006116da565b8282028284828161360357fe5b0414611caf5760405162461bcd60e51b8152600401808060200182810382526021815260200180613ea26021913960400191505060405180910390fd5b6000808211613696576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161369f57fe5b049392505050565b60006136b38383613888565b6136e9575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556116da565b5060006116da565b6060613746826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166138a49092919063ffffffff16565b805190915015612ec25780806020019051602081101561376557600080fd5b5051612ec25760405162461bcd60e51b815260040180806020018281038252602a815260200180613f3b602a913960400191505060405180910390fd5b6137ba600080516020613ec383398151915282610e85565b6040516001600160a01b038216907f80c0b871b97b595b16a7741c1b06fed0c6f6f558639f18ccbce50724325dc40d90600090a250565b6000611caf836001600160a01b0384166138bb565b600954600090611caf90612bb561381d8287613181565b85906135e7565b815460009082106138665760405162461bcd60e51b8152600401808060200182810382526022815260200180613bea6022913960400191505060405180910390fd5b82600001828154811061387557fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b60606138b38484600085613981565b949350505050565b6000818152600183016020526040812054801561397757835460001980830191908101906000908790839081106138ee57fe5b906000526020600020015490508087600001848154811061390b57fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061393b57fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506116da565b60009150506116da565b6060824710156139c25760405162461bcd60e51b8152600401808060200182810382526026815260200180613d336026913960400191505060405180910390fd5b6139cb85613add565b613a1c576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310613a5b5780518252601f199092019160209182019101613a3c565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613abd576040519150601f19603f3d011682016040523d82523d6000602084013e613ac2565b606091505b5091509150613ad2828286613ae3565b979650505050505050565b3b151590565b60608315613af2575081611caf565b825115613b025782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613b4c578181015183820152602001613b34565b50505050905090810190601f168015613b795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5080546000825560020290600052602060002090810190610d659190613bbf565b604080518082019091526000808252602082015290565b5b80821115613be55780546001600160a01b031916815560006001820155600201613bc0565b509056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e745265656e7472616e637947756172643a207265656e7472616e742063616c6c004465706f73697420616d6f756e742073686f756c642062652067726561746572207468616e20304a4954553a2063616c6c6572206973206e6f7420612077686974656c697374656420756e64657277726974657243616e5265636c61696d546f6b656e733a20746f6b656e206973206e6f74207265636f76657261626c656b546f6b656e2073686f756c64206e6f742068617665206265656e20726567697374657265644f70657261746f72526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204f70657261746f7220726f6c65416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b654c6971756964697479506f6f6c56323a20666565706f6f6c2063616e6e6f74206265203078304c6971756964697479506f6f6c56313a206661696c656420746f2073656e642066756e647320746f2074686520626f72726f7765724c6971756964697479506f6f6c56313a206665652073686f756c64206265206265747765656e203020616e64204645455f424153454c6971756964697479506f6f6c56313a206661696c656420746f2073656e642066756e647320746f207468652066656520706f6f6c576974686472617720616d6f756e742073686f756c642062652067726561746572207468616e2030426f72726f776572206661696c656420746f2072657475726e2074686520626f72726f7765642066756e6473536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7797667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929556e6465726c79696e672061737365742073686f756c64206e6f742068617665206265656e20726567697374657265644a4954553a2063616c6c6572206973206e6f7420612077686974656c6973746564206b65657065725361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565644c6971756964697479506f6f6c56323a2053686f756c64206e6f7420616c6c6f7720455448206465706f7369747320647572696e6720455243323020746f6b656e206465706f73697473416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a26469706673582212205261e6662029385547bf5a2535ca9844ec55b4009132e23d3c343f3fa426bcc964736f6c63430007040033608060405234801561001057600080fd5b50600080546001600160a01b03191633179055610238806100326000396000f3fe60806040526004361061001e5760003560e01c8063d5badabc14610023575b600080fd5b6100a36004803603604081101561003957600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561006457600080fd5b82018360208201111561007657600080fd5b8035906020019184600183028401116401000000008311171561009857600080fd5b5090925090506100a5565b005b6000546001600160a01b031633146100ee5760405162461bcd60e51b815260040180806020018281038252602f81526020018061019a602f913960400191505060405180910390fd5b6000836001600160a01b0316348484604051808383808284376040519201945060009350909150508083038185875af1925050503d806000811461014e576040519150601f19603f3d011682016040523d82523d6000602084013e610153565b606091505b50509050806101935760405162461bcd60e51b815260040180806020018281038252603a8152602001806101c9603a913960400191505060405180910390fd5b5050505056fe426f72726f77657250726f78793a2043616c6c6572206973206e6f7420746865206c697175696469747920706f6f6c426f72726f77657250726f78793a20426f72726f77657220636f6e747261637420726576657274656420647572696e6720657865637574696f6ea2646970667358221220507ffd0441fc85a08ea09906da42b4ac5ca495da14989120d67236e6614c623864736f6c63430007040033
Deployed Bytecode
0x60806040526004361061026b5760003560e01c8063834edf4111610144578063c5b1fad1116100b6578063ecefc7051161007a578063ecefc70514610a1b578063f5b541a614610a30578063f65d901c14610a45578063f7cdf47c14610a78578063fc5eb0df14610a8d578063fc772c8b14610ac8576102ba565b8063c5b1fad11461090f578063ca15c87314610942578063ce5494bb1461096c578063d547741f1461099f578063d9caed12146109d8576102ba565b80639a0ba2ea116101085780639a0ba2ea146108055780639df51b271461082f578063a217fddf14610872578063aef67d7814610887578063c07a4c5e1461089c578063c2cac04b146108e5576102ba565b8063834edf41146107215780638456cb59146107545780639010d07c1461076957806391d14854146107995780639870d7fe146107d2576102ba565b806347e86662116101dd5780636d16acfe116101a15780636d16acfe146105ae5780636d70f7ae146105e15780636e2246a714610614578063736158d0146106a657806374fe10d0146106d95780637df1f1b91461070c576102ba565b806347e866621461049d5780635438b9e5146104ec57806355856e991461051f5780635c975abb14610552578063604267771461057b576102ba565b80632ab6f8db1161022f5780632ab6f8db146103a25780632f2ff15d146103b757806336568abe146103f05780633f4ba83a146104295780634420e4861461043e57806347e7ef2414610471576102ba565b8063017def57146102bf5780630534e74e146102eb57806316114acd14610312578063248a9ca31461034557806326a965f01461036f576102ba565b366102ba57610278610afb565b6001600160a01b03167f1e57e3bb474320be3d2c77138f75b7c3941292d647f5f9634e33a8e94e0e069b346040518082815260200191505060405180910390a2005b600080fd5b3480156102cb57600080fd5b506102e9600480360360208110156102e257600080fd5b5035610aff565b005b3480156102f757600080fd5b50610300610b90565b60408051918252519081900360200190f35b34801561031e57600080fd5b506102e96004803603602081101561033557600080fd5b50356001600160a01b0316610b96565b34801561035157600080fd5b506103006004803603602081101561036857600080fd5b5035610d68565b34801561037b57600080fd5b506102e96004803603602081101561039257600080fd5b50356001600160a01b0316610d80565b3480156103ae57600080fd5b506102e9610e0f565b3480156103c357600080fd5b506102e9600480360360408110156103da57600080fd5b50803590602001356001600160a01b0316610e19565b3480156103fc57600080fd5b506102e96004803603604081101561041357600080fd5b50803590602001356001600160a01b0316610e85565b34801561043557600080fd5b506102e9610ee6565b34801561044a57600080fd5b506102e96004803603602081101561046157600080fd5b50356001600160a01b0316610f34565b6103006004803603604081101561048757600080fd5b506001600160a01b03813516906020013561124e565b3480156104a957600080fd5b506104d0600480360360208110156104c057600080fd5b50356001600160a01b031661154b565b604080516001600160a01b039092168252519081900360200190f35b3480156104f857600080fd5b506102e96004803603602081101561050f57600080fd5b50356001600160a01b0316611566565b34801561052b57600080fd5b506102e96004803603602081101561054257600080fd5b50356001600160a01b03166115f8565b34801561055e57600080fd5b50610567611687565b604080519115158252519081900360200190f35b34801561058757600080fd5b506103006004803603602081101561059e57600080fd5b50356001600160a01b0316611690565b3480156105ba57600080fd5b506104d0600480360360208110156105d157600080fd5b50356001600160a01b03166116a2565b3480156105ed57600080fd5b506105676004803603602081101561060457600080fd5b50356001600160a01b03166116c0565b34801561062057600080fd5b506102e96004803603606081101561063757600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561066757600080fd5b82018360208201111561067957600080fd5b8035906020019184600183028401116401000000008311171561069b57600080fd5b5090925090506116e0565b3480156106b257600080fd5b50610300600480360360208110156106c957600080fd5b50356001600160a01b0316611afb565b3480156106e557600080fd5b506102e9600480360360208110156106fc57600080fd5b50356001600160a01b0316611b93565b34801561071857600080fd5b506104d0611c25565b34801561072d57600080fd5b506105676004803603602081101561074457600080fd5b50356001600160a01b0316611c34565b34801561076057600080fd5b506102e9611c49565b34801561077557600080fd5b506104d06004803603604081101561078c57600080fd5b5080359060200135611c97565b3480156107a557600080fd5b50610567600480360360408110156107bc57600080fd5b50803590602001356001600160a01b0316611cb6565b3480156107de57600080fd5b506102e9600480360360208110156107f557600080fd5b50356001600160a01b0316611cce565b34801561081157600080fd5b506104d06004803603602081101561082857600080fd5b5035611d1d565b34801561083b57600080fd5b506102e96004803603606081101561085257600080fd5b506001600160a01b03813581169160208101359091169060400135611d47565b34801561087e57600080fd5b50610300611ffa565b34801561089357600080fd5b50610300611fff565b3480156108a857600080fd5b506102e9600480360360808110156108bf57600080fd5b506001600160a01b03813581169160208101358216916040820135916060013516612005565b3480156108f157600080fd5b506102e96004803603602081101561090857600080fd5b50356121be565b34801561091b57600080fd5b506102e96004803603602081101561093257600080fd5b50356001600160a01b031661224a565b34801561094e57600080fd5b506103006004803603602081101561096557600080fd5b50356122f7565b34801561097857600080fd5b506102e96004803603602081101561098f57600080fd5b50356001600160a01b031661230e565b3480156109ab57600080fd5b506102e9600480360360408110156109c257600080fd5b50803590602001356001600160a01b0316612606565b3480156109e457600080fd5b506102e9600480360360608110156109fb57600080fd5b506001600160a01b0381358116916020810135909116906040013561265f565b348015610a2757600080fd5b506103006129be565b348015610a3c57600080fd5b506103006129c4565b348015610a5157600080fd5b506102e960048036036020811015610a6857600080fd5b50356001600160a01b03166129d6565b348015610a8457600080fd5b506104d0612a43565b348015610a9957600080fd5b5061030060048036036040811015610ab057600080fd5b506001600160a01b0381358116916020013516612a52565b348015610ad457600080fd5b506102e960048036036020811015610aeb57600080fd5b50356001600160a01b0316612bc4565b3390565b610b0f610b0a610afb565b6116c0565b610b4a5760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b600954811115610b8b5760405162461bcd60e51b8152600401808060200182810382526035815260200180613de46035913960400191505060405180910390fd5b600755565b60085481565b610ba1610b0a610afb565b610bdc5760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b6001600160a01b03811660009081526001602052604090205460ff1615610c345760405162461bcd60e51b815260040180806020018281038252602a815260200180613caf602a913960400191505060405180910390fd5b6001600160a01b038116610cd757604051600090339047908381818185875af1925050503d8060008114610c84576040519150601f19603f3d011682016040523d82523d6000602084013e610c89565b606091505b5050905080610cd1576040805162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8811985a5b1959608a1b604482015290519081900360640190fd5b50610d65565b610d6533826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610d2857600080fd5b505afa158015610d3c573d6000803e3d6000fd5b505050506040513d6020811015610d5257600080fd5b50516001600160a01b0384169190612e70565b50565b6000818152602081905260409020600201545b919050565b610d8b610b0a610afb565b610dc65760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b6001600160a01b0381166000818152600f6020526040808220805460ff19169055517f79bf5efab685b39bdd2b7b1aba09ffa5e9dfbd86f7aaebab4b52d7ef679d28449190a250565b610e17612ec7565b565b600082815260208190526040902060020154610e3c90610e37610afb565b611cb6565b610e775760405162461bcd60e51b815260040180806020018281038252602f815260200180613c0c602f913960400191505060405180910390fd5b610e818282612ed0565b5050565b610e8d610afb565b6001600160a01b0316816001600160a01b031614610edc5760405162461bcd60e51b815260040180806020018281038252602f815260200180613faf602f913960400191505060405180910390fd5b610e818282612f39565b610ef1610b0a610afb565b610f2c5760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b610e17612fa2565b610f3f610b0a610afb565b610f7a5760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b60006001600160a01b031660046000836001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc257600080fd5b505afa158015610fd6573d6000803e3d6000fd5b505050506040513d6020811015610fec57600080fd5b50516001600160a01b03908116825260208201929092526040016000205416146110475760405162461bcd60e51b8152600401808060200182810382526030815260200180613ee36030913960400191505060405180910390fd5b6001600160a01b03811660009081526005602052604090205460ff161561109f5760405162461bcd60e51b8152600401808060200182810382526026815260200180613cd96026913960400191505060405180910390fd5b8060046000836001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b1580156110dd57600080fd5b505afa1580156110f1573d6000803e3d6000fd5b505050506040513d602081101561110757600080fd5b50516001600160a01b0390811682526020808301939093526040918201600090812080546001600160a01b0319169583169590951790945584168084526005835292819020805460ff191660011790558051636f307dc360e01b81529051600a9392636f307dc39260048082019391829003018186803b15801561118a57600080fd5b505afa15801561119e573d6000803e3d6000fd5b505050506040513d60208110156111b457600080fd5b5051815460018101835560009283526020928390200180546001600160a01b0319166001600160a01b0392831617905560408051636f307dc360e01b81529051610d659392851692636f307dc39260048082019391829003018186803b15801561121d57600080fd5b505afa158015611231573d6000803e3d6000fd5b505050506040513d602081101561124757600080fd5b50516129d6565b6000600280541415611295576040805162461bcd60e51b815260206004820152601f6024820152600080516020613c3b833981519152604482015290519081900360640190fd5b600280556112a1611687565b156112e6576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6001600160a01b03808416600090815260046020526040902054168061134d576040805162461bcd60e51b8152602060048201526017602482015276151bdad95b881a5cc81b9bdd081c9959da5cdd195c9959604a1b604482015290519081900360640190fd5b6000831161138c5760405162461bcd60e51b8152600401808060200182810382526027815260200180613c5b6027913960400191505060405180910390fd5b600b546001600160a01b038581169116146114005734156113de5760405162461bcd60e51b815260040180806020018281038252604a815260200180613f65604a913960600191505060405180910390fd5b6113fb6113e9610afb565b6001600160a01b038616903086613042565b61144b565b34831461144b576040805162461bcd60e51b8152602060048201526014602482015273125b98dbdc9c9958dd08195d1a08185b5bdd5b9d60621b604482015290519081900360640190fd5b60006114588286866130a2565b9050816001600160a01b03166340c10f19611471610afb565b836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156114b857600080fd5b505af11580156114cc573d6000803e3d6000fd5b505050506040513d60208110156114e257600080fd5b50506001600160a01b0385166114f6610afb565b6001600160a01b03167ff5681f9d0db1b911ac18ee83d515a1cf1051853a9eae418316a2fdf7dea427c58684604051808381526020018281526020019250505060405180910390a36001600255949350505050565b6004602052600090815260409020546001600160a01b031681565b611571610b0a610afb565b6115ac5760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b6001600160a01b0381166000818152600f6020526040808220805460ff19166001179055517f2a2bdc1c5305d6bc286de7c1efdeea7b3e248488284891625ce2e0ce38ffafe29190a250565b611603610b0a610afb565b61163e5760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b6001600160a01b038116600081815260106020526040808220805460ff19169055517f513d24f92767da445cdd7d7d20aef2adde58d95ab5557373adf11e549906f7649190a250565b60035460ff1690565b60066020526000908152604090205481565b6001600160a01b039081166000908152600460205260409020541690565b60006116da600080516020613ec383398151915283611cb6565b92915050565b600280541415611725576040805162461bcd60e51b815260206004820152601f6024820152600080516020613c3b833981519152604482015290519081900360640190fd5b60028055611731611687565b15611776576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6001600160a01b03848116600090815260046020526040902054166117dc576040805162461bcd60e51b8152602060048201526017602482015276151bdad95b881a5cc81b9bdd081c9959da5cdd195c9959604a1b604482015290519081900360640190fd5b60006117e785611afb565b600b549091506001600160a01b038681169116146118205761181b61180a610afb565b6001600160a01b0387169086612e70565b6118bc565b600061182a610afb565b6040516001600160a01b0391909116908690600081818185875af1925050503d8060008114611875576040519150601f19603f3d011682016040523d82523d6000602084013e61187a565b606091505b50509050806118ba5760405162461bcd60e51b8152600401808060200182810382526035815260200180613daf6035913960400191505060405180910390fd5b505b600d546001600160a01b031663d5badabc6118d5610afb565b85856040518463ffffffff1660e01b815260040180846001600160a01b03168152602001806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050945050505050600060405180830381600087803b15801561194857600080fd5b505af115801561195c573d6000803e3d6000fd5b50505050600061196b86611afb565b9050818110156119ac5760405162461bcd60e51b815260040180806020018281038252602c815260200180613e76602c913960400191505060405180910390fd5b60006119b88284613181565b905060006119c8600854836131de565b9050876001600160a01b03166119dc610afb565b6001600160a01b03167fc14e9e6b4d98a542b05a0f6b64acd5f4cbdb914be88432d87486b664e97071a78985604051808381526020018281526020019250505060405180910390a3600b546001600160a01b03898116911614611a5857600c54611a53906001600160a01b038a8116911683612e70565b611aec565b600c546040516000916001600160a01b03169083908381818185875af1925050503d8060008114611aa5576040519150601f19603f3d011682016040523d82523d6000602084013e611aaa565b606091505b5050905080611aea5760405162461bcd60e51b8152600401808060200182810382526035815260200180613e196035913960400191505060405180910390fd5b505b50506001600255505050505050565b600b546000906001600160a01b0383811691161415611b1b575047610d7b565b604080516370a0823160e01b815230600482015290516001600160a01b038416916370a08231916024808301926020929190829003018186803b158015611b6157600080fd5b505afa158015611b75573d6000803e3d6000fd5b505050506040513d6020811015611b8b57600080fd5b505192915050565b611b9e610b0a610afb565b611bd95760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b6001600160a01b038116600081815260106020526040808220805460ff19166001179055517fb1ca29f3640ee298435a000f39125155cfa037ae91b01a14e90e61783d3a86199190a250565b600d546001600160a01b031681565b60056020526000908152604090205460ff1681565b611c54610b0a610afb565b611c8f5760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b610e176131f2565b6000828152602081905260408120611caf9083613275565b9392505050565b6000828152602081905260408120611caf9083613281565b611cd9610b0a610afb565b611d145760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b610d6581613296565b600a8181548110611d2d57600080fd5b6000918252602090912001546001600160a01b0316905081565b3360009081526010602052604090205460ff16611d955760405162461bcd60e51b815260040180806020018281038252602d815260200180613c82602d913960400191505060405180910390fd5b600280541415611dda576040805162461bcd60e51b815260206004820152601f6024820152600080516020613c3b833981519152604482015290519081900360640190fd5b60028055611de6611687565b15611e2b576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b826001600160a01b031663f516b2ee83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015611e8257600080fd5b505af1158015611e96573d6000803e3d6000fd5b50611eaf925050506001600160a01b03831684836132e5565b826001600160a01b03166388180ff683836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015611f0657600080fd5b505af1158015611f1a573d6000803e3d6000fd5b5050506001600160a01b038316600090815260066020526040902054611f419150826133d0565b6001600160a01b03838116600081815260066020908152604080832095909555878416808352600e825285832086518088018852858152808401898152825460018082018555938752958590209151600290960290910180546001600160a01b0319169590971694909417865592519490920193909355835185815293519193339391927fb10e597c7b0d304913e7bdf6f11b0294d08f6494413b33e0ca6ba6918ef3db46929181900390910190a45050600160025550565b600081565b60075481565b336000908152600f602052604090205460ff166120535760405162461bcd60e51b8152600401808060200182810382526028815260200180613f136028913960400191505060405180910390fd5b600280541415612098576040805162461bcd60e51b815260206004820152601f6024820152600080516020613c3b833981519152604482015290519081900360640190fd5b600280556120a4611687565b156120e9576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6040805163603d262f60e11b81523360048201526001600160a01b03858116602483015260448201859052838116606483015291519186169163c07a4c5e9160848082019260009290919082900301818387803b15801561214957600080fd5b505af115801561215d573d6000803e3d6000fd5b5050604080516001600160a01b0387811682526020820187905285811682840152915133945091881692507f488f4cb3bd06b31ff94bcb19ad4a9a453a700637ca4dce451a611e9ae58c9874919081900360600190a3505060016002555050565b6121c9610b0a610afb565b6122045760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b6009548111156122455760405162461bcd60e51b8152600401808060200182810382526035815260200180613de46035913960400191505060405180910390fd5b600855565b612255610b0a610afb565b6122905760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b6001600160a01b0381166122d55760405162461bcd60e51b8152600401808060200182810382526026815260200180613d896026913960400191505060405180910390fd5b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b60008181526020819052604081206116da9061342a565b612319610b0a610afb565b6123545760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b60005b600a548110156125af576000600a828154811061237057fe5b60009182526020808320909101546001600160a01b039081168084526004928390526040808520548151634c1d96ab60e11b81528985169581019590955290519195509091169263983b2d56926024808201939182900301818387803b1580156123d957600080fd5b505af11580156123ed573d6000803e3d6000fd5b505050506001600160a01b038181166000908152600460208190526040808320548151639865027560e01b8152915194169363986502759382840193909282900301818387803b15801561244057600080fd5b505af1158015612454573d6000803e3d6000fd5b505050506001600160a01b038181166000908152600460208190526040808320548151632210724360e11b8152908516928101929092525192861692634420e4869260248084019391929182900301818387803b1580156124b457600080fd5b505af11580156124c8573d6000803e3d6000fd5b5050600b546001600160a01b038481169116149150612506905057612501836124f083611afb565b6001600160a01b0384169190612e70565b6125a6565b6000836001600160a01b031661251b83611afb565b604051600081818185875af1925050503d8060008114612557576040519150601f19603f3d011682016040523d82523d6000602084013e61255c565b606091505b50509050806125a4576040805162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8811985a5b1959608a1b604482015290519081900360640190fd5b505b50600101612357565b50806001600160a01b0316632ab6f8db6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156125eb57600080fd5b505af11580156125ff573d6000803e3d6000fd5b5050505050565b60008281526020819052604090206002015461262490610e37610afb565b610edc5760405162461bcd60e51b8152600401808060200182810382526030815260200180613d596030913960400191505060405180910390fd5b6002805414156126a4576040805162461bcd60e51b815260206004820152601f6024820152600080516020613c3b833981519152604482015290519081900360640190fd5b600280556126b0611687565b156126f5576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6001600160a01b03821660009081526005602052604090205460ff16612762576040805162461bcd60e51b815260206004820152601860248201527f6b546f6b656e206973206e6f7420726567697374657265640000000000000000604482015290519081900360640190fd5b600081116127a15760405162461bcd60e51b8152600401808060200182810382526028815260200180613e4e6028913960400191505060405180910390fd5b6000826001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b1580156127dc57600080fd5b505afa1580156127f0573d6000803e3d6000fd5b505050506040513d602081101561280657600080fd5b505190506000612817848385613435565b9050836001600160a01b03166379cc6790612830610afb565b856040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561287757600080fd5b505af115801561288b573d6000803e3d6000fd5b5050600b546001600160a01b0385811691161491506128bf9050576128ba6001600160a01b0383168683612e70565b612959565b6040516000906001600160a01b0387169083908381818185875af1925050503d806000811461290a576040519150601f19603f3d011682016040523d82523d6000602084013e61290f565b606091505b5050905080612957576040805162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8811985a5b1959608a1b604482015290519081900360640190fd5b505b816001600160a01b031661296b610afb565b604080518481526020810187905281516001600160a01b03938416938a16927f66d8849e904432a33a6c0adbb12d9cf486cc99e88c79160e8b1933b6c6644d59928290030190a450506001600255505050565b60095481565b600080516020613ec383398151915281565b6129e1610b0a610afb565b612a1c5760405162461bcd60e51b8152600401808060200182810382526034815260200180613cff6034913960400191505060405180910390fd5b6001600160a01b03166000908152600160208190526040909120805460ff19169091179055565b600b546001600160a01b031681565b6001600160a01b0380831660009081526004602081815260408084205481516370a0823160e01b8152878716948101949094529051939485949116926370a08231926024808301939192829003018186803b158015612ab057600080fd5b505afa158015612ac4573d6000803e3d6000fd5b505050506040513d6020811015612ada57600080fd5b50516001600160a01b0380861660009081526004602081815260408084205481516318160ddd60e01b81529151969750939593909416936318160ddd93818401939091829003018186803b158015612b3157600080fd5b505afa158015612b45573d6000803e3d6000fd5b505050506040513d6020811015612b5b57600080fd5b5051905081612b6f576000925050506116da565b612bbb81612bb584612baf600660008b6001600160a01b03166001600160a01b0316815260200190815260200160002054612ba98b611afb565b906133d0565b906135e7565b90613640565b95945050505050565b3360009081526010602052604090205460ff16612c125760405162461bcd60e51b815260040180806020018281038252602d815260200180613c82602d913960400191505060405180910390fd5b600280541415612c57576040805162461bcd60e51b815260206004820152601f6024820152600080516020613c3b833981519152604482015290519081900360640190fd5b60028055612c63611687565b15612ca8576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b806001600160a01b03166380e9071b6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612ce357600080fd5b505af1158015612cf7573d6000803e3d6000fd5b5050506001600160a01b0382166000908152600e602090815260408083208054825181850281018501909352808352606095509193909284015b82821015612d79576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101612d31565b5050506001600160a01b0384166000908152600e60205260408120929350612da2929150613b87565b60005b8151811015612e1b57612db6613ba8565b828281518110612dc257fe5b6020908102919091018101518082015181516001600160a01b031660009081526006909352604090922054909250612df991613181565b90516001600160a01b0316600090815260066020526040902055600101612da5565b5060405133906001600160a01b038416907fbd017690b083822e9e6492566f5c0f4b3e2a7ed256a360f458eb627ce9037cd390600090a350506001600255565b6000611caf836001600160a01b0384166136a7565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612ec29084906136f1565b505050565b610e17336137a2565b6000828152602081905260409020612ee89082612e5b565b15610e8157612ef5610afb565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081905260409020612f5190826137f1565b15610e8157612f5e610afb565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b612faa611687565b612ff2576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6003805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa613025610afb565b604080516001600160a01b039092168252519081900360200190a1565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261309c9085906136f1565b50505050565b6001600160a01b03821660009081526006602052604081205481906130d490612ba9856130ce88611afb565b90613181565b90506000856001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561311157600080fd5b505afa158015613125573d6000803e3d6000fd5b505050506040513d602081101561313b57600080fd5b505190508061314e578392505050611caf565b613177613167613160600754876131de565b84906133d0565b612bb583612baf60075489613806565b9695505050505050565b6000828211156131d8576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600954600090611caf90612bb584866135e7565b6131fa611687565b1561323f576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6003805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613025610afb565b6000611caf8383613824565b6000611caf836001600160a01b038416613888565b6132ae600080516020613ec383398151915282610e19565b6040516001600160a01b038216907fac6fa858e9350a46cec16539926e0fde25b7629f84b5a72bffaae4df888ae86d90600090a250565b600061337b82856001600160a01b031663dd62ed3e30876040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b15801561334957600080fd5b505afa15801561335d573d6000803e3d6000fd5b505050506040513d602081101561337357600080fd5b5051906133d0565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905290915061309c9085906136f1565b600082820183811015611caf576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006116da826138a0565b600080846001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561347157600080fd5b505afa158015613485573d6000803e3d6000fd5b505050506040513d602081101561349b57600080fd5b50519050806134ea576040805162461bcd60e51b8152602060048201526016602482015275139bc812d51bdad95b9cc81d1bc8189948189d5c9b9d60521b604482015290519081900360640190fd5b60006134f585611afb565b90506000613590876001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561353557600080fd5b505afa158015613549573d6000803e3d6000fd5b505050506040513d602081101561355f57600080fd5b50516001600160a01b038816600090815260066020526040902054612bb5906135899086906133d0565b88906135e7565b905081811115613177576040805162461bcd60e51b815260206004820152601b60248201527f496e73756666696369656e7420706f6f6c206c69717569646974790000000000604482015290519081900360640190fd5b6000826135f6575060006116da565b8282028284828161360357fe5b0414611caf5760405162461bcd60e51b8152600401808060200182810382526021815260200180613ea26021913960400191505060405180910390fd5b6000808211613696576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161369f57fe5b049392505050565b60006136b38383613888565b6136e9575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556116da565b5060006116da565b6060613746826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166138a49092919063ffffffff16565b805190915015612ec25780806020019051602081101561376557600080fd5b5051612ec25760405162461bcd60e51b815260040180806020018281038252602a815260200180613f3b602a913960400191505060405180910390fd5b6137ba600080516020613ec383398151915282610e85565b6040516001600160a01b038216907f80c0b871b97b595b16a7741c1b06fed0c6f6f558639f18ccbce50724325dc40d90600090a250565b6000611caf836001600160a01b0384166138bb565b600954600090611caf90612bb561381d8287613181565b85906135e7565b815460009082106138665760405162461bcd60e51b8152600401808060200182810382526022815260200180613bea6022913960400191505060405180910390fd5b82600001828154811061387557fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b5490565b60606138b38484600085613981565b949350505050565b6000818152600183016020526040812054801561397757835460001980830191908101906000908790839081106138ee57fe5b906000526020600020015490508087600001848154811061390b57fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061393b57fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506116da565b60009150506116da565b6060824710156139c25760405162461bcd60e51b8152600401808060200182810382526026815260200180613d336026913960400191505060405180910390fd5b6139cb85613add565b613a1c576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310613a5b5780518252601f199092019160209182019101613a3c565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613abd576040519150601f19603f3d011682016040523d82523d6000602084013e613ac2565b606091505b5091509150613ad2828286613ae3565b979650505050505050565b3b151590565b60608315613af2575081611caf565b825115613b025782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613b4c578181015183820152602001613b34565b50505050905090810190601f168015613b795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5080546000825560020290600052602060002090810190610d659190613bbf565b604080518082019091526000808252602082015290565b5b80821115613be55780546001600160a01b031916815560006001820155600201613bc0565b509056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e745265656e7472616e637947756172643a207265656e7472616e742063616c6c004465706f73697420616d6f756e742073686f756c642062652067726561746572207468616e20304a4954553a2063616c6c6572206973206e6f7420612077686974656c697374656420756e64657277726974657243616e5265636c61696d546f6b656e733a20746f6b656e206973206e6f74207265636f76657261626c656b546f6b656e2073686f756c64206e6f742068617665206265656e20726567697374657265644f70657261746f72526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204f70657261746f7220726f6c65416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b654c6971756964697479506f6f6c56323a20666565706f6f6c2063616e6e6f74206265203078304c6971756964697479506f6f6c56313a206661696c656420746f2073656e642066756e647320746f2074686520626f72726f7765724c6971756964697479506f6f6c56313a206665652073686f756c64206265206265747765656e203020616e64204645455f424153454c6971756964697479506f6f6c56313a206661696c656420746f2073656e642066756e647320746f207468652066656520706f6f6c576974686472617720616d6f756e742073686f756c642062652067726561746572207468616e2030426f72726f776572206661696c656420746f2072657475726e2074686520626f72726f7765642066756e6473536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7797667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929556e6465726c79696e672061737365742073686f756c64206e6f742068617665206265656e20726567697374657265644a4954553a2063616c6c6572206973206e6f7420612077686974656c6973746564206b65657065725361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565644c6971756964697479506f6f6c56323a2053686f756c64206e6f7420616c6c6f7720455448206465706f7369747320647572696e6720455243323020746f6b656e206465706f73697473416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a26469706673582212205261e6662029385547bf5a2535ca9844ec55b4009132e23d3c343f3fa426bcc964736f6c63430007040033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ 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.