Token Crucible Ferrum Token

 

Overview ERC20

Price
$0.00 @ 0.000000 ETH
Fully Diluted Market Cap
Total Supply:
74,359,856.896291 cFRM

Holders:
100 addresses

Transfers:
-

Contract:
0xe685d3CC0be48BD59082eDe30C3b64CbFc0326e20xe685d3CC0be48BD59082eDe30C3b64CbFc0326e2

Decimals:
18

Social Profiles:
Not Available, Update ?

Loading
[ Download CSV Export  ] 
Loading
[ Download CSV Export  ] 
Loading

Click here to update the token ICO / general information
# Exchange Pair Price  24H Volume % Volume

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x8C81CF8635d31281abFCe706e68Bf2e75A87a402
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
CrucibleToken

Compiler Version
v0.8.2+commit.661d1103

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 14 : CrucibleToken.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;

import "./ICrucibleToken.sol";
import "./ICrucibleTokenDeployer.sol";
import "./ICrucibleFactory.sol";
import "../taxing/IHasTaxDistributor.sol";
import "../taxing/IGeneralTaxDistributor.sol";
import "../common/ERC20/ERC20.sol";
import "../common/math/FullMath.sol";
import "../staking/library/TokenReceivable.sol";

contract CrucibleToken is ERC20, TokenReceivable, ICrucibleToken {
    uint256 constant MAX_FEE_X10k = 0.6 * 10000;

    struct FeeOverride {
        OverrideState over;
        uint64 feeX10000;
    }

    address public immutable factory;
    address public router;
    address public override baseToken; // Remocing immutables to allow etherscan verification to work. Hopefully etherscan gives us a solution
    uint64 public feeOnTransferX10000;
    uint64 public feeOnWithdrawX10000;
    mapping(address => FeeOverride) public feeOverrides;

    event Withdrawn(uint256 amount, uint256 fee, address from, address to);
    event Deposited(address token, uint256 amount, address to);
    event FeeSet(address target, OverrideState overrideType, uint64 feeX10k);
    event FeesUpdated(uint64 feeOnTransferX10000, uint64 feeOnWithdrawX10000);

    modifier onlyRouter() {
        require(msg.sender == router, "CT: not allowed");
        _;
    }

    constructor() {
        address token;
        address fac;
        (
            fac,
            token,
            feeOnTransferX10000,
            feeOnWithdrawX10000,
            name,
            symbol
        ) = ICrucibleTokenDeployer(msg.sender).parameters();
        decimals = safeDecimals(token);
        baseToken = token;
        router = ICrucibleFactory(fac).router();
        factory = fac;
    }

    /**
     @notice Upgrades a router
     @param _router The new router
     @dev Can only be called by the current router
     */
    function upgradeRouter(address _router
    ) external override onlyRouter {
        require(_router != address(0), "CT: router required");
        router = _router;
    }

    /**
     @notice Allow overriding the global crucible fees. Only router action
     @param newFeeOnTransferX10000 Fee on transfer
     @param newFeeOnWithdrawX10000 Fee on withdraw
     */
    function updateCrucibleFees(
        uint64 newFeeOnTransferX10000,
        uint64 newFeeOnWithdrawX10000
    ) external override onlyRouter {
        require(newFeeOnTransferX10000 < MAX_FEE_X10k, "CT: fee too large");
        require(newFeeOnWithdrawX10000 < MAX_FEE_X10k, "CT: fee too large");
        require(newFeeOnTransferX10000 != 0 && newFeeOnWithdrawX10000 != 0, "CT: one fee required");
        feeOnTransferX10000 = newFeeOnTransferX10000;
        feeOnWithdrawX10000 = newFeeOnWithdrawX10000;
        emit FeesUpdated(feeOnTransferX10000, feeOnWithdrawX10000);
    }

    /**
     @notice Overrides fee for a target
     @param target The target to be overriden
     @param overrideType The type of override
     @param newFeeX10000 The new fee
     @dev Can only be called by the router
     */
    function overrideFee(
        address target,
        OverrideState overrideType,
        uint64 newFeeX10000
    ) external override onlyRouter {
        require(newFeeX10000 < MAX_FEE_X10k, "CT: fee too large");
        feeOverrides[target] = FeeOverride({
            over: overrideType,
            feeX10000: newFeeX10000
        });
        emit FeeSet(target, overrideType, newFeeX10000);
    }

    /**
     @notice Deposits into the crucible
        Can only be called by the router
     @param to Receiver of minted tokens
     @return amount The deposited amount
     */
    function deposit(address to
    ) external override onlyRouter returns (uint256 amount) {
        amount = sync(baseToken);
        require(amount != 0, "CT: empty");
        _mint(to, amount);
        emit Deposited(baseToken, amount, to);
    }

    /**
     @notice Withdraws from the crucible
     @param to Receiver of minted tokens
     @param amount The amount to withdraw
     @return fee The fee
     @return withdrawn The withdrawn amounts
     */
    function withdraw(address to, uint256 amount
    ) external override returns (uint256 fee, uint256 withdrawn) {
        (fee, withdrawn) = _withdraw(msg.sender, to, amount);
    }

    /*
     @notice Burn the underlying asset. If not burnable, send to the factory.
     @param amount Amount to burn
     */
    function burn(uint256 amount
    ) external virtual {
        require(amount != 0, "CT: amount required");
        doBurn(msg.sender, amount);
    }

    /*
     @notice Burn the underlying asset. If not burnable, send to the factory.
     @param from The address to burn from
     @param amount Amount to burn
     */
    function burnFrom(address from, uint256 amount
    ) external virtual {
        require(from != address(0), "CT: from required");
        require(amount != 0, "CT: amount required");
        uint256 decreasedAllowance = allowance[from][msg.sender] - amount;

        _approve(from, msg.sender, decreasedAllowance);
        doBurn(from, amount);
    }

    /**
     @notice Withdraws from crucible
     @param from From address
     @param to To address
     @param amount The amount
     @return fee The fee
     @return withdrawn The withdrawn amount
     */
    function _withdraw(
        address from,
        address to,
        uint256 amount
    ) internal virtual returns (uint256 fee, uint256 withdrawn) {
        fee = calculateFeeX10000(amount, feeOnWithdrawX10000);
        withdrawn = amount - fee;
        address td = IHasTaxDistributor(router).taxDistributor();
        tax(from, td, fee);
        _burn(from, withdrawn);
        sendToken(baseToken, to, withdrawn);
        emit Withdrawn(amount, fee, from, to);
    }

    /**
     @notice Burns tokens. Send base tokens to factory to be locke or burned later
     @param from The from address
     @param amount The amount
     */
    function doBurn(address from, uint256 amount
    ) internal {
        sendToken(baseToken, factory, amount);
        _burn(from, amount);
    }

    /**
     @notice Overrides the ERC20 transfer method
     @param sender The sender
     @param recipient The recipient
     @param amount The amount
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual override {
        FeeOverride memory overFrom = feeOverrides[sender];
        FeeOverride memory overTo = feeOverrides[recipient];
        address td = IHasTaxDistributor(router).taxDistributor();
        if (sender == td || recipient == td) {
            _doTransfer(sender, recipient, amount);
            return;
        }

        uint256 feeRatioX10k = 0;
        bool overriden = false;
        if (
            overFrom.over == OverrideState.OverrideOut ||
            overFrom.over == OverrideState.OverrideBoth
        ) {
            feeRatioX10k = overFrom.feeX10000;
            overriden = true;
        }
        if (
            (overTo.over == OverrideState.OverrideIn ||
                overTo.over == OverrideState.OverrideBoth) &&
            overTo.feeX10000 >= feeRatioX10k
        ) {
            feeRatioX10k = overTo.feeX10000;
            overriden = true;
        }
        if (feeRatioX10k == 0 && !overriden) {
            feeRatioX10k = feeOnTransferX10000;
        }
        uint256 fee = feeRatioX10k == 0 ? 0 : calculateFeeX10000(amount, feeRatioX10k);
        amount = amount - fee;
        if (fee != 0) {
            tax(sender, td, fee);
        }
        _doTransfer(sender, recipient, amount);
    }

    /**
     @notice Just does the transfer
     @param sender The sender
     @param recipient The recipient
     @param amount The amount
     */
    function _doTransfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal {
        ERC20._transfer(sender, recipient, amount);
    }

    /**
     @notice charges the tax
     @param from From address
     @param taxDist The tax distributor contract
     @param amount The tax amount
     */
    function tax(
        address from,
        address taxDist,
        uint256 amount
    ) internal {
        _doTransfer(from, taxDist, amount);
        IGeneralTaxDistributor(taxDist).distributeTaxAvoidOrigin(address(this), from);
    }

    /**
     @notice Gets the decimals or default
     @param token The token
     @return The decimals
     */
    function safeDecimals(address token
    ) private view returns (uint8) {
        (bool succ, bytes memory data) = token.staticcall(
            abi.encodeWithSignature(("decimals()"))
        );
        if (succ) {
            return abi.decode(data, (uint8));
        } else {
            return 18;
        }
    }

    /**
     @notice Calculates the fee
     @param amount The amount
     @param feeX10000 The fee rate
     @return The fee amount
     */
    function calculateFeeX10000(uint256 amount, uint256 feeX10000
    ) private pure returns (uint256) {
        return FullMath.mulDiv(amount, feeX10000, 10000);
    }
}

