Source Code
Latest 18 from a total of 18 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Deploy | 9585607 | 501 days ago | IN | 0 FRAX | 0.00000145 | ||||
| Deploy | 8038839 | 536 days ago | IN | 0 FRAX | 0.00000136 | ||||
| Deploy | 7776589 | 542 days ago | IN | 0 FRAX | 0.00000128 | ||||
| Deploy | 7253243 | 555 days ago | IN | 0 FRAX | 0.00000321 | ||||
| Deploy | 7217767 | 555 days ago | IN | 0 FRAX | 0.0000011 | ||||
| Deploy | 4802673 | 611 days ago | IN | 0 FRAX | 0.00000231 | ||||
| Deploy | 4802597 | 611 days ago | IN | 0 FRAX | 0.00000227 | ||||
| Deploy | 3972783 | 630 days ago | IN | 0 FRAX | 0.00000241 | ||||
| Deploy | 3890183 | 632 days ago | IN | 0 FRAX | 0.00000428 | ||||
| Deploy | 3839395 | 634 days ago | IN | 0 FRAX | 0.00000437 | ||||
| Deploy | 3839351 | 634 days ago | IN | 0 FRAX | 0.00000472 | ||||
| Deploy | 3838270 | 634 days ago | IN | 0 FRAX | 0.00000504 | ||||
| Deploy | 3836582 | 634 days ago | IN | 0 FRAX | 0.00000451 | ||||
| Deploy | 3836502 | 634 days ago | IN | 0 FRAX | 0.00000475 | ||||
| Deploy | 1132521 | 696 days ago | IN | 0 FRAX | 0.00854644 | ||||
| Deploy | 1127813 | 696 days ago | IN | 0 FRAX | 0.00855609 | ||||
| Deploy | 1120970 | 696 days ago | IN | 0 FRAX | 0.00861402 | ||||
| Set Creation Cod... | 947397 | 700 days ago | IN | 0 FRAX | 0.02195576 |
Latest 19 internal transactions
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 9585607 | 501 days ago | Contract Creation | 0 FRAX | |||
| 8038839 | 536 days ago | Contract Creation | 0 FRAX | |||
| 7776589 | 542 days ago | Contract Creation | 0 FRAX | |||
| 7253243 | 555 days ago | Contract Creation | 0 FRAX | |||
| 7217767 | 555 days ago | Contract Creation | 0 FRAX | |||
| 4802673 | 611 days ago | Contract Creation | 0 FRAX | |||
| 4802597 | 611 days ago | Contract Creation | 0 FRAX | |||
| 3972783 | 630 days ago | Contract Creation | 0 FRAX | |||
| 3890183 | 632 days ago | Contract Creation | 0 FRAX | |||
| 3839395 | 634 days ago | Contract Creation | 0 FRAX | |||
| 3839351 | 634 days ago | Contract Creation | 0 FRAX | |||
| 3838270 | 634 days ago | Contract Creation | 0 FRAX | |||
| 3836582 | 634 days ago | Contract Creation | 0 FRAX | |||
| 3836502 | 634 days ago | Contract Creation | 0 FRAX | |||
| 1132521 | 696 days ago | Contract Creation | 0 FRAX | |||
| 1127813 | 696 days ago | Contract Creation | 0 FRAX | |||
| 1120970 | 696 days ago | Contract Creation | 0 FRAX | |||
| 947397 | 700 days ago | Contract Creation | 0 FRAX | |||
| 947397 | 700 days ago | Contract Creation | 0 FRAX |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
FraxlendPairDeployer
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
No with 1000000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: ISC
pragma solidity ^0.8.19;
// ====================================================================
// | ______ _______ |
// | / _____________ __ __ / ____(_____ ____ _____ ________ |
// | / /_ / ___/ __ `| |/_/ / /_ / / __ \/ __ `/ __ \/ ___/ _ \ |
// | / __/ / / / /_/ _> < / __/ / / / / / /_/ / / / / /__/ __/ |
// | /_/ /_/ \__,_/_/|_| /_/ /_/_/ /_/\__,_/_/ /_/\___/\___/ |
// | |
// ====================================================================
// ====================== FraxlendPairDeployer ========================
// ====================================================================
// Frax Finance: https://github.com/FraxFinance
// Primary Author
// Drake Evans: https://github.com/DrakeEvans
// Reviewers
// Dennis: https://github.com/denett
// Sam Kazemian: https://github.com/samkazemian
// Travis Moore: https://github.com/FortisFortuna
// Jack Corddry: https://github.com/corddry
// Rich Gee: https://github.com/zer0blockchain
// ====================================================================
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";
import { SSTORE2 } from "@rari-capital/solmate/src/utils/SSTORE2.sol";
import { BytesLib } from "solidity-bytes-utils/contracts/BytesLib.sol";
import { IFraxlendWhitelist } from "./interfaces/IFraxlendWhitelist.sol";
import { IFraxlendPair } from "./interfaces/IFraxlendPair.sol";
import { IFraxlendPairRegistry } from "./interfaces/IFraxlendPairRegistry.sol";
import { SafeERC20 } from "./libraries/SafeERC20.sol";
// solhint-disable no-inline-assembly
struct ConstructorParams {
address circuitBreaker;
address comptroller;
address timelock;
address fraxlendWhitelist;
address fraxlendPairRegistry;
}
/// @title FraxlendPairDeployer
/// @author Drake Evans (Frax Finance) https://github.com/drakeevans
/// @notice Deploys and initializes new FraxlendPairs
/// @dev Uses create2 to deploy the pairs, logs an event, and records a list of all deployed pairs
contract FraxlendPairDeployer is Ownable {
using Strings for uint256;
using SafeERC20 for IERC20;
// Storage
address public contractAddress1;
address public contractAddress2;
// Admin contracts
address public circuitBreakerAddress;
address public comptrollerAddress;
address public timelockAddress;
address public fraxlendPairRegistryAddress;
address public fraxlendWhitelistAddress;
// Default swappers
address[] public defaultSwappers;
/// @notice Emits when a new pair is deployed
/// @notice The ```LogDeploy``` event is emitted when a new Pair is deployed
/// @param address_ The address of the pair
/// @param asset The address of the Asset Token contract
/// @param collateral The address of the Collateral Token contract
/// @param name The name of the Pair
/// @param configData The config data of the Pair
/// @param immutables The immutables of the Pair
/// @param customConfigData The custom config data of the Pair
event LogDeploy(
address indexed address_,
address indexed asset,
address indexed collateral,
string name,
bytes configData,
bytes immutables,
bytes customConfigData
);
/// @notice List of the names of all deployed Pairs
address[] public deployedPairsArray;
constructor(ConstructorParams memory _params) Ownable() {
circuitBreakerAddress = _params.circuitBreaker;
comptrollerAddress = _params.comptroller;
timelockAddress = _params.timelock;
fraxlendWhitelistAddress = _params.fraxlendWhitelist;
fraxlendPairRegistryAddress = _params.fraxlendPairRegistry;
}
function version() external pure returns (uint256 _major, uint256 _minor, uint256 _patch) {
return (4, 1, 0);
}
// ============================================================================================
// Functions: View Functions
// ============================================================================================
/// @notice The ```deployedPairsLength``` function returns the length of the deployedPairsArray
/// @return length of array
function deployedPairsLength() external view returns (uint256) {
return deployedPairsArray.length;
}
/// @notice The ```getAllPairAddresses``` function returns all pair addresses in deployedPairsArray
/// @return _deployedPairs memory All deployed pair addresses
function getAllPairAddresses() external view returns (address[] memory _deployedPairs) {
_deployedPairs = deployedPairsArray;
}
function getNextNameSymbol(
address _asset,
address _collateral
) public view returns (string memory _name, string memory _symbol) {
uint256 _length = IFraxlendPairRegistry(fraxlendPairRegistryAddress).deployedPairsLength();
_name = string(
abi.encodePacked(
"Fraxlend Interest Bearing ",
IERC20(_asset).safeSymbol(),
" (",
IERC20(_collateral).safeName(),
")",
" - ",
(_length + 1).toString()
)
);
_symbol = string(
abi.encodePacked(
"f",
IERC20(_asset).safeSymbol(),
"(",
IERC20(_collateral).safeSymbol(),
")",
"-",
(_length + 1).toString()
)
);
}
// ============================================================================================
// Functions: Setters
// ============================================================================================
/// @notice The ```setCreationCode``` function sets the bytecode for the fraxlendPair
/// @dev splits the data if necessary to accommodate creation code that is slightly larger than 24kb
/// @param _creationCode The creationCode for the Fraxlend Pair
function setCreationCode(bytes calldata _creationCode) external onlyOwner {
bytes memory _firstHalf = BytesLib.slice(_creationCode, 0, 13_000);
contractAddress1 = SSTORE2.write(_firstHalf);
if (_creationCode.length > 13_000) {
bytes memory _secondHalf = BytesLib.slice(_creationCode, 13_000, _creationCode.length - 13_000);
contractAddress2 = SSTORE2.write(_secondHalf);
}
}
/// @notice The ```setDefaultSwappers``` function is used to set default list of approved swappers
/// @param _swappers The list of swappers to set as default allowed
function setDefaultSwappers(address[] memory _swappers) external onlyOwner {
defaultSwappers = _swappers;
}
/// @notice The ```SetTimelock``` event is emitted when the timelockAddress is set
/// @param oldAddress The original address
/// @param newAddress The new address
event SetTimelock(address oldAddress, address newAddress);
/// @notice The ```setTimelock``` function sets the timelockAddress
/// @param _newAddress the new time lock address
function setTimelock(address _newAddress) external onlyOwner {
emit SetTimelock(timelockAddress, _newAddress);
timelockAddress = _newAddress;
}
/// @notice The ```SetRegistry``` event is emitted when the fraxlendPairRegistryAddress is set
/// @param oldAddress The old address
/// @param newAddress The new address
event SetRegistry(address oldAddress, address newAddress);
/// @notice The ```setRegistry``` function sets the fraxlendPairRegistryAddress
/// @param _newAddress The new address
function setRegistry(address _newAddress) external onlyOwner {
emit SetRegistry(fraxlendPairRegistryAddress, _newAddress);
fraxlendPairRegistryAddress = _newAddress;
}
/// @notice The ```SetComptroller``` event is emitted when the comptrollerAddress is set
/// @param oldAddress The old address
/// @param newAddress The new address
event SetComptroller(address oldAddress, address newAddress);
/// @notice The ```setComptroller``` function sets the comptrollerAddress
/// @param _newAddress The new address
function setComptroller(address _newAddress) external onlyOwner {
emit SetComptroller(comptrollerAddress, _newAddress);
comptrollerAddress = _newAddress;
}
/// @notice The ```SetWhitelist``` event is emitted when the fraxlendWhitelistAddress is set
/// @param oldAddress The old address
/// @param newAddress The new address
event SetWhitelist(address oldAddress, address newAddress);
/// @notice The ```setWhitelist``` function sets the fraxlendWhitelistAddress
/// @param _newAddress The new address
function setWhitelist(address _newAddress) external onlyOwner {
emit SetWhitelist(fraxlendWhitelistAddress, _newAddress);
fraxlendWhitelistAddress = _newAddress;
}
/// @notice The ```SetCircuitBreaker``` event is emitted when the circuitBreakerAddress is set
/// @param oldAddress The old address
/// @param newAddress The new address
event SetCircuitBreaker(address oldAddress, address newAddress);
/// @notice The ```setCircuitBreaker``` function sets the circuitBreakerAddress
/// @param _newAddress The new address
function setCircuitBreaker(address _newAddress) external onlyOwner {
emit SetCircuitBreaker(circuitBreakerAddress, _newAddress);
circuitBreakerAddress = _newAddress;
}
// ============================================================================================
// Functions: Internal Methods
// ============================================================================================
/// @notice The ```_deploy``` function is an internal function with deploys the pair
/// @param _configData abi.encode(address _asset, address _collateral, address _oracle, uint32 _maxOracleDeviation, address _rateContract, uint64 _fullUtilizationRate, uint256 _maxLTV, uint256 _cleanLiquidationFee, uint256 _dirtyLiquidationFee, uint256 _protocolLiquidationFee)
/// @param _immutables abi.encode(address _circuitBreakerAddress, address _comptrollerAddress, address _timelockAddress)
/// @param _customConfigData abi.encode(string memory _nameOfContract, string memory _symbolOfContract, uint8 _decimalsOfContract)
/// @return _pairAddress The address to which the Pair was deployed
function _deploy(
bytes memory _configData,
bytes memory _immutables,
bytes memory _customConfigData
) private returns (address _pairAddress) {
// Get creation code
bytes memory _creationCode = BytesLib.concat(SSTORE2.read(contractAddress1), SSTORE2.read(contractAddress2));
// Get bytecode
bytes memory bytecode = abi.encodePacked(
_creationCode,
abi.encode(_configData, _immutables, _customConfigData)
);
// Generate salt using constructor params
bytes32 salt = keccak256(abi.encodePacked(_configData, _immutables, _customConfigData));
/// @solidity memory-safe-assembly
assembly {
_pairAddress := create2(0, add(bytecode, 32), mload(bytecode), salt)
}
if (_pairAddress == address(0)) revert Create2Failed();
deployedPairsArray.push(_pairAddress);
// Set additional values for FraxlendPair
IFraxlendPair _fraxlendPair = IFraxlendPair(_pairAddress);
address[] memory _defaultSwappers = defaultSwappers;
for (uint256 i = 0; i < _defaultSwappers.length; i++) {
_fraxlendPair.setSwapper(_defaultSwappers[i], true);
}
return _pairAddress;
}
// ============================================================================================
// Functions: External Deploy Methods
// ============================================================================================
/// @notice The ```deploy``` function allows the deployment of a FraxlendPair with default values
/// @param _configData abi.encode(address _asset, address _collateral, address _oracle, uint32 _maxOracleDeviation, address _rateContract, uint64 _fullUtilizationRate, uint256 _maxLTV, uint256 _cleanLiquidationFee, uint256 _dirtyLiquidationFee, uint256 _protocolLiquidationFee)
/// @return _pairAddress The address to which the Pair was deployed
function deploy(bytes memory _configData) external returns (address _pairAddress) {
if (!IFraxlendWhitelist(fraxlendWhitelistAddress).fraxlendDeployerWhitelist(msg.sender)) {
revert WhitelistedDeployersOnly();
}
(address _asset, address _collateral, , , , , , , ) = abi.decode(
_configData,
(address, address, address, uint32, address, uint64, uint256, uint256, uint256)
);
(string memory _name, string memory _symbol) = getNextNameSymbol(_asset, _collateral);
bytes memory _immutables = abi.encode(circuitBreakerAddress, comptrollerAddress, timelockAddress);
bytes memory _customConfigData = abi.encode(_name, _symbol, IERC20(_asset).safeDecimals());
_pairAddress = _deploy(_configData, _immutables, _customConfigData);
IFraxlendPairRegistry(fraxlendPairRegistryAddress).addPair(_pairAddress);
emit LogDeploy(_pairAddress, _asset, _collateral, _name, _configData, _immutables, _customConfigData);
}
// ============================================================================================
// Functions: Admin
// ============================================================================================
/// @notice The ```globalPause``` function calls the pause() function on a given set of pair addresses
/// @dev Ignores reverts when calling pause()
/// @param _addresses Addresses to attempt to pause()
/// @return _updatedAddresses Addresses for which pause() was successful
function globalPause(address[] memory _addresses) external returns (address[] memory _updatedAddresses) {
if (msg.sender != circuitBreakerAddress) revert CircuitBreakerOnly();
address _pairAddress;
uint256 _lengthOfArray = _addresses.length;
_updatedAddresses = new address[](_lengthOfArray);
for (uint256 i = 0; i < _lengthOfArray; ) {
_pairAddress = _addresses[i];
try IFraxlendPair(_pairAddress).pause() {
_updatedAddresses[i] = _addresses[i];
} catch {}
unchecked {
i = i + 1;
}
}
}
// ============================================================================================
// Errors
// ============================================================================================
error CircuitBreakerOnly();
error WhitelistedDeployersOnly();
error Create2Failed();
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Read and write to persistent storage at a fraction of the cost.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/SSTORE2.sol)
/// @author Modified from 0xSequence (https://github.com/0xSequence/sstore2/blob/master/contracts/SSTORE2.sol)
library SSTORE2 {
uint256 internal constant DATA_OFFSET = 1; // We skip the first byte as it's a STOP opcode to ensure the contract can't be called.
/*//////////////////////////////////////////////////////////////
WRITE LOGIC
//////////////////////////////////////////////////////////////*/
function write(bytes memory data) internal returns (address pointer) {
// Prefix the bytecode with a STOP opcode to ensure it cannot be called.
bytes memory runtimeCode = abi.encodePacked(hex"00", data);
bytes memory creationCode = abi.encodePacked(
//---------------------------------------------------------------------------------------------------------------//
// Opcode | Opcode + Arguments | Description | Stack View //
//---------------------------------------------------------------------------------------------------------------//
// 0x60 | 0x600B | PUSH1 11 | codeOffset //
// 0x59 | 0x59 | MSIZE | 0 codeOffset //
// 0x81 | 0x81 | DUP2 | codeOffset 0 codeOffset //
// 0x38 | 0x38 | CODESIZE | codeSize codeOffset 0 codeOffset //
// 0x03 | 0x03 | SUB | (codeSize - codeOffset) 0 codeOffset //
// 0x80 | 0x80 | DUP | (codeSize - codeOffset) (codeSize - codeOffset) 0 codeOffset //
// 0x92 | 0x92 | SWAP3 | codeOffset (codeSize - codeOffset) 0 (codeSize - codeOffset) //
// 0x59 | 0x59 | MSIZE | 0 codeOffset (codeSize - codeOffset) 0 (codeSize - codeOffset) //
// 0x39 | 0x39 | CODECOPY | 0 (codeSize - codeOffset) //
// 0xf3 | 0xf3 | RETURN | //
//---------------------------------------------------------------------------------------------------------------//
hex"60_0B_59_81_38_03_80_92_59_39_F3", // Returns all code in the contract except for the first 11 (0B in hex) bytes.
runtimeCode // The bytecode we want the contract to have after deployment. Capped at 1 byte less than the code size limit.
);
assembly {
// Deploy a new contract with the generated creation code.
// We start 32 bytes into the code to avoid copying the byte length.
pointer := create(0, add(creationCode, 32), mload(creationCode))
}
require(pointer != address(0), "DEPLOYMENT_FAILED");
}
/*//////////////////////////////////////////////////////////////
READ LOGIC
//////////////////////////////////////////////////////////////*/
function read(address pointer) internal view returns (bytes memory) {
return readBytecode(pointer, DATA_OFFSET, pointer.code.length - DATA_OFFSET);
}
function read(address pointer, uint256 start) internal view returns (bytes memory) {
start += DATA_OFFSET;
return readBytecode(pointer, start, pointer.code.length - start);
}
function read(
address pointer,
uint256 start,
uint256 end
) internal view returns (bytes memory) {
start += DATA_OFFSET;
end += DATA_OFFSET;
require(pointer.code.length >= end, "OUT_OF_BOUNDS");
return readBytecode(pointer, start, end - start);
}
/*//////////////////////////////////////////////////////////////
INTERNAL HELPER LOGIC
//////////////////////////////////////////////////////////////*/
function readBytecode(
address pointer,
uint256 start,
uint256 size
) private view returns (bytes memory data) {
assembly {
// Get a pointer to some free memory.
data := mload(0x40)
// Update the free memory pointer to prevent overriding our data.
// We use and(x, not(31)) as a cheaper equivalent to sub(x, mod(x, 32)).
// Adding 31 to size and running the result through the logic above ensures
// the memory pointer remains word-aligned, following the Solidity convention.
mstore(0x40, add(data, and(add(add(size, 32), 31), not(31))))
// Store the size of the data in the first 32 byte chunk of free memory.
mstore(data, size)
// Copy the code into memory right after the 32 bytes we used to store the size.
extcodecopy(pointer, add(data, 32), start, size)
}
}
}// SPDX-License-Identifier: Unlicense /* * @title Solidity Bytes Arrays Utils * @author Gonçalo Sá <[email protected]> * * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity. * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage. */ pragma solidity >=0.8.0 <0.9.0; library BytesLib { function concat( bytes memory _preBytes, bytes memory _postBytes ) internal pure returns (bytes memory) { bytes memory tempBytes; assembly { // Get a location of some free memory and store it in tempBytes as // Solidity does for memory variables. tempBytes := mload(0x40) // Store the length of the first bytes array at the beginning of // the memory for tempBytes. let length := mload(_preBytes) mstore(tempBytes, length) // Maintain a memory counter for the current write location in the // temp bytes array by adding the 32 bytes for the array length to // the starting location. let mc := add(tempBytes, 0x20) // Stop copying when the memory counter reaches the length of the // first bytes array. let end := add(mc, length) for { // Initialize a copy counter to the start of the _preBytes data, // 32 bytes into its memory. let cc := add(_preBytes, 0x20) } lt(mc, end) { // Increase both counters by 32 bytes each iteration. mc := add(mc, 0x20) cc := add(cc, 0x20) } { // Write the _preBytes data into the tempBytes memory 32 bytes // at a time. mstore(mc, mload(cc)) } // Add the length of _postBytes to the current length of tempBytes // and store it as the new length in the first 32 bytes of the // tempBytes memory. length := mload(_postBytes) mstore(tempBytes, add(length, mload(tempBytes))) // Move the memory counter back from a multiple of 0x20 to the // actual end of the _preBytes data. mc := end // Stop copying when the memory counter reaches the new combined // length of the arrays. end := add(mc, length) for { let cc := add(_postBytes, 0x20) } lt(mc, end) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { mstore(mc, mload(cc)) } // Update the free-memory pointer by padding our last write location // to 32 bytes: add 31 bytes to the end of tempBytes to move to the // next 32 byte block, then round down to the nearest multiple of // 32. If the sum of the length of the two arrays is zero then add // one before rounding down to leave a blank 32 bytes (the length block with 0). mstore(0x40, and( add(add(end, iszero(add(length, mload(_preBytes)))), 31), not(31) // Round down to the nearest 32 bytes. )) } return tempBytes; } function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal { assembly { // Read the first 32 bytes of _preBytes storage, which is the length // of the array. (We don't need to use the offset into the slot // because arrays use the entire slot.) let fslot := sload(_preBytes.slot) // Arrays of 31 bytes or less have an even value in their slot, // while longer arrays have an odd value. The actual length is // the slot divided by two for odd values, and the lowest order // byte divided by two for even values. // If the slot is even, bitwise and the slot with 255 and divide by // two to get the length. If the slot is odd, bitwise and the slot // with -1 and divide by two. let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2) let mlength := mload(_postBytes) let newlength := add(slength, mlength) // slength can contain both the length and contents of the array // if length < 32 bytes so let's prepare for that // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage switch add(lt(slength, 32), lt(newlength, 32)) case 2 { // Since the new array still fits in the slot, we just need to // update the contents of the slot. // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length sstore( _preBytes.slot, // all the modifications to the slot are inside this // next block add( // we can just add to the slot contents because the // bytes we want to change are the LSBs fslot, add( mul( div( // load the bytes from memory mload(add(_postBytes, 0x20)), // zero all bytes to the right exp(0x100, sub(32, mlength)) ), // and now shift left the number of bytes to // leave space for the length in the slot exp(0x100, sub(32, newlength)) ), // increase length by the double of the memory // bytes length mul(mlength, 2) ) ) ) } case 1 { // The stored value fits in the slot, but the combined value // will exceed it. // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) let sc := add(keccak256(0x0, 0x20), div(slength, 32)) // save new length sstore(_preBytes.slot, add(mul(newlength, 2), 1)) // The contents of the _postBytes array start 32 bytes into // the structure. Our first read should obtain the `submod` // bytes that can fit into the unused space in the last word // of the stored array. To get this, we read 32 bytes starting // from `submod`, so the data we read overlaps with the array // contents by `submod` bytes. Masking the lowest-order // `submod` bytes allows us to add that value directly to the // stored value. let submod := sub(32, slength) let mc := add(_postBytes, submod) let end := add(_postBytes, mlength) let mask := sub(exp(0x100, submod), 1) sstore( sc, add( and( fslot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00 ), and(mload(mc), mask) ) ) for { mc := add(mc, 0x20) sc := add(sc, 1) } lt(mc, end) { sc := add(sc, 1) mc := add(mc, 0x20) } { sstore(sc, mload(mc)) } mask := exp(0x100, sub(mc, end)) sstore(sc, mul(div(mload(mc), mask), mask)) } default { // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) // Start copying to the last used word of the stored array. let sc := add(keccak256(0x0, 0x20), div(slength, 32)) // save new length sstore(_preBytes.slot, add(mul(newlength, 2), 1)) // Copy over the first `submod` bytes of the new data as in // case 1 above. let slengthmod := mod(slength, 32) let mlengthmod := mod(mlength, 32) let submod := sub(32, slengthmod) let mc := add(_postBytes, submod) let end := add(_postBytes, mlength) let mask := sub(exp(0x100, submod), 1) sstore(sc, add(sload(sc), and(mload(mc), mask))) for { sc := add(sc, 1) mc := add(mc, 0x20) } lt(mc, end) { sc := add(sc, 1) mc := add(mc, 0x20) } { sstore(sc, mload(mc)) } mask := exp(0x100, sub(mc, end)) sstore(sc, mul(div(mload(mc), mask), mask)) } } } function slice( bytes memory _bytes, uint256 _start, uint256 _length ) internal pure returns (bytes memory) { require(_length + 31 >= _length, "slice_overflow"); require(_bytes.length >= _start + _length, "slice_outOfBounds"); bytes memory tempBytes; assembly { switch iszero(_length) case 0 { // Get a location of some free memory and store it in tempBytes as // Solidity does for memory variables. tempBytes := mload(0x40) // The first word of the slice result is potentially a partial // word read from the original array. To read it, we calculate // the length of that partial word and start copying that many // bytes into the array. The first word we copy will start with // data we don't care about, but the last `lengthmod` bytes will // land at the beginning of the contents of the new array. When // we're done copying, we overwrite the full first word with // the actual length of the slice. let lengthmod := and(_length, 31) // The multiplication in the next line is necessary // because when slicing multiples of 32 bytes (lengthmod == 0) // the following copy loop was copying the origin's length // and then ending prematurely not copying everything it should. let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod))) let end := add(mc, _length) for { // The multiplication in the next line has the same exact purpose // as the one above. let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start) } lt(mc, end) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { mstore(mc, mload(cc)) } mstore(tempBytes, _length) //update free-memory pointer //allocating the array padded to 32 bytes like the compiler does now mstore(0x40, and(add(mc, 31), not(31))) } //if we want a zero-length slice let's just return a zero-length array default { tempBytes := mload(0x40) //zero out the 32 bytes slice we are about to return //we need to do it because Solidity does not garbage collect mstore(tempBytes, 0) mstore(0x40, add(tempBytes, 0x20)) } } return tempBytes; } function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) { require(_bytes.length >= _start + 20, "toAddress_outOfBounds"); address tempAddress; assembly { tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000) } return tempAddress; } function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) { require(_bytes.length >= _start + 1 , "toUint8_outOfBounds"); uint8 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x1), _start)) } return tempUint; } function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) { require(_bytes.length >= _start + 2, "toUint16_outOfBounds"); uint16 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x2), _start)) } return tempUint; } function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) { require(_bytes.length >= _start + 4, "toUint32_outOfBounds"); uint32 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x4), _start)) } return tempUint; } function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) { require(_bytes.length >= _start + 8, "toUint64_outOfBounds"); uint64 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x8), _start)) } return tempUint; } function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) { require(_bytes.length >= _start + 12, "toUint96_outOfBounds"); uint96 tempUint; assembly { tempUint := mload(add(add(_bytes, 0xc), _start)) } return tempUint; } function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) { require(_bytes.length >= _start + 16, "toUint128_outOfBounds"); uint128 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x10), _start)) } return tempUint; } function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) { require(_bytes.length >= _start + 32, "toUint256_outOfBounds"); uint256 tempUint; assembly { tempUint := mload(add(add(_bytes, 0x20), _start)) } return tempUint; } function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) { require(_bytes.length >= _start + 32, "toBytes32_outOfBounds"); bytes32 tempBytes32; assembly { tempBytes32 := mload(add(add(_bytes, 0x20), _start)) } return tempBytes32; } function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) { bool success = true; assembly { let length := mload(_preBytes) // if lengths don't match the arrays are not equal switch eq(length, mload(_postBytes)) case 1 { // cb is a circuit breaker in the for loop since there's // no said feature for inline assembly loops // cb = 1 - don't breaker // cb = 0 - break let cb := 1 let mc := add(_preBytes, 0x20) let end := add(mc, length) for { let cc := add(_postBytes, 0x20) // the next line is the loop condition: // while(uint256(mc < end) + cb == 2) } eq(add(lt(mc, end), cb), 2) { mc := add(mc, 0x20) cc := add(cc, 0x20) } { // if any of these checks fails then arrays are not equal if iszero(eq(mload(mc), mload(cc))) { // unsuccess: success := 0 cb := 0 } } } default { // unsuccess: success := 0 } } return success; } function equalStorage( bytes storage _preBytes, bytes memory _postBytes ) internal view returns (bool) { bool success = true; assembly { // we know _preBytes_offset is 0 let fslot := sload(_preBytes.slot) // Decode the length of the stored array like in concatStorage(). let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2) let mlength := mload(_postBytes) // if lengths don't match the arrays are not equal switch eq(slength, mlength) case 1 { // slength can contain both the length and contents of the array // if length < 32 bytes so let's prepare for that // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage if iszero(iszero(slength)) { switch lt(slength, 32) case 1 { // blank the last byte which is the length fslot := mul(div(fslot, 0x100), 0x100) if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) { // unsuccess: success := 0 } } default { // cb is a circuit breaker in the for loop since there's // no said feature for inline assembly loops // cb = 1 - don't breaker // cb = 0 - break let cb := 1 // get the keccak hash to get the contents of the array mstore(0x0, _preBytes.slot) let sc := keccak256(0x0, 0x20) let mc := add(_postBytes, 0x20) let end := add(mc, mlength) // the next line is the loop condition: // while(uint256(mc < end) + cb == 2) for {} eq(add(lt(mc, end), cb), 2) { sc := add(sc, 1) mc := add(mc, 0x20) } { if iszero(eq(sload(sc), mload(mc))) { // unsuccess: success := 0 cb := 0 } } } } } default { // unsuccess: success := 0 } } return success; } }
// SPDX-License-Identifier: ISC
pragma solidity >=0.8.19;
interface IFraxlendWhitelist {
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event SetFraxlendDeployerWhitelist(address indexed _address, bool _bool);
function acceptOwnership() external;
function fraxlendDeployerWhitelist(address) external view returns (bool);
function owner() external view returns (address);
function pendingOwner() external view returns (address);
function renounceOwnership() external;
function setFraxlendDeployerWhitelist(address[] memory _addresses, bool _bool) external;
function transferOwnership(address newOwner) external;
}// SPDX-License-Identifier: ISC
pragma solidity >=0.8.19;
interface IFraxlendPair {
function CIRCUIT_BREAKER_ADDRESS() external view returns (address);
function COMPTROLLER_ADDRESS() external view returns (address);
function DEPLOYER_ADDRESS() external view returns (address);
function FRAXLEND_WHITELIST_ADDRESS() external view returns (address);
function timelockAddress() external view returns (address);
function addCollateral(uint256 _collateralAmount, address _borrower) external;
function addInterest()
external
returns (uint256 _interestEarned, uint256 _feesAmount, uint256 _feesShare, uint64 _newRate);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function approvedBorrowers(address) external view returns (bool);
function approvedLenders(address) external view returns (bool);
function asset() external view returns (address);
function balanceOf(address account) external view returns (uint256);
function borrowAsset(
uint256 _borrowAmount,
uint256 _collateralAmount,
address _receiver
) external returns (uint256 _shares);
function borrowerWhitelistActive() external view returns (bool);
function changeFee(uint32 _newFee) external;
function cleanLiquidationFee() external view returns (uint256);
function collateralContract() external view returns (address);
function currentRateInfo()
external
view
returns (
uint32 lastBlock,
uint32 feeToProtocolRate,
uint64 lastTimestamp,
uint64 ratePerSec,
uint64 fullUtilizationRate
);
function decimals() external view returns (uint8);
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool);
function deposit(uint256 _amount, address _receiver) external returns (uint256 _sharesReceived);
function dirtyLiquidationFee() external view returns (uint256);
function exchangeRateInfo() external view returns (uint32 lastTimestamp, uint224 exchangeRate);
function getConstants()
external
pure
returns (
uint256 _LTV_PRECISION,
uint256 _LIQ_PRECISION,
uint256 _UTIL_PREC,
uint256 _FEE_PRECISION,
uint256 _EXCHANGE_PRECISION,
uint64 _DEFAULT_INT,
uint16 _DEFAULT_PROTOCOL_FEE,
uint256 _MAX_PROTOCOL_FEE
);
function getImmutableAddressBool()
external
view
returns (
address _assetContract,
address _collateralContract,
address _oracleMultiply,
address _oracleDivide,
address _rateContract,
address _DEPLOYER_CONTRACT,
address _COMPTROLLER_ADDRESS,
address _FRAXLEND_WHITELIST,
bool _borrowerWhitelistActive,
bool _lenderWhitelistActive
);
function getImmutableUint256()
external
view
returns (
uint256 _oracleNormalization,
uint256 _maxLTV,
uint256 _cleanLiquidationFee,
uint256 _maturityDate,
uint256 _penaltyRate
);
function getPairAccounting()
external
view
returns (
uint128 _totalAssetAmount,
uint128 _totalAssetShares,
uint128 _totalBorrowAmount,
uint128 _totalBorrowShares,
uint256 _totalCollateral
);
function getUserSnapshot(
address _address
) external view returns (uint256 _userAssetShares, uint256 _userBorrowShares, uint256 _userCollateralBalance);
function increaseAllowance(address spender, uint256 addedValue) external returns (bool);
function lenderWhitelistActive() external view returns (bool);
function leveragedPosition(
address _swapperAddress,
uint256 _borrowAmount,
uint256 _initialCollateralAmount,
uint256 _amountCollateralOutMin,
address[] memory _path
) external returns (uint256 _totalCollateralBalance);
function liquidate(
uint128 _sharesToLiquidate,
uint256 _deadline,
address _borrower
) external returns (uint256 _collateralForLiquidator);
function maturityDate() external view returns (uint256);
function maxLTV() external view returns (uint256);
function maxOracleDelay() external view returns (uint256);
function name() external view returns (string memory);
function oracleDivide() external view returns (address);
function oracleMultiply() external view returns (address);
function oracleNormalization() external view returns (uint256);
function owner() external view returns (address);
function pause() external;
function paused() external view returns (bool);
function penaltyRate() external view returns (uint256);
function rateContract() external view returns (address);
function redeem(uint256 _shares, address _receiver, address _owner) external returns (uint256 _amountToReturn);
function removeCollateral(uint256 _collateralAmount, address _receiver) external;
function renounceOwnership() external;
function repayAsset(uint256 _shares, address _borrower) external returns (uint256 _amountToRepay);
function repayAssetWithCollateral(
address _swapperAddress,
uint256 _collateralToSwap,
uint256 _amountAssetOutMin,
address[] memory _path
) external returns (uint256 _amountAssetOut);
function setApprovedBorrowers(address[] memory _borrowers, bool _approval) external;
function setApprovedLenders(address[] memory _lenders, bool _approval) external;
function setMaxOracleDelay(uint256 _newDelay) external;
function setSwapper(address _swapper, bool _approval) external;
function setTimelock(address _newAddress) external;
function swappers(address) external view returns (bool);
function symbol() external view returns (string memory);
function toAssetAmount(uint256 _shares, bool _roundUp) external view returns (uint256);
function toAssetShares(uint256 _amount, bool _roundUp) external view returns (uint256);
function toBorrowAmount(uint256 _shares, bool _roundUp) external view returns (uint256);
function toBorrowShares(uint256 _amount, bool _roundUp) external view returns (uint256);
function totalAsset() external view returns (uint128 amount, uint128 shares);
function totalBorrow() external view returns (uint128 amount, uint128 shares);
function totalCollateral() external view returns (uint256);
function totalSupply() external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function transferOwnership(address newOwner) external;
function unpause() external;
function updateExchangeRate() external returns (uint256 _exchangeRate);
function userBorrowShares(address) external view returns (uint256);
function userCollateralBalance(address) external view returns (uint256);
function version() external pure returns (uint256 _major, uint256 _minor, uint256 _patch);
function withdrawFees(uint128 _shares, address _recipient) external returns (uint256 _amountToTransfer);
}// SPDX-License-Identifier: ISC
pragma solidity ^0.8.19;
interface IFraxlendPairRegistry {
event AddPair(address pairAddress);
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event SetDeployer(address deployer, bool _bool);
function acceptOwnership() external;
function addPair(address _pairAddress) external;
function deployedPairsArray(uint256) external view returns (address);
function deployedPairsByName(string memory) external view returns (address);
function deployedPairsLength() external view returns (uint256);
function deployers(address) external view returns (bool);
function getAllPairAddresses() external view returns (address[] memory _deployedPairsArray);
function owner() external view returns (address);
function pendingOwner() external view returns (address);
function renounceOwnership() external;
function setDeployers(address[] memory _deployers, bool _bool) external;
function transferOwnership(address newOwner) external;
}// SPDX-License-Identifier: ISC
pragma solidity ^0.8.19;
import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol";
import { SafeERC20 as OZSafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
// solhint-disable avoid-low-level-calls
// solhint-disable max-line-length
/// @title SafeERC20 provides helper functions for safe transfers as well as safe metadata access
/// @author Library originally written by @Boring_Crypto github.com/boring_crypto, modified by Drake Evans (Frax Finance) github.com/drakeevans
/// @dev original: https://github.com/boringcrypto/BoringSolidity/blob/fed25c5d43cb7ce20764cd0b838e21a02ea162e9/contracts/libraries/BoringERC20.sol
library SafeERC20 {
bytes4 private constant SIG_SYMBOL = 0x95d89b41; // symbol()
bytes4 private constant SIG_NAME = 0x06fdde03; // name()
bytes4 private constant SIG_DECIMALS = 0x313ce567; // decimals()
function returnDataToString(bytes memory data) internal pure returns (string memory) {
if (data.length >= 64) {
return abi.decode(data, (string));
} else if (data.length == 32) {
uint8 i = 0;
while (i < 32 && data[i] != 0) {
i++;
}
bytes memory bytesArray = new bytes(i);
for (i = 0; i < 32 && data[i] != 0; i++) {
bytesArray[i] = data[i];
}
return string(bytesArray);
} else {
return "???";
}
}
/// @notice Provides a safe ERC20.symbol version which returns '???' as fallback string.
/// @param token The address of the ERC-20 token contract.
/// @return (string) Token symbol.
function safeSymbol(IERC20 token) internal view returns (string memory) {
(bool success, bytes memory data) = address(token).staticcall(abi.encodeWithSelector(SIG_SYMBOL));
return success ? returnDataToString(data) : "???";
}
/// @notice Provides a safe ERC20.name version which returns '???' as fallback string.
/// @param token The address of the ERC-20 token contract.
/// @return (string) Token name.
function safeName(IERC20 token) internal view returns (string memory) {
(bool success, bytes memory data) = address(token).staticcall(abi.encodeWithSelector(SIG_NAME));
return success ? returnDataToString(data) : "???";
}
/// @notice Provides a safe ERC20.decimals version which returns '18' as fallback value.
/// @param token The address of the ERC-20 token contract.
/// @return (uint8) Token decimals.
function safeDecimals(IERC20 token) internal view returns (uint8) {
(bool success, bytes memory data) = address(token).staticcall(abi.encodeWithSelector(SIG_DECIMALS));
return success && data.length == 32 ? abi.decode(data, (uint8)) : 18;
}
function safeTransfer(IERC20 token, address to, uint256 value) internal {
OZSafeERC20.safeTransfer(token, to, value);
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
OZSafeERC20.safeTransferFrom(token, from, to, value);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^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 meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1);
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol) pragma solidity ^0.8.0; import "../token/ERC20/IERC20.sol";
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
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'
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) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://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");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}{
"remappings": [
"ds-test/=node_modules/ds-test/src/",
"forge-std/=node_modules/forge-std/src/",
"frax-std/=node_modules/frax-standard-solidity/src/",
"script/=script/",
"src/=src/",
"deploy/=deploy/",
"test/=test/",
"@chainlink/=node_modules/@chainlink/",
"@ensdomains/=node_modules/@ensdomains/",
"@eth-optimism/=node_modules/@eth-optimism/",
"@mean-finance/=node_modules/@mean-finance/",
"@openzeppelin/=node_modules/@openzeppelin/",
"@rari-capital/=node_modules/@rari-capital/",
"@uniswap/=node_modules/@uniswap/",
"base64-sol/=node_modules/base64-sol/",
"eth-gas-reporter/=node_modules/eth-gas-reporter/",
"frax-standard-solidity/=node_modules/frax-standard-solidity/",
"hardhat/=node_modules/hardhat/",
"solady/=node_modules/solady/",
"solidity-bytes-utils/=node_modules/solidity-bytes-utils/"
],
"optimizer": {
"enabled": false,
"runs": 1000000
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "none",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"components":[{"internalType":"address","name":"circuitBreaker","type":"address"},{"internalType":"address","name":"comptroller","type":"address"},{"internalType":"address","name":"timelock","type":"address"},{"internalType":"address","name":"fraxlendWhitelist","type":"address"},{"internalType":"address","name":"fraxlendPairRegistry","type":"address"}],"internalType":"struct ConstructorParams","name":"_params","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CircuitBreakerOnly","type":"error"},{"inputs":[],"name":"Create2Failed","type":"error"},{"inputs":[],"name":"WhitelistedDeployersOnly","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"address_","type":"address"},{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":true,"internalType":"address","name":"collateral","type":"address"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"bytes","name":"configData","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"immutables","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"customConfigData","type":"bytes"}],"name":"LogDeploy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetCircuitBreaker","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetComptroller","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetRegistry","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetTimelock","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetWhitelist","type":"event"},{"inputs":[],"name":"circuitBreakerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"comptrollerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractAddress1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractAddress2","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"defaultSwappers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_configData","type":"bytes"}],"name":"deploy","outputs":[{"internalType":"address","name":"_pairAddress","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"deployedPairsArray","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deployedPairsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fraxlendPairRegistryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fraxlendWhitelistAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllPairAddresses","outputs":[{"internalType":"address[]","name":"_deployedPairs","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"},{"internalType":"address","name":"_collateral","type":"address"}],"name":"getNextNameSymbol","outputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"globalPause","outputs":[{"internalType":"address[]","name":"_updatedAddresses","type":"address[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setCircuitBreaker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setComptroller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_creationCode","type":"bytes"}],"name":"setCreationCode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_swappers","type":"address[]"}],"name":"setDefaultSwappers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAddress","type":"address"}],"name":"setWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelockAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"_major","type":"uint256"},{"internalType":"uint256","name":"_minor","type":"uint256"},{"internalType":"uint256","name":"_patch","type":"uint256"}],"stateMutability":"pure","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b5060405162003afe38038062003afe83398181016040528101906200003791906200042c565b620000576200004b620001b760201b60201c565b620001bf60201b60201c565b8060000151600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060200151600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060400151600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060600151600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060800151600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506200045e565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000604051905090565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620002e28262000297565b810181811067ffffffffffffffff82111715620003045762000303620002a8565b5b80604052505050565b60006200031962000283565b9050620003278282620002d7565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600062000359826200032c565b9050919050565b6200036b816200034c565b81146200037757600080fd5b50565b6000815190506200038b8162000360565b92915050565b600060a08284031215620003aa57620003a962000292565b5b620003b660a06200030d565b90506000620003c8848285016200037a565b6000830152506020620003de848285016200037a565b6020830152506040620003f4848285016200037a565b60408301525060606200040a848285016200037a565b606083015250608062000420848285016200037a565b60808301525092915050565b600060a082840312156200044557620004446200028d565b5b6000620004558482850162000391565b91505092915050565b613690806200046e6000396000f3fe608060405234801561001057600080fd5b50600436106101a25760003560e01c806368bde41f116100ee57806382beee89116100975780638da5cb5b116100715780638da5cb5b1461045c578063a91ee0dc1461047a578063bdacb30314610496578063f2fde38b146104b2576101a2565b806382beee8914610408578063854cff2f146104245780638bad38dd14610440576101a2565b8063715018a6116100c8578063715018a6146103c25780637bc02806146103cc5780637ec9e156146103ea576101a2565b806368bde41f1461035857806369285727146103765780636c191eee146103a6576101a2565b80634bc66f321161015057806354fd4d501161012a57806354fd4d50146102fc5780635e7b4e401461031c578063607b6d161461033a576101a2565b80634bc66f321461028f5780635399212a146102ad57806354ea3928146102de576101a2565b8063366831001161018157806336683100146102235780634793221d146102415780634929242714610271576101a2565b8062774360146101a757806306c75b6a146101d757806331c315df146101f3575b600080fd5b6101c160048036038101906101bc91906123b3565b6104ce565b6040516101ce919061243d565b60405180910390f35b6101f160048036038101906101ec91906124b8565b6107d0565b005b61020d6004803603810190610208919061253b565b610937565b60405161021a919061243d565b60405180910390f35b61022b610976565b6040516102389190612577565b60405180910390f35b61025b60048036038101906102569190612681565b610983565b6040516102689190612788565b60405180910390f35b610279610b60565b604051610286919061243d565b60405180910390f35b610297610b86565b6040516102a4919061243d565b60405180910390f35b6102c760048036038101906102c291906127aa565b610bac565b6040516102d5929190612869565b60405180910390f35b6102e6610d38565b6040516102f3919061243d565b60405180910390f35b610304610d5e565b604051610313939291906128a0565b60405180910390f35b610324610d74565b604051610331919061243d565b60405180910390f35b610342610d9a565b60405161034f9190612788565b60405180910390f35b610360610e28565b60405161036d919061243d565b60405180910390f35b610390600480360381019061038b919061253b565b610e4e565b60405161039d919061243d565b60405180910390f35b6103c060048036038101906103bb9190612681565b610e8d565b005b6103ca610eaf565b005b6103d4610ec3565b6040516103e1919061243d565b60405180910390f35b6103f2610ee9565b6040516103ff919061243d565b60405180910390f35b610422600480360381019061041d91906128d7565b610f0f565b005b61043e600480360381019061043991906128d7565b610fb6565b005b61045a600480360381019061045591906128d7565b61105d565b005b610464611104565b604051610471919061243d565b60405180910390f35b610494600480360381019061048f91906128d7565b61112d565b005b6104b060048036038101906104ab91906128d7565b6111d4565b005b6104cc60048036038101906104c791906128d7565b61127b565b005b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a3e982d8336040518263ffffffff1660e01b815260040161052b919061243d565b602060405180830381865afa158015610548573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056c919061293c565b6105a2576040517f93afd58900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080838060200190518101906105b99190612a38565b50505050505050915091506000806105d18484610bac565b915091506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660405160200161065293929190612b02565b6040516020818303038152906040529050600083836106868873ffffffffffffffffffffffffffffffffffffffff166112fe565b60405160200161069893929190612b55565b60405160208183030381529060405290506106b488838361140e565b9650600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c2b7bbb6886040518263ffffffff1660e01b8152600401610711919061243d565b600060405180830381600087803b15801561072b57600080fd5b505af115801561073f573d6000803e3d6000fd5b505050508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f9303649990c462969a3c46d4e2c758166e92f5a4b18c67f26d3e58d2b0660e67878c87876040516107bd9493929190612bef565b60405180910390a4505050505050919050565b6107d8611702565b600061082c83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060006132c8611780565b90506108378161189e565b600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506132c88383905011156109325760006108e584848080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506132c880878790506108e09190612c7f565b611780565b90506108f08161189e565b600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b505050565b6009818154811061094757600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600980549050905090565b6060600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a0c576040517fd8ebffc400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080835190508067ffffffffffffffff811115610a2d57610a2c612288565b5b604051908082528060200260200182016040528015610a5b5781602001602082028036833780820191505090505b50925060005b81811015610b5857848181518110610a7c57610a7b612cb3565b5b602002602001015192508273ffffffffffffffffffffffffffffffffffffffff16638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610ace57600080fd5b505af1925050508015610adf575060015b15610b4d57848181518110610af757610af6612cb3565b5b6020026020010151848281518110610b1257610b11612cb3565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b600181019050610a61565b505050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060806000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663366831006040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c429190612ce2565b9050610c638573ffffffffffffffffffffffffffffffffffffffff16611968565b610c828573ffffffffffffffffffffffffffffffffffffffff16611a94565b610c97600184610c929190612d0f565b611bc0565b604051602001610ca993929190612eaf565b6040516020818303038152906040529250610cd98573ffffffffffffffffffffffffffffffffffffffff16611968565b610cf88573ffffffffffffffffffffffffffffffffffffffff16611968565b610d0d600184610d089190612d0f565b611bc0565b604051602001610d1f93929190612ff0565b6040516020818303038152906040529150509250929050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000600460016000925092509250909192565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606009805480602002602001604051908101604052809291908181526020018280548015610e1e57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610dd4575b5050505050905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088181548110610e5e57600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e95611702565b8060089080519060200190610eab9291906121b2565b5050565b610eb7611702565b610ec16000611c8e565b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610f17611702565b7f4cb8c9e37efb94c6cdbd2a80fe36cee1957b5584d1a1986fa2bae115180af59a600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682604051610f6a92919061304d565b60405180910390a180600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610fbe611702565b7fe8664b925e623f88e598288ed83ff0a0c9b17d50f56ec07db74f075ca4c1d57b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260405161101192919061304d565b60405180910390a180600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611065611702565b7ff45d882a72fce9d8d7a7e2e196a338d4d9d4057510b4b9ddf91a7066104d2eaf600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826040516110b892919061304d565b60405180910390a180600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611135611702565b7fa6cdf06494ab3c79fae6cca5316f6324ff80979c2a51d8f239aee07a4aecd35b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260405161118892919061304d565b60405180910390a180600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6111dc611702565b7f91aa98337922135c1d3ae8654f8d0b938c01a35c402eb21e568af3755e4dcd79600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260405161122f92919061304d565b60405180910390a180600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611283611702565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036112f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e9906130e8565b60405180910390fd5b6112fb81611c8e565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1663313ce56760e01b604051602401604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516113929190613144565b600060405180830381855afa9150503d80600081146113cd576040519150601f19603f3d011682016040523d82523d6000602084013e6113d2565b606091505b50915091508180156113e5575060208151145b6113f0576012611405565b808060200190518101906114049190613187565b5b92505050919050565b60008061146f61143f600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611d52565b61146a600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611d52565b611d89565b9050600081868686604051602001611489939291906131b4565b6040516020818303038152906040526040516020016114a9929190613200565b604051602081830303815290604052905060008686866040516020016114d193929190613224565b604051602081830303815290604052805190602001209050808251602084016000f59350600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361155b576040517f04a5b3ee00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6009849080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008490506000600880548060200260200160405190810160405280929190818152602001828054801561164757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116115fd575b5050505050905060005b81518110156116f5578273ffffffffffffffffffffffffffffffffffffffff16633f2617cb83838151811061168957611688612cb3565b5b602002602001015160016040518363ffffffff1660e01b81526004016116b0929190613264565b600060405180830381600087803b1580156116ca57600080fd5b505af11580156116de573d6000803e3d6000fd5b5050505080806116ed9061328d565b915050611651565b5050505050509392505050565b61170a611e13565b73ffffffffffffffffffffffffffffffffffffffff16611728611104565b73ffffffffffffffffffffffffffffffffffffffff161461177e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177590613321565b60405180910390fd5b565b606081601f836117909190612d0f565b10156117d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c89061338d565b60405180910390fd5b81836117dd9190612d0f565b84511015611820576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611817906133f9565b60405180910390fd5b60608215600081146118415760405191506000825260208201604052611892565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101561187f5780518352602083019250602081019050611862565b50868552601f19601f8301166040525050505b50809150509392505050565b600080826040516020016118b29190613445565b60405160208183030381529060405290506000816040516020016118d691906134b3565b60405160208183030381529060405290508051602082016000f09250600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611961576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195890613521565b60405180910390fd5b5050919050565b60606000808373ffffffffffffffffffffffffffffffffffffffff166395d89b4160e01b604051602401604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516119fc9190613144565b600060405180830381855afa9150503d8060008114611a37576040519150601f19603f3d011682016040523d82523d6000602084013e611a3c565b606091505b509150915081611a81576040518060400160405280600381526020017f3f3f3f0000000000000000000000000000000000000000000000000000000000815250611a8b565b611a8a81611e1b565b5b92505050919050565b60606000808373ffffffffffffffffffffffffffffffffffffffff166306fdde0360e01b604051602401604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051611b289190613144565b600060405180830381855afa9150503d8060008114611b63576040519150601f19603f3d011682016040523d82523d6000602084013e611b68565b606091505b509150915081611bad576040518060400160405280600381526020017f3f3f3f0000000000000000000000000000000000000000000000000000000000815250611bb7565b611bb681611e1b565b5b92505050919050565b606060006001611bcf84612036565b01905060008167ffffffffffffffff811115611bee57611bed612288565b5b6040519080825280601f01601f191660200182016040528015611c205781602001600182028036833780820191505090505b509050600082602001820190505b600115611c83578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581611c7757611c76613541565b5b04945060008503611c2e575b819350505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6060611d82826001808573ffffffffffffffffffffffffffffffffffffffff163b611d7d9190612c7f565b612189565b9050919050565b6060806040519050835180825260208201818101602087015b81831015611dbf5780518352602083019250602081019050611da2565b50855192508351830184528091508282019050602086015b81831015611df45780518352602083019250602081019050611dd7565b50601f19601f8851850115830101166040525050508091505092915050565b600033905090565b60606040825110611e415781806020019051810190611e3a9190613611565b9050612031565b6020825103611ff85760005b60208160ff16108015611ea65750600060f81b838260ff1681518110611e7657611e75612cb3565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614155b15611ebe578080611eb69061365a565b915050611e4d565b60008160ff1667ffffffffffffffff811115611edd57611edc612288565b5b6040519080825280601f01601f191660200182016040528015611f0f5781602001600182028036833780820191505090505b509050600091505b60208260ff16108015611f705750600060f81b848360ff1681518110611f4057611f3f612cb3565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614155b15611fee57838260ff1681518110611f8b57611f8a612cb3565b5b602001015160f81c60f81b818360ff1681518110611fac57611fab612cb3565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508180611fe69061365a565b925050611f17565b8092505050612031565b6040518060400160405280600381526020017f3f3f3f000000000000000000000000000000000000000000000000000000000081525090505b919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612094577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161208a57612089613541565b5b0492506040810190505b6d04ee2d6d415b85acef810000000083106120d1576d04ee2d6d415b85acef810000000083816120c7576120c6613541565b5b0492506020810190505b662386f26fc10000831061210057662386f26fc1000083816120f6576120f5613541565b5b0492506010810190505b6305f5e1008310612129576305f5e100838161211f5761211e613541565b5b0492506008810190505b612710831061214e57612710838161214457612143613541565b5b0492506004810190505b60648310612171576064838161216757612166613541565b5b0492506002810190505b600a8310612180576001810190505b80915050919050565b60606040519050601f19601f6020840101168101604052818152818360208301863c9392505050565b82805482825590600052602060002090810192821561222b579160200282015b8281111561222a5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906121d2565b5b509050612238919061223c565b5090565b5b8082111561225557600081600090555060010161223d565b5090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6122c082612277565b810181811067ffffffffffffffff821117156122df576122de612288565b5b80604052505050565b60006122f2612259565b90506122fe82826122b7565b919050565b600067ffffffffffffffff82111561231e5761231d612288565b5b61232782612277565b9050602081019050919050565b82818337600083830152505050565b600061235661235184612303565b6122e8565b90508281526020810184848401111561237257612371612272565b5b61237d848285612334565b509392505050565b600082601f83011261239a5761239961226d565b5b81356123aa848260208601612343565b91505092915050565b6000602082840312156123c9576123c8612263565b5b600082013567ffffffffffffffff8111156123e7576123e6612268565b5b6123f384828501612385565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612427826123fc565b9050919050565b6124378161241c565b82525050565b6000602082019050612452600083018461242e565b92915050565b600080fd5b600080fd5b60008083601f8401126124785761247761226d565b5b8235905067ffffffffffffffff81111561249557612494612458565b5b6020830191508360018202830111156124b1576124b061245d565b5b9250929050565b600080602083850312156124cf576124ce612263565b5b600083013567ffffffffffffffff8111156124ed576124ec612268565b5b6124f985828601612462565b92509250509250929050565b6000819050919050565b61251881612505565b811461252357600080fd5b50565b6000813590506125358161250f565b92915050565b60006020828403121561255157612550612263565b5b600061255f84828501612526565b91505092915050565b61257181612505565b82525050565b600060208201905061258c6000830184612568565b92915050565b600067ffffffffffffffff8211156125ad576125ac612288565b5b602082029050602081019050919050565b6125c78161241c565b81146125d257600080fd5b50565b6000813590506125e4816125be565b92915050565b60006125fd6125f884612592565b6122e8565b905080838252602082019050602084028301858111156126205761261f61245d565b5b835b81811015612649578061263588826125d5565b845260208401935050602081019050612622565b5050509392505050565b600082601f8301126126685761266761226d565b5b81356126788482602086016125ea565b91505092915050565b60006020828403121561269757612696612263565b5b600082013567ffffffffffffffff8111156126b5576126b4612268565b5b6126c184828501612653565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6126ff8161241c565b82525050565b600061271183836126f6565b60208301905092915050565b6000602082019050919050565b6000612735826126ca565b61273f81856126d5565b935061274a836126e6565b8060005b8381101561277b5781516127628882612705565b975061276d8361271d565b92505060018101905061274e565b5085935050505092915050565b600060208201905081810360008301526127a2818461272a565b905092915050565b600080604083850312156127c1576127c0612263565b5b60006127cf858286016125d5565b92505060206127e0858286016125d5565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612824578082015181840152602081019050612809565b60008484015250505050565b600061283b826127ea565b61284581856127f5565b9350612855818560208601612806565b61285e81612277565b840191505092915050565b600060408201905081810360008301526128838185612830565b905081810360208301526128978184612830565b90509392505050565b60006060820190506128b56000830186612568565b6128c26020830185612568565b6128cf6040830184612568565b949350505050565b6000602082840312156128ed576128ec612263565b5b60006128fb848285016125d5565b91505092915050565b60008115159050919050565b61291981612904565b811461292457600080fd5b50565b60008151905061293681612910565b92915050565b60006020828403121561295257612951612263565b5b600061296084828501612927565b91505092915050565b6000612974826123fc565b9050919050565b61298481612969565b811461298f57600080fd5b50565b6000815190506129a18161297b565b92915050565b600063ffffffff82169050919050565b6129c0816129a7565b81146129cb57600080fd5b50565b6000815190506129dd816129b7565b92915050565b600067ffffffffffffffff82169050919050565b612a00816129e3565b8114612a0b57600080fd5b50565b600081519050612a1d816129f7565b92915050565b600081519050612a328161250f565b92915050565b60008060008060008060008060006101208a8c031215612a5b57612a5a612263565b5b6000612a698c828d01612992565b9950506020612a7a8c828d01612992565b9850506040612a8b8c828d01612992565b9750506060612a9c8c828d016129ce565b9650506080612aad8c828d01612992565b95505060a0612abe8c828d01612a0e565b94505060c0612acf8c828d01612a23565b93505060e0612ae08c828d01612a23565b925050610100612af28c828d01612a23565b9150509295985092959850929598565b6000606082019050612b17600083018661242e565b612b24602083018561242e565b612b31604083018461242e565b949350505050565b600060ff82169050919050565b612b4f81612b39565b82525050565b60006060820190508181036000830152612b6f8186612830565b90508181036020830152612b838185612830565b9050612b926040830184612b46565b949350505050565b600081519050919050565b600082825260208201905092915050565b6000612bc182612b9a565b612bcb8185612ba5565b9350612bdb818560208601612806565b612be481612277565b840191505092915050565b60006080820190508181036000830152612c098187612830565b90508181036020830152612c1d8186612bb6565b90508181036040830152612c318185612bb6565b90508181036060830152612c458184612bb6565b905095945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c8a82612505565b9150612c9583612505565b9250828203905081811115612cad57612cac612c50565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215612cf857612cf7612263565b5b6000612d0684828501612a23565b91505092915050565b6000612d1a82612505565b9150612d2583612505565b9250828201905080821115612d3d57612d3c612c50565b5b92915050565b600081905092915050565b7f467261786c656e6420496e7465726573742042656172696e6720000000000000600082015250565b6000612d84601a83612d43565b9150612d8f82612d4e565b601a82019050919050565b6000612da5826127ea565b612daf8185612d43565b9350612dbf818560208601612806565b80840191505092915050565b7f2028000000000000000000000000000000000000000000000000000000000000600082015250565b6000612e01600283612d43565b9150612e0c82612dcb565b600282019050919050565b7f2900000000000000000000000000000000000000000000000000000000000000600082015250565b6000612e4d600183612d43565b9150612e5882612e17565b600182019050919050565b7f202d200000000000000000000000000000000000000000000000000000000000600082015250565b6000612e99600383612d43565b9150612ea482612e63565b600382019050919050565b6000612eba82612d77565b9150612ec68286612d9a565b9150612ed182612df4565b9150612edd8285612d9a565b9150612ee882612e40565b9150612ef382612e8c565b9150612eff8284612d9a565b9150819050949350505050565b7f6600000000000000000000000000000000000000000000000000000000000000600082015250565b6000612f42600183612d43565b9150612f4d82612f0c565b600182019050919050565b7f2800000000000000000000000000000000000000000000000000000000000000600082015250565b6000612f8e600183612d43565b9150612f9982612f58565b600182019050919050565b7f2d00000000000000000000000000000000000000000000000000000000000000600082015250565b6000612fda600183612d43565b9150612fe582612fa4565b600182019050919050565b6000612ffb82612f35565b91506130078286612d9a565b915061301282612f81565b915061301e8285612d9a565b915061302982612e40565b915061303482612fcd565b91506130408284612d9a565b9150819050949350505050565b6000604082019050613062600083018561242e565b61306f602083018461242e565b9392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006130d26026836127f5565b91506130dd82613076565b604082019050919050565b60006020820190508181036000830152613101816130c5565b9050919050565b600081905092915050565b600061311e82612b9a565b6131288185613108565b9350613138818560208601612806565b80840191505092915050565b60006131508284613113565b915081905092915050565b61316481612b39565b811461316f57600080fd5b50565b6000815190506131818161315b565b92915050565b60006020828403121561319d5761319c612263565b5b60006131ab84828501613172565b91505092915050565b600060608201905081810360008301526131ce8186612bb6565b905081810360208301526131e28185612bb6565b905081810360408301526131f68184612bb6565b9050949350505050565b600061320c8285613113565b91506132188284613113565b91508190509392505050565b60006132308286613113565b915061323c8285613113565b91506132488284613113565b9150819050949350505050565b61325e81612904565b82525050565b6000604082019050613279600083018561242e565b6132866020830184613255565b9392505050565b600061329882612505565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036132ca576132c9612c50565b5b600182019050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061330b6020836127f5565b9150613316826132d5565b602082019050919050565b6000602082019050818103600083015261333a816132fe565b9050919050565b7f736c6963655f6f766572666c6f77000000000000000000000000000000000000600082015250565b6000613377600e836127f5565b915061338282613341565b602082019050919050565b600060208201905081810360008301526133a68161336a565b9050919050565b7f736c6963655f6f75744f66426f756e6473000000000000000000000000000000600082015250565b60006133e36011836127f5565b91506133ee826133ad565b602082019050919050565b60006020820190508181036000830152613412816133d6565b9050919050565b60008082015250565b600061342f600183612d43565b915061343a82613419565b600182019050919050565b600061345082613422565b915061345c8284613113565b915081905092915050565b7f600b5981380380925939f3000000000000000000000000000000000000000000600082015250565b600061349d600b83612d43565b91506134a882613467565b600b82019050919050565b60006134be82613490565b91506134ca8284613113565b915081905092915050565b7f4445504c4f594d454e545f4641494c4544000000000000000000000000000000600082015250565b600061350b6011836127f5565b9150613516826134d5565b602082019050919050565b6000602082019050818103600083015261353a816134fe565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600067ffffffffffffffff82111561358b5761358a612288565b5b61359482612277565b9050602081019050919050565b60006135b46135af84613570565b6122e8565b9050828152602081018484840111156135d0576135cf612272565b5b6135db848285612806565b509392505050565b600082601f8301126135f8576135f761226d565b5b81516136088482602086016135a1565b91505092915050565b60006020828403121561362757613626612263565b5b600082015167ffffffffffffffff81111561364557613644612268565b5b613651848285016135e3565b91505092915050565b600061366582612b39565b915060ff820361367857613677612c50565b5b60018201905091905056fea164736f6c6343000813000a0000000000000000000000000ed01ea3b95e0f68df2c9cd67f138ff3547b311c000000000000000000000000c4eb45d80dc1f079045e75d5d55de8ed1c1090e6000000000000000000000000c16068d1ca7e24e20e56bb70af4d00d92aa4f0b200000000000000000000000064f85076665dce1fbefc23391b8bfb2595c250f60000000000000000000000008c22ebc8f9b96ceac97ea21c53f3b27ef2f45e57
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101a25760003560e01c806368bde41f116100ee57806382beee89116100975780638da5cb5b116100715780638da5cb5b1461045c578063a91ee0dc1461047a578063bdacb30314610496578063f2fde38b146104b2576101a2565b806382beee8914610408578063854cff2f146104245780638bad38dd14610440576101a2565b8063715018a6116100c8578063715018a6146103c25780637bc02806146103cc5780637ec9e156146103ea576101a2565b806368bde41f1461035857806369285727146103765780636c191eee146103a6576101a2565b80634bc66f321161015057806354fd4d501161012a57806354fd4d50146102fc5780635e7b4e401461031c578063607b6d161461033a576101a2565b80634bc66f321461028f5780635399212a146102ad57806354ea3928146102de576101a2565b8063366831001161018157806336683100146102235780634793221d146102415780634929242714610271576101a2565b8062774360146101a757806306c75b6a146101d757806331c315df146101f3575b600080fd5b6101c160048036038101906101bc91906123b3565b6104ce565b6040516101ce919061243d565b60405180910390f35b6101f160048036038101906101ec91906124b8565b6107d0565b005b61020d6004803603810190610208919061253b565b610937565b60405161021a919061243d565b60405180910390f35b61022b610976565b6040516102389190612577565b60405180910390f35b61025b60048036038101906102569190612681565b610983565b6040516102689190612788565b60405180910390f35b610279610b60565b604051610286919061243d565b60405180910390f35b610297610b86565b6040516102a4919061243d565b60405180910390f35b6102c760048036038101906102c291906127aa565b610bac565b6040516102d5929190612869565b60405180910390f35b6102e6610d38565b6040516102f3919061243d565b60405180910390f35b610304610d5e565b604051610313939291906128a0565b60405180910390f35b610324610d74565b604051610331919061243d565b60405180910390f35b610342610d9a565b60405161034f9190612788565b60405180910390f35b610360610e28565b60405161036d919061243d565b60405180910390f35b610390600480360381019061038b919061253b565b610e4e565b60405161039d919061243d565b60405180910390f35b6103c060048036038101906103bb9190612681565b610e8d565b005b6103ca610eaf565b005b6103d4610ec3565b6040516103e1919061243d565b60405180910390f35b6103f2610ee9565b6040516103ff919061243d565b60405180910390f35b610422600480360381019061041d91906128d7565b610f0f565b005b61043e600480360381019061043991906128d7565b610fb6565b005b61045a600480360381019061045591906128d7565b61105d565b005b610464611104565b604051610471919061243d565b60405180910390f35b610494600480360381019061048f91906128d7565b61112d565b005b6104b060048036038101906104ab91906128d7565b6111d4565b005b6104cc60048036038101906104c791906128d7565b61127b565b005b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a3e982d8336040518263ffffffff1660e01b815260040161052b919061243d565b602060405180830381865afa158015610548573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056c919061293c565b6105a2576040517f93afd58900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080838060200190518101906105b99190612a38565b50505050505050915091506000806105d18484610bac565b915091506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660405160200161065293929190612b02565b6040516020818303038152906040529050600083836106868873ffffffffffffffffffffffffffffffffffffffff166112fe565b60405160200161069893929190612b55565b60405160208183030381529060405290506106b488838361140e565b9650600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c2b7bbb6886040518263ffffffff1660e01b8152600401610711919061243d565b600060405180830381600087803b15801561072b57600080fd5b505af115801561073f573d6000803e3d6000fd5b505050508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f9303649990c462969a3c46d4e2c758166e92f5a4b18c67f26d3e58d2b0660e67878c87876040516107bd9493929190612bef565b60405180910390a4505050505050919050565b6107d8611702565b600061082c83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505060006132c8611780565b90506108378161189e565b600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506132c88383905011156109325760006108e584848080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506132c880878790506108e09190612c7f565b611780565b90506108f08161189e565b600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b505050565b6009818154811061094757600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600980549050905090565b6060600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a0c576040517fd8ebffc400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080835190508067ffffffffffffffff811115610a2d57610a2c612288565b5b604051908082528060200260200182016040528015610a5b5781602001602082028036833780820191505090505b50925060005b81811015610b5857848181518110610a7c57610a7b612cb3565b5b602002602001015192508273ffffffffffffffffffffffffffffffffffffffff16638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610ace57600080fd5b505af1925050508015610adf575060015b15610b4d57848181518110610af757610af6612cb3565b5b6020026020010151848281518110610b1257610b11612cb3565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b600181019050610a61565b505050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060806000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663366831006040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c429190612ce2565b9050610c638573ffffffffffffffffffffffffffffffffffffffff16611968565b610c828573ffffffffffffffffffffffffffffffffffffffff16611a94565b610c97600184610c929190612d0f565b611bc0565b604051602001610ca993929190612eaf565b6040516020818303038152906040529250610cd98573ffffffffffffffffffffffffffffffffffffffff16611968565b610cf88573ffffffffffffffffffffffffffffffffffffffff16611968565b610d0d600184610d089190612d0f565b611bc0565b604051602001610d1f93929190612ff0565b6040516020818303038152906040529150509250929050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000600460016000925092509250909192565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606009805480602002602001604051908101604052809291908181526020018280548015610e1e57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610dd4575b5050505050905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088181548110610e5e57600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e95611702565b8060089080519060200190610eab9291906121b2565b5050565b610eb7611702565b610ec16000611c8e565b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610f17611702565b7f4cb8c9e37efb94c6cdbd2a80fe36cee1957b5584d1a1986fa2bae115180af59a600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682604051610f6a92919061304d565b60405180910390a180600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610fbe611702565b7fe8664b925e623f88e598288ed83ff0a0c9b17d50f56ec07db74f075ca4c1d57b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260405161101192919061304d565b60405180910390a180600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611065611702565b7ff45d882a72fce9d8d7a7e2e196a338d4d9d4057510b4b9ddf91a7066104d2eaf600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826040516110b892919061304d565b60405180910390a180600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611135611702565b7fa6cdf06494ab3c79fae6cca5316f6324ff80979c2a51d8f239aee07a4aecd35b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260405161118892919061304d565b60405180910390a180600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6111dc611702565b7f91aa98337922135c1d3ae8654f8d0b938c01a35c402eb21e568af3755e4dcd79600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260405161122f92919061304d565b60405180910390a180600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611283611702565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036112f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e9906130e8565b60405180910390fd5b6112fb81611c8e565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1663313ce56760e01b604051602401604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516113929190613144565b600060405180830381855afa9150503d80600081146113cd576040519150601f19603f3d011682016040523d82523d6000602084013e6113d2565b606091505b50915091508180156113e5575060208151145b6113f0576012611405565b808060200190518101906114049190613187565b5b92505050919050565b60008061146f61143f600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611d52565b61146a600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611d52565b611d89565b9050600081868686604051602001611489939291906131b4565b6040516020818303038152906040526040516020016114a9929190613200565b604051602081830303815290604052905060008686866040516020016114d193929190613224565b604051602081830303815290604052805190602001209050808251602084016000f59350600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361155b576040517f04a5b3ee00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6009849080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008490506000600880548060200260200160405190810160405280929190818152602001828054801561164757602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116115fd575b5050505050905060005b81518110156116f5578273ffffffffffffffffffffffffffffffffffffffff16633f2617cb83838151811061168957611688612cb3565b5b602002602001015160016040518363ffffffff1660e01b81526004016116b0929190613264565b600060405180830381600087803b1580156116ca57600080fd5b505af11580156116de573d6000803e3d6000fd5b5050505080806116ed9061328d565b915050611651565b5050505050509392505050565b61170a611e13565b73ffffffffffffffffffffffffffffffffffffffff16611728611104565b73ffffffffffffffffffffffffffffffffffffffff161461177e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177590613321565b60405180910390fd5b565b606081601f836117909190612d0f565b10156117d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117c89061338d565b60405180910390fd5b81836117dd9190612d0f565b84511015611820576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611817906133f9565b60405180910390fd5b60608215600081146118415760405191506000825260208201604052611892565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101561187f5780518352602083019250602081019050611862565b50868552601f19601f8301166040525050505b50809150509392505050565b600080826040516020016118b29190613445565b60405160208183030381529060405290506000816040516020016118d691906134b3565b60405160208183030381529060405290508051602082016000f09250600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611961576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195890613521565b60405180910390fd5b5050919050565b60606000808373ffffffffffffffffffffffffffffffffffffffff166395d89b4160e01b604051602401604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516119fc9190613144565b600060405180830381855afa9150503d8060008114611a37576040519150601f19603f3d011682016040523d82523d6000602084013e611a3c565b606091505b509150915081611a81576040518060400160405280600381526020017f3f3f3f0000000000000000000000000000000000000000000000000000000000815250611a8b565b611a8a81611e1b565b5b92505050919050565b60606000808373ffffffffffffffffffffffffffffffffffffffff166306fdde0360e01b604051602401604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051611b289190613144565b600060405180830381855afa9150503d8060008114611b63576040519150601f19603f3d011682016040523d82523d6000602084013e611b68565b606091505b509150915081611bad576040518060400160405280600381526020017f3f3f3f0000000000000000000000000000000000000000000000000000000000815250611bb7565b611bb681611e1b565b5b92505050919050565b606060006001611bcf84612036565b01905060008167ffffffffffffffff811115611bee57611bed612288565b5b6040519080825280601f01601f191660200182016040528015611c205781602001600182028036833780820191505090505b509050600082602001820190505b600115611c83578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581611c7757611c76613541565b5b04945060008503611c2e575b819350505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6060611d82826001808573ffffffffffffffffffffffffffffffffffffffff163b611d7d9190612c7f565b612189565b9050919050565b6060806040519050835180825260208201818101602087015b81831015611dbf5780518352602083019250602081019050611da2565b50855192508351830184528091508282019050602086015b81831015611df45780518352602083019250602081019050611dd7565b50601f19601f8851850115830101166040525050508091505092915050565b600033905090565b60606040825110611e415781806020019051810190611e3a9190613611565b9050612031565b6020825103611ff85760005b60208160ff16108015611ea65750600060f81b838260ff1681518110611e7657611e75612cb3565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614155b15611ebe578080611eb69061365a565b915050611e4d565b60008160ff1667ffffffffffffffff811115611edd57611edc612288565b5b6040519080825280601f01601f191660200182016040528015611f0f5781602001600182028036833780820191505090505b509050600091505b60208260ff16108015611f705750600060f81b848360ff1681518110611f4057611f3f612cb3565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614155b15611fee57838260ff1681518110611f8b57611f8a612cb3565b5b602001015160f81c60f81b818360ff1681518110611fac57611fab612cb3565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508180611fe69061365a565b925050611f17565b8092505050612031565b6040518060400160405280600381526020017f3f3f3f000000000000000000000000000000000000000000000000000000000081525090505b919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612094577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161208a57612089613541565b5b0492506040810190505b6d04ee2d6d415b85acef810000000083106120d1576d04ee2d6d415b85acef810000000083816120c7576120c6613541565b5b0492506020810190505b662386f26fc10000831061210057662386f26fc1000083816120f6576120f5613541565b5b0492506010810190505b6305f5e1008310612129576305f5e100838161211f5761211e613541565b5b0492506008810190505b612710831061214e57612710838161214457612143613541565b5b0492506004810190505b60648310612171576064838161216757612166613541565b5b0492506002810190505b600a8310612180576001810190505b80915050919050565b60606040519050601f19601f6020840101168101604052818152818360208301863c9392505050565b82805482825590600052602060002090810192821561222b579160200282015b8281111561222a5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906121d2565b5b509050612238919061223c565b5090565b5b8082111561225557600081600090555060010161223d565b5090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6122c082612277565b810181811067ffffffffffffffff821117156122df576122de612288565b5b80604052505050565b60006122f2612259565b90506122fe82826122b7565b919050565b600067ffffffffffffffff82111561231e5761231d612288565b5b61232782612277565b9050602081019050919050565b82818337600083830152505050565b600061235661235184612303565b6122e8565b90508281526020810184848401111561237257612371612272565b5b61237d848285612334565b509392505050565b600082601f83011261239a5761239961226d565b5b81356123aa848260208601612343565b91505092915050565b6000602082840312156123c9576123c8612263565b5b600082013567ffffffffffffffff8111156123e7576123e6612268565b5b6123f384828501612385565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612427826123fc565b9050919050565b6124378161241c565b82525050565b6000602082019050612452600083018461242e565b92915050565b600080fd5b600080fd5b60008083601f8401126124785761247761226d565b5b8235905067ffffffffffffffff81111561249557612494612458565b5b6020830191508360018202830111156124b1576124b061245d565b5b9250929050565b600080602083850312156124cf576124ce612263565b5b600083013567ffffffffffffffff8111156124ed576124ec612268565b5b6124f985828601612462565b92509250509250929050565b6000819050919050565b61251881612505565b811461252357600080fd5b50565b6000813590506125358161250f565b92915050565b60006020828403121561255157612550612263565b5b600061255f84828501612526565b91505092915050565b61257181612505565b82525050565b600060208201905061258c6000830184612568565b92915050565b600067ffffffffffffffff8211156125ad576125ac612288565b5b602082029050602081019050919050565b6125c78161241c565b81146125d257600080fd5b50565b6000813590506125e4816125be565b92915050565b60006125fd6125f884612592565b6122e8565b905080838252602082019050602084028301858111156126205761261f61245d565b5b835b81811015612649578061263588826125d5565b845260208401935050602081019050612622565b5050509392505050565b600082601f8301126126685761266761226d565b5b81356126788482602086016125ea565b91505092915050565b60006020828403121561269757612696612263565b5b600082013567ffffffffffffffff8111156126b5576126b4612268565b5b6126c184828501612653565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6126ff8161241c565b82525050565b600061271183836126f6565b60208301905092915050565b6000602082019050919050565b6000612735826126ca565b61273f81856126d5565b935061274a836126e6565b8060005b8381101561277b5781516127628882612705565b975061276d8361271d565b92505060018101905061274e565b5085935050505092915050565b600060208201905081810360008301526127a2818461272a565b905092915050565b600080604083850312156127c1576127c0612263565b5b60006127cf858286016125d5565b92505060206127e0858286016125d5565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612824578082015181840152602081019050612809565b60008484015250505050565b600061283b826127ea565b61284581856127f5565b9350612855818560208601612806565b61285e81612277565b840191505092915050565b600060408201905081810360008301526128838185612830565b905081810360208301526128978184612830565b90509392505050565b60006060820190506128b56000830186612568565b6128c26020830185612568565b6128cf6040830184612568565b949350505050565b6000602082840312156128ed576128ec612263565b5b60006128fb848285016125d5565b91505092915050565b60008115159050919050565b61291981612904565b811461292457600080fd5b50565b60008151905061293681612910565b92915050565b60006020828403121561295257612951612263565b5b600061296084828501612927565b91505092915050565b6000612974826123fc565b9050919050565b61298481612969565b811461298f57600080fd5b50565b6000815190506129a18161297b565b92915050565b600063ffffffff82169050919050565b6129c0816129a7565b81146129cb57600080fd5b50565b6000815190506129dd816129b7565b92915050565b600067ffffffffffffffff82169050919050565b612a00816129e3565b8114612a0b57600080fd5b50565b600081519050612a1d816129f7565b92915050565b600081519050612a328161250f565b92915050565b60008060008060008060008060006101208a8c031215612a5b57612a5a612263565b5b6000612a698c828d01612992565b9950506020612a7a8c828d01612992565b9850506040612a8b8c828d01612992565b9750506060612a9c8c828d016129ce565b9650506080612aad8c828d01612992565b95505060a0612abe8c828d01612a0e565b94505060c0612acf8c828d01612a23565b93505060e0612ae08c828d01612a23565b925050610100612af28c828d01612a23565b9150509295985092959850929598565b6000606082019050612b17600083018661242e565b612b24602083018561242e565b612b31604083018461242e565b949350505050565b600060ff82169050919050565b612b4f81612b39565b82525050565b60006060820190508181036000830152612b6f8186612830565b90508181036020830152612b838185612830565b9050612b926040830184612b46565b949350505050565b600081519050919050565b600082825260208201905092915050565b6000612bc182612b9a565b612bcb8185612ba5565b9350612bdb818560208601612806565b612be481612277565b840191505092915050565b60006080820190508181036000830152612c098187612830565b90508181036020830152612c1d8186612bb6565b90508181036040830152612c318185612bb6565b90508181036060830152612c458184612bb6565b905095945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c8a82612505565b9150612c9583612505565b9250828203905081811115612cad57612cac612c50565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215612cf857612cf7612263565b5b6000612d0684828501612a23565b91505092915050565b6000612d1a82612505565b9150612d2583612505565b9250828201905080821115612d3d57612d3c612c50565b5b92915050565b600081905092915050565b7f467261786c656e6420496e7465726573742042656172696e6720000000000000600082015250565b6000612d84601a83612d43565b9150612d8f82612d4e565b601a82019050919050565b6000612da5826127ea565b612daf8185612d43565b9350612dbf818560208601612806565b80840191505092915050565b7f2028000000000000000000000000000000000000000000000000000000000000600082015250565b6000612e01600283612d43565b9150612e0c82612dcb565b600282019050919050565b7f2900000000000000000000000000000000000000000000000000000000000000600082015250565b6000612e4d600183612d43565b9150612e5882612e17565b600182019050919050565b7f202d200000000000000000000000000000000000000000000000000000000000600082015250565b6000612e99600383612d43565b9150612ea482612e63565b600382019050919050565b6000612eba82612d77565b9150612ec68286612d9a565b9150612ed182612df4565b9150612edd8285612d9a565b9150612ee882612e40565b9150612ef382612e8c565b9150612eff8284612d9a565b9150819050949350505050565b7f6600000000000000000000000000000000000000000000000000000000000000600082015250565b6000612f42600183612d43565b9150612f4d82612f0c565b600182019050919050565b7f2800000000000000000000000000000000000000000000000000000000000000600082015250565b6000612f8e600183612d43565b9150612f9982612f58565b600182019050919050565b7f2d00000000000000000000000000000000000000000000000000000000000000600082015250565b6000612fda600183612d43565b9150612fe582612fa4565b600182019050919050565b6000612ffb82612f35565b91506130078286612d9a565b915061301282612f81565b915061301e8285612d9a565b915061302982612e40565b915061303482612fcd565b91506130408284612d9a565b9150819050949350505050565b6000604082019050613062600083018561242e565b61306f602083018461242e565b9392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006130d26026836127f5565b91506130dd82613076565b604082019050919050565b60006020820190508181036000830152613101816130c5565b9050919050565b600081905092915050565b600061311e82612b9a565b6131288185613108565b9350613138818560208601612806565b80840191505092915050565b60006131508284613113565b915081905092915050565b61316481612b39565b811461316f57600080fd5b50565b6000815190506131818161315b565b92915050565b60006020828403121561319d5761319c612263565b5b60006131ab84828501613172565b91505092915050565b600060608201905081810360008301526131ce8186612bb6565b905081810360208301526131e28185612bb6565b905081810360408301526131f68184612bb6565b9050949350505050565b600061320c8285613113565b91506132188284613113565b91508190509392505050565b60006132308286613113565b915061323c8285613113565b91506132488284613113565b9150819050949350505050565b61325e81612904565b82525050565b6000604082019050613279600083018561242e565b6132866020830184613255565b9392505050565b600061329882612505565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036132ca576132c9612c50565b5b600182019050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061330b6020836127f5565b9150613316826132d5565b602082019050919050565b6000602082019050818103600083015261333a816132fe565b9050919050565b7f736c6963655f6f766572666c6f77000000000000000000000000000000000000600082015250565b6000613377600e836127f5565b915061338282613341565b602082019050919050565b600060208201905081810360008301526133a68161336a565b9050919050565b7f736c6963655f6f75744f66426f756e6473000000000000000000000000000000600082015250565b60006133e36011836127f5565b91506133ee826133ad565b602082019050919050565b60006020820190508181036000830152613412816133d6565b9050919050565b60008082015250565b600061342f600183612d43565b915061343a82613419565b600182019050919050565b600061345082613422565b915061345c8284613113565b915081905092915050565b7f600b5981380380925939f3000000000000000000000000000000000000000000600082015250565b600061349d600b83612d43565b91506134a882613467565b600b82019050919050565b60006134be82613490565b91506134ca8284613113565b915081905092915050565b7f4445504c4f594d454e545f4641494c4544000000000000000000000000000000600082015250565b600061350b6011836127f5565b9150613516826134d5565b602082019050919050565b6000602082019050818103600083015261353a816134fe565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600067ffffffffffffffff82111561358b5761358a612288565b5b61359482612277565b9050602081019050919050565b60006135b46135af84613570565b6122e8565b9050828152602081018484840111156135d0576135cf612272565b5b6135db848285612806565b509392505050565b600082601f8301126135f8576135f761226d565b5b81516136088482602086016135a1565b91505092915050565b60006020828403121561362757613626612263565b5b600082015167ffffffffffffffff81111561364557613644612268565b5b613651848285016135e3565b91505092915050565b600061366582612b39565b915060ff820361367857613677612c50565b5b60018201905091905056fea164736f6c6343000813000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000ed01ea3b95e0f68df2c9cd67f138ff3547b311c000000000000000000000000c4eb45d80dc1f079045e75d5d55de8ed1c1090e6000000000000000000000000c16068d1ca7e24e20e56bb70af4d00d92aa4f0b200000000000000000000000064f85076665dce1fbefc23391b8bfb2595c250f60000000000000000000000008c22ebc8f9b96ceac97ea21c53f3b27ef2f45e57
-----Decoded View---------------
Arg [0] : _params (tuple):
Arg [1] : circuitBreaker (address): 0x0eD01ea3B95e0f68DF2c9CD67F138ff3547b311C
Arg [2] : comptroller (address): 0xC4EB45d80DC1F079045E75D5d55de8eD1c1090E6
Arg [3] : timelock (address): 0xc16068d1ca7E24E20e56bB70af4D00D92AA4f0b2
Arg [4] : fraxlendWhitelist (address): 0x64F85076665dcE1FbEfC23391b8BFB2595c250f6
Arg [5] : fraxlendPairRegistry (address): 0x8c22EBc8f9B96cEac97EA21c53F3B27ef2F45e57
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000000ed01ea3b95e0f68df2c9cd67f138ff3547b311c
Arg [1] : 000000000000000000000000c4eb45d80dc1f079045e75d5d55de8ed1c1090e6
Arg [2] : 000000000000000000000000c16068d1ca7e24e20e56bb70af4d00d92aa4f0b2
Arg [3] : 00000000000000000000000064f85076665dce1fbefc23391b8bfb2595c250f6
Arg [4] : 0000000000000000000000008c22ebc8f9b96ceac97ea21c53f3b27ef2f45e57
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in FRAX
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.