FTM Price: $0.537512 (+0.45%)
Gas: 41 GWei
 

Overview

FTM Balance

Fantom LogoFantom LogoFantom Logo0 FTM

FTM Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
0x61012060637857232023-06-08 17:55:03377 days ago1686246903IN
 Create: MultiPath
0 FTM0.1605686555

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To Value
832405062024-06-19 20:50:452 hrs ago1718830245
0x697AA25b...C1A93634a
119.66790869 FTM
832405062024-06-19 20:50:452 hrs ago1718830245
0x697AA25b...C1A93634a
0.00000137 FTM
832372982024-06-19 20:08:092 hrs ago1718827689
0x697AA25b...C1A93634a
505.32862749 FTM
832252612024-06-19 17:28:325 hrs ago1718818112
0x697AA25b...C1A93634a
1,804.423123 FTM
832248762024-06-19 17:23:075 hrs ago1718817787
0x697AA25b...C1A93634a
1,807.6982974 FTM
832241472024-06-19 17:13:005 hrs ago1718817180
0x697AA25b...C1A93634a
81.38307097 FTM
832241472024-06-19 17:13:005 hrs ago1718817180
0x697AA25b...C1A93634a
1.65950858 FTM
832225912024-06-19 16:51:466 hrs ago1718815906
0x697AA25b...C1A93634a
18.52101894 FTM
832212522024-06-19 16:34:256 hrs ago1718814865
0x697AA25b...C1A93634a
11.19521397 FTM
832182742024-06-19 15:54:257 hrs ago1718812465
0x697AA25b...C1A93634a
168.15346582 FTM
832182742024-06-19 15:54:257 hrs ago1718812465
0x697AA25b...C1A93634a
3.42586263 FTM
832148122024-06-19 14:36:018 hrs ago1718807761
0x697AA25b...C1A93634a
2,432.13352394 FTM
832137972024-06-19 14:15:258 hrs ago1718806525
0x697AA25b...C1A93634a
17.35119901 FTM
832137972024-06-19 14:15:258 hrs ago1718806525
0x697AA25b...C1A93634a
0 FTM
832103722024-06-19 12:51:5010 hrs ago1718801510
0x697AA25b...C1A93634a
196.71960182 FTM
832103722024-06-19 12:51:5010 hrs ago1718801510
0x697AA25b...C1A93634a
0.00093314 FTM
832087742024-06-19 12:22:5910 hrs ago1718799779
0x697AA25b...C1A93634a
77.52164569 FTM
832077002024-06-19 12:03:1710 hrs ago1718798597
0x697AA25b...C1A93634a
129.56331163 FTM
832076772024-06-19 12:02:5410 hrs ago1718798574
0x697AA25b...C1A93634a
150.58838792 FTM
832075932024-06-19 12:01:3711 hrs ago1718798497
0x697AA25b...C1A93634a
150.83790807 FTM
832075852024-06-19 12:01:3011 hrs ago1718798490
0x697AA25b...C1A93634a
1,808.62451719 FTM
832052902024-06-19 11:23:5111 hrs ago1718796231
0x697AA25b...C1A93634a
10,701.20342054 FTM
832052902024-06-19 11:23:5111 hrs ago1718796231
0x697AA25b...C1A93634a
0.0004645 FTM
832029982024-06-19 10:47:3012 hrs ago1718794050
0x697AA25b...C1A93634a
21.03597573 FTM
832029982024-06-19 10:47:3012 hrs ago1718794050
0x697AA25b...C1A93634a
0.01718778 FTM
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MultiPath

Compiler Version
v0.7.5+commit.eb77ed08

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
default evmVersion
File 1 of 15 : MultiPath.sol
/*solhint-disable avoid-low-level-calls*/
// SPDX-License-Identifier: ISC

pragma solidity 0.7.5;
pragma abicoder v2;

import "./IRouter.sol";
import "../IAugustusSwapperV5.sol";
import "../adapters/IAdapter.sol";
import "../adapters/IBuyAdapter.sol";
import "../fee/FeeModel.sol";
import "../fee/IFeeClaimer.sol";

contract MultiPath is FeeModel, IRouter {
    using SafeMath for uint256;

    /*solhint-disable no-empty-blocks*/
    constructor(
        uint256 _partnerSharePercent,
        uint256 _maxFeePercent,
        uint256 _paraswapReferralShare,
        uint256 _paraswapSlippageShare,
        IFeeClaimer _feeClaimer
    )
        public
        FeeModel(_partnerSharePercent, _maxFeePercent, _paraswapReferralShare, _paraswapSlippageShare, _feeClaimer)
    {}

    /*solhint-enable no-empty-blocks*/

    function initialize(bytes calldata) external override {
        revert("METHOD NOT IMPLEMENTED");
    }

    function getKey() external pure override returns (bytes32) {
        return keccak256(abi.encodePacked("MULTIPATH_ROUTER", "1.0.0"));
    }

    /**
     * @dev The function which performs the multi path swap.
     * @param data Data required to perform swap.
     */
    function multiSwap(Utils.SellData memory data) public payable returns (uint256) {
        require(data.deadline >= block.timestamp, "Deadline breached");

        address fromToken = data.fromToken;
        uint256 fromAmount = data.fromAmount;
        require(msg.value == (fromToken == Utils.ethAddress() ? fromAmount : 0), "Incorrect msg.value");
        uint256 toAmount = data.toAmount;
        uint256 expectedAmount = data.expectedAmount;
        address payable beneficiary = data.beneficiary == address(0) ? msg.sender : data.beneficiary;
        Utils.Path[] memory path = data.path;
        address toToken = path[path.length - 1].to;

        require(toAmount > 0, "To amount can not be 0");

        //If source token is not ETH than transfer required amount of tokens
        //from sender to this contract
        transferTokensFromProxy(fromToken, fromAmount, data.permit);
        if (_isTakeFeeFromSrcToken(data.feePercent)) {
            // take fee from source token
            fromAmount = takeFromTokenFee(fromToken, fromAmount, data.partner, data.feePercent);
        }

        performSwap(fromToken, fromAmount, path);

        uint256 receivedAmount = Utils.tokenBalance(toToken, address(this));

        require(receivedAmount >= toAmount, "Received amount of tokens are less then expected");

        if (
            _getFixedFeeBps(data.partner, data.feePercent) != 0 &&
            !_isTakeFeeFromSrcToken(data.feePercent) &&
            !_isReferral(data.feePercent)
        ) {
            // take fee from dest token
            takeToTokenFeeAndTransfer(toToken, receivedAmount, beneficiary, data.partner, data.feePercent);
        } else if (receivedAmount > expectedAmount && !_isTakeFeeFromSrcToken(data.feePercent)) {
            takeSlippageAndTransferSell(
                toToken,
                beneficiary,
                data.partner,
                receivedAmount,
                expectedAmount,
                data.feePercent
            );
        } else {
            // Fee is already taken from fromToken
            // Transfer toToken to beneficiary
            Utils.transferTokens(toToken, beneficiary, receivedAmount);
        }

        emit SwappedV3(
            data.uuid,
            data.partner,
            data.feePercent,
            msg.sender,
            beneficiary,
            fromToken,
            toToken,
            fromAmount,
            receivedAmount,
            expectedAmount
        );

        return receivedAmount;
    }

    /**
     * @dev The function which performs the single path buy.
     * @param data Data required to perform swap.
     */
    function buy(Utils.BuyData memory data) public payable returns (uint256) {
        require(data.deadline >= block.timestamp, "Deadline breached");

        address fromToken = data.fromToken;
        uint256 fromAmount = data.fromAmount;
        require(msg.value == (fromToken == Utils.ethAddress() ? fromAmount : 0), "Incorrect msg.value");
        uint256 toAmount = data.toAmount;
        address payable beneficiary = data.beneficiary == address(0) ? msg.sender : data.beneficiary;
        address toToken = data.toToken;
        uint256 expectedAmount = data.expectedAmount;
        uint256 feePercent = data.feePercent;

        require(toAmount > 0, "To amount can not be 0");

        //If source token is not ETH than transfer required amount of tokens
        //from sender to this contract
        transferTokensFromProxy(fromToken, fromAmount, data.permit);

        uint256 receivedAmount = performBuy(data.adapter, fromToken, toToken, fromAmount, toAmount, data.route);

        uint256 remainingAmount = Utils.tokenBalance(fromToken, address(this));

        if (
            _getFixedFeeBps(data.partner, data.feePercent) != 0 &&
            !_isTakeFeeFromSrcToken(feePercent) &&
            !_isReferral(data.feePercent)
        ) {
            // take fee from dest token
            takeToTokenFeeAndTransfer(toToken, receivedAmount, beneficiary, data.partner, feePercent);

            // Transfer remaining token back to sender
            Utils.transferTokens(fromToken, msg.sender, remainingAmount);
        } else {
            Utils.transferTokens(toToken, beneficiary, receivedAmount);
            if (_getFixedFeeBps(data.partner, data.feePercent) != 0 && _isTakeFeeFromSrcToken(feePercent)) {
                //  take fee from source token and transfer remaining token back to sender
                takeFromTokenFeeAndTransfer(
                    fromToken,
                    fromAmount.sub(remainingAmount),
                    remainingAmount,
                    data.partner,
                    feePercent
                );
            } else if (fromAmount.sub(remainingAmount) < expectedAmount) {
                takeSlippageAndTransferBuy(
                    fromToken,
                    data.partner,
                    expectedAmount,
                    fromAmount.sub(remainingAmount),
                    remainingAmount,
                    feePercent
                );
            } else {
                // Transfer remaining token back to sender
                Utils.transferTokens(fromToken, msg.sender, remainingAmount);
            }
        }

        fromAmount = fromAmount.sub(remainingAmount);
        emit BoughtV3(
            data.uuid,
            data.partner,
            feePercent,
            msg.sender,
            beneficiary,
            fromToken,
            toToken,
            fromAmount,
            receivedAmount,
            expectedAmount
        );

        return receivedAmount;
    }

    /**
     * @dev The function which performs the mega path swap.
     * @param data Data required to perform swap.
     */
    function megaSwap(Utils.MegaSwapSellData memory data) public payable returns (uint256) {
        require(data.deadline >= block.timestamp, "Deadline breached");
        address fromToken = data.fromToken;
        uint256 fromAmount = data.fromAmount;
        require(msg.value == (fromToken == Utils.ethAddress() ? fromAmount : 0), "Incorrect msg.value");
        uint256 toAmount = data.toAmount;
        uint256 expectedAmount = data.expectedAmount;
        address payable beneficiary = data.beneficiary == address(0) ? msg.sender : data.beneficiary;
        Utils.MegaSwapPath[] memory path = data.path;
        address toToken = path[0].path[path[0].path.length - 1].to;

        require(toAmount > 0, "To amount can not be 0");

        //if fromToken is not ETH then transfer tokens from user to this contract
        transferTokensFromProxy(fromToken, fromAmount, data.permit);
        if (_isTakeFeeFromSrcToken(data.feePercent)) {
            // take fee from source token
            fromAmount = takeFromTokenFee(fromToken, fromAmount, data.partner, data.feePercent);
        }

        for (uint8 i = 0; i < uint8(path.length); i++) {
            uint256 _fromAmount = fromAmount.mul(path[i].fromAmountPercent).div(10000);
            if (i == path.length - 1) {
                _fromAmount = Utils.tokenBalance(address(fromToken), address(this));
            }
            performSwap(fromToken, _fromAmount, path[i].path);
        }

        uint256 receivedAmount = Utils.tokenBalance(toToken, address(this));

        require(receivedAmount >= toAmount, "Received amount of tokens are less then expected");

        if (
            _getFixedFeeBps(data.partner, data.feePercent) != 0 &&
            !_isTakeFeeFromSrcToken(data.feePercent) &&
            !_isReferral(data.feePercent)
        ) {
            // take fee from dest token
            takeToTokenFeeAndTransfer(toToken, receivedAmount, beneficiary, data.partner, data.feePercent);
        } else if (receivedAmount > expectedAmount && !_isTakeFeeFromSrcToken(data.feePercent)) {
            takeSlippageAndTransferSell(
                toToken,
                beneficiary,
                data.partner,
                receivedAmount,
                expectedAmount,
                data.feePercent
            );
        } else {
            // Fee is already taken from fromToken
            // Transfer toToken to beneficiary
            Utils.transferTokens(toToken, beneficiary, receivedAmount);
        }

        emit SwappedV3(
            data.uuid,
            data.partner,
            data.feePercent,
            msg.sender,
            beneficiary,
            fromToken,
            toToken,
            fromAmount,
            receivedAmount,
            expectedAmount
        );

        return receivedAmount;
    }

    //Helper function to perform swap
    function performSwap(
        address fromToken,
        uint256 fromAmount,
        Utils.Path[] memory path
    ) private {
        require(path.length > 0, "Path not provided for swap");

        //Assuming path will not be too long to reach out of gas exception
        for (uint256 i = 0; i < path.length; i++) {
            //_fromToken will be either fromToken or toToken of the previous path
            address _fromToken = i > 0 ? path[i - 1].to : fromToken;
            address _toToken = path[i].to;

            uint256 _fromAmount = i > 0 ? Utils.tokenBalance(_fromToken, address(this)) : fromAmount;

            for (uint256 j = 0; j < path[i].adapters.length; j++) {
                Utils.Adapter memory adapter = path[i].adapters[j];

                //Check if exchange is supported
                require(
                    IAugustusSwapperV5(address(this)).hasRole(WHITELISTED_ROLE, adapter.adapter),
                    "Exchange not whitelisted"
                );

                //Calculating tokens to be passed to the relevant exchange
                //percentage should be 200 for 2%
                uint256 fromAmountSlice = i > 0 && j == path[i].adapters.length.sub(1)
                    ? Utils.tokenBalance(address(_fromToken), address(this))
                    : _fromAmount.mul(adapter.percent).div(10000);

                //DELEGATING CALL TO THE ADAPTER
                (bool success, ) = adapter.adapter.delegatecall(
                    abi.encodeWithSelector(
                        IAdapter.swap.selector,
                        _fromToken,
                        _toToken,
                        fromAmountSlice,
                        uint256(0), //adapter.networkFee,
                        adapter.route
                    )
                );

                require(success, "Call to adapter failed");
            }
        }
    }

    //Helper function to perform swap
    function performBuy(
        address adapter,
        address fromToken,
        address toToken,
        uint256 fromAmount,
        uint256 toAmount,
        Utils.Route[] memory routes
    ) private returns (uint256) {
        //Check if exchange is supported
        require(IAugustusSwapperV5(address(this)).hasRole(WHITELISTED_ROLE, adapter), "Exchange not whitelisted");

        for (uint256 j = 0; j < routes.length; j++) {
            Utils.Route memory route = routes[j];

            uint256 fromAmountSlice;
            uint256 toAmountSlice;

            //last route
            if (j == routes.length.sub(1)) {
                toAmountSlice = toAmount.sub(Utils.tokenBalance(address(toToken), address(this)));

                fromAmountSlice = Utils.tokenBalance(address(fromToken), address(this));
            } else {
                fromAmountSlice = fromAmount.mul(route.percent).div(10000);
                toAmountSlice = toAmount.mul(route.percent).div(10000);
            }

            //delegate Call to the exchange
            (bool success, ) = adapter.delegatecall(
                abi.encodeWithSelector(
                    IBuyAdapter.buy.selector,
                    route.index,
                    fromToken,
                    toToken,
                    fromAmountSlice,
                    toAmountSlice,
                    route.targetExchange,
                    route.payload
                )
            );
            require(success, "Call to adapter failed");
        }

        uint256 receivedAmount = Utils.tokenBalance(toToken, address(this));
        require(receivedAmount >= toAmount, "Received amount of tokens are less then expected tokens");

        return receivedAmount;
    }

    function transferTokensFromProxy(
        address token,
        uint256 amount,
        bytes memory permit
    ) private {
        if (token != Utils.ethAddress()) {
            Utils.permit(token, permit);
            tokenTransferProxy.transferFrom(token, msg.sender, address(this), amount);
        }
    }
}