File 2 of 14 : ICrucibleToken.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;

interface ICrucibleToken {
    enum OverrideState {
        Default,
        OverrideIn,
        OverrideOut,
        OverrideBoth
    }

    function deposit(address to) external returns (uint256);

    function withdraw(address to, uint256 amount)
        external
        returns (uint256, uint256);

    function baseToken() external returns (address);

    function overrideFee(
        address target,
        OverrideState overrideType,
        uint64 newFeeX10000
    ) external;

    function updateCrucibleFees(
        uint64 newFeeOnTransferX10000,
        uint64 newFeeOnWithdrawX10000
    ) external;

    function upgradeRouter(address router) external;
}

File 3 of 14 : ICrucibleFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;

interface ICrucibleFactory {
    function getCrucible(
        address baseToken,
        uint64 feeOnTransferX10000,
        uint64 feeOnWithdrawX10000
    ) external view returns (address);

    function router() external view returns (address);
}

File 4 of 14 : ICrucibleTokenDeployer.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;

interface ICrucibleTokenDeployer {
    function parameters()
        external
        returns (
            address,
            address,
            uint64,
            uint64,
            string memory,
            string memory
        );
}

File 5 of 14 : FullMath.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.0;

/// @title Contains 512-bit math functions
/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision
/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits
library FullMath {
    /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
    /// @param a The multiplicand
    /// @param b The multiplier
    /// @param denominator The divisor
    /// @return result The 256-bit result
    /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv
    function mulDiv(
        uint256 a,
        uint256 b,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        // 512-bit multiply [prod1 prod0] = a * b
        // Compute the product mod 2**256 and mod 2**256 - 1
        // then use the Chinese Remainder Theorem to reconstruct
        // the 512 bit result. The result is stored in two 256
        // variables such that product = prod1 * 2**256 + prod0
        uint256 prod0; // Least significant 256 bits of the product
        uint256 prod1; // Most significant 256 bits of the product
        assembly {
            let mm := mulmod(a, b, not(0))
            prod0 := mul(a, b)
            prod1 := sub(sub(mm, prod0), lt(mm, prod0))
        }

        // Handle non-overflow cases, 256 by 256 division
        if (prod1 == 0) {
            require(denominator > 0);
            assembly {
                result := div(prod0, denominator)
            }
            return result;
        }

        // Make sure the result is less than 2**256.
        // Also prevents denominator == 0
        require(denominator > prod1);

        ///////////////////////////////////////////////
        // 512 by 256 division.
        ///////////////////////////////////////////////

        // Make division exact by subtracting the remainder from [prod1 prod0]
        // Compute remainder using mulmod
        uint256 remainder;
        assembly {
            remainder := mulmod(a, b, denominator)
        }
        // Subtract 256 bit number from 512 bit number
        assembly {
            prod1 := sub(prod1, gt(remainder, prod0))
            prod0 := sub(prod0, remainder)
        }

        // Factor powers of two out of denominator
        // Compute largest power of two divisor of denominator.
        // Always >= 1.
        uint256 twos = (type(uint256).max - denominator + 1) & denominator;
        // uint256 twos = -denominator & denominator;
        // Divide denominator by power of two
        assembly {
            denominator := div(denominator, twos)
        }

        // Divide [prod1 prod0] by the factors of two
        assembly {
            prod0 := div(prod0, twos)
        }
        // Shift in bits from prod1 into prod0. For this we need
        // to flip `twos` such that it is 2**256 / twos.
        // If twos is zero, then it becomes one
        assembly {
            twos := add(div(sub(0, twos), twos), 1)
        }
        prod0 |= prod1 * twos;

        // Invert denominator mod 2**256
        // Now that denominator is an odd number, it has an inverse
        // modulo 2**256 such that denominator * inv = 1 mod 2**256.
        // Compute the inverse by starting with a seed that is correct
        // correct for four bits. That is, denominator * inv = 1 mod 2**4
        uint256 inv = (3 * denominator) ^ 2;
        // Now use Newton-Raphson iteration to improve the precision.
        // Thanks to Hensel's lifting lemma, this also works in modular
        // arithmetic, doubling the correct bits in each step.
        inv *= 2 - denominator * inv; // inverse mod 2**8
        inv *= 2 - denominator * inv; // inverse mod 2**16
        inv *= 2 - denominator * inv; // inverse mod 2**32
        inv *= 2 - denominator * inv; // inverse mod 2**64
        inv *= 2 - denominator * inv; // inverse mod 2**128
        inv *= 2 - denominator * inv; // inverse mod 2**256

        // Because the division is now exact we can divide by multiplying
        // with the modular inverse of denominator. This will give us the
        // correct result modulo 2**256. Since the precoditions guarantee
        // that the outcome is less than 2**256, this is the final result.
        // We don't need to compute the high bits of the result and prod1
        // is no longer required.
        result = prod0 * inv;
        return result;
    }

    /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
    /// @param a The multiplicand
    /// @param b The multiplier
    /// @param denominator The divisor
    /// @return result The 256-bit result
    function mulDivRoundingUp(
        uint256 a,
        uint256 b,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        result = mulDiv(a, b, denominator);
        if (mulmod(a, b, denominator) > 0) {
            require(result < type(uint256).max);
            result++;
        }
    }
}

