Contract 0x400d75dAb26bBc18D163AEA3e83D9Ea68F6c1804 8

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x4285a8dc8e1158877c01dc2edfa7fea5d90bcc4a3c94879b2305d95d0bae795dProcess Route297305912023-05-07 23:37:2722 days 8 hrs ago0xd705a44f2bcbeba5d296cd9d6b18024ebf95c71e IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.003979314268 27.152361018
0x148a9754a0fefaed0ff0ba57616f56f6217c7f5290f3fe5031ccddba434c024bProcess Route297061182023-05-07 9:47:2322 days 21 hrs ago0xcb7e59cc093690f5b4b10fc8dfe3c693480c24bf IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.003883824716 26.500799814
0x46128a9f2292457733904ff3227b62eb507a7094f09891a4cdf6d80ea9ab53b2Process Route297023992023-05-07 7:41:2222 days 23 hrs ago0xb5fb33df9af5f31b8451253f7f7d7fbffeb2984e IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.0038837075 26.5
0xfd6127567df325301f1a9552657b91da9357f188c1a92f84f1a7b53436c509afProcess Route296349692023-05-05 17:24:1124 days 14 hrs ago0x53b9ef7b48e086810b50b47f3de0a3d87777fec5 IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.0038837075 26.5
0x66471165e27fe7e877458bc571a76cb76e0ef17391a65f16ee27cef8bb3b8a58Process Route295966652023-05-04 19:43:3225 days 11 hrs ago0x012217647bb0ce428929968a5d096c6de111c85d IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040.6 AVAX0.005337789 26.5
0xe1dc2cf2b3b1ff356877cc8d66e21d88577b1a91bc037f52996e4b68ed077561Process Route295349252023-05-03 8:57:0126 days 22 hrs ago0x4a5532a7552125ebe099760deb679cde6747fe74 IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.0061494045 26.5
0x5d3f21f201b3410d85844283d0840751ce64f19379e2ab0149e140cef744eb59Process Route294946872023-05-02 10:07:0827 days 21 hrs ago0x22090f819892ce289b17ffba379b575a5c823a67 IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.0038837075 26.5
0x93149485fcb32e40aaff73f8fda80ecb6f2ca69fdab3457ec50a8aad39d88c5dProcess Route294938872023-05-02 9:40:0327 days 22 hrs ago0x4acf688ee0a1e6e1220e5594ad29a6a3331dff4d IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.0051684805 26.5
0x63b19f879a38300cffcd7e5a2fd119fbf3fc83635b5f49168a427a170ef4f711Process Route294751222023-05-01 23:02:4528 days 8 hrs ago0x4f66b029515c781b0046e84714a85d1968442593 IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.0038833895 26.5
0x2a92729d7905da52fd08c87742118b6bfa68269adc3777a90ff83b883e3f2aadProcess Route294713642023-05-01 20:54:4328 days 10 hrs ago0x31b1554c9c79fabcbc259a3ec426e0e30f611965 IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.005176534525 26.546194768
0x0cc7e770a92f0dbc0b7c871c86bd553864c88c839e39839bc909bbfc48aeb45aProcess Route294711792023-05-01 20:48:1928 days 10 hrs ago0xe75142d9e5f8fbf73093dfb2594b4a1be057c757 IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.0051675265 26.5
0xfe368ae41b8392c54158d2455732c751e74ed97895ceb6964956450a8eb3fec4Process Route294704422023-05-01 20:22:2928 days 11 hrs ago0xe59150cc54b28d55b9b1df175a3bdff10a29d1ba IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.003965153753 28.929002689
0x1bea02d0966ee37beb262b2337ba0f3698236b6ceea6927e745ab779fe007d69Process Route294685392023-05-01 19:16:3428 days 12 hrs ago0xe59150cc54b28d55b9b1df175a3bdff10a29d1ba IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.00537692441 39.229011128
0xe26373d7316afc946458c8cd815a2c3a9e521b0333a96beef4908ad530ade95aProcess Route294617822023-05-01 15:20:3528 days 16 hrs ago0xe59150cc54b28d55b9b1df175a3bdff10a29d1ba IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.003664932364 26.738644907
0x816c98af0461744ba4b39563b524e1522a4061866aea7ea4887d74d5321551dfProcess Route294597612023-05-01 14:11:1928 days 17 hrs ago0xe59150cc54b28d55b9b1df175a3bdff10a29d1ba IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.003963691786 28.460894003
0x74341c6c81fd636878101c01fa1264fb186921605e967b9d95ae8364c44de6ebProcess Route294588702023-05-01 13:41:0828 days 17 hrs ago0x2e2252e971c6fe707aec46b91136039e9e6ab385 IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040.09 AVAX0.004304536023 28.865481237
0x3a71396e724bd7dca6c3be0575dc10b1fdf46c8cf559ac5ab2e040273cb03dc3Process Route294556052023-05-01 11:50:3428 days 19 hrs ago0x582f78dc8de833e807b271c30a087b3399c9d4fd IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040.078 AVAX0.004830235099 32.390729186
0x6601252bd0d396c9f55927ab9d191d85c0fc5ba641cd199a563a84471d832da8Process Route294552452023-05-01 11:38:2828 days 20 hrs ago0xda454e581f3b8ba452a42ccad8f194d966edfed3 IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.0038837075 26.5
0xf680da379b262513bd1ce0cfbb6113b386f8a2b27ccd9ce5ce128c94b9a37d67Process Route294544712023-05-01 11:11:4928 days 20 hrs ago0xe59150cc54b28d55b9b1df175a3bdff10a29d1ba IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.003929817505 28.217663109
0xe4a45613144ef08a2faa5c5b2ba0b516f72e53c1b29ff0ffee29f18f09b594d6Process Route294544242023-05-01 11:10:1128 days 20 hrs ago0xbb32a76ba4e85661fa22fbe06b3ee810f246b91c IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.005606337039 28.744992179
0x792765e85dc6a49bafc1d16959be5935215549c3a37490ea71464e7f8c2842feProcess Route294537742023-05-01 10:46:5528 days 20 hrs ago0xf7bba5d8c5595aaa4eb6ccea8e3509f4eefb31be IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040.015 AVAX0.003987150177 26.737146116
0xc3b0e7f8bf0fdc0c0ccf1c41bbf37593fe38c2ac86b63a9e744e204b80e9423eProcess Route294536442023-05-01 10:42:3128 days 20 hrs ago0x2d3c86a8ddec8c2e19662453395320b95dddc2b6 IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.0038833895 26.5
0x2fb309113e0aaa400c8e034e587a4a3430c570dc06d45694136174447be62f86Process Route294535662023-05-01 10:39:5328 days 21 hrs ago0x4327fbd84b31ecbefd1f4a16c5a48a254eb2a3f6 IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.0038833895 26.5
0x49820d14188100d6aa49c46e3540efeca7b89de8fdf3ee4708e1abf081ed82a1Process Route294534762023-05-01 10:36:4928 days 21 hrs ago0xd6f94e29185b8084e06d15b54d3a4ff9c4f3b19c IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18040 AVAX0.0069018427.5
0x41e32df7f429de0721bc20baa4ef9ff91553c9932afa2a5bf15d87bd0819d3b2Process Route294532882023-05-01 10:30:3328 days 21 hrs ago0xbb32a76ba4e85661fa22fbe06b3ee810f246b91c IN  0x400d75dab26bbc18d163aea3e83d9ea68f6c18047 AVAX0.005573564255 27.668882018
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x4285a8dc8e1158877c01dc2edfa7fea5d90bcc4a3c94879b2305d95d0bae795d297305912023-05-07 23:37:2722 days 8 hrs ago 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040xd705a44f2bcbeba5d296cd9d6b18024ebf95c71e0.299899331160887665 AVAX
0x4285a8dc8e1158877c01dc2edfa7fea5d90bcc4a3c94879b2305d95d0bae795d297305912023-05-07 23:37:2722 days 8 hrs ago Wrapped AVAX 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040.299899331160887665 AVAX
0x148a9754a0fefaed0ff0ba57616f56f6217c7f5290f3fe5031ccddba434c024b297061182023-05-07 9:47:2322 days 21 hrs ago 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040xcb7e59cc093690f5b4b10fc8dfe3c693480c24bf0.299497671210490018 AVAX
0x148a9754a0fefaed0ff0ba57616f56f6217c7f5290f3fe5031ccddba434c024b297061182023-05-07 9:47:2322 days 21 hrs ago Wrapped AVAX 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040.299497671210490018 AVAX
0x46128a9f2292457733904ff3227b62eb507a7094f09891a4cdf6d80ea9ab53b2297023992023-05-07 7:41:2222 days 23 hrs ago 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040xb5fb33df9af5f31b8451253f7f7d7fbffeb2984e0.358753446767239358 AVAX
0x46128a9f2292457733904ff3227b62eb507a7094f09891a4cdf6d80ea9ab53b2297023992023-05-07 7:41:2222 days 23 hrs ago Wrapped AVAX 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040.358753446767239358 AVAX
0xfd6127567df325301f1a9552657b91da9357f188c1a92f84f1a7b53436c509af296349692023-05-05 17:24:1124 days 14 hrs ago 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040x53b9ef7b48e086810b50b47f3de0a3d87777fec50.116142415851279715 AVAX
0xfd6127567df325301f1a9552657b91da9357f188c1a92f84f1a7b53436c509af296349692023-05-05 17:24:1124 days 14 hrs ago Wrapped AVAX 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040.116142415851279715 AVAX
0x66471165e27fe7e877458bc571a76cb76e0ef17391a65f16ee27cef8bb3b8a58295966652023-05-04 19:43:3225 days 11 hrs ago 0x400d75dab26bbc18d163aea3e83d9ea68f6c1804 Wrapped AVAX0.6 AVAX
0xe1dc2cf2b3b1ff356877cc8d66e21d88577b1a91bc037f52996e4b68ed077561295349252023-05-03 8:57:0126 days 22 hrs ago 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040x4a5532a7552125ebe099760deb679cde6747fe740.298141127020511568 AVAX
0xe1dc2cf2b3b1ff356877cc8d66e21d88577b1a91bc037f52996e4b68ed077561295349252023-05-03 8:57:0126 days 22 hrs ago Wrapped AVAX 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040.298141127020511568 AVAX
0x5d3f21f201b3410d85844283d0840751ce64f19379e2ab0149e140cef744eb59294946872023-05-02 10:07:0827 days 21 hrs ago 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040x22090f819892ce289b17ffba379b575a5c823a670.120094732465706524 AVAX
0x5d3f21f201b3410d85844283d0840751ce64f19379e2ab0149e140cef744eb59294946872023-05-02 10:07:0827 days 21 hrs ago Wrapped AVAX 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040.120094732465706524 AVAX
0x93149485fcb32e40aaff73f8fda80ecb6f2ca69fdab3457ec50a8aad39d88c5d294938872023-05-02 9:40:0327 days 22 hrs ago 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040x4acf688ee0a1e6e1220e5594ad29a6a3331dff4d5.806501123561710054 AVAX
0x93149485fcb32e40aaff73f8fda80ecb6f2ca69fdab3457ec50a8aad39d88c5d294938872023-05-02 9:40:0327 days 22 hrs ago Wrapped AVAX 0x400d75dab26bbc18d163aea3e83d9ea68f6c18045.806501123561710054 AVAX
0x63b19f879a38300cffcd7e5a2fd119fbf3fc83635b5f49168a427a170ef4f711294751222023-05-01 23:02:4528 days 8 hrs ago 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040x4f66b029515c781b0046e84714a85d19684425930.119721550044381868 AVAX
0x63b19f879a38300cffcd7e5a2fd119fbf3fc83635b5f49168a427a170ef4f711294751222023-05-01 23:02:4528 days 8 hrs ago Wrapped AVAX 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040.119721550044381868 AVAX
0x2a92729d7905da52fd08c87742118b6bfa68269adc3777a90ff83b883e3f2aad294713642023-05-01 20:54:4328 days 10 hrs ago 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040x31b1554c9c79fabcbc259a3ec426e0e30f6119650.896180164885788292 AVAX
0x2a92729d7905da52fd08c87742118b6bfa68269adc3777a90ff83b883e3f2aad294713642023-05-01 20:54:4328 days 10 hrs ago Wrapped AVAX 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040.896180164885788292 AVAX
0x0cc7e770a92f0dbc0b7c871c86bd553864c88c839e39839bc909bbfc48aeb45a294711792023-05-01 20:48:1928 days 10 hrs ago 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040xe75142d9e5f8fbf73093dfb2594b4a1be057c7570.646822858056904454 AVAX
0x0cc7e770a92f0dbc0b7c871c86bd553864c88c839e39839bc909bbfc48aeb45a294711792023-05-01 20:48:1928 days 10 hrs ago Wrapped AVAX 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040.646822858056904454 AVAX
0x74341c6c81fd636878101c01fa1264fb186921605e967b9d95ae8364c44de6eb294588702023-05-01 13:41:0828 days 17 hrs ago 0x400d75dab26bbc18d163aea3e83d9ea68f6c1804 Wrapped AVAX0.09 AVAX
0x3a71396e724bd7dca6c3be0575dc10b1fdf46c8cf559ac5ab2e040273cb03dc3294556052023-05-01 11:50:3428 days 19 hrs ago 0x400d75dab26bbc18d163aea3e83d9ea68f6c1804 Wrapped AVAX0.078 AVAX
0x6601252bd0d396c9f55927ab9d191d85c0fc5ba641cd199a563a84471d832da8294552452023-05-01 11:38:2828 days 20 hrs ago 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040xda454e581f3b8ba452a42ccad8f194d966edfed30.175404522841456631 AVAX
0x6601252bd0d396c9f55927ab9d191d85c0fc5ba641cd199a563a84471d832da8294552452023-05-01 11:38:2828 days 20 hrs ago Wrapped AVAX 0x400d75dab26bbc18d163aea3e83d9ea68f6c18040.175404522841456631 AVAX
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RouteProcessor

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 10000000 runs