File 2 of 15 : IRouter.sol
// SPDX-License-Identifier: ISC

pragma solidity 0.7.5;

interface IRouter {
    /**
     * @dev Certain routers/exchanges needs to be initialized.
     * This method will be called from Augustus
     */
    function initialize(bytes calldata data) external;

    /**
     * @dev Returns unique identifier for the router
     */
    function getKey() external pure returns (bytes32);

    event SwappedV3(
        bytes16 uuid,
        address partner,
        uint256 feePercent,
        address initiator,
        address indexed beneficiary,
        address indexed srcToken,
        address indexed destToken,
        uint256 srcAmount,
        uint256 receivedAmount,
        uint256 expectedAmount
    );

    event BoughtV3(
        bytes16 uuid,
        address partner,
        uint256 feePercent,
        address initiator,
        address indexed beneficiary,
        address indexed srcToken,
        address indexed destToken,
        uint256 srcAmount,
        uint256 receivedAmount,
        uint256 expectedAmount
    );
}

File 3 of 15 : IAugustusSwapperV5.sol
// SPDX-License-Identifier: ISC

pragma solidity 0.7.5;

interface IAugustusSwapperV5 {
    function hasRole(bytes32 role, address account) external view returns (bool);
}

File 4 of 15 : IAdapter.sol
// SPDX-License-Identifier: ISC

pragma solidity 0.7.5;
pragma abicoder v2;

import "../lib/Utils.sol";

interface IAdapter {
    /**
     * @dev Certain adapters needs to be initialized.
     * This method will be called from Augustus
     */
    function initialize(bytes calldata data) external;

    /**
     * @dev The function which performs the swap on an exchange.
     * @param fromToken Address of the source token
     * @param toToken Address of the destination token
     * @param fromAmount Amount of source tokens to be swapped
     * @param networkFee NOT USED - Network fee to be used in this router
     * @param route Route to be followed
     */
    function swap(
        IERC20 fromToken,
        IERC20 toToken,
        uint256 fromAmount,
        uint256 networkFee,
        Utils.Route[] calldata route
    ) external payable;
}

File 5 of 15 : IBuyAdapter.sol
// SPDX-License-Identifier: ISC

pragma solidity 0.7.5;

import "../lib/Utils.sol";

interface IBuyAdapter {
    /**
     * @dev Certain adapters needs to be initialized.
     * This method will be called from Augustus
     */
    function initialize(bytes calldata data) external;

    /**
     * @dev The function which performs the swap on an exchange.
     * @param index Index of the router in the adapter
     * @param fromToken Address of the source token
     * @param toToken Address of the destination token
     * @param maxFromAmount Max amount of source tokens to be swapped
     * @param toAmount Amount of destination tokens to be received
     * @param targetExchange Target exchange address to be called
     * @param payload extra data which needs to be passed to this router
     */
    function buy(
        uint256 index,
        IERC20 fromToken,
        IERC20 toToken,
        uint256 maxFromAmount,
        uint256 toAmount,
        address targetExchange,
        bytes calldata payload
    ) external payable;
}

File 6 of 15 : FeeModel.sol
// SPDX-License-Identifier: ISC

pragma solidity 0.7.5;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "../AugustusStorage.sol";
import "../lib/Utils.sol";
import "./IFeeClaimer.sol";
// helpers
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