File 6 of 14 : ERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";

abstract contract ERC20 {
    using SafeMath for uint;

    string public name;
    string public symbol;
    uint8 public decimals = 18;
    uint  public totalSupply;
    mapping(address => uint) public balanceOf;
    mapping(address => mapping(address => uint)) public allowance;

    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function _mint(address to, uint value) internal {
        totalSupply = totalSupply.add(value);
        balanceOf[to] = balanceOf[to].add(value);
        emit Transfer(address(0), to, value);
    }

    function _burn(address from, uint value) internal {
        balanceOf[from] = balanceOf[from].sub(value);
        totalSupply = totalSupply.sub(value);
        emit Transfer(from, address(0), value);
    }

    function _approve(address owner, address spender, uint value) internal {
        allowance[owner][spender] = value;
        emit Approval(owner, spender, value);
    }

    function _transfer(address from, address to, uint value) internal virtual {
        balanceOf[from] = balanceOf[from].sub(value);
        balanceOf[to] = balanceOf[to].add(value);
        emit Transfer(from, to, value);
    }

    function approve(address spender, uint value) external returns (bool) {
        _approve(msg.sender, spender, value);
        return true;
    }

    function transfer(address to, uint value) external returns (bool) {
        _transfer(msg.sender, to, value);
        return true;
    }

    function transferFrom(address from, address to, uint value) external returns (bool) {
        if (allowance[from][msg.sender] != type(uint).max) {
            allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);
        }
        _transfer(from, to, value);
        return true;
    }
}