Other Settings:
default evmVersion
File 1 of 10 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 2 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 3 of 10 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

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

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

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

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

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

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

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

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

File 4 of 10 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 5 of 10 : InputStream.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity 0.8.10;

library InputStream {
  function createStream(bytes memory data) internal pure returns (uint256 stream) {
    assembly {
      stream := mload(0x40)
      mstore(0x40, add(stream, 64))
      mstore(stream, data)
      let length := mload(data)
      mstore(add(stream, 32), add(data, length))
    }
  }

  function isNotEmpty(uint256 stream) internal pure returns (bool) {
    uint256 pos;
    uint256 finish;
    assembly {
      pos := mload(stream)
      finish := mload(add(stream, 32))
    }
    return pos < finish;
  }

  function readUint8(uint256 stream) internal pure returns (uint8 res) {
    assembly {
      let pos := mload(stream)
      pos := add(pos, 1)
      res := mload(pos)
      mstore(stream, pos)
    }
  }

  function readUint16(uint256 stream) internal pure returns (uint16 res) {
    assembly {
      let pos := mload(stream)
      pos := add(pos, 2)
      res := mload(pos)
      mstore(stream, pos)
    }
  }

  function readUint32(uint256 stream) internal pure returns (uint32 res) {
    assembly {
      let pos := mload(stream)
      pos := add(pos, 4)
      res := mload(pos)
      mstore(stream, pos)
    }
  }

  function readUint(uint256 stream) internal pure returns (uint256 res) {
    assembly {
      let pos := mload(stream)
      pos := add(pos, 32)
      res := mload(pos)
      mstore(stream, pos)
    }
  }

  function readAddress(uint256 stream) internal pure returns (address res) {
    assembly {
      let pos := mload(stream)
      pos := add(pos, 20)
      res := mload(pos)
      mstore(stream, pos)
    }
  }

  function readBytes(uint256 stream) internal pure returns (bytes memory res) {
    assembly {
      let pos := mload(stream)
      res := add(pos, 32)
      let length := mload(res)
      mstore(stream, add(res, length))
    }
  }
}