contract FeeModel is AugustusStorage {
    using SafeMath for uint256;

    uint256 public immutable partnerSharePercent;
    uint256 public immutable maxFeePercent;
    uint256 public immutable paraswapReferralShare;
    uint256 public immutable paraswapSlippageShare;
    IFeeClaimer public immutable feeClaimer;

    constructor(
        uint256 _partnerSharePercent,
        uint256 _maxFeePercent,
        uint256 _paraswapReferralShare,
        uint256 _paraswapSlippageShare,
        IFeeClaimer _feeClaimer
    ) {
        partnerSharePercent = _partnerSharePercent;
        maxFeePercent = _maxFeePercent;
        paraswapReferralShare = _paraswapReferralShare;
        paraswapSlippageShare = _paraswapSlippageShare;
        feeClaimer = _feeClaimer;
    }

    // feePercent is a packed structure.
    // Bits 255-248 = 8-bit version field
    //
    // Version 0
    // =========
    // Entire structure is interpreted as the fee percent in basis points.
    // If set to 0 then partner will not receive any fees.
    //
    // Version 1
    // =========
    // Bits 13-0 = Fee percent in basis points
    // Bit 14 = positiveSlippageToUser (positive slippage to partner if not set)
    // Bit 15 = if set, take fee from fromToken, toToken otherwise
    // Bit 16 = if set, do fee distribution as per referral program

    function takeFromTokenFee(
        address fromToken,
        uint256 fromAmount,
        address payable partner,
        uint256 feePercent
    ) internal returns (uint256 newFromAmount) {
        uint256 fixedFeeBps = _getFixedFeeBps(partner, feePercent);
        if (fixedFeeBps == 0) return fromAmount;
        (uint256 partnerShare, uint256 paraswapShare) = _calcFixedFees(fromAmount, fixedFeeBps);
        return _distributeFees(fromAmount, fromToken, partner, partnerShare, paraswapShare);
    }

    function takeFromTokenFeeAndTransfer(
        address fromToken,
        uint256 fromAmount,
        uint256 remainingAmount,
        address payable partner,
        uint256 feePercent
    ) internal {
        uint256 fixedFeeBps = _getFixedFeeBps(partner, feePercent);
        (uint256 partnerShare, uint256 paraswapShare) = _calcFixedFees(fromAmount, fixedFeeBps);
        if (partnerShare.add(paraswapShare) <= remainingAmount) {
            remainingAmount = _distributeFees(remainingAmount, fromToken, partner, partnerShare, paraswapShare);
        }
        Utils.transferTokens(fromToken, msg.sender, remainingAmount);
    }

    function takeToTokenFeeAndTransfer(
        address toToken,
        uint256 receivedAmount,
        address payable beneficiary,
        address payable partner,
        uint256 feePercent
    ) internal {
        uint256 fixedFeeBps = _getFixedFeeBps(partner, feePercent);
        (uint256 partnerShare, uint256 paraswapShare) = _calcFixedFees(receivedAmount, fixedFeeBps);
        Utils.transferTokens(
            toToken,
            beneficiary,
            _distributeFees(receivedAmount, toToken, partner, partnerShare, paraswapShare)
        );
    }

    function takeSlippageAndTransferSell(
        address toToken,
        address payable beneficiary,
        address payable partner,
        uint256 positiveAmount,
        uint256 negativeAmount,
        uint256 feePercent
    ) internal {
        uint256 totalSlippage = positiveAmount.sub(negativeAmount);
        if (partner != address(0)) {
            (uint256 referrerShare, uint256 paraswapShare) = _calcSlippageFees(totalSlippage, feePercent);
            positiveAmount = _distributeFees(positiveAmount, toToken, partner, referrerShare, paraswapShare);
        } else {
            uint256 paraswapSlippage = totalSlippage.mul(paraswapSlippageShare).div(10000);
            Utils.transferTokens(toToken, feeWallet, paraswapSlippage);
            positiveAmount = positiveAmount.sub(paraswapSlippage);
        }
        Utils.transferTokens(toToken, beneficiary, positiveAmount);
    }

    function takeSlippageAndTransferBuy(
        address fromToken,
        address payable partner,
        uint256 positiveAmount,
        uint256 negativeAmount,
        uint256 remainingAmount,
        uint256 feePercent
    ) internal {
        uint256 totalSlippage = positiveAmount.sub(negativeAmount);
        if (partner != address(0)) {
            (uint256 referrerShare, uint256 paraswapShare) = _calcSlippageFees(totalSlippage, feePercent);
            remainingAmount = _distributeFees(remainingAmount, fromToken, partner, referrerShare, paraswapShare);
        } else {
            uint256 paraswapSlippage = totalSlippage.mul(paraswapSlippageShare).div(10000);
            Utils.transferTokens(fromToken, feeWallet, paraswapSlippage);
            remainingAmount = remainingAmount.sub(paraswapSlippage);
        }
        // Transfer remaining token back to sender
        Utils.transferTokens(fromToken, msg.sender, remainingAmount);
    }

    function _getFixedFeeBps(address partner, uint256 feePercent) internal view returns (uint256 fixedFeeBps) {
        if (partner == address(0)) return 0;
        uint256 version = feePercent >> 248;
        if (version == 0) {
            fixedFeeBps = feePercent;
        } else {
            fixedFeeBps = feePercent & 0x3FFF;
        }
        return fixedFeeBps > maxFeePercent ? maxFeePercent : fixedFeeBps;
    }

    function _calcFixedFees(uint256 amount, uint256 fixedFeeBps)
        private
        view
        returns (uint256 partnerShare, uint256 paraswapShare)
    {
        uint256 fee = amount.mul(fixedFeeBps).div(10000);
        partnerShare = fee.mul(partnerSharePercent).div(10000);
        paraswapShare = fee.sub(partnerShare);
    }

    function _calcSlippageFees(uint256 slippage, uint256 feePercent)
        private
        view
        returns (uint256 partnerShare, uint256 paraswapShare)
    {
        uint256 feeBps = feePercent & 0x3FFF;
        require(feeBps + paraswapReferralShare <= 10000, "Invalid fee percent");
        paraswapShare = slippage.mul(paraswapReferralShare).div(10000);
        partnerShare = slippage.mul(feeBps).div(10000);
    }

    function _distributeFees(
        uint256 currentBalance,
        address token,
        address payable partner,
        uint256 partnerShare,
        uint256 paraswapShare
    ) private returns (uint256 newBalance) {
        uint256 totalFees = partnerShare.add(paraswapShare);
        if (totalFees == 0) return currentBalance;

        require(totalFees <= currentBalance, "Insufficient balance to pay for fees");

        Utils.transferTokens(token, payable(address(feeClaimer)), totalFees);
        if (partnerShare != 0) {
            feeClaimer.registerFee(partner, IERC20(token), partnerShare);
        }
        if (paraswapShare != 0) {
            feeClaimer.registerFee(feeWallet, IERC20(token), paraswapShare);
        }
        return currentBalance.sub(totalFees);
    }

    function _isTakeFeeFromSrcToken(uint256 feePercent) internal pure returns (bool) {
        return feePercent >> 248 != 0 && (feePercent & (1 << 15)) != 0;
    }

    function _isReferral(uint256 feePercent) internal pure returns (bool) {
        return (feePercent & (1 << 16)) != 0;
    }
}

File 7 of 15 : IFeeClaimer.sol
// SPDX-License-Identifier: ISC

pragma solidity 0.7.5;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IFeeClaimer {
    /**
     * @notice register partner's, affiliate's and PP's fee
     * @dev only callable by AugustusSwapper contract
     * @param _account account address used to withdraw fees
     * @param _token token address
     * @param _fee fee amount in token
     */
    function registerFee(
        address _account,
        IERC20 _token,
        uint256 _fee
    ) external;

    /**
     * @notice claim partner share fee in ERC20 token
     * @dev transfers ERC20 token balance to the caller's account
     *      the call will fail if withdrawer have zero balance in the contract
     * @param _token address of the ERC20 token
     * @param _recipient address
     * @return true if the withdraw was successfull
     */
    function withdrawAllERC20(IERC20 _token, address _recipient) external returns (bool);

    /**
     * @notice batch claim whole balance of fee share amount
     * @dev transfers ERC20 token balance to the caller's account
     *      the call will fail if withdrawer have zero balance in the contract
     * @param _tokens list of addresses of the ERC20 token
     * @param _recipient address of recipient
     * @return true if the withdraw was successfull
     */
    function batchWithdrawAllERC20(IERC20[] calldata _tokens, address _recipient) external returns (bool);

    /**
     * @notice claim some partner share fee in ERC20 token
     * @dev transfers ERC20 token amount to the caller's account
     *      the call will fail if withdrawer have zero balance in the contract
     * @param _token address of the ERC20 token
     * @param _recipient address
     * @return true if the withdraw was successfull
     */
    function withdrawSomeERC20(
        IERC20 _token,
        uint256 _tokenAmount,
        address _recipient
    ) external returns (bool);

    /**
     * @notice batch claim some amount of fee share in ERC20 token
     * @dev transfers ERC20 token balance to the caller's account
     *      the call will fail if withdrawer have zero balance in the contract
     * @param _tokens address of the ERC20 tokens
     * @param _tokenAmounts array of amounts
     * @param _recipient destination account addresses
     * @return true if the withdraw was successfull
     */
    function batchWithdrawSomeERC20(
        IERC20[] calldata _tokens,
        uint256[] calldata _tokenAmounts,
        address _recipient
    ) external returns (bool);

    /**
     * @notice compute unallocated fee in token
     * @param _token address of the ERC20 token
     * @return amount of unallocated token in fees
     */
    function getUnallocatedFees(IERC20 _token) external view returns (uint256);

    /**
     * @notice returns unclaimed fee amount given the token
     * @dev retrieves the balance of ERC20 token fee amount for a partner
     * @param _token address of the ERC20 token
     * @param _partner account address of the partner
     * @return amount of balance
     */
    function getBalance(IERC20 _token, address _partner) external view returns (uint256);

    /**
     * @notice returns unclaimed fee amount given the token in batch
     * @dev retrieves the balance of ERC20 token fee amount for a partner in batch
     * @param _tokens list of ERC20 token addresses
     * @param _partner account address of the partner
     * @return _fees array of the token amount
     */
    function batchGetBalance(IERC20[] calldata _tokens, address _partner)
        external
        view
        returns (uint256[] memory _fees);
}

File 8 of 15 : Utils.sol
/*solhint-disable avoid-low-level-calls */
// SPDX-License-Identifier: ISC

pragma solidity 0.7.5;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "../ITokenTransferProxy.sol";
import { IBalancerV2Vault } from "./balancerv2/IBalancerV2Vault.sol";

interface IERC20Permit {
    function permit(
        address owner,
        address spender,
        uint256 amount,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;
}

interface IERC20PermitLegacy {
    function permit(
        address holder,
        address spender,
        uint256 nonce,
        uint256 expiry,
        bool allowed,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;
}

library Utils {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    address private constant ETH_ADDRESS = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);

    uint256 private constant MAX_UINT = type(uint256).max;

    enum CurveSwapType {
        EXCHANGE,
        EXCHANGE_UNDERLYING,
        EXCHANGE_GENERIC_FACTORY_ZAP
    }

    /**
     * @param fromToken Address of the source token
     * @param fromAmount Amount of source tokens to be swapped
     * @param toAmount Minimum destination token amount expected out of this swap
     * @param expectedAmount Expected amount of destination tokens without slippage
     * @param beneficiary Beneficiary address
     * 0 then 100% will be transferred to beneficiary. Pass 10000 for 100%
     * @param path Route to be taken for this swap to take place
     */
    struct SellData {
        address fromToken;
        uint256 fromAmount;
        uint256 toAmount;
        uint256 expectedAmount;
        address payable beneficiary;
        Utils.Path[] path;
        address payable partner;
        uint256 feePercent;
        bytes permit;
        uint256 deadline;
        bytes16 uuid;
    }

    struct BuyData {
        address adapter;
        address fromToken;
        address toToken;
        uint256 fromAmount;
        uint256 toAmount;
        uint256 expectedAmount;
        address payable beneficiary;
        Utils.Route[] route;
        address payable partner;
        uint256 feePercent;
        bytes permit;
        uint256 deadline;
        bytes16 uuid;
    }

    struct MegaSwapSellData {
        address fromToken;
        uint256 fromAmount;
        uint256 toAmount;
        uint256 expectedAmount;
        address payable beneficiary;
        Utils.MegaSwapPath[] path;
        address payable partner;
        uint256 feePercent;
        bytes permit;
        uint256 deadline;
        bytes16 uuid;
    }

    struct SimpleData {
        address fromToken;
        address toToken;
        uint256 fromAmount;
        uint256 toAmount;
        uint256 expectedAmount;
        address[] callees;
        bytes exchangeData;
        uint256[] startIndexes;
        uint256[] values;
        address payable beneficiary;
        address payable partner;
        uint256 feePercent;
        bytes permit;
        uint256 deadline;
        bytes16 uuid;
    }

    struct DirectUniV3 {
        address fromToken;
        address toToken;
        address exchange;
        uint256 fromAmount;
        uint256 toAmount;
        uint256 expectedAmount;
        uint256 feePercent;
        uint256 deadline;
        address payable partner;
        bool isApproved;
        address payable beneficiary;
        bytes path;
        bytes permit;
        bytes16 uuid;
    }