File 7 of 14 : IGeneralTaxDistributor.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IGeneralTaxDistributor {
    function distributeTax(address token) external returns (uint256);
    function distributeTaxAvoidOrigin(address token, address origin) external returns (uint256);
}

File 8 of 14 : IHasTaxDistributor.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IHasTaxDistributor {
	function taxDistributor() external returns (address);
}

File 9 of 14 : TokenReceivable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.2;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

/**
 * @notice Library for handling safe token transactions including fee per transaction tokens.
 */
abstract contract TokenReceivable is ReentrancyGuard {
  using SafeERC20 for IERC20;
  mapping(address => uint256) public inventory; // Amount of received tokens that are accounted for

  /**
   @notice Sync the inventory of a token based on amount changed
   @param token The token address
   @return amount The changed amount
   */
  function sync(address token) internal nonReentrant returns (uint256 amount) {
    uint256 inv = inventory[token];
    uint256 balance = IERC20(token).balanceOf(address(this));
    amount = balance - inv;
    inventory[token] = balance;
  }

  /**
   @notice Safely sends a token out and updates the inventory
   @param token The token address
   @param payee The payee
   @param amount The amount
   */
  function sendToken(address token, address payee, uint256 amount) internal nonReentrant {
    inventory[token] = inventory[token] - amount;
    IERC20(token).safeTransfer(payee, amount);
  }
}