File 6 of 10 : RouteProcessor.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity 0.8.10;

import '../interfaces/IUniswapV2Pair.sol';
import '../interfaces/IBentoBoxMinimal.sol';
import '../interfaces/IPool.sol';
import '../interfaces/IWETH.sol';
import './InputStream.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';

address constant NATIVE_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

/// @title A route processor for the Sushi Aggregator
/// @author Okavango
contract RouteProcessor {
  using SafeERC20 for IERC20;
  using InputStream for uint256;

  IBentoBoxMinimal public immutable bentoBox;

  uint private unlocked = 1;
  modifier lock() {
      require(unlocked == 1, 'RouteProcessor is locked');
      unlocked = 2;
      _;
      unlocked = 1;
  }

  constructor(address _bentoBox) {
    bentoBox = IBentoBoxMinimal(_bentoBox);
  }

  /// @notice For native unwrapping
  receive() external payable {}

  /// @notice Processes the route generated off-chain. Has a lock
  /// @param tokenIn Address of the input token
  /// @param amountIn Amount of the input token
  /// @param tokenOut Address of the output token
  /// @param amountOutMin Minimum amount of the output token
  /// @return amountOut Actual amount of the output token
  function processRoute(
    address tokenIn,
    uint256 amountIn,
    address tokenOut,
    uint256 amountOutMin,
    address to,
    bytes memory route
  ) external payable lock returns (uint256 amountOut) {
    return processRouteInternal(tokenIn, amountIn, tokenOut, amountOutMin, to, route);
  }

  /// @notice Transfers some value to <transferValueTo> and then processes the route
  /// @param transferValueTo Address where the value should be transferred
  /// @param amountValueTransfer How much value to transfer
  /// @param tokenIn Address of the input token
  /// @param amountIn Amount of the input token
  /// @param tokenOut Address of the output token
  /// @param amountOutMin Minimum amount of the output token
  /// @return amountOut Actual amount of the output token
  function transferValueAndprocessRoute(
    address payable transferValueTo,
    uint256 amountValueTransfer,
    address tokenIn,
    uint256 amountIn,
    address tokenOut,
    uint256 amountOutMin,
    address to,
    bytes memory route
  ) external payable lock returns (uint256 amountOut) {
    (bool success, bytes memory returnBytes) = transferValueTo.call{value: amountValueTransfer}('');
    require(success, string(abi.encodePacked(returnBytes)));
    return processRouteInternal(tokenIn, amountIn, tokenOut, amountOutMin, to, route);
  }

  /// @notice Processes the route generated off-chain
  /// @param tokenIn Address of the input token
  /// @param amountIn Amount of the input token
  /// @param tokenOut Address of the output token
  /// @param amountOutMin Minimum amount of the output token
  /// @return amountOut Actual amount of the output token
  function processRouteInternal(
    address tokenIn,
    uint256 amountIn,
    address tokenOut,
    uint256 amountOutMin,
    address to,
    bytes memory route
  ) private returns (uint256 amountOut) {
    uint256 amountInAcc = 0;
    uint256 balanceInitial = tokenOut == NATIVE_ADDRESS ? 
      address(to).balance : IERC20(tokenOut).balanceOf(to);

    uint256 stream = InputStream.createStream(route);
    while (stream.isNotEmpty()) {
      uint8 commandCode = stream.readUint8();
      if (commandCode < 20) {
        if (commandCode == 10)
          swapUniswapPool(stream); // Sushi/Uniswap pool swap
        else if (commandCode == 4)
          distributeERC20Shares(stream); // distribute ERC20 tokens from this router to pools
        else if (commandCode == 3)
          amountInAcc += distributeERC20Amounts(stream, tokenIn); // initial distribution
        else if (commandCode == 5)
          amountInAcc += wrapAndDistributeERC20Amounts(stream); // wrap natives and initial distribution        
        else if (commandCode == 6) 
          unwrapNative(to, stream);
        else if (commandCode == 7)
          amountInAcc += distributeERC20AmountsFromRP(stream, tokenIn); // initial distribution
        else revert('Unknown command code');
      } else if (commandCode < 24) {
        if (commandCode == 20) bentoDepositAmountFromBento(stream, tokenIn);
        else if (commandCode == 21) swapTrident(stream);
        else if (commandCode == 23) bentoWithdrawShareFromRP(stream, tokenIn);
        else revert('Unknown command code');
      } else {
        if (commandCode == 24) amountInAcc += distributeBentoShares(stream, tokenIn);
        else if (commandCode == 25) distributeBentoPortions(stream);
        else if (commandCode == 26) bentoDepositAllFromBento(stream);
        else if (commandCode == 27) bentoWithdrawAllFromRP(stream);
        else revert('Unknown command code');
      }
    }

    require(amountInAcc == amountIn, 'Wrong amountIn value');
    uint256 balanceFinal = tokenOut == NATIVE_ADDRESS ? 
      address(to).balance : IERC20(tokenOut).balanceOf(to);
    require(balanceFinal >= balanceInitial + amountOutMin, 'Minimal ouput balance violation');

    amountOut = balanceFinal - balanceInitial;
  }

  /// @notice Transfers input tokens sent to BentoBox to a pool
  /// @notice Expected to be called for initial liquidity transfer from user to BentoBox, so we know exact amounts
  /// @param stream [Pool, Amount]. Pool into which an amount of tokens will be transferred
  /// @param token Address of the token to transfer
  function bentoDepositAmountFromBento(uint256 stream, address token) private {
    address to = stream.readAddress();
    uint256 amount = stream.readUint();
    bentoBox.deposit(token, address(bentoBox), to, amount, 0);
  }

  /// @notice Transfers all available input tokens from BentoBox to a pool
  /// @param stream [Pool, Token]. Pool into which all tokens will be transferred 
  function bentoDepositAllFromBento(uint256 stream) private {
    address to = stream.readAddress();
    address token = stream.readAddress();

    uint256 amount = IERC20(token).balanceOf(address(bentoBox)) +
      bentoBox.strategyData(token).balance -
      bentoBox.totals(token).elastic;
    bentoBox.deposit(token, address(bentoBox), to, amount, 0);
  }

  /// @notice Withdraws BentoBox tokens from BentoBox to an address
  /// @param stream [To, Amount]. Destination where an amount of token will be transferred
  /// @param token Token to transfer
  function bentoWithdrawShareFromRP(uint256 stream, address token) private {
    address to = stream.readAddress();
    uint256 amount = stream.readUint();
    bentoBox.withdraw(token, address(this), to, amount, 0);
  }

  /// @notice Withdraws all available BentoBox tokens from BentoBox to an address
  /// @param stream [Token, To]. Token which will be transferred to a destination
  function bentoWithdrawAllFromRP(uint256 stream) private {
    address token = stream.readAddress();
    address to = stream.readAddress();
    uint256 amount = bentoBox.balanceOf(token, address(this));
    bentoBox.withdraw(token, address(this), to, 0, amount);
  }

  /// @notice Performs a Trident pool swap
  /// @param stream [Pool, SwapData]. Pool against a swap defined by SwapData will be executed
  function swapTrident(uint256 stream) private {
    address pool = stream.readAddress();
    bytes memory swapData = stream.readBytes();
    IPool(pool).swap(swapData);
  }

  /// @notice Performs a Sushi/UniswapV2 pool swap
  /// @param stream [Pool, TokenIn, Direction, To]
  /// @return amountOut Amount of the output token
  function swapUniswapPool(uint256 stream) private returns (uint256 amountOut) {
    address pool = stream.readAddress();
    address tokenIn = stream.readAddress();
    uint8 direction = stream.readUint8();
    address to = stream.readAddress();

    (uint256 r0, uint256 r1, ) = IUniswapV2Pair(pool).getReserves();
    require(r0 > 0 && r1 > 0, 'Wrong pool reserves');
    (uint256 reserveIn, uint256 reserveOut) = direction == 1 ? (r0, r1) : (r1, r0);

    uint256 amountIn = IERC20(tokenIn).balanceOf(pool) - reserveIn;
    uint256 amountInWithFee = amountIn * 997;
    amountOut = (amountInWithFee * reserveOut) / (reserveIn * 1000 + amountInWithFee);
    (uint256 amount0Out, uint256 amount1Out) = direction == 1 ? (uint256(0), amountOut) : (amountOut, uint256(0));
    IUniswapV2Pair(pool).swap(amount0Out, amount1Out, to, new bytes(0));
  }

  /// @notice Distributes input ERC20 tokens from msg.sender to addresses. Tokens should be approved
  /// @notice Expected to be called for initial liquidity transfer from the user to pools, so we know exact amounts
  /// @param stream [ArrayLength, ...[To, Amount][]]. An array of destinations and token amounts
  /// @param token Token to distribute
  /// @return amountTotal Total amount distributed
  function distributeERC20Amounts(uint256 stream, address token) private returns (uint256 amountTotal) {
    uint8 num = stream.readUint8();
    amountTotal = 0;
    for (uint256 i = 0; i < num; ++i) {
      address to = stream.readAddress();
      uint256 amount = stream.readUint();
      amountTotal += amount;
      IERC20(token).safeTransferFrom(msg.sender, to, amount);
    }
  }

  /// @notice Distributes input ERC20 tokens from this contract to addresses. Tokens should be approved
  /// @notice Expected to be called for initial liquidity transfer from the user to pools, so we know exact amounts
  /// @param stream [ArrayLength, ...[To, Amount][]]. An array of destinations and token amounts
  /// @param token Token to distribute
  /// @return amountTotal Total amount distributed
  function distributeERC20AmountsFromRP(uint256 stream, address token) private returns (uint256 amountTotal) {
    uint8 num = stream.readUint8();
    amountTotal = 0;
    for (uint256 i = 0; i < num; ++i) {
      address to = stream.readAddress();
      uint256 amount = stream.readUint();
      amountTotal += amount;
      IERC20(token).safeTransfer(to, amount);
    }
  }

  /// @notice Wraps all native inputs and distributes wrapped ERC20 tokens from RouteProcessor to addresses
  /// @notice Expected to be called for initial liquidity transfer from the user to pools, so we know exact amounts
  /// @param stream [WrapToken, ArrayLength, ...[To, Amount][]]. An array of destinations and token amounts
  /// @return amountTotal Total amount distributed
  function wrapAndDistributeERC20Amounts(uint256 stream) private returns (uint256 amountTotal) {
    address token = stream.readAddress();
    IWETH(token).deposit{value: address(this).balance}();
    uint8 num = stream.readUint8();
    amountTotal = 0;
    for (uint256 i = 0; i < num; ++i) {
      address to = stream.readAddress();
      uint256 amount = stream.readUint();
      amountTotal += amount;
      IERC20(token).safeTransfer(to, amount);
    }
    require(address(this).balance == 0, "RouteProcessor: invalid input amount");
  }

  /// @notice Distributes input BentoBox tokens from msg.sender to addresses. Tokens should be approved
  /// @notice Expected to be called for initial liquidity transfer from the user to pools, so we know exact amounts
  /// @param stream [ArrayLength, ...[To, ShareAmount][]]. An array of destinations and token share amounts
  /// @param token Token to distribute
  /// @return sharesTotal Total shares distributed
  function distributeBentoShares(uint256 stream, address token) private returns (uint256 sharesTotal) {
    uint8 num = stream.readUint8();
    sharesTotal = 0;
    for (uint256 i = 0; i < num; ++i) {
      address to = stream.readAddress();
      uint256 share = stream.readUint();
      sharesTotal += share;
      bentoBox.transfer(token, msg.sender, to, share);
    }
  }

  /// @notice Distributes ERC20 tokens from RouteProcessor to addresses
  /// @notice Quantity for sending is determined by share in 1/65535
  /// @notice During routing we can't predict in advance the actual value of internal swaps because of slippage,
  /// @notice so we have to work with shares - not fixed amounts
  /// @param stream [Token, ArrayLength, ...[To, ShareAmount][]]. Token to distribute. An array of destinations and token share amounts
  function distributeERC20Shares(uint256 stream) private {
    address token = stream.readAddress();
    uint8 num = stream.readUint8();
    uint256 amountTotal = IERC20(token).balanceOf(address(this))
      - 1;     // slot undrain protection

    unchecked {
      for (uint256 i = 0; i < num; ++i) {
        address to = stream.readAddress();
        uint16 share = stream.readUint16();
        uint256 amount = (amountTotal * share) / 65535;
        amountTotal -= amount;
        IERC20(token).safeTransfer(to, amount);
      }
    }
  }

  /// @notice Distributes BentoBox tokens from RouteProcessor to addresses
  /// @notice Quantity for sending is determined by portions in 1/65535.
  /// @notice During routing we can't predict in advance the actual value of internal swaps because of slippage,
  /// @notice so we have to work with portions - not fixed amounts
  /// @param stream [Token, ArrayLength, ...[To, ShareAmount][]]. Token to distribute. An array of destinations and token share amounts
  function distributeBentoPortions(uint256 stream) private {
    address token = stream.readAddress();
    uint8 num = stream.readUint8();
    uint256 amountTotal = bentoBox.balanceOf(token, address(this))
      - 1;     // slot undrain protection

    unchecked {
      for (uint256 i = 0; i < num; ++i) {
        address to = stream.readAddress();
        uint16 share = stream.readUint16();
        uint256 amount = (amountTotal * share) / 65535;
        amountTotal -= amount;
        bentoBox.transfer(token, address(this), to, amount);
      }
    }
  }

  /// @notice Unwraps the Native Token
  /// @param receiver Destination of the unwrapped token
  /// @param stream [Token]. Token to unwrap native
  function unwrapNative(address receiver, uint256 stream) private {
    address token = stream.readAddress();
    IWETH(token).withdraw( IERC20(token).balanceOf(address(this))
      - 1);     // slot undrain protection
    payable(receiver).transfer(address(this).balance);
  }
}

