Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- CargoFactory
- Optimization enabled
- true
- Compiler version
- v0.8.20+commit.a1b79de6
- Optimization runs
- 200
- EVM Version
- paris
- Verified at
- 2026-07-26T19:49:20.746047Z
Contract source code
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.20;
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
/**
* @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.
*
* The initial owner is set to the address provided by the deployer. 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;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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 {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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);
}
}
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC20/ERC20.sol)
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Metadata.sol)
/**
* @dev Interface for the optional metadata functions from the ERC-20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// OpenZeppelin Contracts (last updated v5.5.0) (interfaces/draft-IERC6093.sol)
/**
* @dev Standard ERC-20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC-721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-721.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC-1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC-20
* applications.
*/
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
mapping(address account => uint256) private _balances;
mapping(address account => mapping(address spender => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* Both values are immutable: they can only be set once during construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/// @inheritdoc IERC20
function totalSupply() public view virtual returns (uint256) {
return _totalSupply;
}
/// @inheritdoc IERC20
function balanceOf(address account) public view virtual returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `value`.
*/
function transfer(address to, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, value);
return true;
}
/// @inheritdoc IERC20
function allowance(address owner, address spender) public view virtual returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, value);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Skips emitting an {Approval} event indicating an allowance update. This is not
* required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `value`.
* - the caller must have allowance for ``from``'s tokens of at least
* `value`.
*/
function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
return true;
}
/**
* @dev Moves a `value` amount of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _transfer(address from, address to, uint256 value) internal {
if (from == address(0)) {
revert ERC20InvalidSender(address(0));
}
if (to == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(from, to, value);
}
/**
* @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
* (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
* this function.
*
* Emits a {Transfer} event.
*/
function _update(address from, address to, uint256 value) internal virtual {
if (from == address(0)) {
// Overflow check required: The rest of the code assumes that totalSupply never overflows
_totalSupply += value;
} else {
uint256 fromBalance = _balances[from];
if (fromBalance < value) {
revert ERC20InsufficientBalance(from, fromBalance, value);
}
unchecked {
// Overflow not possible: value <= fromBalance <= totalSupply.
_balances[from] = fromBalance - value;
}
}
if (to == address(0)) {
unchecked {
// Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
_totalSupply -= value;
}
} else {
unchecked {
// Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
_balances[to] += value;
}
}
emit Transfer(from, to, value);
}
/**
* @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
* Relies on the `_update` mechanism
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _mint(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(address(0), account, value);
}
/**
* @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
* Relies on the `_update` mechanism.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead
*/
function _burn(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidSender(address(0));
}
_update(account, address(0), value);
}
/**
* @dev Sets `value` as the allowance of `spender` over the `owner`'s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
*/
function _approve(address owner, address spender, uint256 value) internal {
_approve(owner, spender, value, true);
}
/**
* @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
*
* By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
* `_spendAllowance` during the `transferFrom` operation sets the flag to false. This saves gas by not emitting any
* `Approval` event during `transferFrom` operations.
*
* Anyone who wishes to continue emitting `Approval` events on the `transferFrom` operation can force the flag to
* true using the following override:
*
* ```solidity
* function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
* super._approve(owner, spender, value, true);
* }
* ```
*
* Requirements are the same as {_approve}.
*/
function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
if (owner == address(0)) {
revert ERC20InvalidApprover(address(0));
}
if (spender == address(0)) {
revert ERC20InvalidSpender(address(0));
}
_allowances[owner][spender] = value;
if (emitEvent) {
emit Approval(owner, spender, value);
}
}
/**
* @dev Updates `owner`'s allowance for `spender` based on spent `value`.
*
* Does not update the allowance value in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Does not emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance < type(uint256).max) {
if (currentAllowance < value) {
revert ERC20InsufficientAllowance(spender, currentAllowance, value);
}
unchecked {
_approve(owner, spender, currentAllowance - value, false);
}
}
}
}
// OpenZeppelin Contracts (last updated v5.5.0) (utils/ReentrancyGuard.sol)
// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC-1967 implementation slot:
* ```solidity
* contract ERC1967 {
* // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* TIP: Consider using this library along with {SlotDerivation}.
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct Int256Slot {
int256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Int256Slot` with member `value` located at `slot`.
*/
function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
assembly ("memory-safe") {
r.slot := store.slot
}
}
/**
* @dev Returns a `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
assembly ("memory-safe") {
r.slot := store.slot
}
}
}
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*
* IMPORTANT: Deprecated. This storage-based reentrancy guard will be removed and replaced
* by the {ReentrancyGuardTransient} variant in v6.0.
*
* @custom:stateless
*/
abstract contract ReentrancyGuard {
using StorageSlot for bytes32;
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ReentrancyGuard")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant REENTRANCY_GUARD_STORAGE =
0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00;
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_reentrancyGuardStorageSlot().getUint256Slot().value = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
/**
* @dev A `view` only version of {nonReentrant}. Use to block view functions
* from being called, preventing reading from inconsistent contract state.
*
* CAUTION: This is a "view" modifier and does not change the reentrancy
* status. Use it only on view functions. For payable or non-payable functions,
* use the standard {nonReentrant} modifier instead.
*/
modifier nonReentrantView() {
_nonReentrantBeforeView();
_;
}
function _nonReentrantBeforeView() private view {
if (_reentrancyGuardEntered()) {
revert ReentrancyGuardReentrantCall();
}
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
_nonReentrantBeforeView();
// Any calls to nonReentrant after this point will fail
_reentrancyGuardStorageSlot().getUint256Slot().value = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_reentrancyGuardStorageSlot().getUint256Slot().value = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _reentrancyGuardStorageSlot().getUint256Slot().value == ENTERED;
}
function _reentrancyGuardStorageSlot() internal pure virtual returns (bytes32) {
return REENTRANCY_GUARD_STORAGE;
}
}
// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
bool private _paused;
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
/**
* @dev The operation failed because the contract is paused.
*/
error EnforcedPause();
/**
* @dev The operation failed because the contract is not paused.
*/
error ExpectedPause();
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
if (paused()) {
revert EnforcedPause();
}
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
/// @title CargoMath — Safe math utilities for AMM calculations
library CargoMath {
/// @notice Returns the minimum of two uint256 values
function min(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = x < y ? x : y;
}
/// @notice Babylonian method for integer square root
/// @dev Accurate for all uint256 inputs, gas-optimized
function sqrt(uint256 y) internal pure returns (uint256 z) {
if (y > 3) {
z = y;
uint256 x = y;
if (y > 0xffffffffffffffffffffffffffffffff) { x >>= 128; z >>= 64; }
if (x > 0xffffffffffffffff) { x >>= 64; z >>= 32; }
if (x > 0xffffffff) { x >>= 32; z >>= 16; }
if (x > 0xffff) { x >>= 16; z >>= 8; }
if (x > 0xff) { x >>= 8; z >>= 4; }
if (x > 0xf) { x >>= 4; z >>= 2; }
if (x > 0x3) { z >>= 1; }
z = (z + y / z) >> 1;
z = (z + y / z) >> 1;
z = (z + y / z) >> 1;
z = (z + y / z) >> 1;
z = (z + y / z) >> 1;
z = (z + y / z) >> 1;
z = (z + y / z) >> 1;
uint256 z1 = y / z;
if (z > z1) z = z1;
} else if (y != 0) {
z = 1;
}
}
}
/// @title ICargoFactory — Factory Interface
/// @notice Interface for CargoFactory fee configuration
interface ICargoFactory {
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function allPairsLength() external view returns (uint256);
function owner() external view returns (address);
}
/// @title CargoPair — AMM Liquidity Pool
/// @notice Uniswap V2 fork with ETH/native token support
/// @dev WARNING: TWAP oracle is for internal use only. Use Chainlink for external pricing.
contract CargoPair is ERC20, ReentrancyGuard, Pausable {
using CargoMath for uint256;
// ── Errors ──────────────────────────────────────────────────────────
error NotInitialized();
error AlreadyInitialized();
error Forbidden();
error Expired();
error ZeroValue();
error ZeroAddress();
error InsufficientInput();
error InsufficientOutput();
error InsufficientLiquidity();
error InsufficientLiquidityMinted();
error InsufficientLiquidityBurned();
error InsufficientCargoOut();
error InsufficientTokenOut();
error InsufficientTokenAmount();
error NoLiquidity();
error StaleReservesSync();
error CargoTransferFailed();
error TokenTransferFailed();
error LiquidityTooLow();
error PairedContractReverted();
// ── Events ──────────────────────────────────────────────────────────
event Mint(address indexed sender, uint256 amountCargo, uint256 amountToken);
event Burn(address indexed sender, uint256 amountCargo, uint256 amountToken, address indexed to);
event Swap(
address indexed sender,
uint256 amountCargoIn,
uint256 amountTokenIn,
uint256 amountCargoOut,
uint256 amountTokenOut,
address indexed to
);
event Sync(uint256 reserveCargo, uint256 reserveToken);
event PermanentLiquidityBurned(uint256 amount);
event Initialized(address indexed token);
event PairSkimmed(address indexed to, uint256 cargoAmount, uint256 tokenAmount);
// ── State ───────────────────────────────────────────────────────────
address public factory;
address public token;
bool private _initialized;
uint256 private constant MINIMUM_LIQUIDITY = 10 ** 3;
uint256 private constant FEE_NUMERATOR = 997;
uint256 private constant FEE_DENOMINATOR = 1000;
uint256 public reserveCargo;
uint256 public reserveToken;
uint256 public price0CumulativeLast;
uint256 public price1CumulativeLast;
uint256 public kLast;
uint256 private _blockTimestampLast;
// ── Modifiers ───────────────────────────────────────────────────────
modifier onlyFactory() {
// Allow factory contract OR factory owner
if (msg.sender != factory && msg.sender != ICargoFactory(factory).owner()) revert Forbidden();
_;
}
modifier initialized() {
if (!_initialized) revert NotInitialized();
_;
}
modifier checkDeadline(uint256 deadline) {
if (block.timestamp > deadline) revert Expired();
_;
}
// ── Constructor ─────────────────────────────────────────────────────
constructor() ERC20("Cargo Liquidity Provider", "CARGO-LP") {
factory = msg.sender;
}
// ── Initialization ──────────────────────────────────────────────────
function initialize(address _token) external {
if (_initialized) revert AlreadyInitialized();
if (_token == address(0)) revert ZeroAddress();
token = _token;
_initialized = true;
emit Initialized(_token);
}
// ── View Functions ──────────────────────────────────────────────────
function getReserves() public view returns (uint256 cargo, uint256 tokenAmt, uint256 ts) {
cargo = reserveCargo;
tokenAmt = reserveToken;
ts = _blockTimestampLast;
}
// ── Internal Functions ──────────────────────────────────────────────
function _update(uint256 balanceCargo, uint256 balanceToken) private {
uint256 timeElapsed = block.timestamp - _blockTimestampLast;
if (timeElapsed > 0 && reserveCargo != 0 && reserveToken != 0) {
unchecked {
price0CumulativeLast += (reserveToken * timeElapsed) / reserveCargo;
price1CumulativeLast += (reserveCargo * timeElapsed) / reserveToken;
}
}
reserveCargo = balanceCargo;
reserveToken = balanceToken;
_blockTimestampLast = block.timestamp;
emit Sync(reserveCargo, reserveToken);
}
function _mintFee(uint256 _reserveCargo, uint256 _reserveToken) private returns (bool feeOn) {
address feeTo = ICargoFactory(factory).feeTo();
feeOn = feeTo != address(0);
uint256 _kLast = kLast;
if (feeOn) {
if (_kLast != 0) {
uint256 rootK = CargoMath.sqrt(_reserveCargo * _reserveToken);
uint256 rootKLast = CargoMath.sqrt(_kLast);
if (rootK > rootKLast) {
uint256 numerator = totalSupply() * (rootK - rootKLast);
uint256 denominator = rootK * 5 + rootKLast;
uint256 liquidity = numerator / denominator;
if (liquidity > 0) _mint(feeTo, liquidity);
}
}
} else if (_kLast != 0) {
kLast = 0;
}
}
function _safeTransfer(address tokenAddr, address to, uint256 value) private {
(bool success, bytes memory data) = tokenAddr.call(
abi.encodeWithSelector(IERC20.transfer.selector, to, value)
);
if (!success || (data.length != 0 && !abi.decode(data, (bool)))) revert TokenTransferFailed();
}
function _safeTransferFrom(address tokenAddr, address from, address to, uint256 value) private {
(bool success, bytes memory data) = tokenAddr.call(
abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value)
);
if (!success || (data.length != 0 && !abi.decode(data, (bool)))) revert TokenTransferFailed();
}
/// @notice Safe ETH transfer with failure handling
/// @dev Uses call with success check — reverts on failure to protect users
function _safeTransferETH(address to, uint256 value) private {
(bool success, ) = payable(to).call{value: value}("");
if (!success) revert CargoTransferFailed();
}
// ── Liquidity Functions ─────────────────────────────────────────────
function addLiquidity(
address to,
uint256 maxTokenIn,
uint256 deadline
) external payable nonReentrant initialized whenNotPaused checkDeadline(deadline) returns (uint256 liquidity, uint256 tokenUsed) {
if (to == address(0)) revert ZeroAddress();
if (msg.value == 0) revert ZeroValue();
if (maxTokenIn == 0) revert InsufficientInput();
uint256 _reserveCargo = reserveCargo;
uint256 _reserveToken = reserveToken;
if (_reserveCargo == 0 && _reserveToken == 0) {
require(maxTokenIn > 0, "CargoPair: INITIAL_TOKEN_REQUIRED");
_safeTransferFrom(token, msg.sender, address(this), maxTokenIn);
tokenUsed = maxTokenIn;
} else {
if (_reserveCargo == 0) revert StaleReservesSync();
uint256 optimalToken = (msg.value * _reserveToken) / _reserveCargo;
if (optimalToken > maxTokenIn) revert InsufficientTokenAmount();
if (optimalToken == 0) revert InsufficientInput();
_safeTransferFrom(token, msg.sender, address(this), optimalToken);
tokenUsed = optimalToken;
}
uint256 balanceCargo = address(this).balance;
uint256 balanceToken = IERC20(token).balanceOf(address(this));
uint256 amountCargo = balanceCargo - _reserveCargo;
uint256 amountToken = balanceToken - _reserveToken;
_mintFee(_reserveCargo, _reserveToken);
uint256 _totalSupply = totalSupply();
if (_totalSupply == 0) {
uint256 rootK = CargoMath.sqrt(amountCargo * amountToken);
if (rootK <= MINIMUM_LIQUIDITY) revert LiquidityTooLow();
liquidity = rootK - MINIMUM_LIQUIDITY;
_mint(0x000000000000000000000000000000000000dEaD, MINIMUM_LIQUIDITY);
emit PermanentLiquidityBurned(MINIMUM_LIQUIDITY);
} else {
liquidity = CargoMath.min(
(amountCargo * _totalSupply) / _reserveCargo,
(amountToken * _totalSupply) / _reserveToken
);
}
if (liquidity == 0) revert InsufficientLiquidityMinted();
_mint(to, liquidity);
_update(balanceCargo, balanceToken);
kLast = reserveCargo * reserveToken;
emit Mint(msg.sender, amountCargo, amountToken);
}
function removeLiquidity(
uint256 liquidity,
address to,
uint256 deadline
) external nonReentrant initialized whenNotPaused checkDeadline(deadline) returns (uint256 amountCargo, uint256 amountToken) {
if (to == address(0)) revert ZeroAddress();
if (liquidity == 0) revert InsufficientLiquidityBurned();
if (balanceOf(msg.sender) < liquidity) revert InsufficientLiquidityBurned();
uint256 balanceCargo = address(this).balance;
uint256 balanceToken = IERC20(token).balanceOf(address(this));
_mintFee(reserveCargo, reserveToken);
uint256 _totalSupply = totalSupply();
amountCargo = (liquidity * balanceCargo) / _totalSupply;
amountToken = (liquidity * balanceToken) / _totalSupply;
if (amountCargo == 0) revert InsufficientCargoOut();
if (amountToken == 0) revert InsufficientTokenOut();
_burn(msg.sender, liquidity);
_safeTransfer(token, to, amountToken);
_safeTransferETH(to, amountCargo);
balanceCargo = address(this).balance;
balanceToken = IERC20(token).balanceOf(address(this));
_update(balanceCargo, balanceToken);
kLast = reserveCargo * reserveToken;
emit Burn(msg.sender, amountCargo, amountToken, to);
}
// ── Swap Functions ──────────────────────────────────────────────────
function swapExactCargoForTokens(
uint256 amountOutMin,
address to,
uint256 deadline
) external payable nonReentrant initialized whenNotPaused checkDeadline(deadline) returns (uint256 amountOut) {
if (to == address(0)) revert ZeroAddress();
uint256 amountIn = msg.value;
if (amountIn == 0) revert ZeroValue();
uint256 _reserveCargo = reserveCargo;
uint256 _reserveToken = reserveToken;
if (_reserveCargo == 0 || _reserveToken == 0) revert NoLiquidity();
amountOut = (amountIn * FEE_NUMERATOR * _reserveToken) /
((_reserveCargo * FEE_DENOMINATOR) + (amountIn * FEE_NUMERATOR));
if (amountOut < amountOutMin) revert InsufficientOutput();
if (amountOut >= _reserveToken) revert InsufficientLiquidity();
_safeTransfer(token, to, amountOut);
_update(address(this).balance, IERC20(token).balanceOf(address(this)));
emit Swap(msg.sender, amountIn, 0, 0, amountOut, to);
}
function swapExactTokensForCargo(
uint256 amountIn,
uint256 amountOutMin,
address to,
uint256 deadline
) external nonReentrant initialized whenNotPaused checkDeadline(deadline) returns (uint256 amountOut) {
if (to == address(0)) revert ZeroAddress();
if (amountIn == 0) revert ZeroValue();
_safeTransferFrom(token, msg.sender, address(this), amountIn);
uint256 _reserveCargo = reserveCargo;
uint256 _reserveToken = reserveToken;
if (_reserveCargo == 0 || _reserveToken == 0) revert NoLiquidity();
amountOut = (amountIn * FEE_NUMERATOR * _reserveCargo) /
((_reserveToken * FEE_DENOMINATOR) + (amountIn * FEE_NUMERATOR));
if (amountOut < amountOutMin) revert InsufficientOutput();
if (amountOut >= _reserveCargo) revert InsufficientLiquidity();
_safeTransferETH(to, amountOut);
_update(address(this).balance, IERC20(token).balanceOf(address(this)));
emit Swap(msg.sender, 0, amountIn, amountOut, 0, to);
}
// ── Admin Functions ─────────────────────────────────────────────────
/// @notice Skim excess tokens/ETH to owner only
/// @dev Restricted to factory owner to prevent griefing
function skim(address to) external nonReentrant onlyFactory {
if (to == address(0)) revert ZeroAddress();
address _token = token;
uint256 tokenBalance = IERC20(_token).balanceOf(address(this));
uint256 cargoBalance = address(this).balance;
uint256 tExcess = tokenBalance > reserveToken ? tokenBalance - reserveToken : 0;
uint256 cExcess = cargoBalance > reserveCargo ? cargoBalance - reserveCargo : 0;
if (tExcess > 0) {
_safeTransfer(_token, to, tExcess);
}
if (cExcess > 0) {
_safeTransferETH(to, cExcess);
}
emit PairSkimmed(to, cExcess, tExcess);
}
function sync() external nonReentrant onlyFactory {
_update(address(this).balance, IERC20(token).balanceOf(address(this)));
}
function pause() external onlyFactory {
_pause();
}
function unpause() external onlyFactory {
_unpause();
}
// ── Receive ─────────────────────────────────────────────────────────
receive() external payable {}
}
/// @title CargoFactory — AMM Pair Factory
/// @notice Creates and manages CargoPair pools with timelock-protected fee changes
contract CargoFactory is Ownable {
// ── Errors ──────────────────────────────────────────────────────────
error Forbidden();
error ZeroAddress();
error PairExists();
error Create2Failed();
error MaxPairsExceeded();
error TimelockNotReady();
error TimelockNotExpired();
error InvalidTimelock();
// ── Events ──────────────────────────────────────────────────────────
event PairCreated(
address indexed nativeAsset,
address indexed token,
address pair,
uint256 pairIndex
);
event FeeToUpdated(address indexed oldFeeTo, address indexed newFeeTo);
event FeeToSetterUpdated(address indexed oldSetter, address indexed newSetter);
event Pause(address indexed account);
event Unpause(address indexed account);
event FeeToTimelockStarted(address indexed newFeeTo, uint256 executeAfter);
event FeeToTimelockCancelled();
// ── State ───────────────────────────────────────────────────────────
address public feeTo;
address public feeToSetter;
uint256 public constant MAX_PAIRS = 256;
uint256 public constant TIMELOCK_DURATION = 1 days;
mapping(address => mapping(address => address)) public getPair;
address[] public allPairs;
// Timelock for feeTo changes
address public pendingFeeTo;
uint256 public feeToTimelockExpiry;
// ── Constructor ─────────────────────────────────────────────────────
constructor() Ownable(msg.sender) {
feeToSetter = msg.sender;
}
// ── View Functions ──────────────────────────────────────────────────
function allPairsLength() external view returns (uint256) {
return allPairs.length;
}
// ── Pair Management ─────────────────────────────────────────────────
function createPair(address tokenAddr) external returns (address pair) {
if (tokenAddr == address(0)) revert ZeroAddress();
if (getPair[address(0)][tokenAddr] != address(0)) revert PairExists();
if (allPairs.length >= MAX_PAIRS) revert MaxPairsExceeded();
bytes memory bytecode = type(CargoPair).creationCode;
bytes32 salt = keccak256(abi.encodePacked(address(0), tokenAddr));
assembly {
pair := create2(0, add(bytecode, 32), mload(bytecode), salt)
}
if (pair == address(0)) revert Create2Failed();
CargoPair(payable(pair)).initialize(tokenAddr);
getPair[address(0)][tokenAddr] = pair;
getPair[tokenAddr][address(0)] = pair;
allPairs.push(pair);
emit PairCreated(address(0), tokenAddr, pair, allPairs.length);
}
// ── Fee Management (Timelock Protected) ─────────────────────────────
/// @notice Start timelock for changing fee recipient
/// @param _feeTo New fee recipient address
function proposeFeeTo(address _feeTo) external {
if (msg.sender != feeToSetter) revert Forbidden();
if (_feeTo == address(0)) revert ZeroAddress();
pendingFeeTo = _feeTo;
feeToTimelockExpiry = block.timestamp + TIMELOCK_DURATION;
emit FeeToTimelockStarted(_feeTo, feeToTimelockExpiry);
}
/// @notice Execute pending feeTo change after timelock expires
function executeFeeTo() external {
if (msg.sender != feeToSetter) revert Forbidden();
if (pendingFeeTo == address(0)) revert TimelockNotReady();
if (block.timestamp < feeToTimelockExpiry) revert TimelockNotExpired();
address old = feeTo;
feeTo = pendingFeeTo;
pendingFeeTo = address(0);
feeToTimelockExpiry = 0;
emit FeeToUpdated(old, feeTo);
}
/// @notice Cancel pending feeTo change
function cancelFeeToTimelock() external {
if (msg.sender != feeToSetter) revert Forbidden();
pendingFeeTo = address(0);
feeToTimelockExpiry = 0;
emit FeeToTimelockCancelled();
}
/// @notice Update feeToSetter (immediate — setters are trusted)
function setFeeToSetter(address _feeToSetter) external {
if (msg.sender != feeToSetter) revert Forbidden();
if (_feeToSetter == address(0)) revert ZeroAddress();
address old = feeToSetter;
feeToSetter = _feeToSetter;
emit FeeToSetterUpdated(old, _feeToSetter);
}
// ── Pause (propagates to all pairs) ─────────────────────────────────
function pausePair(address pair) external {
if (msg.sender != owner()) revert Forbidden();
CargoPair(payable(pair)).pause();
}
function unpausePair(address pair) external {
if (msg.sender != owner()) revert Forbidden();
CargoPair(payable(pair)).unpause();
}
}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"error","name":"Create2Failed","inputs":[]},{"type":"error","name":"Forbidden","inputs":[]},{"type":"error","name":"InvalidTimelock","inputs":[]},{"type":"error","name":"MaxPairsExceeded","inputs":[]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"error","name":"PairExists","inputs":[]},{"type":"error","name":"TimelockNotExpired","inputs":[]},{"type":"error","name":"TimelockNotReady","inputs":[]},{"type":"error","name":"ZeroAddress","inputs":[]},{"type":"event","name":"FeeToSetterUpdated","inputs":[{"type":"address","name":"oldSetter","internalType":"address","indexed":true},{"type":"address","name":"newSetter","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"FeeToTimelockCancelled","inputs":[],"anonymous":false},{"type":"event","name":"FeeToTimelockStarted","inputs":[{"type":"address","name":"newFeeTo","internalType":"address","indexed":true},{"type":"uint256","name":"executeAfter","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"FeeToUpdated","inputs":[{"type":"address","name":"oldFeeTo","internalType":"address","indexed":true},{"type":"address","name":"newFeeTo","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"PairCreated","inputs":[{"type":"address","name":"nativeAsset","internalType":"address","indexed":true},{"type":"address","name":"token","internalType":"address","indexed":true},{"type":"address","name":"pair","internalType":"address","indexed":false},{"type":"uint256","name":"pairIndex","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Pause","inputs":[{"type":"address","name":"account","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Unpause","inputs":[{"type":"address","name":"account","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_PAIRS","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"TIMELOCK_DURATION","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"allPairs","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allPairsLength","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"cancelFeeToTimelock","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"address","name":"pair","internalType":"address"}],"name":"createPair","inputs":[{"type":"address","name":"tokenAddr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"executeFeeTo","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"feeTo","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"feeToSetter","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"feeToTimelockExpiry","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getPair","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pausePair","inputs":[{"type":"address","name":"pair","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"pendingFeeTo","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"proposeFeeTo","inputs":[{"type":"address","name":"_feeTo","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeToSetter","inputs":[{"type":"address","name":"_feeToSetter","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpausePair","inputs":[{"type":"address","name":"pair","internalType":"address"}]}]
Contract Creation Code
0x608060405234801561001057600080fd5b50338061003757604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61004081610058565b50600280546001600160a01b031916331790556100a8565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b613279806100b76000396000f3fe60806040523480156200001157600080fd5b5060043610620001395760003560e01c8063996cf23311620000bb578063e1c20979116200007a578063e1c20979146200025f578063e6a439051462000269578063e96ede4214620002a0578063f2fde38b14620002b7578063f7c733c014620002ce57600080fd5b8063996cf23314620001fc5780639ccb074414620002065780639feb0c76146200021d578063a2e74af61462000231578063ce70448f146200024857600080fd5b80633ec321cf11620001085780633ec321cf14620001b35780634623c81e14620001cc578063574f2ba314620001d7578063715018a614620001e05780638da5cb5b14620001ea57600080fd5b8063017e7e58146200013e578063094b7415146200016f5780631218a3b214620001835780631e3dd18b146200019c575b600080fd5b60015462000152906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60025462000152906001600160a01b031681565b6200019a6200019436600462000a34565b620002d8565b005b62000152620001ad36600462000a59565b6200035c565b620001bd60065481565b60405190815260200162000166565b620001bd6201518081565b600454620001bd565b6200019a62000387565b6000546001600160a01b031662000152565b620001bd61010081565b620001526200021736600462000a34565b6200039f565b60055462000152906001600160a01b031681565b6200019a6200024236600462000a34565b62000626565b6200019a6200025936600462000a34565b620006cc565b6200019a62000790565b620001526200027a36600462000a73565b60036020908152600092835260408084209091529082529020546001600160a01b031681565b6200019a620002b136600462000a34565b6200086e565b6200019a620002c836600462000a34565b620008d6565b6200019a6200091e565b6000546001600160a01b031633146200030457604051631dd2188d60e31b815260040160405180910390fd5b806001600160a01b0316633f4ba83a6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200034057600080fd5b505af115801562000355573d6000803e3d6000fd5b5050505050565b600481815481106200036d57600080fd5b6000918252602090912001546001600160a01b0316905081565b620003916200098a565b6200039d6000620009b9565b565b60006001600160a01b038216620003c95760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0382811660009081527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff602052604090205416156200042257604051633d77e89160e01b815260040160405180910390fd5b600454610100116200044757604051630769e8d360e11b815260040160405180910390fd5b6000604051806020016200045b9062000a09565b601f1982820381018352601f909101166040819052600060208201819052606086901b6bffffffffffffffffffffffff19166034830152919250604801604051602081830303815290604052805190602001209050808251602084016000f592506001600160a01b038316620004e457604051630252d9f760e11b815260040160405180910390fd5b60405163189acdbd60e31b81526001600160a01b03858116600483015284169063c4d66de890602401600060405180830381600087803b1580156200052857600080fd5b505af11580156200053d573d6000803e3d6000fd5b505050506001600160a01b0384811660008181527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff6020908152604080832080546001600160a01b0319908116968a169687179091556003835281842084805283528184208054821687179055600480546001810182558186527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054909216871790915554815195865291850191909152919290917f0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9910160405180910390a35050919050565b6002546001600160a01b031633146200065257604051631dd2188d60e31b815260040160405180910390fd5b6001600160a01b0381166200067a5760405163d92e233d60e01b815260040160405180910390fd5b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fcca89bc909e02b7f333d20ee52583360f8ede8c27d76774f1e1c5935576a7f7290600090a35050565b6002546001600160a01b03163314620006f857604051631dd2188d60e31b815260040160405180910390fd5b6001600160a01b038116620007205760405163d92e233d60e01b815260040160405180910390fd5b600580546001600160a01b0319166001600160a01b0383161790556200074a620151804262000aab565b60068190556040519081526001600160a01b038216907fca08a32f8e2cc45a6e3298274c898214e3477056b4319fa8334cf90345c971449060200160405180910390a250565b6002546001600160a01b03163314620007bc57604051631dd2188d60e31b815260040160405180910390fd5b6005546001600160a01b0316620007e657604051637378c19d60e01b815260040160405180910390fd5b6006544210156200080a5760405163621e25c360e01b815260040160405180910390fd5b60018054600580546001600160a01b03198084166001600160a01b038381169182179096559116909155600060068190556040519390921692909183917f8f93286d6f131e956d1aa672d3ecdc817f24efc20b223b0de5d591f454edc3479190a350565b6000546001600160a01b031633146200089a57604051631dd2188d60e31b815260040160405180910390fd5b806001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200034057600080fd5b620008e06200098a565b6001600160a01b0381166200091057604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6200091b81620009b9565b50565b6002546001600160a01b031633146200094a57604051631dd2188d60e31b815260040160405180910390fd5b600580546001600160a01b0319169055600060068190556040517f9b07ffeb2bb5bf98e1f437c84e4f011a793b204b116fd1e6e2477195ae8fe53d9190a1565b6000546001600160a01b031633146200039d5760405163118cdaa760e01b815233600482015260240162000907565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6127708062000ad483390190565b80356001600160a01b038116811462000a2f57600080fd5b919050565b60006020828403121562000a4757600080fd5b62000a528262000a17565b9392505050565b60006020828403121562000a6c57600080fd5b5035919050565b6000806040838503121562000a8757600080fd5b62000a928362000a17565b915062000aa26020840162000a17565b90509250929050565b8082018082111562000acd57634e487b7160e01b600052601160045260246000fd5b9291505056fe60806040523480156200001157600080fd5b506040518060400160405280601881526020017f436172676f204c69717569646974792050726f76696465720000000000000000815250604051806040016040528060088152602001670434152474f2d4c560c41b81525081600390816200007a91906200018c565b5060046200008982826200018c565b5050506001620000a5620000a2620000c360201b60201c565b90565b5560058054610100600160a81b031916336101000217905562000258565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0090565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200011257607f821691505b6020821081036200013357634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200018757600081815260208120601f850160051c81016020861015620001625750805b601f850160051c820191505b8181101562000183578281556001016200016e565b5050505b505050565b81516001600160401b03811115620001a857620001a8620000e7565b620001c081620001b98454620000fd565b8462000139565b602080601f831160018114620001f85760008415620001df5750858301515b600019600386901b1c1916600185901b17855562000183565b600085815260208120601f198616915b82811015620002295788860151825594840194600190910190840162000208565b5085821015620002485787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61250880620002686000396000f3fe6080604052600436106101a05760003560e01c80637464fc3d116100ec578063c45a01551161008a578063dd62ed3e11610064578063dd62ed3e14610496578063f4325d67146104dc578063fc0c546a146104f2578063fff6cae91461051257600080fd5b8063c45a015514610419578063c4ccdeea14610456578063c4d66de81461047657600080fd5b80638acaf74a116100c65780638acaf74a146103ae57806395d89b41146103c4578063a9059cbb146103d9578063bc25cf77146103f957600080fd5b80637464fc3d146103705780638456cb591461038657806386fb37981461039b57600080fd5b8063313ce567116101595780635909c0d5116101335780635909c0d5146102f65780635a3d54931461030c5780635c975abb1461032257806370a082311461033a57600080fd5b8063313ce5671461029b5780633f4ba83a146102b757806355776b77146102ce57600080fd5b806306fdde03146101ac5780630902f1ac146101d7578063092d2d7f14610208578063095ea7b31461023657806318160ddd1461026657806323b872dd1461027b57600080fd5b366101a757005b600080fd5b3480156101b857600080fd5b506101c1610527565b6040516101ce91906121d3565b60405180910390f35b3480156101e357600080fd5b50600754600854600c54604080519384526020840192909252908201526060016101ce565b34801561021457600080fd5b5061022861022336600461221b565b6105b9565b6040519081526020016101ce565b34801561024257600080fd5b5061025661025136600461225a565b610824565b60405190151581526020016101ce565b34801561027257600080fd5b50600254610228565b34801561028757600080fd5b50610256610296366004612286565b61083e565b3480156102a757600080fd5b50604051601281526020016101ce565b3480156102c357600080fd5b506102cc610864565b005b6102e16102dc3660046122c7565b610934565b604080519283526020830191909152016101ce565b34801561030257600080fd5b5061022860095481565b34801561031857600080fd5b50610228600a5481565b34801561032e57600080fd5b5060055460ff16610256565b34801561034657600080fd5b506102286103553660046122fc565b6001600160a01b031660009081526020819052604090205490565b34801561037c57600080fd5b50610228600b5481565b34801561039257600080fd5b506102cc610d46565b6102286103a9366004612319565b610e14565b3480156103ba57600080fd5b5061022860075481565b3480156103d057600080fd5b506101c161102d565b3480156103e557600080fd5b506102566103f436600461225a565b61103c565b34801561040557600080fd5b506102cc6104143660046122fc565b61104a565b34801561042557600080fd5b5060055461043e9061010090046001600160a01b031681565b6040516001600160a01b0390911681526020016101ce565b34801561046257600080fd5b506102e1610471366004612319565b61127d565b34801561048257600080fd5b506102cc6104913660046122fc565b61156d565b3480156104a257600080fd5b506102286104b1366004612340565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3480156104e857600080fd5b5061022860085481565b3480156104fe57600080fd5b5060065461043e906001600160a01b031681565b34801561051e57600080fd5b506102cc61160e565b60606003805461053690612379565b80601f016020809104026020016040519081016040528092919081815260200182805461056290612379565b80156105af5780601f10610584576101008083540402835291602001916105af565b820191906000526020600020905b81548152906001019060200180831161059257829003601f168201915b5050505050905090565b60006105c3611729565b600654600160a01b900460ff166105ed576040516321c4e35760e21b815260040160405180910390fd5b6105f5611745565b818042111561061757604051630407b05b60e31b815260040160405180910390fd5b6001600160a01b03841661063e5760405163d92e233d60e01b815260040160405180910390fd5b8560000361065f57604051637c946ed760e01b815260040160405180910390fd5b600654610677906001600160a01b0316333089611769565b600754600854811580610688575080155b156106a657604051636180f03f60e11b815260040160405180910390fd5b6106b26103e5896123c9565b6106be6103e8836123c9565b6106c891906123e0565b826106d56103e58b6123c9565b6106df91906123c9565b6106e99190612409565b93508684101561070c5760405163bb2875c360e01b815260040160405180910390fd5b81841061072c5760405163bb55fd2760e01b815260040160405180910390fd5b6107368685611863565b6006546040516370a0823160e01b81523060048201526107ae9147916001600160a01b03909116906370a08231906024015b602060405180830381865afa158015610785573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a9919061242b565b6118dc565b604080516000808252602082018b9052818301879052606082015290516001600160a01b0388169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350505061081c60016000805160206124b383398151915255565b949350505050565b6000336108328185856119a2565b60019150505b92915050565b60003361084c8582856119af565b610857858585611a2e565b60019150505b9392505050565b60055461010090046001600160a01b0316331480159061090c5750600560019054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f69190612444565b6001600160a01b0316336001600160a01b031614155b1561092a57604051631dd2188d60e31b815260040160405180910390fd5b610932611a8d565b565b60008061093f611729565b600654600160a01b900460ff16610969576040516321c4e35760e21b815260040160405180910390fd5b610971611745565b828042111561099357604051630407b05b60e31b815260040160405180910390fd5b6001600160a01b0386166109ba5760405163d92e233d60e01b815260040160405180910390fd5b346000036109db57604051637c946ed760e01b815260040160405180910390fd5b846000036109fc5760405163f8b3bb6160e01b815260040160405180910390fd5b60075460085481158015610a0e575080155b15610a925760008711610a725760405162461bcd60e51b815260206004820152602160248201527f436172676f506169723a20494e495449414c5f544f4b454e5f524551554952456044820152601160fa1b60648201526084015b60405180910390fd5b600654610a8a906001600160a01b031633308a611769565b869350610b29565b81600003610ab357604051635b16157d60e11b815260040160405180910390fd5b600082610ac083346123c9565b610aca9190612409565b905087811115610aed57604051631762402160e11b815260040160405180910390fd5b80600003610b0e5760405163f8b3bb6160e01b815260040160405180910390fd5b600654610b26906001600160a01b0316333084611769565b93505b6006546040516370a0823160e01b815230600482015247916000916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610b76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9a919061242b565b90506000610ba88584612461565b90506000610bb68584612461565b9050610bc28686611adf565b506000610bce60025490565b905080600003610c67576000610bec610be784866123c9565b611c12565b90506103e88111610c1057604051634088b74160e01b815260040160405180910390fd5b610c1c6103e882612461565b9a50610c2c61dead6103e8611da9565b6040516103e881527fae3369a6140e1e652814c880a1f87b0e0aa329ec50ab97a7d4de5e7caaf249c09060200160405180910390a150610c9c565b610c9987610c7583866123c9565b610c7f9190612409565b87610c8a84866123c9565b610c949190612409565b611de3565b99505b89600003610cbd57604051633489be7560e21b815260040160405180910390fd5b610cc78d8b611da9565b610cd185856118dc565b600854600754610ce191906123c9565b600b55604080518481526020810184905233917f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f910160405180910390a25050505050505050610d3e60016000805160206124b383398151915255565b935093915050565b60055461010090046001600160a01b03163314801590610dee5750600560019054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610db4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd89190612444565b6001600160a01b0316336001600160a01b031614155b15610e0c57604051631dd2188d60e31b815260040160405180910390fd5b610932611df9565b6000610e1e611729565b600654600160a01b900460ff16610e48576040516321c4e35760e21b815260040160405180910390fd5b610e50611745565b8180421115610e7257604051630407b05b60e31b815260040160405180910390fd5b6001600160a01b038416610e995760405163d92e233d60e01b815260040160405180910390fd5b346000819003610ebc57604051637c946ed760e01b815260040160405180910390fd5b600754600854811580610ecd575080155b15610eeb57604051636180f03f60e11b815260040160405180910390fd5b610ef76103e5846123c9565b610f036103e8846123c9565b610f0d91906123e0565b81610f1a6103e5866123c9565b610f2491906123c9565b610f2e9190612409565b945087851015610f515760405163bb2875c360e01b815260040160405180910390fd5b808510610f715760405163bb55fd2760e01b815260040160405180910390fd5b600654610f88906001600160a01b03168887611e36565b6006546040516370a0823160e01b8152306004820152610fbe9147916001600160a01b03909116906370a0823190602401610768565b60408051848152600060208201819052818301526060810187905290516001600160a01b0389169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a35050505061085d60016000805160206124b383398151915255565b60606004805461053690612379565b600033610832818585611a2e565b611052611729565b60055461010090046001600160a01b031633148015906110fa5750600560019054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e49190612444565b6001600160a01b0316336001600160a01b031614155b1561111857604051631dd2188d60e31b815260040160405180910390fd5b6001600160a01b03811661113f5760405163d92e233d60e01b815260040160405180910390fd5b6006546040516370a0823160e01b81523060048201526001600160a01b039091169060009082906370a0823190602401602060405180830381865afa15801561118c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b0919061242b565b90506000479050600060085483116111c95760006111d6565b6008546111d69084612461565b9050600060075483116111ea5760006111f7565b6007546111f79084612461565b9050811561120a5761120a858784611e36565b801561121a5761121a8682611863565b60408051828152602081018490526001600160a01b038816917fe2459372bf2d601eff5e11bdcdd16c39436da3a1b7744bb08a2e287057a92705910160405180910390a2505050505061127a60016000805160206124b383398151915255565b50565b600080611288611729565b600654600160a01b900460ff166112b2576040516321c4e35760e21b815260040160405180910390fd5b6112ba611745565b82804211156112dc57604051630407b05b60e31b815260040160405180910390fd5b6001600160a01b0385166113035760405163d92e233d60e01b815260040160405180910390fd5b856000036113245760405163749383ad60e01b815260040160405180910390fd5b336000908152602081905260409020548611156113545760405163749383ad60e01b815260040160405180910390fd5b6006546040516370a0823160e01b815230600482015247916000916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156113a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c5919061242b565b90506113d5600754600854611adf565b5060006113e160025490565b9050806113ee848b6123c9565b6113f89190612409565b955080611405838b6123c9565b61140f9190612409565b94508560000361143257604051632332fef360e21b815260040160405180910390fd5b8460000361145357604051633dec066560e01b815260040160405180910390fd5b61145d338a611f27565b600654611474906001600160a01b03168987611e36565b61147e8887611863565b6006546040516370a0823160e01b81523060048201524794506001600160a01b03909116906370a0823190602401602060405180830381865afa1580156114c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ed919061242b565b91506114f983836118dc565b60085460075461150991906123c9565b600b5560408051878152602081018790526001600160a01b038a169133917fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496910160405180910390a350505050610d3e60016000805160206124b383398151915255565b600654600160a01b900460ff16156115975760405162dc149f60e41b815260040160405180910390fd5b6001600160a01b0381166115be5760405163d92e233d60e01b815260040160405180910390fd5b600680546001600160a81b0319166001600160a01b038316908117600160a01b179091556040517f908408e307fc569b417f6cbec5d5a06f44a0a505ac0479b47d421a4b2fd6a1e690600090a250565b611616611729565b60055461010090046001600160a01b031633148015906116be5750600560019054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611684573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a89190612444565b6001600160a01b0316336001600160a01b031614155b156116dc57604051631dd2188d60e31b815260040160405180910390fd5b6006546040516370a0823160e01b81523060048201526117129147916001600160a01b03909116906370a0823190602401610768565b61093260016000805160206124b383398151915255565b611731611f5d565b60026000805160206124b383398151915255565b60055460ff16156109325760405163d93c066560e01b815260040160405180910390fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916117cd9190612474565b6000604051808303816000865af19150503d806000811461180a576040519150601f19603f3d011682016040523d82523d6000602084013e61180f565b606091505b509150915081158061183d575080511580159061183d57508080602001905181019061183b9190612490565b155b1561185b5760405163022e258160e11b815260040160405180910390fd5b505050505050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146118b0576040519150601f19603f3d011682016040523d82523d6000602084013e6118b5565b606091505b50509050806118d757604051630136109160e01b815260040160405180910390fd5b505050565b6000600c54426118ec9190612461565b90506000811180156118ff575060075415155b801561190c575060085415155b1561195657600754816008540281611926576119266123f3565b60098054929091049091019055600854600754820281611948576119486123f3565b600a80549290910490910190555b6007839055600882905542600c5560408051848152602081018490527fcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a910160405180910390a1505050565b6118d78383836001611f8d565b6001600160a01b03838116600090815260016020908152604080832093861683529290522054600019811015611a285781811015611a1957604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610a69565b611a2884848484036000611f8d565b50505050565b6001600160a01b038316611a5857604051634b637e8f60e11b815260006004820152602401610a69565b6001600160a01b038216611a825760405163ec442f0560e01b815260006004820152602401610a69565b6118d7838383612062565b611a9561218c565b6005805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080600560019054906101000a90046001600160a01b03166001600160a01b031663017e7e586040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b599190612444565b600b546001600160a01b038216158015945091925090611bfe578015611bf9576000611b88610be786886123c9565b90506000611b9583611c12565b905080821115611bf6576000611bab8284612461565b600254611bb891906123c9565b9050600082611bc88560056123c9565b611bd291906123e0565b90506000611be08284612409565b90508015611bf257611bf28782611da9565b5050505b50505b611c0a565b8015611c0a576000600b555b505092915050565b60006003821115611d9a575080806fffffffffffffffffffffffffffffffff811115611c435760409190911c9060801c5b67ffffffffffffffff811115611c5e5760209190911c9060401c5b63ffffffff811115611c755760109190911c9060201c5b61ffff811115611c8a5760089190911c9060101c5b60ff811115611c9e5760049190911c9060081c5b600f811115611cb25760029190911c9060041c5b6003811115611cc357600182901c91505b6001611ccf8385612409565b611cd990846123e0565b901c91506001611ce98385612409565b611cf390846123e0565b901c91506001611d038385612409565b611d0d90846123e0565b901c91506001611d1d8385612409565b611d2790846123e0565b901c91506001611d378385612409565b611d4190846123e0565b901c91506001611d518385612409565b611d5b90846123e0565b901c91506001611d6b8385612409565b611d7590846123e0565b901c91506000611d858385612409565b905080831115611d93578092505b5050919050565b8115611da4575060015b919050565b6001600160a01b038216611dd35760405163ec442f0560e01b815260006004820152602401610a69565b611ddf60008383612062565b5050565b6000818310611df2578161085d565b5090919050565b611e01611745565b6005805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ac23390565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691611e929190612474565b6000604051808303816000865af19150503d8060008114611ecf576040519150601f19603f3d011682016040523d82523d6000602084013e611ed4565b606091505b5091509150811580611f025750805115801590611f02575080806020019051810190611f009190612490565b155b15611f205760405163022e258160e11b815260040160405180910390fd5b5050505050565b6001600160a01b038216611f5157604051634b637e8f60e11b815260006004820152602401610a69565b611ddf82600083612062565b6000805160206124b38339815191525460020361093257604051633ee5aeb560e01b815260040160405180910390fd5b6001600160a01b038416611fb75760405163e602df0560e01b815260006004820152602401610a69565b6001600160a01b038316611fe157604051634a1406b160e11b815260006004820152602401610a69565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015611a2857826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161205491815260200190565b60405180910390a350505050565b6001600160a01b03831661208d57806002600082825461208291906123e0565b909155506120ff9050565b6001600160a01b038316600090815260208190526040902054818110156120e05760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610a69565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661211b5760028054829003905561213a565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161217f91815260200190565b60405180910390a3505050565b60055460ff1661093257604051638dfc202b60e01b815260040160405180910390fd5b60005b838110156121ca5781810151838201526020016121b2565b50506000910152565b60208152600082518060208401526121f28160408501602087016121af565b601f01601f19169190910160400192915050565b6001600160a01b038116811461127a57600080fd5b6000806000806080858703121561223157600080fd5b8435935060208501359250604085013561224a81612206565b9396929550929360600135925050565b6000806040838503121561226d57600080fd5b823561227881612206565b946020939093013593505050565b60008060006060848603121561229b57600080fd5b83356122a681612206565b925060208401356122b681612206565b929592945050506040919091013590565b6000806000606084860312156122dc57600080fd5b83356122e781612206565b95602085013595506040909401359392505050565b60006020828403121561230e57600080fd5b813561085d81612206565b60008060006060848603121561232e57600080fd5b8335925060208401356122b681612206565b6000806040838503121561235357600080fd5b823561235e81612206565b9150602083013561236e81612206565b809150509250929050565b600181811c9082168061238d57607f821691505b6020821081036123ad57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610838576108386123b3565b80820180821115610838576108386123b3565b634e487b7160e01b600052601260045260246000fd5b60008261242657634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561243d57600080fd5b5051919050565b60006020828403121561245657600080fd5b815161085d81612206565b81810381811115610838576108386123b3565b600082516124868184602087016121af565b9190910192915050565b6000602082840312156124a257600080fd5b8151801515811461085d57600080fdfe9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a2646970667358221220358d1723e74193a9386c5ebafead988f19775e55766403a448315fe1144007d264736f6c63430008140033a26469706673582212201aea1379375ef494865b4c2da811ebb63f7309b1b6fd7e782754a1e48d666df264736f6c63430008140033
Deployed ByteCode
0x60806040523480156200001157600080fd5b5060043610620001395760003560e01c8063996cf23311620000bb578063e1c20979116200007a578063e1c20979146200025f578063e6a439051462000269578063e96ede4214620002a0578063f2fde38b14620002b7578063f7c733c014620002ce57600080fd5b8063996cf23314620001fc5780639ccb074414620002065780639feb0c76146200021d578063a2e74af61462000231578063ce70448f146200024857600080fd5b80633ec321cf11620001085780633ec321cf14620001b35780634623c81e14620001cc578063574f2ba314620001d7578063715018a614620001e05780638da5cb5b14620001ea57600080fd5b8063017e7e58146200013e578063094b7415146200016f5780631218a3b214620001835780631e3dd18b146200019c575b600080fd5b60015462000152906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60025462000152906001600160a01b031681565b6200019a6200019436600462000a34565b620002d8565b005b62000152620001ad36600462000a59565b6200035c565b620001bd60065481565b60405190815260200162000166565b620001bd6201518081565b600454620001bd565b6200019a62000387565b6000546001600160a01b031662000152565b620001bd61010081565b620001526200021736600462000a34565b6200039f565b60055462000152906001600160a01b031681565b6200019a6200024236600462000a34565b62000626565b6200019a6200025936600462000a34565b620006cc565b6200019a62000790565b620001526200027a36600462000a73565b60036020908152600092835260408084209091529082529020546001600160a01b031681565b6200019a620002b136600462000a34565b6200086e565b6200019a620002c836600462000a34565b620008d6565b6200019a6200091e565b6000546001600160a01b031633146200030457604051631dd2188d60e31b815260040160405180910390fd5b806001600160a01b0316633f4ba83a6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200034057600080fd5b505af115801562000355573d6000803e3d6000fd5b5050505050565b600481815481106200036d57600080fd5b6000918252602090912001546001600160a01b0316905081565b620003916200098a565b6200039d6000620009b9565b565b60006001600160a01b038216620003c95760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0382811660009081527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff602052604090205416156200042257604051633d77e89160e01b815260040160405180910390fd5b600454610100116200044757604051630769e8d360e11b815260040160405180910390fd5b6000604051806020016200045b9062000a09565b601f1982820381018352601f909101166040819052600060208201819052606086901b6bffffffffffffffffffffffff19166034830152919250604801604051602081830303815290604052805190602001209050808251602084016000f592506001600160a01b038316620004e457604051630252d9f760e11b815260040160405180910390fd5b60405163189acdbd60e31b81526001600160a01b03858116600483015284169063c4d66de890602401600060405180830381600087803b1580156200052857600080fd5b505af11580156200053d573d6000803e3d6000fd5b505050506001600160a01b0384811660008181527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff6020908152604080832080546001600160a01b0319908116968a169687179091556003835281842084805283528184208054821687179055600480546001810182558186527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018054909216871790915554815195865291850191909152919290917f0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9910160405180910390a35050919050565b6002546001600160a01b031633146200065257604051631dd2188d60e31b815260040160405180910390fd5b6001600160a01b0381166200067a5760405163d92e233d60e01b815260040160405180910390fd5b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fcca89bc909e02b7f333d20ee52583360f8ede8c27d76774f1e1c5935576a7f7290600090a35050565b6002546001600160a01b03163314620006f857604051631dd2188d60e31b815260040160405180910390fd5b6001600160a01b038116620007205760405163d92e233d60e01b815260040160405180910390fd5b600580546001600160a01b0319166001600160a01b0383161790556200074a620151804262000aab565b60068190556040519081526001600160a01b038216907fca08a32f8e2cc45a6e3298274c898214e3477056b4319fa8334cf90345c971449060200160405180910390a250565b6002546001600160a01b03163314620007bc57604051631dd2188d60e31b815260040160405180910390fd5b6005546001600160a01b0316620007e657604051637378c19d60e01b815260040160405180910390fd5b6006544210156200080a5760405163621e25c360e01b815260040160405180910390fd5b60018054600580546001600160a01b03198084166001600160a01b038381169182179096559116909155600060068190556040519390921692909183917f8f93286d6f131e956d1aa672d3ecdc817f24efc20b223b0de5d591f454edc3479190a350565b6000546001600160a01b031633146200089a57604051631dd2188d60e31b815260040160405180910390fd5b806001600160a01b0316638456cb596040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156200034057600080fd5b620008e06200098a565b6001600160a01b0381166200091057604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6200091b81620009b9565b50565b6002546001600160a01b031633146200094a57604051631dd2188d60e31b815260040160405180910390fd5b600580546001600160a01b0319169055600060068190556040517f9b07ffeb2bb5bf98e1f437c84e4f011a793b204b116fd1e6e2477195ae8fe53d9190a1565b6000546001600160a01b031633146200039d5760405163118cdaa760e01b815233600482015260240162000907565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6127708062000ad483390190565b80356001600160a01b038116811462000a2f57600080fd5b919050565b60006020828403121562000a4757600080fd5b62000a528262000a17565b9392505050565b60006020828403121562000a6c57600080fd5b5035919050565b6000806040838503121562000a8757600080fd5b62000a928362000a17565b915062000aa26020840162000a17565b90509250929050565b8082018082111562000acd57634e487b7160e01b600052601160045260246000fd5b9291505056fe60806040523480156200001157600080fd5b506040518060400160405280601881526020017f436172676f204c69717569646974792050726f76696465720000000000000000815250604051806040016040528060088152602001670434152474f2d4c560c41b81525081600390816200007a91906200018c565b5060046200008982826200018c565b5050506001620000a5620000a2620000c360201b60201c565b90565b5560058054610100600160a81b031916336101000217905562000258565b7f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f0090565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200011257607f821691505b6020821081036200013357634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200018757600081815260208120601f850160051c81016020861015620001625750805b601f850160051c820191505b8181101562000183578281556001016200016e565b5050505b505050565b81516001600160401b03811115620001a857620001a8620000e7565b620001c081620001b98454620000fd565b8462000139565b602080601f831160018114620001f85760008415620001df5750858301515b600019600386901b1c1916600185901b17855562000183565b600085815260208120601f198616915b82811015620002295788860151825594840194600190910190840162000208565b5085821015620002485787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61250880620002686000396000f3fe6080604052600436106101a05760003560e01c80637464fc3d116100ec578063c45a01551161008a578063dd62ed3e11610064578063dd62ed3e14610496578063f4325d67146104dc578063fc0c546a146104f2578063fff6cae91461051257600080fd5b8063c45a015514610419578063c4ccdeea14610456578063c4d66de81461047657600080fd5b80638acaf74a116100c65780638acaf74a146103ae57806395d89b41146103c4578063a9059cbb146103d9578063bc25cf77146103f957600080fd5b80637464fc3d146103705780638456cb591461038657806386fb37981461039b57600080fd5b8063313ce567116101595780635909c0d5116101335780635909c0d5146102f65780635a3d54931461030c5780635c975abb1461032257806370a082311461033a57600080fd5b8063313ce5671461029b5780633f4ba83a146102b757806355776b77146102ce57600080fd5b806306fdde03146101ac5780630902f1ac146101d7578063092d2d7f14610208578063095ea7b31461023657806318160ddd1461026657806323b872dd1461027b57600080fd5b366101a757005b600080fd5b3480156101b857600080fd5b506101c1610527565b6040516101ce91906121d3565b60405180910390f35b3480156101e357600080fd5b50600754600854600c54604080519384526020840192909252908201526060016101ce565b34801561021457600080fd5b5061022861022336600461221b565b6105b9565b6040519081526020016101ce565b34801561024257600080fd5b5061025661025136600461225a565b610824565b60405190151581526020016101ce565b34801561027257600080fd5b50600254610228565b34801561028757600080fd5b50610256610296366004612286565b61083e565b3480156102a757600080fd5b50604051601281526020016101ce565b3480156102c357600080fd5b506102cc610864565b005b6102e16102dc3660046122c7565b610934565b604080519283526020830191909152016101ce565b34801561030257600080fd5b5061022860095481565b34801561031857600080fd5b50610228600a5481565b34801561032e57600080fd5b5060055460ff16610256565b34801561034657600080fd5b506102286103553660046122fc565b6001600160a01b031660009081526020819052604090205490565b34801561037c57600080fd5b50610228600b5481565b34801561039257600080fd5b506102cc610d46565b6102286103a9366004612319565b610e14565b3480156103ba57600080fd5b5061022860075481565b3480156103d057600080fd5b506101c161102d565b3480156103e557600080fd5b506102566103f436600461225a565b61103c565b34801561040557600080fd5b506102cc6104143660046122fc565b61104a565b34801561042557600080fd5b5060055461043e9061010090046001600160a01b031681565b6040516001600160a01b0390911681526020016101ce565b34801561046257600080fd5b506102e1610471366004612319565b61127d565b34801561048257600080fd5b506102cc6104913660046122fc565b61156d565b3480156104a257600080fd5b506102286104b1366004612340565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3480156104e857600080fd5b5061022860085481565b3480156104fe57600080fd5b5060065461043e906001600160a01b031681565b34801561051e57600080fd5b506102cc61160e565b60606003805461053690612379565b80601f016020809104026020016040519081016040528092919081815260200182805461056290612379565b80156105af5780601f10610584576101008083540402835291602001916105af565b820191906000526020600020905b81548152906001019060200180831161059257829003601f168201915b5050505050905090565b60006105c3611729565b600654600160a01b900460ff166105ed576040516321c4e35760e21b815260040160405180910390fd5b6105f5611745565b818042111561061757604051630407b05b60e31b815260040160405180910390fd5b6001600160a01b03841661063e5760405163d92e233d60e01b815260040160405180910390fd5b8560000361065f57604051637c946ed760e01b815260040160405180910390fd5b600654610677906001600160a01b0316333089611769565b600754600854811580610688575080155b156106a657604051636180f03f60e11b815260040160405180910390fd5b6106b26103e5896123c9565b6106be6103e8836123c9565b6106c891906123e0565b826106d56103e58b6123c9565b6106df91906123c9565b6106e99190612409565b93508684101561070c5760405163bb2875c360e01b815260040160405180910390fd5b81841061072c5760405163bb55fd2760e01b815260040160405180910390fd5b6107368685611863565b6006546040516370a0823160e01b81523060048201526107ae9147916001600160a01b03909116906370a08231906024015b602060405180830381865afa158015610785573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a9919061242b565b6118dc565b604080516000808252602082018b9052818301879052606082015290516001600160a01b0388169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a350505061081c60016000805160206124b383398151915255565b949350505050565b6000336108328185856119a2565b60019150505b92915050565b60003361084c8582856119af565b610857858585611a2e565b60019150505b9392505050565b60055461010090046001600160a01b0316331480159061090c5750600560019054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f69190612444565b6001600160a01b0316336001600160a01b031614155b1561092a57604051631dd2188d60e31b815260040160405180910390fd5b610932611a8d565b565b60008061093f611729565b600654600160a01b900460ff16610969576040516321c4e35760e21b815260040160405180910390fd5b610971611745565b828042111561099357604051630407b05b60e31b815260040160405180910390fd5b6001600160a01b0386166109ba5760405163d92e233d60e01b815260040160405180910390fd5b346000036109db57604051637c946ed760e01b815260040160405180910390fd5b846000036109fc5760405163f8b3bb6160e01b815260040160405180910390fd5b60075460085481158015610a0e575080155b15610a925760008711610a725760405162461bcd60e51b815260206004820152602160248201527f436172676f506169723a20494e495449414c5f544f4b454e5f524551554952456044820152601160fa1b60648201526084015b60405180910390fd5b600654610a8a906001600160a01b031633308a611769565b869350610b29565b81600003610ab357604051635b16157d60e11b815260040160405180910390fd5b600082610ac083346123c9565b610aca9190612409565b905087811115610aed57604051631762402160e11b815260040160405180910390fd5b80600003610b0e5760405163f8b3bb6160e01b815260040160405180910390fd5b600654610b26906001600160a01b0316333084611769565b93505b6006546040516370a0823160e01b815230600482015247916000916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610b76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9a919061242b565b90506000610ba88584612461565b90506000610bb68584612461565b9050610bc28686611adf565b506000610bce60025490565b905080600003610c67576000610bec610be784866123c9565b611c12565b90506103e88111610c1057604051634088b74160e01b815260040160405180910390fd5b610c1c6103e882612461565b9a50610c2c61dead6103e8611da9565b6040516103e881527fae3369a6140e1e652814c880a1f87b0e0aa329ec50ab97a7d4de5e7caaf249c09060200160405180910390a150610c9c565b610c9987610c7583866123c9565b610c7f9190612409565b87610c8a84866123c9565b610c949190612409565b611de3565b99505b89600003610cbd57604051633489be7560e21b815260040160405180910390fd5b610cc78d8b611da9565b610cd185856118dc565b600854600754610ce191906123c9565b600b55604080518481526020810184905233917f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f910160405180910390a25050505050505050610d3e60016000805160206124b383398151915255565b935093915050565b60055461010090046001600160a01b03163314801590610dee5750600560019054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610db4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd89190612444565b6001600160a01b0316336001600160a01b031614155b15610e0c57604051631dd2188d60e31b815260040160405180910390fd5b610932611df9565b6000610e1e611729565b600654600160a01b900460ff16610e48576040516321c4e35760e21b815260040160405180910390fd5b610e50611745565b8180421115610e7257604051630407b05b60e31b815260040160405180910390fd5b6001600160a01b038416610e995760405163d92e233d60e01b815260040160405180910390fd5b346000819003610ebc57604051637c946ed760e01b815260040160405180910390fd5b600754600854811580610ecd575080155b15610eeb57604051636180f03f60e11b815260040160405180910390fd5b610ef76103e5846123c9565b610f036103e8846123c9565b610f0d91906123e0565b81610f1a6103e5866123c9565b610f2491906123c9565b610f2e9190612409565b945087851015610f515760405163bb2875c360e01b815260040160405180910390fd5b808510610f715760405163bb55fd2760e01b815260040160405180910390fd5b600654610f88906001600160a01b03168887611e36565b6006546040516370a0823160e01b8152306004820152610fbe9147916001600160a01b03909116906370a0823190602401610768565b60408051848152600060208201819052818301526060810187905290516001600160a01b0389169133917fd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d8229181900360800190a35050505061085d60016000805160206124b383398151915255565b60606004805461053690612379565b600033610832818585611a2e565b611052611729565b60055461010090046001600160a01b031633148015906110fa5750600560019054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e49190612444565b6001600160a01b0316336001600160a01b031614155b1561111857604051631dd2188d60e31b815260040160405180910390fd5b6001600160a01b03811661113f5760405163d92e233d60e01b815260040160405180910390fd5b6006546040516370a0823160e01b81523060048201526001600160a01b039091169060009082906370a0823190602401602060405180830381865afa15801561118c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b0919061242b565b90506000479050600060085483116111c95760006111d6565b6008546111d69084612461565b9050600060075483116111ea5760006111f7565b6007546111f79084612461565b9050811561120a5761120a858784611e36565b801561121a5761121a8682611863565b60408051828152602081018490526001600160a01b038816917fe2459372bf2d601eff5e11bdcdd16c39436da3a1b7744bb08a2e287057a92705910160405180910390a2505050505061127a60016000805160206124b383398151915255565b50565b600080611288611729565b600654600160a01b900460ff166112b2576040516321c4e35760e21b815260040160405180910390fd5b6112ba611745565b82804211156112dc57604051630407b05b60e31b815260040160405180910390fd5b6001600160a01b0385166113035760405163d92e233d60e01b815260040160405180910390fd5b856000036113245760405163749383ad60e01b815260040160405180910390fd5b336000908152602081905260409020548611156113545760405163749383ad60e01b815260040160405180910390fd5b6006546040516370a0823160e01b815230600482015247916000916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156113a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c5919061242b565b90506113d5600754600854611adf565b5060006113e160025490565b9050806113ee848b6123c9565b6113f89190612409565b955080611405838b6123c9565b61140f9190612409565b94508560000361143257604051632332fef360e21b815260040160405180910390fd5b8460000361145357604051633dec066560e01b815260040160405180910390fd5b61145d338a611f27565b600654611474906001600160a01b03168987611e36565b61147e8887611863565b6006546040516370a0823160e01b81523060048201524794506001600160a01b03909116906370a0823190602401602060405180830381865afa1580156114c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ed919061242b565b91506114f983836118dc565b60085460075461150991906123c9565b600b5560408051878152602081018790526001600160a01b038a169133917fdccd412f0b1252819cb1fd330b93224ca42612892bb3f4f789976e6d81936496910160405180910390a350505050610d3e60016000805160206124b383398151915255565b600654600160a01b900460ff16156115975760405162dc149f60e41b815260040160405180910390fd5b6001600160a01b0381166115be5760405163d92e233d60e01b815260040160405180910390fd5b600680546001600160a81b0319166001600160a01b038316908117600160a01b179091556040517f908408e307fc569b417f6cbec5d5a06f44a0a505ac0479b47d421a4b2fd6a1e690600090a250565b611616611729565b60055461010090046001600160a01b031633148015906116be5750600560019054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611684573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a89190612444565b6001600160a01b0316336001600160a01b031614155b156116dc57604051631dd2188d60e31b815260040160405180910390fd5b6006546040516370a0823160e01b81523060048201526117129147916001600160a01b03909116906370a0823190602401610768565b61093260016000805160206124b383398151915255565b611731611f5d565b60026000805160206124b383398151915255565b60055460ff16156109325760405163d93c066560e01b815260040160405180910390fd5b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916117cd9190612474565b6000604051808303816000865af19150503d806000811461180a576040519150601f19603f3d011682016040523d82523d6000602084013e61180f565b606091505b509150915081158061183d575080511580159061183d57508080602001905181019061183b9190612490565b155b1561185b5760405163022e258160e11b815260040160405180910390fd5b505050505050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146118b0576040519150601f19603f3d011682016040523d82523d6000602084013e6118b5565b606091505b50509050806118d757604051630136109160e01b815260040160405180910390fd5b505050565b6000600c54426118ec9190612461565b90506000811180156118ff575060075415155b801561190c575060085415155b1561195657600754816008540281611926576119266123f3565b60098054929091049091019055600854600754820281611948576119486123f3565b600a80549290910490910190555b6007839055600882905542600c5560408051848152602081018490527fcf2aa50876cdfbb541206f89af0ee78d44a2abf8d328e37fa4917f982149848a910160405180910390a1505050565b6118d78383836001611f8d565b6001600160a01b03838116600090815260016020908152604080832093861683529290522054600019811015611a285781811015611a1957604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610a69565b611a2884848484036000611f8d565b50505050565b6001600160a01b038316611a5857604051634b637e8f60e11b815260006004820152602401610a69565b6001600160a01b038216611a825760405163ec442f0560e01b815260006004820152602401610a69565b6118d7838383612062565b611a9561218c565b6005805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080600560019054906101000a90046001600160a01b03166001600160a01b031663017e7e586040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b599190612444565b600b546001600160a01b038216158015945091925090611bfe578015611bf9576000611b88610be786886123c9565b90506000611b9583611c12565b905080821115611bf6576000611bab8284612461565b600254611bb891906123c9565b9050600082611bc88560056123c9565b611bd291906123e0565b90506000611be08284612409565b90508015611bf257611bf28782611da9565b5050505b50505b611c0a565b8015611c0a576000600b555b505092915050565b60006003821115611d9a575080806fffffffffffffffffffffffffffffffff811115611c435760409190911c9060801c5b67ffffffffffffffff811115611c5e5760209190911c9060401c5b63ffffffff811115611c755760109190911c9060201c5b61ffff811115611c8a5760089190911c9060101c5b60ff811115611c9e5760049190911c9060081c5b600f811115611cb25760029190911c9060041c5b6003811115611cc357600182901c91505b6001611ccf8385612409565b611cd990846123e0565b901c91506001611ce98385612409565b611cf390846123e0565b901c91506001611d038385612409565b611d0d90846123e0565b901c91506001611d1d8385612409565b611d2790846123e0565b901c91506001611d378385612409565b611d4190846123e0565b901c91506001611d518385612409565b611d5b90846123e0565b901c91506001611d6b8385612409565b611d7590846123e0565b901c91506000611d858385612409565b905080831115611d93578092505b5050919050565b8115611da4575060015b919050565b6001600160a01b038216611dd35760405163ec442f0560e01b815260006004820152602401610a69565b611ddf60008383612062565b5050565b6000818310611df2578161085d565b5090919050565b611e01611745565b6005805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ac23390565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1790529151600092839290871691611e929190612474565b6000604051808303816000865af19150503d8060008114611ecf576040519150601f19603f3d011682016040523d82523d6000602084013e611ed4565b606091505b5091509150811580611f025750805115801590611f02575080806020019051810190611f009190612490565b155b15611f205760405163022e258160e11b815260040160405180910390fd5b5050505050565b6001600160a01b038216611f5157604051634b637e8f60e11b815260006004820152602401610a69565b611ddf82600083612062565b6000805160206124b38339815191525460020361093257604051633ee5aeb560e01b815260040160405180910390fd5b6001600160a01b038416611fb75760405163e602df0560e01b815260006004820152602401610a69565b6001600160a01b038316611fe157604051634a1406b160e11b815260006004820152602401610a69565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015611a2857826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161205491815260200190565b60405180910390a350505050565b6001600160a01b03831661208d57806002600082825461208291906123e0565b909155506120ff9050565b6001600160a01b038316600090815260208190526040902054818110156120e05760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610a69565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661211b5760028054829003905561213a565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161217f91815260200190565b60405180910390a3505050565b60055460ff1661093257604051638dfc202b60e01b815260040160405180910390fd5b60005b838110156121ca5781810151838201526020016121b2565b50506000910152565b60208152600082518060208401526121f28160408501602087016121af565b601f01601f19169190910160400192915050565b6001600160a01b038116811461127a57600080fd5b6000806000806080858703121561223157600080fd5b8435935060208501359250604085013561224a81612206565b9396929550929360600135925050565b6000806040838503121561226d57600080fd5b823561227881612206565b946020939093013593505050565b60008060006060848603121561229b57600080fd5b83356122a681612206565b925060208401356122b681612206565b929592945050506040919091013590565b6000806000606084860312156122dc57600080fd5b83356122e781612206565b95602085013595506040909401359392505050565b60006020828403121561230e57600080fd5b813561085d81612206565b60008060006060848603121561232e57600080fd5b8335925060208401356122b681612206565b6000806040838503121561235357600080fd5b823561235e81612206565b9150602083013561236e81612206565b809150509250929050565b600181811c9082168061238d57607f821691505b6020821081036123ad57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610838576108386123b3565b80820180821115610838576108386123b3565b634e487b7160e01b600052601260045260246000fd5b60008261242657634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561243d57600080fd5b5051919050565b60006020828403121561245657600080fd5b815161085d81612206565b81810381811115610838576108386123b3565b600082516124868184602087016121af565b9190910192915050565b6000602082840312156124a257600080fd5b8151801515811461085d57600080fdfe9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a2646970667358221220358d1723e74193a9386c5ebafead988f19775e55766403a448315fe1144007d264736f6c63430008140033a26469706673582212201aea1379375ef494865b4c2da811ebb63f7309b1b6fd7e782754a1e48d666df264736f6c63430008140033