File 10 of 14 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 11 of 14 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 12 of 14 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 13 of 14 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 14 of 14 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"enum ICrucibleToken.OverrideState","name":"overrideType","type":"uint8"},{"indexed":false,"internalType":"uint64","name":"feeX10k","type":"uint64"}],"name":"FeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"feeOnTransferX10000","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"feeOnWithdrawX10000","type":"uint64"}],"name":"FeesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeOnTransferX10000","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeOnWithdrawX10000","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feeOverrides","outputs":[{"internalType":"enum ICrucibleToken.OverrideState","name":"over","type":"uint8"},{"internalType":"uint64","name":"feeX10000","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"inventory","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"enum ICrucibleToken.OverrideState","name":"overrideType","type":"uint8"},{"internalType":"uint64","name":"newFeeX10000","type":"uint64"}],"name":"overrideFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"newFeeOnTransferX10000","type":"uint64"},{"internalType":"uint64","name":"newFeeOnWithdrawX10000","type":"uint64"}],"name":"updateCrucibleFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_router","type":"address"}],"name":"upgradeRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"withdrawn","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061014d5760003560e01c806395d89b41116100c3578063d4e6e0461161007c578063d4e6e0461461034a578063dd62ed3e1461035d578063e56a5ec514610388578063f340fa011461039b578063f3fef3a3146103ae578063f887ea40146103d65761014d565b806395d89b411461027c578063a9059cbb14610284578063aa9d881c14610297578063b5fd282a146102d8578063c45a0155146102f8578063c55dae63146103375761014d565b8063313ce56711610115578063313ce567146101ef57806342966c681461020e57806355565fce1461022357806370a08231146102365780637651b2841461025657806379cc6790146102695761014d565b806306fdde0314610152578063095ea7b31461017057806313cf47a21461019357806318160ddd146101c557806323b872dd146101dc575b600080fd5b61015a6103e9565b6040516101679190611a5e565b60405180910390f35b61018361017e36600461191b565b610477565b6040519015158152602001610167565b6009546101ad90600160a01b90046001600160401b031681565b6040516001600160401b039091168152602001610167565b6101ce60035481565b604051908152602001610167565b6101836101ea366004611892565b61048d565b6002546101fc9060ff1681565b60405160ff9091168152602001610167565b61022161021c366004611966565b610522565b005b610221610231366004611822565b610577565b6101ce610244366004611822565b60046020526000908152604090205481565b600a546101ad906001600160401b031681565b61022161027736600461191b565b61060f565b61015a6106e7565b61018361029236600461191b565b6106f4565b6102ca6102a5366004611822565b600b6020526000908152604090205460ff81169061010090046001600160401b031682565b604051610167929190611a3a565b6101ce6102e6366004611822565b60076020526000908152604090205481565b61031f7f000000000000000000000000d138ba4c9a04ebe9cedf23161a76057fa800b01781565b6040516001600160a01b039091168152602001610167565b60095461031f906001600160a01b031681565b610221610358366004611996565b610701565b6101ce61036b36600461185a565b600560209081526000928352604080842090915290825290205481565b6102216103963660046118d2565b610868565b6101ce6103a9366004611822565b6109ac565b6103c16103bc36600461191b565b610a85565b60408051928352602083019190915201610167565b60085461031f906001600160a01b031681565b600080546103f690611b5f565b80601f016020809104026020016040519081016040528092919081815260200182805461042290611b5f565b801561046f5780601f106104445761010080835404028352916020019161046f565b820191906000526020600020905b81548152906001019060200180831161045257829003601f168201915b505050505081565b6000610484338484610a9e565b50600192915050565b6001600160a01b03831660009081526005602090815260408083203384529091528120546000191461050c576001600160a01b03841660009081526005602090815260408083203384529091529020546104e79083610b00565b6001600160a01b03851660009081526005602090815260408083203384529091529020555b610517848484610b0c565b5060015b9392505050565b8061056a5760405162461bcd60e51b815260206004820152601360248201527210d50e88185b5bdd5b9d081c995c5d5a5c9959606a1b60448201526064015b60405180910390fd5b6105743382610e39565b50565b6008546001600160a01b031633146105a15760405162461bcd60e51b815260040161056190611abc565b6001600160a01b0381166105ed5760405162461bcd60e51b815260206004820152601360248201527210d50e881c9bdd5d195c881c995c5d5a5c9959606a1b6044820152606401610561565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0382166106595760405162461bcd60e51b815260206004820152601160248201527010d50e88199c9bdb481c995c5d5a5c9959607a1b6044820152606401610561565b8061069c5760405162461bcd60e51b815260206004820152601360248201527210d50e88185b5bdd5b9d081c995c5d5a5c9959606a1b6044820152606401610561565b6001600160a01b03821660009081526005602090815260408083203384529091528120546106cb908390611b1c565b90506106d8833383610a9e565b6106e28383610e39565b505050565b600180546103f690611b5f565b6000610484338484610b0c565b6008546001600160a01b0316331461072b5760405162461bcd60e51b815260040161056190611abc565b611770826001600160401b0316106107555760405162461bcd60e51b815260040161056190611a91565b611770816001600160401b03161061077f5760405162461bcd60e51b815260040161056190611a91565b6001600160401b0382161580159061079f57506001600160401b03811615155b6107e25760405162461bcd60e51b815260206004820152601460248201527310d50e881bdb9948199959481c995c5d5a5c995960621b6044820152606401610561565b6009805467ffffffffffffffff60a01b1916600160a01b6001600160401b0385811682029290921792839055600a805467ffffffffffffffff1916858416179081905560408051929094048316825290911660208201527f13c339074f104e125abc4623e58b8550f8a82863a245dad226be40bec66156c4910160405180910390a15050565b6008546001600160a01b031633146108925760405162461bcd60e51b815260040161056190611abc565b611770816001600160401b0316106108bc5760405162461bcd60e51b815260040161056190611a91565b60405180604001604052808360038111156108e757634e487b7160e01b600052602160045260246000fd5b81526001600160401b0383166020918201526001600160a01b0385166000908152600b9091526040902081518154829060ff1916600183600381111561093d57634e487b7160e01b600052602160045260246000fd5b02179055506020919091015181546001600160401b039091166101000268ffffffffffffffff00199091161790556040517f322a14cd72711b473bdc3549ec949cbc27451339a81997e028f2996445b29ded9061099f90859085908590611a06565b60405180910390a1505050565b6008546000906001600160a01b031633146109d95760405162461bcd60e51b815260040161056190611abc565b6009546109ee906001600160a01b0316610e7e565b905080610a295760405162461bcd60e51b815260206004820152600960248201526843543a20656d70747960b81b6044820152606401610561565b610a338282610f90565b600954604080516001600160a01b0392831681526020810184905291841682820152517fb4e1304f97b5093610f51b33ddab6622388422e2dac138b0d32f93dcfbd39edf9181900360600190a1919050565b600080610a93338585611020565b909590945092505050565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b600061051b8284611b1c565b6001600160a01b0383166000908152600b602052604080822081518083019092528054829060ff166003811115610b5357634e487b7160e01b600052602160045260246000fd5b6003811115610b7257634e487b7160e01b600052602160045260246000fd5b8152905461010090046001600160401b03166020918201526001600160a01b0385166000908152600b9091526040808220815180830190925280549394509192909190829060ff166003811115610bd957634e487b7160e01b600052602160045260246000fd5b6003811115610bf857634e487b7160e01b600052602160045260246000fd5b8152905461010090046001600160401b031660209182015260085460408051635a539ad960e11b815290519394506000936001600160a01b039092169263b4a735b29260048084019382900301818787803b158015610c5657600080fd5b505af1158015610c6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8e919061183e565b9050806001600160a01b0316866001600160a01b03161480610cc15750806001600160a01b0316856001600160a01b0316145b15610cd957610cd186868661115b565b5050506106e2565b600080600285516003811115610cff57634e487b7160e01b600052602160045260246000fd5b1480610d2b5750600385516003811115610d2957634e487b7160e01b600052602160045260246000fd5b145b15610d4357505060208301516001600160401b031660015b600184516003811115610d6657634e487b7160e01b600052602160045260246000fd5b1480610d925750600384516003811115610d9057634e487b7160e01b600052602160045260246000fd5b145b8015610dab57508184602001516001600160401b031610155b15610dc357505060208201516001600160401b031660015b81158015610dcf575080155b15610dea57600954600160a01b90046001600160401b031691505b60008215610e0157610dfc8784611166565b610e04565b60005b9050610e108188611b1c565b96508015610e2357610e23898583611175565b610e2e89898961115b565b505050505050505050565b600954610e70906001600160a01b03167f000000000000000000000000d138ba4c9a04ebe9cedf23161a76057fa800b01783611207565b610e7a82826112b4565b5050565b600060026006541415610ed35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610561565b60026006556001600160a01b0382166000818152600760205260408082205490516370a0823160e01b81523060048201529092906370a082319060240160206040518083038186803b158015610f2857600080fd5b505afa158015610f3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f60919061197e565b9050610f6c8282611b1c565b6001600160a01b039094166000908152600760205260409020555050600160065590565b600354610f9d908261133e565b6003556001600160a01b038216600090815260046020526040902054610fc3908261133e565b6001600160a01b0383166000818152600460205260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906110149085815260200190565b60405180910390a35050565b600a54600090819061103c9084906001600160401b0316611166565b91506110488284611b1c565b90506000600860009054906101000a90046001600160a01b03166001600160a01b031663b4a735b26040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561109c57600080fd5b505af11580156110b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d4919061183e565b90506110e1868285611175565b6110eb86836112b4565b600954611102906001600160a01b03168684611207565b60408051858152602081018590526001600160a01b03888116828401528716606082015290517ffc40624533f3a6341b6cd846b808821ff3de38e50edbcbdfc55db74e9c1311909181900360800190a150935093915050565b6106e283838361134a565b600061051b83836127106113f0565b61118083838361115b565b60405163826150b560e01b81523060048201526001600160a01b03848116602483015283169063826150b590604401602060405180830381600087803b1580156111c957600080fd5b505af11580156111dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611201919061197e565b50505050565b6002600654141561125a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610561565b60026006556001600160a01b038316600090815260076020526040902054611283908290611b1c565b6001600160a01b0384166000818152600760205260409020919091556112aa908383611575565b5050600160065550565b6001600160a01b0382166000908152600460205260409020546112d79082610b00565b6001600160a01b0383166000908152600460205260409020556003546112fd9082610b00565b6003556040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001611014565b600061051b8284611ae5565b6001600160a01b03831660009081526004602052604090205461136d9082610b00565b6001600160a01b03808516600090815260046020526040808220939093559084168152205461139c908261133e565b6001600160a01b0380841660008181526004602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610af39085815260200190565b60008080600019858709858702925082811083820303915050806000141561142a576000841161141f57600080fd5b50829004905061051b565b80841161143657600080fd5b60008486880980840393811190920391905060008561145781600019611b1c565b611462906001611ae5565b169586900495938490049360008190030460010190506114828184611afd565b909317926000611493876003611afd565b60021890506114a28188611afd565b6114ad906002611b1c565b6114b79082611afd565b90506114c38188611afd565b6114ce906002611b1c565b6114d89082611afd565b90506114e48188611afd565b6114ef906002611b1c565b6114f99082611afd565b90506115058188611afd565b611510906002611b1c565b61151a9082611afd565b90506115268188611afd565b611531906002611b1c565b61153b9082611afd565b90506115478188611afd565b611552906002611b1c565b61155c9082611afd565b90506115688186611afd565b9998505050505050505050565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092018352602080830180516001600160e01b031663a9059cbb60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908401526106e292869291600091611605918516908490611682565b8051909150156106e257808060200190518101906116239190611946565b6106e25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610561565b60606116918484600085611699565b949350505050565b6060824710156116fa5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610561565b611703856117c8565b61174f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610561565b600080866001600160a01b0316858760405161176b91906119ea565b60006040518083038185875af1925050503d80600081146117a8576040519150601f19603f3d011682016040523d82523d6000602084013e6117ad565b606091505b50915091506117bd8282866117d2565b979650505050505050565b803b15155b919050565b606083156117e157508161051b565b8251156117f15782518084602001fd5b8160405162461bcd60e51b81526004016105619190611a5e565b80356001600160401b03811681146117cd57600080fd5b600060208284031215611833578081fd5b813561051b81611bb0565b60006020828403121561184f578081fd5b815161051b81611bb0565b6000806040838503121561186c578081fd5b823561187781611bb0565b9150602083013561188781611bb0565b809150509250929050565b6000806000606084860312156118a6578081fd5b83356118b181611bb0565b925060208401356118c181611bb0565b929592945050506040919091013590565b6000806000606084860312156118e6578283fd5b83356118f181611bb0565b9250602084013560048110611904578283fd5b91506119126040850161180b565b90509250925092565b6000806040838503121561192d578182fd5b823561193881611bb0565b946020939093013593505050565b600060208284031215611957578081fd5b8151801515811461051b578182fd5b600060208284031215611977578081fd5b5035919050565b60006020828403121561198f578081fd5b5051919050565b600080604083850312156119a8578182fd5b6119b18361180b565b91506119bf6020840161180b565b90509250929050565b600481106119e657634e487b7160e01b600052602160045260246000fd5b9052565b600082516119fc818460208701611b33565b9190910192915050565b6001600160a01b038416815260608101611a2360208301856119c8565b6001600160401b0383166040830152949350505050565b60408101611a4882856119c8565b6001600160401b03831660208301529392505050565b6000602082528251806020840152611a7d816040850160208701611b33565b601f01601f19169190910160400192915050565b60208082526011908201527043543a2066656520746f6f206c6172676560781b604082015260600190565b6020808252600f908201526e10d50e881b9bdd08185b1b1bddd959608a1b604082015260600190565b60008219821115611af857611af8611b9a565b500190565b6000816000190483118215151615611b1757611b17611b9a565b500290565b600082821015611b2e57611b2e611b9a565b500390565b60005b83811015611b4e578181015183820152602001611b36565b838111156112015750506000910152565b600281046001821680611b7357607f821691505b60208210811415611b9457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461057457600080fdfea2646970667358221220526f216f26473687cb81f5ba28200e11e542f482b2c0a1eb17253f0005c34d6064736f6c63430008020033

Loading