File 7 of 10 : IBentoBoxMinimal.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity >=0.8.0;

struct Rebase {
    uint128 elastic;
    uint128 base;
}

struct StrategyData {
    uint64 strategyStartDate;
    uint64 targetPercentage;
    uint128 balance; // the balance of the strategy that BentoBox thinks is in there
}

/// @notice A rebasing library
library RebaseLibrary {
    /// @notice Calculates the base value in relationship to `elastic` and `total`.
    function toBase(Rebase memory total, uint256 elastic) internal pure returns (uint256 base) {
        if (total.elastic == 0) {
            base = elastic;
        } else {
            base = (elastic * total.base) / total.elastic;
        }
    }

    /// @notice Calculates the elastic value in relationship to `base` and `total`.
    function toElastic(Rebase memory total, uint256 base) internal pure returns (uint256 elastic) {
        if (total.base == 0) {
            elastic = base;
        } else {
            elastic = (base * total.elastic) / total.base;
        }
    }
}

/// @notice Minimal BentoBox vault interface.
/// @dev `token` is aliased as `address` from `IERC20` for simplicity.
interface IBentoBoxMinimal {
    /// @notice Balance per ERC-20 token per account in shares.
    function balanceOf(address, address) external view returns (uint256);

    /// @dev Helper function to represent an `amount` of `token` in shares.
    /// @param token The ERC-20 token.
    /// @param amount The `token` amount.
    /// @param roundUp If the result `share` should be rounded up.
    /// @return share The token amount represented in shares.
    function toShare(
        address token,
        uint256 amount,
        bool roundUp
    ) external view returns (uint256 share);