    struct DirectCurveV1 {
        address fromToken;
        address toToken;
        address exchange;
        uint256 fromAmount;
        uint256 toAmount;
        uint256 expectedAmount;
        uint256 feePercent;
        int128 i;
        int128 j;
        address payable partner;
        bool isApproved;
        CurveSwapType swapType;
        address payable beneficiary;
        bool needWrapNative;
        bytes permit;
        bytes16 uuid;
    }

    struct DirectCurveV2 {
        address fromToken;
        address toToken;
        address exchange;
        address poolAddress;
        uint256 fromAmount;
        uint256 toAmount;
        uint256 expectedAmount;
        uint256 feePercent;
        uint256 i;
        uint256 j;
        address payable partner;
        bool isApproved;
        CurveSwapType swapType;
        address payable beneficiary;
        bool needWrapNative;
        bytes permit;
        bytes16 uuid;
    }

    struct DirectBalancerV2 {
        IBalancerV2Vault.BatchSwapStep[] swaps;
        address[] assets;
        IBalancerV2Vault.FundManagement funds;
        int256[] limits;
        uint256 fromAmount;
        uint256 toAmount;
        uint256 expectedAmount;
        uint256 deadline;
        uint256 feePercent;
        address vault;
        address payable partner;
        bool isApproved;
        address payable beneficiary;
        bytes permit;
        bytes16 uuid;
    }

    struct Adapter {
        address payable adapter;
        uint256 percent;
        uint256 networkFee; //NOT USED
        Route[] route;
    }

    struct Route {
        uint256 index; //Adapter at which index needs to be used
        address targetExchange;
        uint256 percent;
        bytes payload;
        uint256 networkFee; //NOT USED - Network fee is associated with 0xv3 trades
    }

    struct MegaSwapPath {
        uint256 fromAmountPercent;
        Path[] path;
    }

    struct Path {
        address to;
        uint256 totalNetworkFee; //NOT USED - Network fee is associated with 0xv3 trades
        Adapter[] adapters;
    }

    function ethAddress() internal pure returns (address) {
        return ETH_ADDRESS;
    }

    function maxUint() internal pure returns (uint256) {
        return MAX_UINT;
    }

    function approve(
        address addressToApprove,
        address token,
        uint256 amount
    ) internal {
        if (token != ETH_ADDRESS) {
            IERC20 _token = IERC20(token);

            uint256 allowance = _token.allowance(address(this), addressToApprove);

            if (allowance < amount) {
                _token.safeApprove(addressToApprove, 0);
                _token.safeIncreaseAllowance(addressToApprove, MAX_UINT);
            }
        }
    }

    function transferTokens(
        address token,
        address payable destination,
        uint256 amount
    ) internal {
        if (amount > 0) {
            if (token == ETH_ADDRESS) {
                (bool result, ) = destination.call{ value: amount, gas: 10000 }("");
                require(result, "Failed to transfer Ether");
            } else {
                IERC20(token).safeTransfer(destination, amount);
            }
        }
    }

    function tokenBalance(address token, address account) internal view returns (uint256) {
        if (token == ETH_ADDRESS) {
            return account.balance;
        } else {
            return IERC20(token).balanceOf(account);
        }
    }

    function permit(address token, bytes memory permit) internal {
        if (permit.length == 32 * 7) {
            (bool success, ) = token.call(abi.encodePacked(IERC20Permit.permit.selector, permit));
            require(success, "Permit failed");
        }

        if (permit.length == 32 * 8) {
            (bool success, ) = token.call(abi.encodePacked(IERC20PermitLegacy.permit.selector, permit));
            require(success, "Permit failed");
        }
    }

    function transferETH(address payable destination, uint256 amount) internal {
        if (amount > 0) {
            (bool result, ) = destination.call{ value: amount, gas: 10000 }("");
            require(result, "Transfer ETH failed");
        }
    }
}

File 9 of 15 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity >=0.6.0 <0.8.0;

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

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

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

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

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

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

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

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

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

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

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

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

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

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

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

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

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

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

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

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

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

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

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

File 12 of 15 : ITokenTransferProxy.sol
// SPDX-License-Identifier: ISC

pragma solidity 0.7.5;

interface ITokenTransferProxy {
    function transferFrom(
        address token,
        address from,
        address to,
        uint256 amount
    ) external;
}

File 13 of 15 : IBalancerV2Vault.sol
// SPDX-License-Identifier: ISC

pragma solidity 0.7.5;
pragma abicoder v2;

import "../Utils.sol";

interface IBalancerV2Vault {
    enum SwapKind {
        GIVEN_IN,
        GIVEN_OUT
    }

    struct SingleSwap {
        bytes32 poolId;
        SwapKind kind;
        address assetIn;
        address assetOut;
        uint256 amount;
        bytes userData;
    }

    struct BatchSwapStep {
        bytes32 poolId;
        uint256 assetInIndex;
        uint256 assetOutIndex;
        uint256 amount;
        bytes userData;
    }

    struct FundManagement {
        address sender;
        bool fromInternalBalance;
        address payable recipient;
        bool toInternalBalance;
    }

    function swap(
        SingleSwap memory singleSwap,
        FundManagement memory funds,
        uint256 limit,
        uint256 deadline
    ) external payable returns (uint256);