    /// @dev Helper function to represent shares back into the `token` amount.
    /// @param token The ERC-20 token.
    /// @param share The amount of shares.
    /// @param roundUp If the result should be rounded up.
    /// @return amount The share amount back into native representation.
    function toAmount(
        address token,
        uint256 share,
        bool roundUp
    ) external view returns (uint256 amount);

    /// @notice Registers this contract so that users can approve it for BentoBox.
    function registerProtocol() external;

    /// @notice Deposit an amount of `token` represented in either `amount` or `share`.
    /// @param token The ERC-20 token to deposit.
    /// @param from which account to pull the tokens.
    /// @param to which account to push the tokens.
    /// @param amount Token amount in native representation to deposit.
    /// @param share Token amount represented in shares to deposit. Takes precedence over `amount`.
    /// @return amountOut The amount deposited.
    /// @return shareOut The deposited amount represented in shares.
    function deposit(
        address token,
        address from,
        address to,
        uint256 amount,
        uint256 share
    ) external payable returns (uint256 amountOut, uint256 shareOut);

    /// @notice Withdraws an amount of `token` from a user account.
    /// @param token_ The ERC-20 token to withdraw.
    /// @param from which user to pull the tokens.
    /// @param to which user to push the tokens.
    /// @param amount of tokens. Either one of `amount` or `share` needs to be supplied.
    /// @param share Like above, but `share` takes precedence over `amount`.
    function withdraw(
        address token_,
        address from,
        address to,
        uint256 amount,
        uint256 share
    ) external returns (uint256 amountOut, uint256 shareOut);

    /// @notice Transfer shares from a user account to another one.
    /// @param token The ERC-20 token to transfer.
    /// @param from which user to pull the tokens.
    /// @param to which user to push the tokens.
    /// @param share The amount of `token` in shares.
    function transfer(
        address token,
        address from,
        address to,
        uint256 share
    ) external;

    /// @dev Reads the Rebase `totals`from storage for a given token
    function totals(address token) external view returns (Rebase memory total);

    function strategyData(address token) external view returns (StrategyData memory total);

    /// @dev Approves users' BentoBox assets to a "master" contract.
    function setMasterContractApproval(
        address user,
        address masterContract,
        bool approved,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    function harvest(
        address token,
        bool balance,
        uint256 maxChangeAmount
    ) external;
}

File 8 of 10 : IPool.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity >=0.5.0;
pragma experimental ABIEncoderV2;

/// @notice Trident pool interface.
interface IPool {
    /// @notice Executes a swap from one token to another.
    /// @dev The input tokens must've already been sent to the pool.
    /// @param data ABI-encoded params that the pool requires.
    /// @return finalAmountOut The amount of output tokens that were sent to the user.
    function swap(bytes calldata data) external returns (uint256 finalAmountOut);

    /// @notice Executes a swap from one token to another with a callback.
    /// @dev This function allows borrowing the output tokens and sending the input tokens in the callback.
    /// @param data ABI-encoded params that the pool requires.
    /// @return finalAmountOut The amount of output tokens that were sent to the user.
    function flashSwap(bytes calldata data) external returns (uint256 finalAmountOut);

    /// @notice Mints liquidity tokens.
    /// @param data ABI-encoded params that the pool requires.
    /// @return liquidity The amount of liquidity tokens that were minted for the user.
    function mint(bytes calldata data) external returns (uint256 liquidity);

    /// @notice Burns liquidity tokens.
    /// @dev The input LP tokens must've already been sent to the pool.
    /// @param data ABI-encoded params that the pool requires.
    /// @return withdrawnAmounts The amount of various output tokens that were sent to the user.
    function burn(bytes calldata data) external returns (TokenAmount[] memory withdrawnAmounts);

    /// @notice Burns liquidity tokens for a single output token.
    /// @dev The input LP tokens must've already been sent to the pool.
    /// @param data ABI-encoded params that the pool requires.
    /// @return amountOut The amount of output tokens that were sent to the user.
    function burnSingle(bytes calldata data) external returns (uint256 amountOut);

    /// @return A unique identifier for the pool type.
    function poolIdentifier() external pure returns (bytes32);

    /// @return An array of tokens supported by the pool.
    function getAssets() external view returns (address[] memory);

    /// @notice Simulates a trade and returns the expected output.
    /// @dev The pool does not need to include a trade simulator directly in itself - it can use a library.
    /// @param data ABI-encoded params that the pool requires.
    /// @return finalAmountOut The amount of output tokens that will be sent to the user if the trade is executed.
    function getAmountOut(bytes calldata data) external view returns (uint256 finalAmountOut);

    /// @notice Simulates a trade and returns the expected output.
    /// @dev The pool does not need to include a trade simulator directly in itself - it can use a library.
    /// @param data ABI-encoded params that the pool requires.
    /// @return finalAmountIn The amount of input tokens that are required from the user if the trade is executed.
    function getAmountIn(bytes calldata data) external view returns (uint256 finalAmountIn);

    /// @dev This event must be emitted on all swaps.
    event Swap(address indexed recipient, address indexed tokenIn, address indexed tokenOut, uint256 amountIn, uint256 amountOut);

    /// @dev This struct frames output tokens for burns.
    struct TokenAmount {
        address token;
        uint256 amount;
    }
}

File 9 of 10 : IUniswapV2Pair.sol
// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.5.0;

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

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}

File 10 of 10 : IWETH.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.8.10;

interface IWETH {
  function deposit() external payable;

  function transfer(address to, uint256 value) external returns (bool);