    function batchSwap(
        SwapKind kind,
        BatchSwapStep[] memory swaps,
        address[] memory assets,
        FundManagement memory funds,
        int256[] memory limits,
        uint256 deadline
    ) external payable returns (int256[] memory);
}

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

pragma solidity >=0.6.2 <0.8.0;

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

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

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

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 15 of 15 : AugustusStorage.sol
// SPDX-License-Identifier: ISC

pragma solidity 0.7.5;

import "./ITokenTransferProxy.sol";

contract AugustusStorage {
    struct FeeStructure {
        uint256 partnerShare;
        bool noPositiveSlippage;
        bool positiveSlippageToUser;
        uint16 feePercent;
        string partnerId;
        bytes data;
    }

    ITokenTransferProxy internal tokenTransferProxy;
    address payable internal feeWallet;

    mapping(address => FeeStructure) internal registeredPartners;

    mapping(bytes4 => address) internal selectorVsRouter;
    mapping(bytes32 => bool) internal adapterInitialized;
    mapping(bytes32 => bytes) internal adapterVsData;

    mapping(bytes32 => bytes) internal routerData;
    mapping(bytes32 => bool) internal routerInitialized;

    bytes32 public constant WHITELISTED_ROLE = keccak256("WHITELISTED_ROLE");

    bytes32 public constant ROUTER_ROLE = keccak256("ROUTER_ROLE");
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"_partnerSharePercent","type":"uint256"},{"internalType":"uint256","name":"_maxFeePercent","type":"uint256"},{"internalType":"uint256","name":"_paraswapReferralShare","type":"uint256"},{"internalType":"uint256","name":"_paraswapSlippageShare","type":"uint256"},{"internalType":"contract IFeeClaimer","name":"_feeClaimer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes16","name":"uuid","type":"bytes16"},{"indexed":false,"internalType":"address","name":"partner","type":"address"},{"indexed":false,"internalType":"uint256","name":"feePercent","type":"uint256"},{"indexed":false,"internalType":"address","name":"initiator","type":"address"},{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":true,"internalType":"address","name":"srcToken","type":"address"},{"indexed":true,"internalType":"address","name":"destToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"srcAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"receivedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expectedAmount","type":"uint256"}],"name":"BoughtV3","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes16","name":"uuid","type":"bytes16"},{"indexed":false,"internalType":"address","name":"partner","type":"address"},{"indexed":false,"internalType":"uint256","name":"feePercent","type":"uint256"},{"indexed":false,"internalType":"address","name":"initiator","type":"address"},{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":true,"internalType":"address","name":"srcToken","type":"address"},{"indexed":true,"internalType":"address","name":"destToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"srcAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"receivedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expectedAmount","type":"uint256"}],"name":"SwappedV3","type":"event"},{"inputs":[],"name":"ROUTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WHITELISTED_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"adapter","type":"address"},{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"uint256","name":"toAmount","type":"uint256"},{"internalType":"uint256","name":"expectedAmount","type":"uint256"},{"internalType":"address payable","name":"beneficiary","type":"address"},{"components":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"targetExchange","type":"address"},{"internalType":"uint256","name":"percent","type":"uint256"},{"internalType":"bytes","name":"payload","type":"bytes"},{"internalType":"uint256","name":"networkFee","type":"uint256"}],"internalType":"struct Utils.Route[]","name":"route","type":"tuple[]"},{"internalType":"address payable","name":"partner","type":"address"},{"internalType":"uint256","name":"feePercent","type":"uint256"},{"internalType":"bytes","name":"permit","type":"bytes"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes16","name":"uuid","type":"bytes16"}],"internalType":"struct Utils.BuyData","name":"data","type":"tuple"}],"name":"buy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"feeClaimer","outputs":[{"internalType":"contract IFeeClaimer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getKey","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxFeePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"uint256","name":"toAmount","type":"uint256"},{"internalType":"uint256","name":"expectedAmount","type":"uint256"},{"internalType":"address payable","name":"beneficiary","type":"address"},{"components":[{"internalType":"uint256","name":"fromAmountPercent","type":"uint256"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"totalNetworkFee","type":"uint256"},{"components":[{"internalType":"address payable","name":"adapter","type":"address"},{"internalType":"uint256","name":"percent","type":"uint256"},{"internalType":"uint256","name":"networkFee","type":"uint256"},{"components":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"targetExchange","type":"address"},{"internalType":"uint256","name":"percent","type":"uint256"},{"internalType":"bytes","name":"payload","type":"bytes"},{"internalType":"uint256","name":"networkFee","type":"uint256"}],"internalType":"struct Utils.Route[]","name":"route","type":"tuple[]"}],"internalType":"struct Utils.Adapter[]","name":"adapters","type":"tuple[]"}],"internalType":"struct Utils.Path[]","name":"path","type":"tuple[]"}],"internalType":"struct Utils.MegaSwapPath[]","name":"path","type":"tuple[]"},{"internalType":"address payable","name":"partner","type":"address"},{"internalType":"uint256","name":"feePercent","type":"uint256"},{"internalType":"bytes","name":"permit","type":"bytes"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes16","name":"uuid","type":"bytes16"}],"internalType":"struct Utils.MegaSwapSellData","name":"data","type":"tuple"}],"name":"megaSwap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"uint256","name":"toAmount","type":"uint256"},{"internalType":"uint256","name":"expectedAmount","type":"uint256"},{"internalType":"address payable","name":"beneficiary","type":"address"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"totalNetworkFee","type":"uint256"},{"components":[{"internalType":"address payable","name":"adapter","type":"address"},{"internalType":"uint256","name":"percent","type":"uint256"},{"internalType":"uint256","name":"networkFee","type":"uint256"},{"components":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"targetExchange","type":"address"},{"internalType":"uint256","name":"percent","type":"uint256"},{"internalType":"bytes","name":"payload","type":"bytes"},{"internalType":"uint256","name":"networkFee","type":"uint256"}],"internalType":"struct Utils.Route[]","name":"route","type":"tuple[]"}],"internalType":"struct Utils.Adapter[]","name":"adapters","type":"tuple[]"}],"internalType":"struct Utils.Path[]","name":"path","type":"tuple[]"},{"internalType":"address payable","name":"partner","type":"address"},{"internalType":"uint256","name":"feePercent","type":"uint256"},{"internalType":"bytes","name":"permit","type":"bytes"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes16","name":"uuid","type":"bytes16"}],"internalType":"struct Utils.SellData","name":"data","type":"tuple"}],"name":"multiSwap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"paraswapReferralShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paraswapSlippageShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"partnerSharePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

6101206040523480156200001257600080fd5b506040516200354b3803806200354b83398101604081905262000035916200005e565b60809490945260a09290925260c05260e05260601b6001600160601b03191661010052620000b9565b600080600080600060a0868803121562000076578081fd5b855160208701516040880151606089015160808a0151939850919650945092506001600160a01b0381168114620000ab578182fd5b809150509295509295909350565b60805160a05160c05160e0516101005160601c61341d6200012e600039806109a45280611d4e5280611d7b5280611ea1525080610ba552806114665280611a26525080610bc9528061202952806120c3525080610bed528061118552806111b25250806101f45280611c98525061341d6000f3fe6080604052600436106100c75760003560e01c806381cbd3ea11610074578063c25ff0261161004e578063c25ff026146101b3578063d555d4f9146101c8578063d830a05b146101dd576100c7565b806381cbd3ea1461016957806382678dd61461018b578063a94e78ef146101a0576100c7565b8063439fab91116100a5578063439fab911461011f57806346c67b6d146101415780637a3226ec14610154576100c7565b806312070a41146100cc57806330d643b5146100f7578063353269101461010c575b600080fd5b3480156100d857600080fd5b506100e16101f2565b6040516100ee9190612fb2565b60405180910390f35b34801561010357600080fd5b506100e1610216565b6100e161011a366004612a0e565b61023a565b34801561012b57600080fd5b5061013f61013a3660046129a1565b610560565b005b6100e161014f366004612b44565b610592565b34801561016057600080fd5b506100e161097e565b34801561017557600080fd5b5061017e6109a2565b6040516100ee9190612dff565b34801561019757600080fd5b506100e16109c6565b6100e16101ae366004612c47565b6109f2565b3480156101bf57600080fd5b506100e1610ba3565b3480156101d457600080fd5b506100e1610bc7565b3480156101e957600080fd5b506100e1610beb565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f7a05a596cb0ce7fdea8a1e1ec73be300bdb35097c944ce1897202f7a13122eb281565b6000428261016001511015610284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b9061321a565b60405180910390fd5b60208201516060830151610296610c0f565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146102cf5760006102d1565b805b3414610309576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613186565b608084015160c085015160009073ffffffffffffffffffffffffffffffffffffffff161561033b578560c0015161033d565b335b604087015160a0880151610120890151929350909184610389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613251565b61039987878b6101400151610c27565b60006103b18a6000015189868a8a8f60e00151610cff565b905060006103bf8930611047565b90506103d58b61010001518c6101200151611144565b158015906103e957506103e7836111da565b155b801561040057506103fe8b61012001516111f4565b155b15610427576104178583888e6101000151876111fe565b61042289338361123e565b6104b2565b61043285878461123e565b6104468b61010001518c6101200151611144565b158015906104585750610458836111da565b15610478576104228961046b8a84611345565b838e6101000151876113bc565b836104838983611345565b10156104a7576101008b0151610422908a90866104a08c86611345565b8588611407565b6104b289338361123e565b6104bc8882611345565b97508473ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f4cc7e95e48af62690313a0733e93308ac9a73326bc3c29f1788b1191c376d5b68e61018001518f610100015188338f8a8d6040516105489796959493929190612f42565b60405180910390a4509750505050505050505b919050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613118565b60004282610120015110156105d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b9061321a565b815160208301516105e2610c0f565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461061b57600061061d565b805b3414610655576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613186565b60408401516060850151608086015160009073ffffffffffffffffffffffffffffffffffffffff161561068c57866080015161068e565b335b905060608760a0015190506000816000815181106106a857fe5b6020026020010151602001516001836000815181106106c357fe5b6020026020010151602001515103815181106106db57fe5b602002602001015160000151905060008511610723576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613251565b61073387878b6101000151610c27565b6107408960e001516111da565b1561075c5761075987878b60c001518c60e001516114cb565b95505b60005b825160ff168160ff1610156107f55760006107a96127106107a3868560ff168151811061078857fe5b6020026020010151600001518b61151290919063ffffffff16565b90611585565b905060018451038260ff1614156107c7576107c48930611047565b90505b6107ec8982868560ff16815181106107db57fe5b602002602001015160200151611606565b5060010161075f565b5060006108028230611047565b90508581101561083e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b906131bd565b6108508a60c001518b60e00151611144565b1580159061086857506108668a60e001516111da565b155b801561087e575061087c8a60e001516111f4565b155b1561089d576108988282868d60c001518e60e001516111fe565b6108dc565b84811180156108b657506108b48a60e001516111da565b155b156108d15761089882858c60c0015184898f60e001516119c7565b6108dc82858361123e565b8173ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fe00361d207b252a464323eb23d45d42583e391f2031acdd2e9fa36efddd43cb08d61014001518e60c001518f60e00151338e898e6040516109699796959493929190612f42565b60405180910390a49998505050505050505050565b7f8429d542926e6695b59ac6fbdcd9b37e8b1aeb757afab06ab60b1bb5878c3b4981565b7f000000000000000000000000000000000000000000000000000000000000000081565b60006040516020016109d790612dad565b60405160208183030381529060405280519060200120905090565b6000428261012001511015610a33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b9061321a565b81516020830151610a42610c0f565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610a7b576000610a7d565b805b3414610ab5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613186565b60408401516060850151608086015160009073ffffffffffffffffffffffffffffffffffffffff1615610aec578660800151610aee565b335b905060608760a001519050600081600183510381518110610b0b57fe5b602002602001015160000151905060008511610b53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613251565b610b6387878b6101000151610c27565b610b708960e001516111da565b15610b8c57610b8987878b60c001518c60e001516114cb565b95505b610b97878784611606565b60006108028230611047565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee90565b610c2f610c0f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610cfa57610c6b8382611a8b565b6000546040517f15dacbea00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116906315dacbea90610cc7908690339030908890600401612e20565b600060405180830381600087803b158015610ce157600080fd5b505af1158015610cf5573d6000803e3d6000fd5b505050505b505050565b6040517f91d1485400000000000000000000000000000000000000000000000000000000815260009030906391d1485490610d60907f8429d542926e6695b59ac6fbdcd9b37e8b1aeb757afab06ab60b1bb5878c3b49908b90600401612fbb565b60206040518083038186803b158015610d7857600080fd5b505afa158015610d8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db09190612981565b610de6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b906130e1565b60005b8251811015610ff357610dfa612468565b838281518110610e0657fe5b60200260200101519050600080610e286001875161134590919063ffffffff16565b841415610e5657610e43610e3c8a30611047565b8890611345565b9050610e4f8a30611047565b9150610e95565b610e736127106107a385604001518b61151290919063ffffffff16565b9150610e926127106107a385604001518a61151290919063ffffffff16565b90505b60008b73ffffffffffffffffffffffffffffffffffffffff166325deee1e60e01b85600001518d8d87878a602001518b60600151604051602401610edf9796959493929190613288565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093179092529051610f689190612d91565b600060405180830381855af49150503d8060008114610fa3576040519150601f19603f3d011682016040523d82523d6000602084013e610fa8565b606091505b5050905080610fe3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b9061314f565b505060019092019150610de99050565b5060006110008630611047565b90508381101561103c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613016565b979650505050505050565b600073ffffffffffffffffffffffffffffffffffffffff831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611099575073ffffffffffffffffffffffffffffffffffffffff81163161113e565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416906370a08231906110eb908590600401612dff565b60206040518083038186803b15801561110357600080fd5b505afa158015611117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113b9190612ce7565b90505b92915050565b600073ffffffffffffffffffffffffffffffffffffffff83166111695750600061113e565b60f882901c8061117b57829150611183565b82613fff1691505b7f000000000000000000000000000000000000000000000000000000000000000082116111b057816111d2565b7f00000000000000000000000000000000000000000000000000000000000000005b949350505050565b600060f882901c1580159061113e57505061800016151590565b6201000016151590565b600061120a8383611144565b90506000806112198784611c76565b91509150611234888761122f8a8c8a8888611cd2565b61123e565b5050505050505050565b8015610cfa5773ffffffffffffffffffffffffffffffffffffffff831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156113245760008273ffffffffffffffffffffffffffffffffffffffff1682612710906040516112a090612dfc565b600060405180830381858888f193505050503d80600081146112de576040519150601f19603f3d011682016040523d82523d6000602084013e6112e3565b606091505b505090508061131e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90612fdf565b50610cfa565b610cfa73ffffffffffffffffffffffffffffffffffffffff84168383611f1b565b6000828211156113b657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006113c88383611144565b90506000806113d78784611c76565b9092509050856113e78383611fa8565b116113fc576113f98689878585611cd2565b95505b61123488338861123e565b60006114138585611345565b905073ffffffffffffffffffffffffffffffffffffffff8616156114585760008061143e838561201c565b9150915061144f858a8a8585611cd2565b945050506114c0565b600061148a6127106107a3847f0000000000000000000000000000000000000000000000000000000000000000611512565b6001549091506114b290899073ffffffffffffffffffffffffffffffffffffffff168361123e565b6114bc8482611345565b9350505b610cf587338561123e565b6000806114d88484611144565b9050806114e857849150506111d2565b6000806114f58784611c76565b915091506115068789888585611cd2565b98975050505050505050565b6000826115215750600061113e565b8282028284828161152e57fe5b041461113b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133a26021913960400191505060405180910390fd5b60008082116115f557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816115fe57fe5b049392505050565b6000815111611641576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b906130aa565b60005b81518110156119c157600080821161165c5784611678565b82600183038151811061166b57fe5b6020026020010151600001515b9050600083838151811061168857fe5b602002602001015160000151905060008084116116a557856116af565b6116af8330611047565b905060005b8585815181106116c057fe5b602002602001015160400151518110156119b1576116dc6124ad565b8686815181106116e857fe5b60200260200101516040015182815181106116ff57fe5b602090810291909101015180516040517f91d1485400000000000000000000000000000000000000000000000000000000815291925030916391d148549161176c917f8429d542926e6695b59ac6fbdcd9b37e8b1aeb757afab06ab60b1bb5878c3b499190600401612fbb565b60206040518083038186803b15801561178457600080fd5b505afa158015611798573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117bc9190612981565b6117f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b906130e1565b6000808711801561182d575061182a600189898151811061180f57fe5b6020026020010151604001515161134590919063ffffffff16565b83145b6118535761184e6127106107a384602001518761151290919063ffffffff16565b61185d565b61185d8630611047565b90506000826000015173ffffffffffffffffffffffffffffffffffffffff1663e76b146c60e01b888885600088606001516040516024016118a2959493929190612e57565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090941693909317909252905161192b9190612d91565b600060405180830381855af49150503d8060008114611966576040519150601f19603f3d011682016040523d82523d6000602084013e61196b565b606091505b50509050806119a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b9061314f565b5050506001016116b4565b5050600190920191506116449050565b50505050565b60006119d38484611345565b905073ffffffffffffffffffffffffffffffffffffffff851615611a18576000806119fe838561201c565b91509150611a0f868a898585611cd2565b95505050611a80565b6000611a4a6127106107a3847f0000000000000000000000000000000000000000000000000000000000000000611512565b600154909150611a7290899073ffffffffffffffffffffffffffffffffffffffff168361123e565b611a7c8582611345565b9450505b610cf587878661123e565b805160e01415611b7f5760008273ffffffffffffffffffffffffffffffffffffffff1663d505accf60e01b83604051602001611ac8929190612d49565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052611b0091612d91565b6000604051808303816000865af19150503d8060008114611b3d576040519150601f19603f3d011682016040523d82523d6000602084013e611b42565b606091505b5050905080611b7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613073565b505b80516101001415611c725760008273ffffffffffffffffffffffffffffffffffffffff16638fcbaf0c60e01b83604051602001611bbd929190612d49565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052611bf591612d91565b6000604051808303816000865af19150503d8060008114611c32576040519150601f19603f3d011682016040523d82523d6000602084013e611c37565b606091505b5050905080610cfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613073565b5050565b60008080611c8a6127106107a38787611512565b9050611cbc6127106107a3837f0000000000000000000000000000000000000000000000000000000000000000611512565b9250611cc88184611345565b9150509250929050565b600080611cdf8484611fa8565b905080611cef5786915050611f12565b86811115611d48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806133c36024913960400191505060405180910390fd5b611d73867f00000000000000000000000000000000000000000000000000000000000000008361123e565b8315611e41577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d1f4354b8688876040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015611e2857600080fd5b505af1158015611e3c573d6000803e3d6000fd5b505050505b8215611f0457600154604080517fd1f4354b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316600482015288831660248201526044810186905290517f00000000000000000000000000000000000000000000000000000000000000009092169163d1f4354b9160648082019260009290919082900301818387803b158015611eeb57600080fd5b505af1158015611eff573d6000803e3d6000fd5b505050505b611f0e8782611345565b9150505b95945050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610cfa908490612103565b60008282018381101561113b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600080613fff83166127107f0000000000000000000000000000000000000000000000000000000000000000820111156120b757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f496e76616c6964206665652070657263656e7400000000000000000000000000604482015290519081900360640190fd5b6120e76127106107a3877f0000000000000000000000000000000000000000000000000000000000000000611512565b91506120f96127106107a38784611512565b9250509250929050565b6060612165826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166121db9092919063ffffffff16565b805190915015610cfa5780806020019051602081101561218457600080fd5b5051610cfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806133e7602a913960400191505060405180910390fd5b60606121ea84846000856121f4565b90505b9392505050565b60608247101561224f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061337c6026913960400191505060405180910390fd5b612258856123a4565b6122c357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b6020831061232d57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016122f0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461238f576040519150601f19603f3d011682016040523d82523d6000602084013e612394565b606091505b509150915061103c8282866123aa565b3b151590565b606083156123b95750816121ed565b8251156123c95782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561242d578181015183820152602001612415565b50505050905090810190601f16801561245a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6040518060a0016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160608152602001600081525090565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001606081525090565b803561055b81613356565b600082601f830112612506578081fd5b81356125196125148261330c565b6132e8565b818152915060208083019084810160005b848110156125c857813587016040807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0838c0301121561256957600080fd5b805181810167ffffffffffffffff828210818311171561258557fe5b8184528488013583529284013592808411156125a057600080fd5b50506125b08b87848601016125d3565b8187015286525050928201929082019060010161252a565b505050505092915050565b600082601f8301126125e3578081fd5b6125f0612514833561330c565b823581529050602080820190830160005b84358110156127cc578135850160607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082890301121561264057600080fd5b60405180606082011067ffffffffffffffff6060830111171561265f57fe5b606081016040526126736020830135613356565b602082013581526040820135602082015267ffffffffffffffff6060830135111561269d57600080fd5b60608201358201915087603f8301126126b557600080fd5b6126c5612514602084013561330c565b60208381013582528101906040840160005b60208601358110156127ae578135860160807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0828f0301121561271957600080fd5b60405180608082011067ffffffffffffffff6080830111171561273857fe5b6080810160405261274c6040830135613356565b60408201358152606082013560208201526080820135604082015267ffffffffffffffff60a0830135111561278057600080fd5b6127938e604060a08501358501016127d5565b606082015285525060209384019391909101906001016126d7565b50506040830152508452506020928301929190910190600101612601565b50505092915050565b600082601f8301126127e5578081fd5b81356127f36125148261330c565b818152915060208083019084810160005b848110156125c8578135870160a0807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0838c0301121561284357600080fd5b6040805182810167ffffffffffffffff828210818311171561286157fe5b8184528886013583526128758487016124eb565b8984015260609150818601358484015260809350838601358181111561289a57600080fd5b6128a88f8b838a01016128fc565b92840192909252505092909101359082015284529282019290820190600101612804565b80357fffffffffffffffffffffffffffffffff000000000000000000000000000000008116811461055b57600080fd5b600082601f83011261290c578081fd5b813567ffffffffffffffff81111561292057fe5b61295160207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016132e8565b915080825283602082850101111561296857600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215612992578081fd5b8151801515811461113b578182fd5b600080602083850312156129b3578081fd5b823567ffffffffffffffff808211156129ca578283fd5b818501915085601f8301126129dd578283fd5b8135818111156129eb578384fd5b8660208285010111156129fc578384fd5b60209290920196919550909350505050565b600060208284031215612a1f578081fd5b813567ffffffffffffffff80821115612a36578283fd5b81840191506101a0808387031215612a4c578384fd5b612a55816132e8565b9050612a60836124eb565b8152612a6e602084016124eb565b6020820152612a7f604084016124eb565b6040820152606083013560608201526080830135608082015260a083013560a0820152612aae60c084016124eb565b60c082015260e083013582811115612ac4578485fd5b612ad0878286016127d5565b60e083015250610100612ae48185016124eb565b9082015261012083810135908201526101408084013583811115612b06578586fd5b612b12888287016128fc565b828401525050610160915081830135828201526101809150612b358284016128cc565b91810191909152949350505050565b600060208284031215612b55578081fd5b813567ffffffffffffffff80821115612b6c578283fd5b8184019150610160808387031215612b82578384fd5b612b8b816132e8565b9050612b96836124eb565b8152602083013560208201526040830135604082015260608301356060820152612bc2608084016124eb565b608082015260a083013582811115612bd8578485fd5b612be4878286016124f6565b60a083015250612bf660c084016124eb565b60c082015260e083013560e08201526101008084013583811115612c18578586fd5b612c24888287016128fc565b828401525050610120915081830135828201526101409150612b358284016128cc565b600060208284031215612c58578081fd5b813567ffffffffffffffff80821115612c6f578283fd5b8184019150610160808387031215612c85578384fd5b612c8e816132e8565b9050612c99836124eb565b8152602083013560208201526040830135604082015260608301356060820152612cc5608084016124eb565b608082015260a083013582811115612cdb578485fd5b612be4878286016125d3565b600060208284031215612cf8578081fd5b5051919050565b60008151808452612d1781602086016020860161332a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60007fffffffff00000000000000000000000000000000000000000000000000000000841682528251612d8381600485016020870161332a565b919091016004019392505050565b60008251612da381846020870161332a565b9190910192915050565b7f4d554c5449504154485f524f555445520000000000000000000000000000000081527f312e302e30000000000000000000000000000000000000000000000000000000601082015260150190565b90565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff9485168152928416602084015292166040820152606081019190915260800190565b600060a080830173ffffffffffffffffffffffffffffffffffffffff808a1685526020818a16818701526040898188015260608981890152608086818a0152858a5180885260c08b01915060c08682028c01019750858c018a5b82811015612f2a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff408d8b03018452815180518b52898982015116898c015287810151888c0152868101518c888d0152612f0d8d8d0182612cff565b918701519b87019b909b5299509287019290870190600101612eb1565b50505050505050505080925050509695505050505050565b7fffffffffffffffffffffffffffffffff0000000000000000000000000000000097909716875273ffffffffffffffffffffffffffffffffffffffff95861660208801526040870194909452919093166060850152608084019290925260a083019190915260c082015260e00190565b90815260200190565b91825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b60208082526018908201527f4661696c656420746f207472616e736665722045746865720000000000000000604082015260600190565b60208082526037908201527f526563656976656420616d6f756e74206f6620746f6b656e7320617265206c6560408201527f7373207468656e20657870656374656420746f6b656e73000000000000000000606082015260800190565b6020808252600d908201527f5065726d6974206661696c656400000000000000000000000000000000000000604082015260600190565b6020808252601a908201527f50617468206e6f742070726f766964656420666f722073776170000000000000604082015260600190565b60208082526018908201527f45786368616e6765206e6f742077686974656c69737465640000000000000000604082015260600190565b60208082526016908201527f4d4554484f44204e4f5420494d504c454d454e54454400000000000000000000604082015260600190565b60208082526016908201527f43616c6c20746f2061646170746572206661696c656400000000000000000000604082015260600190565b60208082526013908201527f496e636f7272656374206d73672e76616c756500000000000000000000000000604082015260600190565b60208082526030908201527f526563656976656420616d6f756e74206f6620746f6b656e7320617265206c6560408201527f7373207468656e20657870656374656400000000000000000000000000000000606082015260800190565b60208082526011908201527f446561646c696e65206272656163686564000000000000000000000000000000604082015260600190565b60208082526016908201527f546f20616d6f756e742063616e206e6f74206265203000000000000000000000604082015260600190565b600088825273ffffffffffffffffffffffffffffffffffffffff8089166020840152808816604084015286606084015285608084015280851660a08401525060e060c08301526132db60e0830184612cff565b9998505050505050505050565b60405181810167ffffffffffffffff8111828210171561330457fe5b604052919050565b600067ffffffffffffffff82111561332057fe5b5060209081020190565b60005b8381101561334557818101518382015260200161332d565b838111156119c15750506000910152565b73ffffffffffffffffffffffffffffffffffffffff8116811461337857600080fd5b5056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77496e73756666696369656e742062616c616e636520746f2070617920666f7220666565735361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a164736f6c6343000705000a000000000000000000000000000000000000000000000000000000000000213400000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000000000000000000000000000000000000000138800000000000000000000000000000000000000000000000000000000000027100000000000000000000000004f14fe8c86a00d6dfb9e91239738499fc0f587de

Deployed Bytecode

0x6080604052600436106100c75760003560e01c806381cbd3ea11610074578063c25ff0261161004e578063c25ff026146101b3578063d555d4f9146101c8578063d830a05b146101dd576100c7565b806381cbd3ea1461016957806382678dd61461018b578063a94e78ef146101a0576100c7565b8063439fab91116100a5578063439fab911461011f57806346c67b6d146101415780637a3226ec14610154576100c7565b806312070a41146100cc57806330d643b5146100f7578063353269101461010c575b600080fd5b3480156100d857600080fd5b506100e16101f2565b6040516100ee9190612fb2565b60405180910390f35b34801561010357600080fd5b506100e1610216565b6100e161011a366004612a0e565b61023a565b34801561012b57600080fd5b5061013f61013a3660046129a1565b610560565b005b6100e161014f366004612b44565b610592565b34801561016057600080fd5b506100e161097e565b34801561017557600080fd5b5061017e6109a2565b6040516100ee9190612dff565b34801561019757600080fd5b506100e16109c6565b6100e16101ae366004612c47565b6109f2565b3480156101bf57600080fd5b506100e1610ba3565b3480156101d457600080fd5b506100e1610bc7565b3480156101e957600080fd5b506100e1610beb565b7f000000000000000000000000000000000000000000000000000000000000213481565b7f7a05a596cb0ce7fdea8a1e1ec73be300bdb35097c944ce1897202f7a13122eb281565b6000428261016001511015610284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b9061321a565b60405180910390fd5b60208201516060830151610296610c0f565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146102cf5760006102d1565b805b3414610309576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613186565b608084015160c085015160009073ffffffffffffffffffffffffffffffffffffffff161561033b578560c0015161033d565b335b604087015160a0880151610120890151929350909184610389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613251565b61039987878b6101400151610c27565b60006103b18a6000015189868a8a8f60e00151610cff565b905060006103bf8930611047565b90506103d58b61010001518c6101200151611144565b158015906103e957506103e7836111da565b155b801561040057506103fe8b61012001516111f4565b155b15610427576104178583888e6101000151876111fe565b61042289338361123e565b6104b2565b61043285878461123e565b6104468b61010001518c6101200151611144565b158015906104585750610458836111da565b15610478576104228961046b8a84611345565b838e6101000151876113bc565b836104838983611345565b10156104a7576101008b0151610422908a90866104a08c86611345565b8588611407565b6104b289338361123e565b6104bc8882611345565b97508473ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167f4cc7e95e48af62690313a0733e93308ac9a73326bc3c29f1788b1191c376d5b68e61018001518f610100015188338f8a8d6040516105489796959493929190612f42565b60405180910390a4509750505050505050505b919050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613118565b60004282610120015110156105d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b9061321a565b815160208301516105e2610c0f565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461061b57600061061d565b805b3414610655576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613186565b60408401516060850151608086015160009073ffffffffffffffffffffffffffffffffffffffff161561068c57866080015161068e565b335b905060608760a0015190506000816000815181106106a857fe5b6020026020010151602001516001836000815181106106c357fe5b6020026020010151602001515103815181106106db57fe5b602002602001015160000151905060008511610723576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613251565b61073387878b6101000151610c27565b6107408960e001516111da565b1561075c5761075987878b60c001518c60e001516114cb565b95505b60005b825160ff168160ff1610156107f55760006107a96127106107a3868560ff168151811061078857fe5b6020026020010151600001518b61151290919063ffffffff16565b90611585565b905060018451038260ff1614156107c7576107c48930611047565b90505b6107ec8982868560ff16815181106107db57fe5b602002602001015160200151611606565b5060010161075f565b5060006108028230611047565b90508581101561083e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b906131bd565b6108508a60c001518b60e00151611144565b1580159061086857506108668a60e001516111da565b155b801561087e575061087c8a60e001516111f4565b155b1561089d576108988282868d60c001518e60e001516111fe565b6108dc565b84811180156108b657506108b48a60e001516111da565b155b156108d15761089882858c60c0015184898f60e001516119c7565b6108dc82858361123e565b8173ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fe00361d207b252a464323eb23d45d42583e391f2031acdd2e9fa36efddd43cb08d61014001518e60c001518f60e00151338e898e6040516109699796959493929190612f42565b60405180910390a49998505050505050505050565b7f8429d542926e6695b59ac6fbdcd9b37e8b1aeb757afab06ab60b1bb5878c3b4981565b7f0000000000000000000000004f14fe8c86a00d6dfb9e91239738499fc0f587de81565b60006040516020016109d790612dad565b60405160208183030381529060405280519060200120905090565b6000428261012001511015610a33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b9061321a565b81516020830151610a42610c0f565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610a7b576000610a7d565b805b3414610ab5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613186565b60408401516060850151608086015160009073ffffffffffffffffffffffffffffffffffffffff1615610aec578660800151610aee565b335b905060608760a001519050600081600183510381518110610b0b57fe5b602002602001015160000151905060008511610b53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613251565b610b6387878b6101000151610c27565b610b708960e001516111da565b15610b8c57610b8987878b60c001518c60e001516114cb565b95505b610b97878784611606565b60006108028230611047565b7f000000000000000000000000000000000000000000000000000000000000271081565b7f000000000000000000000000000000000000000000000000000000000000138881565b7f00000000000000000000000000000000000000000000000000000000000001f481565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee90565b610c2f610c0f565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610cfa57610c6b8382611a8b565b6000546040517f15dacbea00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116906315dacbea90610cc7908690339030908890600401612e20565b600060405180830381600087803b158015610ce157600080fd5b505af1158015610cf5573d6000803e3d6000fd5b505050505b505050565b6040517f91d1485400000000000000000000000000000000000000000000000000000000815260009030906391d1485490610d60907f8429d542926e6695b59ac6fbdcd9b37e8b1aeb757afab06ab60b1bb5878c3b49908b90600401612fbb565b60206040518083038186803b158015610d7857600080fd5b505afa158015610d8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db09190612981565b610de6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b906130e1565b60005b8251811015610ff357610dfa612468565b838281518110610e0657fe5b60200260200101519050600080610e286001875161134590919063ffffffff16565b841415610e5657610e43610e3c8a30611047565b8890611345565b9050610e4f8a30611047565b9150610e95565b610e736127106107a385604001518b61151290919063ffffffff16565b9150610e926127106107a385604001518a61151290919063ffffffff16565b90505b60008b73ffffffffffffffffffffffffffffffffffffffff166325deee1e60e01b85600001518d8d87878a602001518b60600151604051602401610edf9796959493929190613288565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093179092529051610f689190612d91565b600060405180830381855af49150503d8060008114610fa3576040519150601f19603f3d011682016040523d82523d6000602084013e610fa8565b606091505b5050905080610fe3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b9061314f565b505060019092019150610de99050565b5060006110008630611047565b90508381101561103c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613016565b979650505050505050565b600073ffffffffffffffffffffffffffffffffffffffff831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611099575073ffffffffffffffffffffffffffffffffffffffff81163161113e565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416906370a08231906110eb908590600401612dff565b60206040518083038186803b15801561110357600080fd5b505afa158015611117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113b9190612ce7565b90505b92915050565b600073ffffffffffffffffffffffffffffffffffffffff83166111695750600061113e565b60f882901c8061117b57829150611183565b82613fff1691505b7f00000000000000000000000000000000000000000000000000000000000001f482116111b057816111d2565b7f00000000000000000000000000000000000000000000000000000000000001f45b949350505050565b600060f882901c1580159061113e57505061800016151590565b6201000016151590565b600061120a8383611144565b90506000806112198784611c76565b91509150611234888761122f8a8c8a8888611cd2565b61123e565b5050505050505050565b8015610cfa5773ffffffffffffffffffffffffffffffffffffffff831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156113245760008273ffffffffffffffffffffffffffffffffffffffff1682612710906040516112a090612dfc565b600060405180830381858888f193505050503d80600081146112de576040519150601f19603f3d011682016040523d82523d6000602084013e6112e3565b606091505b505090508061131e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90612fdf565b50610cfa565b610cfa73ffffffffffffffffffffffffffffffffffffffff84168383611f1b565b6000828211156113b657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006113c88383611144565b90506000806113d78784611c76565b9092509050856113e78383611fa8565b116113fc576113f98689878585611cd2565b95505b61123488338861123e565b60006114138585611345565b905073ffffffffffffffffffffffffffffffffffffffff8616156114585760008061143e838561201c565b9150915061144f858a8a8585611cd2565b945050506114c0565b600061148a6127106107a3847f0000000000000000000000000000000000000000000000000000000000002710611512565b6001549091506114b290899073ffffffffffffffffffffffffffffffffffffffff168361123e565b6114bc8482611345565b9350505b610cf587338561123e565b6000806114d88484611144565b9050806114e857849150506111d2565b6000806114f58784611c76565b915091506115068789888585611cd2565b98975050505050505050565b6000826115215750600061113e565b8282028284828161152e57fe5b041461113b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133a26021913960400191505060405180910390fd5b60008082116115f557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816115fe57fe5b049392505050565b6000815111611641576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b906130aa565b60005b81518110156119c157600080821161165c5784611678565b82600183038151811061166b57fe5b6020026020010151600001515b9050600083838151811061168857fe5b602002602001015160000151905060008084116116a557856116af565b6116af8330611047565b905060005b8585815181106116c057fe5b602002602001015160400151518110156119b1576116dc6124ad565b8686815181106116e857fe5b60200260200101516040015182815181106116ff57fe5b602090810291909101015180516040517f91d1485400000000000000000000000000000000000000000000000000000000815291925030916391d148549161176c917f8429d542926e6695b59ac6fbdcd9b37e8b1aeb757afab06ab60b1bb5878c3b499190600401612fbb565b60206040518083038186803b15801561178457600080fd5b505afa158015611798573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117bc9190612981565b6117f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b906130e1565b6000808711801561182d575061182a600189898151811061180f57fe5b6020026020010151604001515161134590919063ffffffff16565b83145b6118535761184e6127106107a384602001518761151290919063ffffffff16565b61185d565b61185d8630611047565b90506000826000015173ffffffffffffffffffffffffffffffffffffffff1663e76b146c60e01b888885600088606001516040516024016118a2959493929190612e57565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090941693909317909252905161192b9190612d91565b600060405180830381855af49150503d8060008114611966576040519150601f19603f3d011682016040523d82523d6000602084013e61196b565b606091505b50509050806119a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b9061314f565b5050506001016116b4565b5050600190920191506116449050565b50505050565b60006119d38484611345565b905073ffffffffffffffffffffffffffffffffffffffff851615611a18576000806119fe838561201c565b91509150611a0f868a898585611cd2565b95505050611a80565b6000611a4a6127106107a3847f0000000000000000000000000000000000000000000000000000000000002710611512565b600154909150611a7290899073ffffffffffffffffffffffffffffffffffffffff168361123e565b611a7c8582611345565b9450505b610cf587878661123e565b805160e01415611b7f5760008273ffffffffffffffffffffffffffffffffffffffff1663d505accf60e01b83604051602001611ac8929190612d49565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052611b0091612d91565b6000604051808303816000865af19150503d8060008114611b3d576040519150601f19603f3d011682016040523d82523d6000602084013e611b42565b606091505b5050905080611b7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613073565b505b80516101001415611c725760008273ffffffffffffffffffffffffffffffffffffffff16638fcbaf0c60e01b83604051602001611bbd929190612d49565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052611bf591612d91565b6000604051808303816000865af19150503d8060008114611c32576040519150601f19603f3d011682016040523d82523d6000602084013e611c37565b606091505b5050905080610cfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027b90613073565b5050565b60008080611c8a6127106107a38787611512565b9050611cbc6127106107a3837f0000000000000000000000000000000000000000000000000000000000002134611512565b9250611cc88184611345565b9150509250929050565b600080611cdf8484611fa8565b905080611cef5786915050611f12565b86811115611d48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806133c36024913960400191505060405180910390fd5b611d73867f0000000000000000000000004f14fe8c86a00d6dfb9e91239738499fc0f587de8361123e565b8315611e41577f0000000000000000000000004f14fe8c86a00d6dfb9e91239738499fc0f587de73ffffffffffffffffffffffffffffffffffffffff1663d1f4354b8688876040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015611e2857600080fd5b505af1158015611e3c573d6000803e3d6000fd5b505050505b8215611f0457600154604080517fd1f4354b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316600482015288831660248201526044810186905290517f0000000000000000000000004f14fe8c86a00d6dfb9e91239738499fc0f587de9092169163d1f4354b9160648082019260009290919082900301818387803b158015611eeb57600080fd5b505af1158015611eff573d6000803e3d6000fd5b505050505b611f0e8782611345565b9150505b95945050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610cfa908490612103565b60008282018381101561113b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600080613fff83166127107f0000000000000000000000000000000000000000000000000000000000001388820111156120b757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f496e76616c6964206665652070657263656e7400000000000000000000000000604482015290519081900360640190fd5b6120e76127106107a3877f0000000000000000000000000000000000000000000000000000000000001388611512565b91506120f96127106107a38784611512565b9250509250929050565b6060612165826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166121db9092919063ffffffff16565b805190915015610cfa5780806020019051602081101561218457600080fd5b5051610cfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806133e7602a913960400191505060405180910390fd5b60606121ea84846000856121f4565b90505b9392505050565b60608247101561224f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061337c6026913960400191505060405180910390fd5b612258856123a4565b6122c357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b6020831061232d57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016122f0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461238f576040519150601f19603f3d011682016040523d82523d6000602084013e612394565b606091505b509150915061103c8282866123aa565b3b151590565b606083156123b95750816121ed565b8251156123c95782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561242d578181015183820152602001612415565b50505050905090810190601f16801561245a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6040518060a0016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160608152602001600081525090565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001606081525090565b803561055b81613356565b600082601f830112612506578081fd5b81356125196125148261330c565b6132e8565b818152915060208083019084810160005b848110156125c857813587016040807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0838c0301121561256957600080fd5b805181810167ffffffffffffffff828210818311171561258557fe5b8184528488013583529284013592808411156125a057600080fd5b50506125b08b87848601016125d3565b8187015286525050928201929082019060010161252a565b505050505092915050565b600082601f8301126125e3578081fd5b6125f0612514833561330c565b823581529050602080820190830160005b84358110156127cc578135850160607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082890301121561264057600080fd5b60405180606082011067ffffffffffffffff6060830111171561265f57fe5b606081016040526126736020830135613356565b602082013581526040820135602082015267ffffffffffffffff6060830135111561269d57600080fd5b60608201358201915087603f8301126126b557600080fd5b6126c5612514602084013561330c565b60208381013582528101906040840160005b60208601358110156127ae578135860160807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0828f0301121561271957600080fd5b60405180608082011067ffffffffffffffff6080830111171561273857fe5b6080810160405261274c6040830135613356565b60408201358152606082013560208201526080820135604082015267ffffffffffffffff60a0830135111561278057600080fd5b6127938e604060a08501358501016127d5565b606082015285525060209384019391909101906001016126d7565b50506040830152508452506020928301929190910190600101612601565b50505092915050565b600082601f8301126127e5578081fd5b81356127f36125148261330c565b818152915060208083019084810160005b848110156125c8578135870160a0807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0838c0301121561284357600080fd5b6040805182810167ffffffffffffffff828210818311171561286157fe5b8184528886013583526128758487016124eb565b8984015260609150818601358484015260809350838601358181111561289a57600080fd5b6128a88f8b838a01016128fc565b92840192909252505092909101359082015284529282019290820190600101612804565b80357fffffffffffffffffffffffffffffffff000000000000000000000000000000008116811461055b57600080fd5b600082601f83011261290c578081fd5b813567ffffffffffffffff81111561292057fe5b61295160207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016132e8565b915080825283602082850101111561296857600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215612992578081fd5b8151801515811461113b578182fd5b600080602083850312156129b3578081fd5b823567ffffffffffffffff808211156129ca578283fd5b818501915085601f8301126129dd578283fd5b8135818111156129eb578384fd5b8660208285010111156129fc578384fd5b60209290920196919550909350505050565b600060208284031215612a1f578081fd5b813567ffffffffffffffff80821115612a36578283fd5b81840191506101a0808387031215612a4c578384fd5b612a55816132e8565b9050612a60836124eb565b8152612a6e602084016124eb565b6020820152612a7f604084016124eb565b6040820152606083013560608201526080830135608082015260a083013560a0820152612aae60c084016124eb565b60c082015260e083013582811115612ac4578485fd5b612ad0878286016127d5565b60e083015250610100612ae48185016124eb565b9082015261012083810135908201526101408084013583811115612b06578586fd5b612b12888287016128fc565b828401525050610160915081830135828201526101809150612b358284016128cc565b91810191909152949350505050565b600060208284031215612b55578081fd5b813567ffffffffffffffff80821115612b6c578283fd5b8184019150610160808387031215612b82578384fd5b612b8b816132e8565b9050612b96836124eb565b8152602083013560208201526040830135604082015260608301356060820152612bc2608084016124eb565b608082015260a083013582811115612bd8578485fd5b612be4878286016124f6565b60a083015250612bf660c084016124eb565b60c082015260e083013560e08201526101008084013583811115612c18578586fd5b612c24888287016128fc565b828401525050610120915081830135828201526101409150612b358284016128cc565b600060208284031215612c58578081fd5b813567ffffffffffffffff80821115612c6f578283fd5b8184019150610160808387031215612c85578384fd5b612c8e816132e8565b9050612c99836124eb565b8152602083013560208201526040830135604082015260608301356060820152612cc5608084016124eb565b608082015260a083013582811115612cdb578485fd5b612be4878286016125d3565b600060208284031215612cf8578081fd5b5051919050565b60008151808452612d1781602086016020860161332a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60007fffffffff00000000000000000000000000000000000000000000000000000000841682528251612d8381600485016020870161332a565b919091016004019392505050565b60008251612da381846020870161332a565b9190910192915050565b7f4d554c5449504154485f524f555445520000000000000000000000000000000081527f312e302e30000000000000000000000000000000000000000000000000000000601082015260150190565b90565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff9485168152928416602084015292166040820152606081019190915260800190565b600060a080830173ffffffffffffffffffffffffffffffffffffffff808a1685526020818a16818701526040898188015260608981890152608086818a0152858a5180885260c08b01915060c08682028c01019750858c018a5b82811015612f2a577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff408d8b03018452815180518b52898982015116898c015287810151888c0152868101518c888d0152612f0d8d8d0182612cff565b918701519b87019b909b5299509287019290870190600101612eb1565b50505050505050505080925050509695505050505050565b7fffffffffffffffffffffffffffffffff0000000000000000000000000000000097909716875273ffffffffffffffffffffffffffffffffffffffff95861660208801526040870194909452919093166060850152608084019290925260a083019190915260c082015260e00190565b90815260200190565b91825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b60208082526018908201527f4661696c656420746f207472616e736665722045746865720000000000000000604082015260600190565b60208082526037908201527f526563656976656420616d6f756e74206f6620746f6b656e7320617265206c6560408201527f7373207468656e20657870656374656420746f6b656e73000000000000000000606082015260800190565b6020808252600d908201527f5065726d6974206661696c656400000000000000000000000000000000000000604082015260600190565b6020808252601a908201527f50617468206e6f742070726f766964656420666f722073776170000000000000604082015260600190565b60208082526018908201527f45786368616e6765206e6f742077686974656c69737465640000000000000000604082015260600190565b60208082526016908201527f4d4554484f44204e4f5420494d504c454d454e54454400000000000000000000604082015260600190565b60208082526016908201527f43616c6c20746f2061646170746572206661696c656400000000000000000000604082015260600190565b60208082526013908201527f496e636f7272656374206d73672e76616c756500000000000000000000000000604082015260600190565b60208082526030908201527f526563656976656420616d6f756e74206f6620746f6b656e7320617265206c6560408201527f7373207468656e20657870656374656400000000000000000000000000000000606082015260800190565b60208082526011908201527f446561646c696e65206272656163686564000000000000000000000000000000604082015260600190565b60208082526016908201527f546f20616d6f756e742063616e206e6f74206265203000000000000000000000604082015260600190565b600088825273ffffffffffffffffffffffffffffffffffffffff8089166020840152808816604084015286606084015285608084015280851660a08401525060e060c08301526132db60e0830184612cff565b9998505050505050505050565b60405181810167ffffffffffffffff8111828210171561330457fe5b604052919050565b600067ffffffffffffffff82111561332057fe5b5060209081020190565b60005b8381101561334557818101518382015260200161332d565b838111156119c15750506000910152565b73ffffffffffffffffffffffffffffffffffffffff8116811461337857600080fd5b5056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77496e73756666696369656e742062616c616e636520746f2070617920666f7220666565735361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a164736f6c6343000705000a

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000000000000000000000000000000000000000213400000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000000000000000000000000000000000000000138800000000000000000000000000000000000000000000000000000000000027100000000000000000000000004f14fe8c86a00d6dfb9e91239738499fc0f587de

-----Decoded View---------------
Arg [0] : _partnerSharePercent (uint256): 8500
Arg [1] : _maxFeePercent (uint256): 500
Arg [2] : _paraswapReferralShare (uint256): 5000
Arg [3] : _paraswapSlippageShare (uint256): 10000
Arg [4] : _feeClaimer (address): 0x4F14fE8c86A00D6DFB9e91239738499Fc0F587De

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000002134
Arg [1] : 00000000000000000000000000000000000000000000000000000000000001f4
Arg [2] : 0000000000000000000000000000000000000000000000000000000000001388
Arg [3] : 0000000000000000000000000000000000000000000000000000000000002710
Arg [4] : 0000000000000000000000004f14fe8c86a00d6dfb9e91239738499fc0f587de


Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.