  function withdraw(uint256) external;
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_bentoBox","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"bentoBox","outputs":[{"internalType":"contract IBentoBoxMinimal","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"route","type":"bytes"}],"name":"processRoute","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address payable","name":"transferValueTo","type":"address"},{"internalType":"uint256","name":"amountValueTransfer","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"route","type":"bytes"}],"name":"transferValueAndprocessRoute","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a0604052600160005534801561001557600080fd5b506040516200255e3803806200255e83398101604081905261003691610047565b6001600160a01b0316608052610077565b60006020828403121561005957600080fd5b81516001600160a01b038116811461007057600080fd5b9392505050565b60805161247f620000df60003960008181607c015281816110470152818161122001528181611307015281816113f20152818161150a015281816115e5015281816116aa0152818161175701528181611838015281816118fe01526119cd015261247f6000f3fe6080604052600436106100385760003560e01c80632646478b146100445780636b2ace871461006a57806393b3774c146100c357600080fd5b3661003f57005b600080fd5b610057610052366004611f4c565b6100d6565b6040519081526020015b60405180910390f35b34801561007657600080fd5b5061009e7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610061565b6100576100d1366004611fd3565b61016b565b60008054600114610148576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f526f75746550726f636573736f72206973206c6f636b6564000000000000000060448201526064015b60405180910390fd5b600260005561015b8787878787876102bc565b6001600055979650505050505050565b600080546001146101d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f526f75746550726f636573736f72206973206c6f636b65640000000000000000604482015260640161013f565b60026000908155604051819073ffffffffffffffffffffffffffffffffffffffff8c16908b908381818185875af1925050503d8060008114610236576040519150601f19603f3d011682016040523d82523d6000602084013e61023b565b606091505b5091509150818160405160200161025291906120a4565b60405160208183030381529060405290610299576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013f919061210a565b506102a88989898989896102bc565b60016000559b9a5050505050505050505050565b6000808073ffffffffffffffffffffffffffffffffffffffff871673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610386576040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301528816906370a0823190602401602060405180830381865afa15801561035d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103819190612124565b61039f565b8473ffffffffffffffffffffffffffffffffffffffff16315b604080518082019091528581528551860160208201529091505b80516020820151111561058d5760006103d88280516001018051915290565b905060148160ff1610156104e5578060ff16600a1415610401576103fb82610765565b50610587565b8060ff166004141561041b5761041682610a87565b610587565b8060ff166003141561044257610431828c610bcb565b61043b908561216c565b9350610587565b8060ff16600514156104575761043182610c63565b8060ff166006141561046d576104168783610dfc565b8060ff166007141561048357610431828c610f4d565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f556e6b6e6f776e20636f6d6d616e6420636f6465000000000000000000000000604482015260640161013f565b60188160ff161015610532578060ff166014141561050757610416828c610fdc565b8060ff166015141561051c57610416826110dc565b8060ff166017141561048357610416828c611196565b8060ff166018141561054857610431828c611251565b8060ff166019141561055d5761041682611378565b8060ff16601a14156105725761041682611574565b8060ff16601b14156104835761041682611887565b506103b9565b8883146105f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f57726f6e6720616d6f756e74496e2076616c7565000000000000000000000000604482015260640161013f565b600073ffffffffffffffffffffffffffffffffffffffff891673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146106be576040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff88811660048301528a16906370a0823190602401602060405180830381865afa158015610695573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b99190612124565b6106d7565b8673ffffffffffffffffffffffffffffffffffffffff16315b90506106e3888461216c565b81101561074c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4d696e696d616c206f757075742062616c616e63652076696f6c6174696f6e00604482015260640161013f565b6107568382612184565b9b9a5050505050505050505050565b6000806107788380516014018051915290565b9050600061078c8480516014018051915290565b905060006107a08580516001018051915290565b905060006107b48680516014018051915290565b90506000808573ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610804573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082891906121be565b506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff16915060008211801561085d5750600081115b6108c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f57726f6e6720706f6f6c20726573657276657300000000000000000000000000604482015260640161013f565b6000808560ff166001146108d85782846108db565b83835b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b811660048301529294509092506000918491908a16906370a0823190602401602060405180830381865afa158015610953573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109779190612124565b6109819190612184565b90506000610991826103e561220e565b9050806109a0856103e861220e565b6109aa919061216c565b6109b4848361220e565b6109be919061224b565b9a506000808960ff166001146109d6578c60006109da565b60008d5b604080516000815260208101918290527f022c0d9f00000000000000000000000000000000000000000000000000000000909152919350915073ffffffffffffffffffffffffffffffffffffffff8d169063022c0d9f90610a4490859085908e9060248101612286565b600060405180830381600087803b158015610a5e57600080fd5b505af1158015610a72573d6000803e3d6000fd5b50505050505050505050505050505050919050565b6000610a998280516014018051915290565b90506000610aad8380516001018051915290565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290915060009060019073ffffffffffffffffffffffffffffffffffffffff8516906370a0823190602401602060405180830381865afa158015610b20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b449190612124565b610b4e9190612184565b905060005b8260ff16811015610bc4576000610b708680516014018051915290565b90506000610b848780516002018051915290565b61ffff8082168602049485900394909150610bb673ffffffffffffffffffffffffffffffffffffffff881684836119fe565b505050806001019050610b53565b5050505050565b600080610bde8480516001018051915290565b90506000915060005b8160ff16811015610c5b576000610c048680516014018051915290565b90506000610c188780516020018051915290565b9050610c24818661216c565b9450610c4873ffffffffffffffffffffffffffffffffffffffff8716338484611ad7565b505080610c54906122cb565b9050610be7565b505092915050565b600080610c768380516014018051915290565b90508073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0476040518263ffffffff1660e01b81526004016000604051808303818588803b158015610cc057600080fd5b505af1158015610cd4573d6000803e3d6000fd5b50505050506000610ceb8480516001018051915290565b90506000925060005b8160ff16811015610d67576000610d118680516014018051915290565b90506000610d258780516020018051915290565b9050610d31818761216c565b9550610d5473ffffffffffffffffffffffffffffffffffffffff861683836119fe565b505080610d60906122cb565b9050610cf4565b504715610df5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f526f75746550726f636573736f723a20696e76616c696420696e70757420616d60448201527f6f756e7400000000000000000000000000000000000000000000000000000000606482015260840161013f565b5050919050565b6000610e0e8280516014018051915290565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290915073ffffffffffffffffffffffffffffffffffffffff821690632e1a7d4d9060019083906370a0823190602401602060405180830381865afa158015610e86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eaa9190612124565b610eb49190612184565b6040518263ffffffff1660e01b8152600401610ed291815260200190565b600060405180830381600087803b158015610eec57600080fd5b505af1158015610f00573d6000803e3d6000fd5b505060405173ffffffffffffffffffffffffffffffffffffffff861692504780156108fc029250906000818181858888f19350505050158015610f47573d6000803e3d6000fd5b50505050565b600080610f608480516001018051915290565b90506000915060005b8160ff16811015610c5b576000610f868680516014018051915290565b90506000610f9a8780516020018051915290565b9050610fa6818661216c565b9450610fc973ffffffffffffffffffffffffffffffffffffffff871683836119fe565b505080610fd5906122cb565b9050610f69565b6000610fee8380516014018051915290565b905060006110028480516020018051915290565b6040517f02b9446c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301527f0000000000000000000000000000000000000000000000000000000000000000811660248301819052908516604483015260648201839052600060848301529192506302b9446c9060a4015b60408051808303816000875af11580156110b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d49190612304565b505050505050565b60006110ee8280516014018051915290565b8251602080820180519092010184526040517f627dd56a0000000000000000000000000000000000000000000000000000000081529192509073ffffffffffffffffffffffffffffffffffffffff83169063627dd56a9061115390849060040161210a565b6020604051808303816000875af1158015611172573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f479190612124565b60006111a88380516014018051915290565b905060006111bc8480516020018051915290565b6040517f97da6d3000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152306024830152848116604483015260648201839052600060848301529192507f0000000000000000000000000000000000000000000000000000000000000000909116906397da6d309060a401611092565b6000806112648480516001018051915290565b90506000915060005b8160ff16811015610c5b57600061128a8680516014018051915290565b9050600061129e8780516020018051915290565b90506112aa818661216c565b6040517ff18d03cc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff88811660048301523360248301528481166044830152606482018490529196507f00000000000000000000000000000000000000000000000000000000000000009091169063f18d03cc90608401600060405180830381600087803b15801561134d57600080fd5b505af1158015611361573d6000803e3d6000fd5b50505050505080611371906122cb565b905061126d565b600061138a8280516014018051915290565b9050600061139e8380516001018051915290565b6040517ff7888aec00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301523060248301529192506000916001917f00000000000000000000000000000000000000000000000000000000000000009091169063f7888aec90604401602060405180830381865afa15801561143b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145f9190612124565b6114699190612184565b905060005b8260ff16811015610bc457600061148b8680516014018051915290565b9050600061149f8780516002018051915290565b6040517ff18d03cc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152306024830152848116604483015261ffff8084168802046064830181905296879003969293507f0000000000000000000000000000000000000000000000000000000000000000169063f18d03cc90608401600060405180830381600087803b15801561154e57600080fd5b505af1158015611562573d6000803e3d6000fd5b5050505050505080600101905061146e565b60006115868280516014018051915290565b9050600061159a8380516014018051915290565b6040517f4ffe34db00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff80831660048301529192506000917f00000000000000000000000000000000000000000000000000000000000000001690634ffe34db906024016040805180830381865afa15801561162b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061164f9190612348565b516040517fdf23b45b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526fffffffffffffffffffffffffffffffff909216917f0000000000000000000000000000000000000000000000000000000000000000169063df23b45b90602401606060405180830381865afa1580156116f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061171591906123bb565b60409081015190517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660048301526fffffffffffffffffffffffffffffffff909216918516906370a0823190602401602060405180830381865afa1580156117bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117df9190612124565b6117e9919061216c565b6117f39190612184565b6040517f02b9446c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301527f0000000000000000000000000000000000000000000000000000000000000000811660248301819052908616604483015260648201839052600060848301529192506302b9446c9060a401611092565b60006118998280516014018051915290565b905060006118ad8380516014018051915290565b6040517ff7888aec00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301523060248301529192506000917f0000000000000000000000000000000000000000000000000000000000000000169063f7888aec90604401602060405180830381865afa158015611945573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119699190612124565b6040517f97da6d3000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152306024830152848116604483015260006064830152608482018390529192507f0000000000000000000000000000000000000000000000000000000000000000909116906397da6d309060a401611092565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052611ad29084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611b35565b505050565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052610f479085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611a50565b6000611b97826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611c419092919063ffffffff16565b805190915015611ad25780806020019051810190611bb59190612427565b611ad2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161013f565b6060611c508484600085611c58565b949350505050565b606082471015611cea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161013f565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611d1391906120a4565b60006040518083038185875af1925050503d8060008114611d50576040519150601f19603f3d011682016040523d82523d6000602084013e611d55565b606091505b5091509150611d6687838387611d71565b979650505050505050565b60608315611e04578251611dfd5773ffffffffffffffffffffffffffffffffffffffff85163b611dfd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161013f565b5081611c50565b611c508383815115611e195781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161013f919061210a565b73ffffffffffffffffffffffffffffffffffffffff81168114611e6f57600080fd5b50565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112611eb257600080fd5b813567ffffffffffffffff80821115611ecd57611ecd611e72565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715611f1357611f13611e72565b81604052838152866020858801011115611f2c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060008060008060c08789031215611f6557600080fd5b8635611f7081611e4d565b9550602087013594506040870135611f8781611e4d565b9350606087013592506080870135611f9e81611e4d565b915060a087013567ffffffffffffffff811115611fba57600080fd5b611fc689828a01611ea1565b9150509295509295509295565b600080600080600080600080610100898b031215611ff057600080fd5b8835611ffb81611e4d565b975060208901359650604089013561201281611e4d565b955060608901359450608089013561202981611e4d565b935060a0890135925060c089013561204081611e4d565b915060e089013567ffffffffffffffff81111561205c57600080fd5b6120688b828c01611ea1565b9150509295985092959890939650565b60005b8381101561209357818101518382015260200161207b565b83811115610f475750506000910152565b600082516120b6818460208701612078565b9190910192915050565b600081518084526120d8816020860160208601612078565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061211d60208301846120c0565b9392505050565b60006020828403121561213657600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561217f5761217f61213d565b500190565b6000828210156121965761219661213d565b500390565b80516dffffffffffffffffffffffffffff811681146121b957600080fd5b919050565b6000806000606084860312156121d357600080fd5b6121dc8461219b565b92506121ea6020850161219b565b9150604084015163ffffffff8116811461220357600080fd5b809150509250925092565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156122465761224661213d565b500290565b600082612281577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b84815283602082015273ffffffffffffffffffffffffffffffffffffffff831660408201526080606082015260006122c160808301846120c0565b9695505050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122fd576122fd61213d565b5060010190565b6000806040838503121561231757600080fd5b505080516020909101519092909150565b80516fffffffffffffffffffffffffffffffff811681146121b957600080fd5b60006040828403121561235a57600080fd5b6040516040810181811067ffffffffffffffff8211171561237d5761237d611e72565b60405261238983612328565b815261239760208401612328565b60208201529392505050565b805167ffffffffffffffff811681146121b957600080fd5b6000606082840312156123cd57600080fd5b6040516060810181811067ffffffffffffffff821117156123f0576123f0611e72565b6040526123fc836123a3565b815261240a602084016123a3565b602082015261241b60408401612328565b60408201529392505050565b60006020828403121561243957600080fd5b8151801515811461211d57600080fdfea26469706673582212209b78afa27a62136892cf89cf9f96738d000f62d1e7884677de68fa7be644924a64736f6c634300080a00330000000000000000000000000711b6026068f736bae6b213031fce978d48e026

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

0000000000000000000000000711b6026068f736bae6b213031fce978d48e026

-----Decoded View---------------
Arg [0] : _bentoBox (address): 0x0711b6026068f736bae6b213031fce978d48e026

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000711b6026068f736bae6b213031fce978d48e026


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.